Liquidity Management
LiquidCore provides flexible liquidity management.
Adding Liquidity
LiquidCore accepts deposits of any token combination (unlike traditional AMMs that require exact ratios):
function deposit(uint256 amount0, uint256 amount1) external returns (uint256 lpTokens)Parameters
amount0
uint256
Amount of token0 to deposit (USDT0 or USDC, can be 0)
amount1
uint256
Amount of token1 to deposit (WHYPE, can be 0)
Returns: Number of LP tokens minted
Depositing requires 100K LIQD tokens.
LP Token Minting
LP tokens represent pool ownership share. Existing LP holders automatically claim unclaimed fees before deposit. New deposits don't generate fees until trading occurs.
Removing Liquidity
Proportional Withdrawals
Withdrawals are always proportional to current pool composition:
Parameters
lpTokens
uint256
Number of LP tokens to burn
Returns: Amounts of both tokens received
Withdrawal Mechanics
Withdrawals proportional to LP token ownership
Receive both tokens based on current pool composition
Unclaimed fees automatically claimed before withdrawal
Cannot withdraw in the same block as deposit
Estimating Deposits and Withdrawals
Preview Functions
Before executing transactions, you can estimate outcomes:
LP Token Information
ERC20-Like Interface
LP tokens implement standard ERC20 view functions but are non-transferable:
Position Tracking
Use getUserPosition(address) to check LP balance, fees, and pool share. See API Reference for details.
Same-Block Restrictions
Cannot withdraw in the same block as deposit. Wait one block after deposit before withdrawing.
Last updated