API
Last updated
Was this helpful?
Last updated
Was this helpful?
Manager:
Router:
InviteManager:
Periphery:
Vault:
Insurance Fund:
MarketPriceFeed:
Pools:
USDC1:
USDC2:
ETH:
ARB:
Markets:
BTC_USD(USDC):
ETH_USD(USDC):
ARB_USD(USDC):
ETH_USD(ETH):
ARB_USD(ARB):
Tokens:
USDC
ARB
WETH
Approve the Router contract for the base token and amount you would like to add for liquidity
Call Router.addLiquidity with parameters to add USDC pools or other ERC20 pools
_pool: pool address
_amount: base token amount you would like to spend
isStakeLp: true if automatically to stake LP for earn (to be online)
_deadline: request deadline timestamp
Call Router.addLiquidityETH with parameters to add ETH pools
_pool: pool address
_amount: base token amount you would like to spend, should be less than transaction value
isStakeLp: true if automatically to stake LP for earn (to be online)
_deadline: request deadline timestamp for price protection
Call Router.removeLiquidity with parameters to remove liquidity from USDC pools or other ERC20 pools:
_pool: pool address
_liquidity: how much liquidity you would like to remove
isUnstake: should unstake staked LP from earn (to be online)
_deadline: request deadline timestamp for price protection
Call Router.removeLiquidityETH to remove liquidity from ETH pools, parameters are the same as above.
Approve the Router contract for the margin asset token and amount you would like to spend as the initial margin
Call Router.takerOpen or takerOpenETH with parameters:
Call Router.takerClose with parameters:
Everyone can liquidate other positions that should be liquidated. Liquidation keeper can get 2USDC reward each time.
To run a liquidation keeper, you should:
Trace positions. You can trace positions by our subgraph or listen contract event.
Call Periphery.getPositionStatus to check if the position can be liquidated. Return value with true
means this position can be liquidated.
Call Router.liquidateByCommunity to execute liquidation.
Call Vault.collectExecutedFee to get liquidation bonus.
To get your position information:
Call Market.getPositionId to get position id
_taker: position owner address
_direction: 1: long, -1: short
Call Market.getPosition with the position id