Complete reference for LiquidCore's smart contract functions.
Contract Addresses
USDT0/WHYPE Pool : 0xA7478A5ff7cB27A8008D6D90785db10223bc6087
USDC/WHYPE Pool : 0xD3994A6CF46cA91536376f89aCDadf92eD289a9F
Liquidity Management
Copy function deposit ( uint256 amount0 , uint256 amount1 ) external nonReentrant returns ( uint256 lpTokens ) Adds liquidity to the pool and mints LP tokens.
Amount of token0 to deposit (can be 0)
Amount of token1 to deposit (can be 0)
Returns: lpTokens - Number of LP tokens minted (non-transferable)
Requirements:
At least one amount must be > 0
Sufficient token approvals
Tokens transferred successfully
Removes liquidity from pool and burns LP tokens.
Number of LP tokens to burn
Returns:
amount0 - Amount of token0 received
amount1 - Amount of token1 received
Requirements:
Sufficient LP token balance
Cannot withdraw in same block as deposit
Automatically claims fees before withdrawal
Executes token swap with slippage protection.
Minimum output amount (slippage protection)
Returns: amountOut - Actual amount of output tokens received
Requirements:
Valid token pair for the specific pool (USDT0/WHYPE or USDC/WHYPE)
Claims accumulated trading fees for the caller.
Returns:
amount0 - Token0 fees claimed
amount1 - Token1 fees claimed
Requirements:
Compounds accumulated fees into additional LP tokens.
Returns: lpTokens - New LP tokens minted from fees
Requirements:
Returns the two token addresses supported by the pool.
Returns current token reserves in the pool.
Returns current spot prices.
forwardPrice: token0/token1 price
inversePrice: token1/token0 price
getUserPosition
Returns complete user position information.
Note: LP tokens are non-transferable and cannot be moved between addresses.
Pool ownership percentage
Token0 from withdrawing all LP
Token1 from withdrawing all LP
Returns current dynamic fees for each trading direction.
Estimation Functions
estimateDeposit
Estimates LP tokens that would be minted for a deposit.
estimateWithdraw
Estimates tokens that would be received for withdrawing LP tokens.
Estimates output amount for a swap.
Emitted when liquidity is added.
Emitted when liquidity is removed.
Emitted when a swap is executed.
UserFeesClaimed
Emitted when user claims trading fees.
Emitted when fees are compounded into LP tokens.
Last updated 2 months ago