Infinity
Last updated
Last updated
Infinity is designed to provide a shared liquidity pool for swapping LSTs. It allows users to swap between different LSTs at prices determined by their intrinsic SOL valuations, which are read from the on-chain state of external liquid staking programs. The protocol also enables users to deposit any LST (or SOL) to receive LP tokens (INF) and later burn these INF tokens to withdraw a corresponding share of any LST or SOL.
Infinity is a powerful primitive that enables frictionless, no-slippage swaps with predictable fees, not just for trading LSTs but also as an highly efficient liquidation engine providing instant SOL liquidity.
Infinity supports all Sanctum LSTs with at least 1,000 SOL in external stake.
Infinity is built upon three main components:
S Controller: This is the central component that manages LST reserves, continually updates their SOL valuation, and handles LST swaps as well as liquidity deposits and withdrawals. It uses the Pricing Program to calculate fees and the SOL Value Calculator Programs to determine LST intrinsic SOL values. The S Controller also includes mechanisms for synchronizing LST reserve values, rebalancing liquidity, and administering the pool (whitelisting or blacklisting LSTs). It supports pausing all pool operations in case of an incident.
Pricing Program: This program calculates fees for LST swaps and for adding or removing liquidity. It operates with SOL-denominated values and returns output amounts as integers using Solana's CPI return value functionality.
Flat Fee Pricing Program: It applies input and output fees (in basis points) for swaps and a flat fee for removing liquidity. It does not charge fees for adding liquidity. Fees are split between the reserves (contributing to LP token appreciation) and protocol fee vaults. Current split is 90/10.
SOL Value Calculator Programs: There is one such program for each supported LST (and SOL). These programs convert LST amounts to their intrinsic SOL value and vice-versa, by inspecting the on-chain state accounts of the external liquid staking protocol managing the respective LST and mirroring its internal pricing calculation, factoring in any fees. Examples include programs for Marinade (mSOL), Sanctum LSTs, non-Sanctum LSTs (e.g., jitoSOL, bSOL), and Wrapped SOL (wSOL).
Program ID: 5ocnV1qiCgaQR8Jb8xWnVbApfaygJ8tNoZfgPwsgx9kx
The protocol maintains its state and parameters using various and :
S Controller PDAs:
Pool State PDA: This is the main state account of the protocol. It is derived from the seed [b"state"]
and stores configuration parameters (protocol fee share, global pricing program address, LP token mint, protocol version), addresses of most authorities (admin, fee beneficiary, rebalance authority), and global state information (total SOL value of assets, pause status, rebalance status). It also acts as an authority for the LP token mint and pool reserves.
LST State List PDA: It is derived from the fixed seed [b"lst-state-list"]
. It contains an entry for each LST, storing its mint, the address of its SOL value calculator program, the SOL value of its pool reserves, and its 'input disabled' status.
S Controller Token Accounts and Mints:
LST Reserve ATAs: The reserves for each LST, derived from the Pool State PDA.
LP Token Mint: The mint account for the LP token (INF) users receive for providing liquidity, with minting and freezing authority set to the Pool State PDA.
Flat Fee Pricing Program PDAs:
Program State PDA: Stores the program's manager and LP withdrawal fees.
Fee Account PDA: One for each LST, storing its input and output fees.
AddLiquidity
: Allows users to deposit a whitelisted LST (or SOL) into the pool and receive LP tokens (INF) in return.
RemoveLiquidity
: Enables users to burn their INF tokens to withdraw a corresponding share of any LST or SOL from the pool.
SwapExactIn
: Facilitates swaps where the user specifies the exact amount of an input LST they want to swap, and the protocol calculates the output amount of another LST.
When a user swaps amount_in
LST A for amount_out
LST B via Infinity:
Infinity's primary capital allocation strategy focuses on high-performing LSTs.
The system features a continuous monitoring mechanism that tracks the performance of various LSTs. This allows it to identify and capitalize on opportunities to reallocate stake from LSTs with lower returns to those offering higher returns. The algorithm intelligently assesses potential target LSTs, taking into account their APY while accounting for potential "yield drag" that new stake might impose on their returns. By predicting this yield drag and ensuring that any reallocation is significantly beneficial over time, the algorithm dynamically moves stake. This iterative and dynamic process ensures that stake is effectively distributed across multiple high-performing LSTs, thereby optimizing the overall yield for the Infinity pool.
Only LSTs with at least 10,000 SOL in external stake are considered for this dynamic reallocation process.
Trading fees vary depending on each LST and include both input and output fees. For instance, SOL input fees are set at 0bps to encourage deposits, while output fees are 14bps to discourage withdrawals in order to maximize fees generated from trading activity.
Withdrawing liquidity (withdrawing any of the assets in Infinity in exchange for INF) incurs a 20bps fee.
All fees are dynamically adjusted to maximise returns for liquidity providers.
The Infinity program has been thoroughly audited by three independent companies:
Furthermore, the protocol maintains a significant allocation of approximately 10% in SOL. This dedicated SOL reserve is instrumental in maintaining sufficient liquidity for immediate withdrawals. Although this dedicated ~10% SOL portion doesn't generate direct yield, its function in enabling consistent trading within the protocol is what .
Audit 1:
Audit 2:
Audit 3:
amount_in
LST A for amount_out
LST B via Infinity.