fl0at protocol
a permissionless, immutable bonding curve token on uniswap v4
abstract
fl0at implements a hyperbolic bonding curve as a uniswap v4 beforeSwap hook. the hook fully replaces the concentrated-liquidity AMM with custom pricing logic, settling assets directly through the PoolManager. there are no admin keys, no upgradability, and no governance — the protocol is immutable at deployment.
bonding curve
M(E) = K · E / (S + E)
K = 21,000,000 (max supply, 18 decimals)
S = 500 ETH (half-saturation constant)
E = cumulative ETH contributed to curve
M = total tokens minted at reserve level E
the curve is monotonically increasing and asymptotically bounded by K. as more ETH enters the reserve, each additional unit of ETH mints fewer tokens. this creates natural price appreciation for early participants while ensuring the token can never exceed its maximum supply.
buy mechanics
buying is exact-input only. the user specifies ETH to spend (max 5 ETH per tx). a 0.30% fee is deducted and retained in the hook as a non-redeemable buffer. the remaining ETH contribution advances the curve position, minting tokens proportional to the area under the curve between the old and new reserve levels.
1. fee = ethIn × 30 / 10000
2. contribution = ethIn - fee
3. tokensOut = M(curveEth + contribution) - M(curveEth)
4. curveEth += contribution
5. grossReserve += ethIn
6. retainedBuffer += fee
sell mechanics
selling burns tokens and returns ETH from the redeemable reserve. a 5.00% exit toll is applied to the gross ETH output. the toll is redistributed to the redeemable reserve, benefiting remaining holders. same-block buy-then-sell is prohibited (sandwich protection).
1. grossEthOut = curveEth - ethAt(totalMinted - tokenIn)
2. exitToll = grossEthOut × 500 / 10000
3. netEthOut = grossEthOut - exitToll
4. curveEth -= grossEthOut
5. redeemableReserve += exitToll - netEthOut
seal mechanism
when totalMinted reaches 20,790,000 tokens (99% of max supply), the protocol seals permanently. no further buys are possible. sells remain functional, allowing holders to exit at any time. the seal is irreversible — once triggered, the curve position is frozen forever.
security model
- ✓no owner, no admin, no multisig, no governance
- ✓immutable at deployment — no proxy, no upgrades
- ✓ETH only exits via sell settlement (bonding curve guarantee)
- ✓tokens only minted via buy settlement (no pre-mine)
- ✓same-block sandwich protection via lastBuyBlock mapping
- ✓canonical pool enforcement — only one valid pool per hook
- ✓liquidity additions blocked at permission level (0x888 mask)
architecture
contracts:
RemnantHook.sol — beforeSwap hook (custom accounting)
RemnantToken.sol — ERC-20 (mint/burn authority = hook)
RemnantAccounting.sol — stateless buy/sell logic
RemnantCurve.sol — hyperbolic curve math
deployment:
token deployed via CREATE (predictable address)
hook deployed via CREATE2 (permission-mined address)
hook address bits encode: BEFORE_ADD_LIQUIDITY | BEFORE_SWAP | BEFORE_SWAP_RETURNS_DELTA
fl0at is experimental software. use at your own risk.