Protocol mechanics
The fund and withdrawals
What the treasury holds, the withdrawal formula, and why it burns Coin.
Loading…
Browse documentation
Protocol mechanics
What the treasury holds, the withdrawal formula, and why it burns Coin.
Loading…
Protocol mechanics
What the treasury holds, the withdrawal formula, and why it burns Coin.
The treasury is the treasury behind a Coin. It is ownerless, has no registry and no manager, and exposes two functions: withdraw (redeem), and burn any Coin it holds.
Assets, and only assets. Every strategy pays the treasury's share of its sales directly to the treasury's address, so the treasury's balance of each payment token is the treasury. Nothing is registered: holders choose which supported tokens held by the treasury to withdraw.
The treasury never holds Coin as a position. The Coin strategy and trading-fee claims can pay Coin into the treasury, and burnCoin(amount) lets anyone burn it from the treasury's own balance, never from the caller's. No backing asset moves when that happens; it simply retires supply, which raises what every remaining unit can withdraw.
function redeem(
uint256 coinAmount,
address receiver,
address[] calldata tokens,
uint256[] calldata minimumAmounts,
uint256 deadline
) external;The caller must hold and approve coinAmount. For every selected token the payout is:
payout = floor(fundBalanceBefore * coinAmount / effectiveSupplyBefore)where effectiveSupplyBefore is the Coin total supply plus all emission the Mine has accrued but not yet minted. Using effective supply means unminted emission is already counted against everyone, so the current miner's pending Coin cannot dilute a withdrawal after the fact. Balances are snapshotted before the burn.
Payouts are determined when the transaction executes. Direct treasury redeem requires a minimum for every selected token and a deadline. A payout below a supplied minimum or an expired deadline reverts the transaction.
Withdrawal is selective. You choose the tokens you want; any asset you leave out stays in the treasury and your share of it is forfeited for the amount you burn. The token list must be non-empty, nonzero, must not include the Coin itself and must be in strictly increasing numeric address order. Strict ordering proves uniqueness with one comparison per token instead of an increasingly expensive duplicate scan. The official interface and SDK sort a copy automatically. There is no length cap beyond gas.
Selected assets must be standard, non-rebasing ERC-20s. treasury uses SafeERC20, so a token that reverts or explicitly returns false reverts the whole withdrawal and nothing is burned. Fee-on-transfer, rebasing and shared-ledger alias tokens are unsupported because their accounting does not match the payout formula. receiver may differ from the caller but cannot be the treasury.
For treasury planning, aim for 100 intended assets or fewer. This is practical guidance, not a contract limit or a guarantee: gas cost depends on each token's implementation and the target chain. Estimate a complete withdrawal with the actual assets before launch and leave headroom below the transaction gas limit.
Each selected asset adds a balance read and, for a nonzero payout, a transfer. The treasury can hold more assets than fit in one withdrawal. Splitting the assets across separate withdrawals does not preserve a complete claim: each call burns Coin and forfeits that burned amount's share of the omitted assets. Unsolicited tokens can still arrive and remain outside the fund’s intended holdings.
The app withdraws through the Periphery. When the treasury is a current destination of the launch LP token's swap fees, Periphery.redeem first collects those fees and claims the treasury's share. It then burns all treasury-held Coin, including Coin just claimed, collects the caller's exact withdrawal amount and calls redeem directly for the selected receiver. Finally it checks each actual receiver balance increase against the supplied minimum. redeemWithoutFeeCollection skips the fee claims, so the caller forfeits their share of those unclaimed fees. A failed minimum or expired deadline reverts the claims, both burns and every transfer.
The app's quote uses current effective supply minus treasury-held Coin, with all balances read from one block; it leaves out unclaimed swap fees. Direct treasury withdrawal uses current effective supply and also requires token-paired minimums and a deadline. Both paths still require the caller to select every asset; the helper cannot recover a forfeited share of an omitted asset.
Withdrawal gives holders a proportional claim on existing backing. Backing per Coin can change as mining emissions accrue and treasury balances change. See Withdraw assets for the interface flow.