rat0whitepaper 1.0

docs

how rat0 works, and how it is deployed. companion to the paper; the formulas live there.

the system is three contracts. the token is a bare erc 20 with eighteen decimals whose mint and burn are callable by exactly one address, and whose constructor writes the manifesto into contract storage, where it stays readable forever. the hook holds the ether reserve, computes the curve, and enforces every guard. the poolmanager is the uniswap v4 singleton that all pools on the chain live inside. the curve is not a contract of its own: it is a pool key inside the manager that names native eth as currency0, rat0 as currency1, and the hook's address in the hooks field. the secondary pool names the same token against usdg and leaves the hooks field empty. a swap becomes a mint or a burn only because its key routes it through the hook; the same tokens through the other key are an ordinary amm trade.

curve pool key
currency0: native eth · currency1: rat0 · fee: 0 · tick spacing: 1 · hooks: the hook address

v4 encodes a hook's permissions in its address. the low bits of the address are read by the manager as capability flags, so a hook cannot claim rights it was not deployed with. deployment therefore begins with salt grinding: iterate create2 salts until keccak256 of the deployer, the salt, and the init code hash yields an address whose flag bits match exactly the permissions this hook uses, beforeInitialize and beforeSwap with delta return, and no others. the mined salt ships in the deploy artifact. anyone can recompute the address from public inputs and confirm it was chosen for its bit pattern, not found by luck or picked for vanity.

order matters, because ownership is designed out rather than renounced. the token deploys first with the hook's precomputed create2 address baked in as an immutable sole minter: the constructor grants mint rights to an address that does not exist yet and that only the mined salt can ever produce. the hook deploys second, landing on that exact address, taking the token and the poolmanager as immutables and K and S as compile time constants. third, the curve pool is initialized in the manager; the hook's beforeInitialize refuses any key except its own, so it can never be attached to a second pool. the block that initialization lands in is the genesis block printed in the footer. after these three transactions there is nothing left to administer: no owner was constructed, so none needed renouncing, and no admin transaction has existed or will.

deploy order
1 token (minter = mined address) · 2 hook (create2 at mined address) · 3 pool init (genesis block)

a mint is a swap of native eth into rat0 through the curve key. beforeSwap intercepts, takes custody of the ether, deducts the 0.3 percent fee, and integrates the curve in ud60x18 fixed point: the new supply is K · (1 − exp(−(e + Δe)/S)) and the minted amount is the difference from current supply. the 5 eth cap is checked against gross input. during the first 36,000 blocks the minted amount is scaled by a multiplier derived from block.prevrandao reduced into the interval 0.9 to 1.1, unpredictable to a bot that precomputed calldata for the deployment block and pure noise to a person. the hook then exercises its exclusive mint right, records the caller's block number for the same block guard, and the ether net of fee becomes reserve. cumulative position e is never stored; it is recovered from supply as e = −S · ln(1 − q/K), so the entire curve state is one number and can never desynchronize from the token it prices.

a burn is the opposite swap. the hook recovers the position from supply, evaluates Δe = S · ln((K − q + b)/(K − q)) for the burned amount b, scales the payout by mintedFair over totalSupply, deducts the fee, burns through its exclusive right, and pays ether from its own balance. the guard reverts if the caller minted in the current block, which kills flash loan round trips outright: atomicity cannot cross a block boundary, at twelve seconds or at one hundred milliseconds. the fair to real correction exists because ud60x18 exp and ln are eighteen decimal approximations; composing them drifts by parts per quintillion per round trip, with every rounding direction chosen in the reserve's favor. the drift is why the burn quote sits structurally below the mint quote even before the fee, and why the reserve can only ever be over collateralized against the inverse curve, never under.

the security model is subtraction. there is no owner, no proxy, no delegatecall, no upgrade slot, no external call during accounting, and no oracle: price is a deterministic function of supply and nothing else, so there is nothing to manipulate except the curve itself, and the cap, the block guard, and the launch multiplier price that attempt above its yield. the invariant that matters is solvency: the hook's balance is greater than or equal to the exact inverse curve liability of the entire supply at all times, provable from the rounding directions alone. the retained fee accumulates in the same balance and is owed to no one, so it only ever widens that margin. an audit of this system is short because the attack surface was not defended; it was removed.

on robinhood chain the mechanism runs in its own denomination end to end. ether crosses the canonical arbitrum bridge, pays gas at one hundred millisecond cadence, and enters the reserve without a wrapper. first come, first served sequencing removes priority auctions from the launch window, so position in the opening blocks cannot be bought at any price, and fraud proofs on ethereum bound what the single sequencer can do to state: it can delay a transaction, it cannot forge a balance. everything above is checkable from a terminal against the endpoints in the footer: eth_call totalSupply on the token, eth_getBalance on the hook, and the front page quotes reproduce from the three formulas in the paper. source is verified on blockscout at deployment, and the manifesto sits in storage from construction, readable by anyone who asks the contract for it.