Skip to main content

Staking Vaults

tip

A Staking Vault is a per-token vault that lets holders stake the token and earn yield from its trading activity on the AMM. Withdrawals are two-step - request, wait, claim - so the vault can't be drained in a single block.

Why per-token vaultsโ€‹

Each Factory token can opt into its own Staking Vault at launch. When that switch is on, the Factory deploys two contracts alongside the token:

  • A Staking Vault - the vault that holds staked tokens and accrues yield.
  • A Cooldown Holder - a small escrow that custodies tokens during pending withdrawals.

The vault's underlying asset is the token itself. Once the token graduates, the community share of the coin-side LP fees flows straight into the vault. The yield curve for stakers is therefore a function of the token's trading volume on the AMM - no farming, no emissions, no inflation.

A token that launches without staking has no vault and no cooldown holder, and its coin-side fees are split the same way as the WETH side (see Fees & Revenue).

Vault metadataโ€‹

Each vault has a recognisable name and symbol: Staked <token name> and st<token symbol>. So a vault on top of a token called MOON becomes Staked MOON / stMOON.

The vault uses standard ERC4626 share accounting plus a small anti-inflation buffer that makes share-price manipulation by donating tokens to the vault economically uninteresting.

Depositingโ€‹

Standard ERC4626 deposit and mint both work:

  • Deposit - you specify how many tokens to stake. The vault pulls them, credits you with shares at the current rate.
  • Mint - you specify how many shares to receive. The vault charges whatever the token amount works out to.

Yield accrues automatically. As fees flow into the vault address, the value of every share rises with it. There is no "claim" action for yield - it compounds inside your share balance, so the number of shares you hold doesn't change, but each share is worth slightly more tokens over time.

Withdrawing - two stepsโ€‹

The standard ERC4626 withdraw and redeem paths are intentionally disabled. Withdrawals go through a cooldown instead:

1. Depositstake tokens,receive shares2. Request withdrawalshares burned, tokens movedto escrow ยท cooldown starts3. Unstakeafter cooldown,escrow pays out

Step 1 - Requestโ€‹

You request a withdrawal in one of two ways: by asset amount ("withdraw 100,000 tokens") or by share amount ("redeem 5,000 shares"). Either way, the vault:

  1. Burns your shares.
  2. Moves the corresponding tokens out of the vault and into the cooldown escrow.
  3. Starts your personal cooldown timer.

Once your shares are burned, the request stops earning yield - the tokens in escrow are no longer part of the vault's working balance. That's the deliberate trade-off: you give up future yield to start the unstake clock.

Step 2 - Waitโ€‹

The cooldown duration is set per vault, capped at 90 days. You can check the status of your pending withdrawal - pending amount, cooldown end, and whether it is ready - at any time.

Step 3 - Claimโ€‹

Once the cooldown has elapsed, anyone can finalise the unstake on your behalf (it costs gas but cannot move funds anywhere except your designated receiver). The escrow transfers the pending tokens out and the cooldown resets.

A user can have only one active cooldown at a time. Requesting a second withdrawal before the first one completes adds to the pending amount and extends the cooldown - there is no parallel queue.

How yield gets inโ€‹

The vault never explicitly "claims" yield. Fees from the Algebra plugin are sent directly to the vault address as token transfers. Every transfer increases the vault's working balance, which in turn lifts the share-to-asset ratio. From your point of view: you do nothing, your share count is the same, but each share is worth more tokens.

Yield only stops accruing when:

  • You request a withdrawal (the requested portion leaves the vault).
  • The token has no on-chain trading activity on the AMM (no swaps โ†’ no plugin fees โ†’ no yield).

What the vault admin can and cannot doโ€‹

The vault owner - the protocol after a one-time handoff at deploy - has a small and well-defined surface:

  • Adjust the cooldown duration, within the 90-day cap.
  • Recover non-underlying tokens that were mis-sent to the vault. The underlying token itself is excluded from this path.

That's it. No mint, no pause, no opaque admin function that could touch your stake.