Keep Liquidity is a Rust-based Liquidity Pool protocol inspired by the Marinade Protocol. The core idea is to facilitate smooth swaps between liquid tokens and staked tokens while empowering liquidity providers to manage the pool. Two main actors interact with the pool:
- Swappers who exchange Token for StakedToken (and vice versa).
- Liquidity Providers who stake their assets into the pool to earn passive returns.
- Token Swap: Seamlessly swap between Token and StakedToken assets.
- LP Management: Add and remove liquidity using LpToken to earn rewards.
- Customizable Fees: Adjustable fees for token swaps.
- Rust Implementation: Built with the speed and safety of Rust.
Initialize the Pool
let liquidity_pool = LiquidityPool::init(price, liquidity_target, min_fee, max_fee);
Add Liquidity
liquidity_pool.add_liquidity(amount_of_new_tokens);
Swap Tokens
liquidity_pool.swap(staked_token_amount);
Remove Liquidity
liquidity_pool.remove_liquidity(lp_token_amount);
Run the tests to verify everything works as expected:
cargo test