Skip to content

Instantly share code, notes, and snippets.

View dicethedev's full-sized avatar
🚀
Learning & Building

Blessing Samuel dicethedev

🚀
Learning & Building
View GitHub Profile
@dicethedev
dicethedev / ERC4626_Notes_Prototype.md
Created June 3, 2026 16:45
ERC-4626 vault prototype for tokenized AMM strategy ownership, with adapter-based allocation, share accounting, and Noise protocol design notes.

ERC-4626 Tokenized Vault Notes / Prototype

Context

The AMM competition strategy controls fees or swap behavior directly. ERC-4626 solves a different but related product-layer problem: how users can deposit capital into a standardized vault, receive transferable shares, and let the protocol allocate that capital into AMM strategies.

For Noise, ERC-4626 can turn strategy participation into a composable primitive:

  • users deposit an ERC-20 asset
  • the vault mints shares representing proportional ownership
@dicethedev
dicethedev / NoisePropAMMStrategy.rs
Created June 3, 2026 15:52
Prop AMM curve using virtual liquidity, side-aware inventory fees, and bounded spreads to improve retail routing while protecting against inventory-worsening flow.
use pinocchio::{account_info::AccountInfo, entrypoint, pubkey::Pubkey, ProgramResult};
use prop_amm_submission_sdk::{set_return_data_bytes, set_return_data_u64};
const NAME: &str = "Noise Tail Guard";
const MODEL_USED: &str = "None";
const STORAGE_SIZE: usize = 1024;
const SCALE_BPS: u128 = 10_000;
const BASE_FEE_BPS: u128 = 64;
@dicethedev
dicethedev / NoiseAMMStrategy.sol
Created June 3, 2026 15:48
Dynamic AMM fee strategy using trade size, reserve imbalance, volatility proxy, and same-side flow to widen fees against toxic flow while discounting inventory-rebalancing trades.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {AMMStrategyBase} from "./AMMStrategyBase.sol";
import {TradeInfo} from "./IAMMStrategy.sol";
/// @title Noise Volatility Plus Strategy
/// @notice Dynamic AMM fee strategy tuned for volatility protection with controlled retail capture.
contract Strategy is AMMStrategyBase {
uint256 private constant LOCAL_WAD = 1e18;
@dicethedev
dicethedev / countries.ts
Created November 26, 2025 10:59
Country json file
export interface Country {
id: string
code: string
flag: string
name: string
fullName: string
currency: string
}
export const countries: Country[] = [
{
"orders": [
{
"id": "cf84a81d-e3d5-4fc4-82d2-7c7fbc56b45a",
"createdAt": "2024-08-16T15:37:10.798Z",
"updatedAt": "2024-08-16T15:38:04.116Z",
"userId": "f0fce882-e26b-4d8a-bde3-e8d6921703d9",
"orderCode": "870421",
"offerVariantId": "c9715ef4-99f7-4a86-8321-72a3816b3100",
"brandId": "ea72b22e-bba8-4e24-8a85-5c76a34604ba",
@dicethedev
dicethedev / countries.ts
Last active February 26, 2024 16:01
countries.ts
export const countries = [
{
"capital": "Kabul",
"currencies": [
{
"code": "AFN",
"name": "Afghan afghani",
"symbol": "Ø‹"
}
],
"use client";
import ContainerWrapper from "@/components/ContainerWrapper";
import { useState, useEffect } from "react";
import { Box, Text, Flex, Icon, Button, Input, Stack, HStack, Skeleton, useToast } from "@chakra-ui/react";
import { useAppSelector } from "@/hooks/rtkHooks";
import { Link } from "@chakra-ui/next-js";
import { ME_SVG } from "@/assets/svg";
import { CiSettings } from "react-icons/ci";
import TokenSelectOption from "@/components/SelectOptions/TokenSelect";
<!DOCTYPE html>
<html>
<head>
<title>Niki Chatbot</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css"
integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
@dicethedev
dicethedev / _app.tsx
Created May 8, 2023 17:38
CELO Testnet
import '../styles/globals.css'
import Head from 'next/head'
import type { AppProps } from 'next/app'
import { WagmiConfig, createClient, configureChains, Chain, chain } from "wagmi";
import { getDefaultWallets, RainbowKitProvider, darkTheme} from "@rainbow-me/rainbowkit";
import { jsonRpcProvider } from "wagmi/providers/jsonRpc";
import '@rainbow-me/rainbowkit/styles.css';
function MyApp({ Component, pageProps }: AppProps) {
const celoChain: Chain = {
@dicethedev
dicethedev / index.jsx
Created April 26, 2023 04:25
How to extract the contract address from an ERC20 token owned by a user using Ethers.js
import { ethers } from 'ethers';
const ERC20_ABI = ... // Replace with the ABI of your ERC20 token
async function getContractAddress(tokenAddress, userAddress) {
const provider = new ethers.providers.InfuraProvider('mainnet', 'YOUR_INFURA_PROJECT_ID');
const contract = new ethers.Contract(tokenAddress, ERC20_ABI, provider);
const balance = await contract.balanceOf(userAddress);