Docs

Graduation

When the 800M coins are sold, the contract opens a Uniswap V3 pool at the curve's closing price and locks the liquidity.

When it happens

The buy that fills the curve marks the coin full and then calls graduate(token, 10000) on the contract itself, wrapped so that a failure cannot make the buy revert. If it fails, any address can call graduate(token, poolFee) afterwards. The function is permissionless and can only run once per coin.

Gas

Creating the pool costs about 4.6M gas and graduating about 5.0M in total, cheap on this chain but far more than a normal trade. A buy that fills the curve therefore needs about 5.6M gas available (GRADUATE_GAS). If the gas limit is lower, the buy reverts with NotEnoughGas instead of quietly skipping the pool. Wallets estimate this correctly on their own, and you are only charged for the gas actually used.

The pool

  • Uniswap V3 on Robinhood Chain, created through the chain's factory.
  • Fee tier: 1% by default (tick spacing 200). Tiers 0.05% and 0.3% are available when graduating by hand.
  • Range: full, from -887200 to 887200 ticks for the 1% tier.
  • Amounts: 200M coins and every pair token that was raised.
  • Opening price: the closing price of the curve (raised / 200M), computed as a Q64.96 square-root price and checked by the tests against the closing price to 0.01%.

Why the liquidity is locked

The position is minted directly by the Yoke contract to itself, not through a position manager NFT. The contract has no function that reduces liquidity. The only call on the position besides minting is collect, preceded by a zero-amount poke that credits earned fees. There is no owner function that can move it either: the owner can only change the address that receives protocol fees.

Pools created in advance

The coin's address is public from the moment it is created, so someone could create and initialise a pool for it at a bad price before the curve fills. The contract handles three cases:

CaseWhat it does
No pool yetCreates and initialises it at the closing price.
Pool exists, price within 1%Mints at the current price.
Pool exists at a bad priceIf there is no liquidity in range, moves the price with a zero-cost swap to the closing price and mints. If there is liquidity, the call reverts; graduate again with another fee tier.

Both bad-price cases are covered by tests on a fork, including one where the attacker adds liquidity near the bad price and the 0.3% tier is used instead.

Leftovers

The liquidity amount is rounded down so the pool never asks for more than the contract holds. Any leftover coin dust is sent to the dead address, and any leftover pair dust goes to the protocol.

Fees after graduation

collectFees(token) pokes the position, collects what it earned, burns the coin side, and splits the pair side 50/50 between the coin's creator and the protocol. Both then claim as for curve fees.