Router
Last updated
Last updated
The Router's primary role is to streamline complex staking and swapping processes. It handles the underlying logic for:
Staking and Withdrawing SOL: Allows users to stake and withdraw SOL.
Swapping via Stake Accounts: Facilitates swaps between different LSTs by leveraging stake accounts, acting as a routing layer.
The Router currently only works with active stake accounts.
The Router Program exposes a comprehensive set of instructions to manage its various functionalities:
StakeWrappedSol
: Allows users to stake SOL into a staking pool, receiving an LST in return
WithdrawWrappedSol
: Allows users to withdraw undelegated SOL from a stake pool's reserve.
WithdrawStake
: Prepares a temporary stake account that will receive SOL from an unstake operation.
DepositStake
: Allows users to deposit a stake account directly into a staking pool, receiving an LST in return.
SwapViaStake
: Executes a "swap" between two different LSTs. This operation requires that the two stake pools involved in the swap have a validator in common within their validator set.
The SwapViaStake
instruction can also be used in conjunction with to access instant SOL liquidity.
When a user swaps amount_in
LST A for amount_out
LST B via the Router:
No fees on StakeWrappedSol
1bps on WithdrawWrappedSol
10bps on DepositStake
unless output mint is SOL (via The Reserve) in which case there are no fees
The Router program is a simple CPI wrapper program that is integrated into Jupiter. Its main purpose is to glue stake pool operations together so that they involve only SPL token inputs and outputs so that it can be treated as an AMM on Jupiter. As such, there is no value at risk.