The tide and feed contracts are fork-tested; the Elysium deploy is next.Read the log ›
Docs / Mechanism

Deposit and withdraw

Two-sided deposit

deposit(shares, max0, max1, to) mints exactly shares and charges exactly that fraction of the position's liquidity and of the idle balances, rounded up in the tide's favour. HYPE goes as the transaction value; any extra HYPE is refunded in the same transaction. The quote token (USDC or KNTQ) needs an approval first. max0 and max1 are your slippage guard. The app and the SDK compute shares from the amounts you type, using totals() and totalSupply().

Two-sided deposits read no price, so they work with the keeper stopped. They are the only deposits the owner can pause; withdrawals are never paused.

The first deposit

open(amount0Max, amount1Max, to) opens a tide that holds nothing yet. It needs a fresh reference, places the range on it and mints liquidity-many shares, of which 1,000,000 go to a dead address so the supply can never return to zero.

Single-sided deposit

depositSingle(zeroIn, amountIn, minShares, to) takes one token, swaps the minimum through the pool to match the tide's mix, then deposits by shares. The swap's price limit is the reference ± slippageBps, the pool must trade within maxDeviationTicks of a fresh reference, and minShares protects you.

Gas

CallGas, measured on an Elysium fork
open (first deposit)399,181
deposit142,928
depositSingle224,705
withdraw77,633
rebalance494,005
SeleneFeed post (both markets)56,000 to 66,000

At a 0.5 gwei base fee a deposit costs about 0.00007 HYPE and a withdrawal about 0.00004 HYPE.

Withdraw

withdraw(shares, min0, min1, to) burns your shares and sends your fraction of the position and of the idle balances, rounded down. It does not read the reference, it has no pause, and it does not wait for the protocol share to be paid out. It works with the keeper stopped.