QilinV2Pool
Last updated
Last updated
Managing liquidity pools, LP tokens, positions
Add liquidity to a trading pool to obtain corresponding LP tokens
parameters:
Remove the liquidity in a trading pool, destroy the corresponding LP token, and obtain the pool tokens
parameters:
Open a position based on a certain trading pool
parameters:
returns:
Add margin to a specified position
parameters:
Close position, only when the remaining margin of the position is not lower than the margin*margin rate, the position can be closed
parameters:
Liquidation, when the remaining margin of the position is lower than the margin * margin rate, you can use this interface to liquidate
parameters:
name
type
description
user
address
Address of whom actually adds liquidity, since Qilin's trading pool is called by Router, the actually signer address cannot be obtained through msg.sender
amount
uint256
Amount of added liquidity (measured in pool tokens)
name
type
description
user
address
Address of whom actually removes liquidity
lsAmount
uint256
Amount of removed liquidity (measured in ls tokens)
bondsAmount
uint256
The amount of bond tokens used to offset debt when removing liquidity
receipt
address
Receiver address after removing liquidity
name
type
description
user
address
Actual trading address
direction
uint8
Trading direction,1: buy long,2: buy short
leverage
uint16
Leverage
position
uint256
Initial margin size of position
name
type
description
positionId
uint32
Position ID
name
type
description
user
address
The address where the margin is actually added
positionId
uint32
Position ID
margin
uint256
Amount of margin added
name
type
description
receipt
address
Address to receive tokens
positionId
uint32
Position ID
name
type
description
user
address
The address where the position is actually liquidated
positionId
uint32
Position ID
receipt
address
Address to receive tokens