QilinV2Pool

QILINV2POOL

Managing liquidity pools, LP tokens, positions

addLiquidity

Add liquidity to a trading pool to obtain corresponding LP tokens

function addLiquidity(
    address user,
    uint256 amount
) external;

parameters:

removeLiquidity

Remove the liquidity in a trading pool, destroy the corresponding LP token, and obtain the pool tokens

function removeLiquidity(
    address user,
    uint256 lsAmount, 
    uint256 bondsAmount, 
    address receipt
) external;

parameters:

openPosition

Open a position based on a certain trading pool

function openPosition(
    address user,
    uint8 direction,
    uint16 leverage,
    uint256 position
) external returns (uint32);

parameters:

returns:

addMargin

Add margin to a specified position

function addMargin(
    address user,
    uint32 positionId,
    uint256 margin
) external;

parameters:

closePosition

Close position, only when the remaining margin of the position is not lower than the margin*margin rate, the position can be closed

function closePosition(
    address receipt,
    uint32 positionId
) external;

parameters:

liquidate

Liquidation, when the remaining margin of the position is lower than the margin * margin rate, you can use this interface to liquidate

function liquidate(
    address user,
    uint32 positionId,
    address receipt
) external;

parameters:

Last updated