Guides

Stake with Marinade

marinade.stake turns SOL in your private balance into mSOL. marinade.unstake turns mSOL back into SOL through Marinade's liquidity pool in the same transaction. The mSOL sits in your private balance as a note and gains value against SOL as Marinade's stake earns.

You need a private balance holding SOL. Enter and leave covers getting one.

Stake

  1. Open the hook

    On Balance, under Run a hook, press Stake in the Marinade group.

  2. Type the amount

    The asset in is SOL and the asset out is mSOL. Type how much SOL to stake.

  3. Read the quote and run

    The quote shows the mSOL you receive after the run fee and the relayer's fee. Press Run. At Done, the mSOL is in your balance.

In a simulation against mainnet state, 0.1 SOL staked gave 0.070427037 mSOL.

Unstake

  1. Open the hook

    On Balance, under Run a hook, press Unstake in the Marinade group.

  2. Type the amount

    The asset in is mSOL and the asset out is SOL. Type how much mSOL to unstake.

  3. Read the quote and run

    The quote shows the SOL you receive after Marinade's liquidity-pool fee, the run fee and the relayer's fee. Press Run.

In the same simulation, 0.1 mSOL unstaked gave 0.140727202 SOL.

The quote

For marinade.stake, the quote converts at Marinade's current mSOL exchange price stored in its state account, less any deposit fee Marinade sets. For marinade.unstake, the quote also reads the SOL balance of Marinade's liquidity pool against its liquidity target to work out the dynamic liquidity-pool fee. minimumOut applies your slippageBps to that result, and the run fee and the relayer's fee come off what the run returns: Fees and POOK gives the rates.

What the run does at Marinade

marinade.stake calls Marinade's deposit instruction. SOL leaves Pook's stage as native lamports and Marinade mints mSOL into the stage's mSOL token account at the pool's rate. marinade.unstake calls liquid_unstake: mSOL moves from the stage into Marinade's liquidity pool and native SOL returns to the stage in the same transaction.

Both hooks fix every Marinade account on chain and need no companion instructions. Measured on a local network running the mainnet programs, marinade.stake takes 395,645 compute units across 28 accounts and marinade.unstake takes 325,185 compute units across 24 accounts.

What the chain shows

Each run shows the hook, Marinade's program, the amount in and the amount out. Marinade records a deposit or a liquid unstake made by Pook's stage, the same address for every holder. Your wallet is in neither.