ActionAddRemoveLiq
ActionAddRemoveLiqV3 supports 10 liquidity operation variants — dual-sided, single-sided, and keep-CT strategies for providing and removing liquidity.
Last updated
ActionAddRemoveLiqV3 supports 10 liquidity operation variants — dual-sided, single-sided, and keep-CT strategies for providing and removing liquidity.
Source: src/fira_bonding/router/ActionAddRemoveLiqV3.sol
addLiquidityDualTokenAndBt
Token + BT
Mint FW from token, add with BT
addLiquidityDualFwAndBt
FW + BT
Direct dual-sided add
addLiquiditySingleToken
Token only
Mint FW, swap portion to BT, add both
addLiquiditySingleBt
BT only
Swap portion to FW, add both
addLiquiditySingleFw
FW only
Swap portion to BT, add both
addLiquiditySingleTokenKeepCt
Token only
Mint FW, mint BT+CT, use BT for LP, keep CT
addLiquiditySingleFwKeepCt
FW only
Same keep-CT strategy
Instead of swapping FW to BT, the router mints BT+CT from FW. BT goes to the market for liquidity, CT goes to the user. This way the user gets LP exposure plus floating yield from CT simultaneously.
removeLiquidityDualFwAndBt
FW + BT separately
removeLiquidityDualTokenAndBt
Token (from FW redeem) + BT
removeLiquiditySingleBt
BT only (FW swapped to BT)
removeLiquiditySingleFw
FW only (BT swapped to FW, or redeemed via CT post-expiry)
removeLiquiditySingleToken
Token (everything converted)
Since the market doesn't allow swaps post-expiry, single-FW removal sends BT to the CT contract and redeems via CT.redeemBC().
All add operations ultimately call FiraMarket.mint(receiver, netFwUsed, netBtUsed). Single-sided adds use approximation libraries to calculate how much to swap before depositing both sides. All remove operations call FiraMarket.burn.
Last updated