Marinade Native
Marinade Native: API & SDK¶
Technical Overview¶
Marinade Native leverages Solana's stake account structure. As explained in Solana's documentation, stake accounts have two different authorities that can belong to separate addresses: the stake authority and the withdraw authority.
The stake authority is used to sign transactions for the following operations:
- Delegating stake
- Deactivating the stake delegation
- Splitting the stake account, creating a new stake account with a portion of the funds in the first account
- Merging two stake accounts into one
- Setting a new stake authority
The withdraw authority signs transactions for the following:
- Withdrawing un-delegated stake into a wallet address
- Setting a new withdraw authority
- Setting a new stake authority
Marinade Native was designed to receive the stake authority of the user's stake account without touching the withdraw authority that stays assigned to the user's wallet.
The stake authority that Marinade uses is a PDA of the Native Staking Proxy program. The program allows a Marinade bot to call delegation instructions on behalf of this PDA. This way, Marinade's Council multisig (3 of 5) can revoke the bot's access and create a new one if needed.
How Does the Unstake Work?¶
Staking on Solana is subject to a cooldown period. When a stake account is delegated, the stake account has to be deactivated first. Then, at the beginning of the next epoch (epochs currently run about 1 day), the user holding the withdraw authority can withdraw funds from the stake account.
Users of this product always maintain ultimate power over the stake accounts and can revoke the stake authority previously granted to Marinade using most wallets.
However, Marinade splits the stake between over 100 validators to spread the risk and support well-performing validators. Therefore, it would be inconvenient for our users to revoke the stake authority, deactivate and withdraw each of the stake accounts one by one.
Marinade has thought of this, and users can use the dApp to help them with the withdrawal. Marinade will prepare the stake accounts for withdraw on your behalf.
- Users ask for the amount of SOL they want to withdraw.
- We deactivate stake accounts amounting to how much users want to withdraw.
- We merge deactivated stake accounts at the beginning of the next epoch, so there is a single deactivated stake account.
- Users can withdraw funds in a single transaction.
To avoid some draining attacks (as Marinade pays for deactivation, and timely merging of all the stake accounts), a flat fee of 0.003 SOL is applied for this service. It does not scale with the amount being unstaked, and it applies equally to Marinade Native, Marinade Select and Native positions paid in a Recipe reward token.
This can be integrated easily through the SDK.
Does Marinade Native Support Locked-Up Stake Accounts?¶
Yes.
When users give Marinade stake authority over stake accounts with different lockup periods and users then want to withdraw some part of the stake, Marinade prioritizes the unlocked stake accounts and then stake accounts with the shortest lockup periods.
Marinade Native On-Chain Addresses¶
| Role | Address |
|---|---|
| Native Staking Proxy program | mnspJQyF1KdDEs5c6YJPocYdY1esBgVQFufM2dY9oDk |
| Stake authority, Marinade Native (Max Yield) | stWirqFCf2Uts1JBL1Jsd3r6VBWhgnpdPxCTe1MFjrq |
| Exit authority, Marinade Native (Max Yield) | ex9CfkBZZd6Nv9XdnoDmmB45ymbu4arXVk7g5pWnt3N |
| Stake authority, Marinade Select | STNi1NHDUi6Hvibvonawgze8fM83PFLeJhuGMEXyGps |
The stake authority manages the delegation of all stake accounts for its product flavour. The exit authority prepares and merges the stake accounts of users who requested an unstake.
These authorities are PDAs derived from the proxy program, so no private key exists for them, and they are controlled and can be changed by Marinade's Council.
Do not enumerate Marinade Native positions by a single stake authority. Marinade Native spans several staker authorities: Max Yield, Marinade Select, and one authority per Marinade Recipe (the stR... set, which grows as new recipes launch). Filtering stake accounts on stWirqFCf2Uts1JBL1Jsd3r6VBWhgnpdPxCTe1MFjrq alone silently misses every Select and Recipe position. Fetch the current authority set rather than hardcoding it.
Marinade Native API¶
Base URL: https://native-staking.marinade.finance
| Method | Endpoint | Purpose |
|---|---|---|
GET | /v2/{stake_authority}/apy | APY history for a stake authority |
GET | /v2/{stake_authority}/tvl | TVL for a stake authority and withdraw authority |
GET | /v2/{stake_authority}/user-rewards | Rewards earned by a user's stake accounts |
GET | /v2/{stake_authority}/pending-revokes | Stake accounts pending a stake-authority revoke |
POST | /v2/{stake_authority}/prepare-for-revoke | Prepare stake accounts for a revoke |
POST | /v2/{stake_authority}/rebalance-hint | Tell the delegation backend that new stake has arrived |
{stake_authority} is one of the addresses in the table above. The rebalance-hint call is an off-chain advisory and is not required for correctness: the periodic scanner picks up new stake accounts at the next epoch boundary regardless.
The /v1/ routes are gone. Use /v2/ only.