⬇️How to interact directly with the contract
How to get trading pair information
Contract Address:0x1b6f2d3844c6ae7d56ceb3c3643b9060ba28feb0
Method:ParisV3
Response :
struct LeverageMargin {
uint256 notionalUsd;
uint16 tier;
uint16 maxLeverage;
uint16 initialLostP; // 1e4
uint16 liqLostP; // 1e4
}
struct SlippageConfig {
string name;
uint256 onePercentDepthAboveUsd;
uint256 onePercentDepthBelowUsd;
uint16 slippageLongP; // 1e4
uint16 slippageShortP; // 1e4
uint16 index;
ISlippageManager.SlippageType slippageType;
bool enable;
}
struct FeeConfig {
string name;
uint16 index;
uint16 openFeeP; // 1e4
uint16 closeFeeP; // 1e4
bool enable;
uint24 shareP; // 1e5
uint24 minCloseFeeP; // 1e5
}
struct PairView {
// BTC/USD
string name;
// BTC address
address base;
uint16 basePosition;
PairType pairType;
PairStatus status;
uint256 maxLongOiUsd;
uint256 maxShortOiUsd;
uint256 fundingFeePerBlockP; // 1e18
uint256 minFundingFeeR; // 1e18
uint256 maxFundingFeeR; // 1e18
LibPairsManager.LeverageMargin[] leverageMargins;
uint16 slippageConfigIndex;
uint16 slippagePosition;
LibPairsManager.SlippageConfig slippageConfig;
uint16 feeConfigIndex;
uint16 feePosition;
LibFeeManager.FeeConfig feeConfig;
uint40 longHoldingFeeRate; // 1e12
uint40 shortHoldingFeeRate; // 1e12
}1. How to open a position at the opening price
Contract Address:0x1b6f2d3844c6ae7d56ceb3c3643b9060ba28feb0
Method:openMarketTrade
Parameters:data (tuple) Tuple: A tuple is an array of values e.g. [ "0x4sd…","100","100"..]. It can contain strings, integers and Boolean values. The structure for this tuple is:
Example: If the user wants to use 100USDT to place a pending order for a BTC Long position with Price: 20000 Qty: 0.001, and the take profit price is 25000, and the stop loss price is 19000, the inPutData should be:["0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c","True","0x55d398326f99059fF775485246999027B3197955","100000000000000000000","10000000",,"2000000000000"2500000000000","1900000000000",1]
Users could real time price through https://www.apollox.com/fapi/v1/premiumIndex
2. How to place a limit order
Contract Address:0x1b6f2d3844c6ae7d56ceb3c3643b9060ba28feb0
Method:createLimitOrder(
Parameters:data (tuple)
3. How to check user’s position information
Link UrL:https://api.thegraph.com/subgraphs/name/apollx-apx/apollox-perp-bnb
4. How to check Open Order
Contract Address:0x1b6f2d3844c6ae7d56ceb3c3643b9060ba28feb0
Method:getLimitOrders
Parameters
user:address
pairs:0x0000000000000000000000000000000000000000
Response :
5. How to close a position
Contract Address:0x1b6f2d3844c6ae7d56ceb3c3643b9060ba28feb0
Method:closeTrade
Parameters:
6. How to add margin
Contract Address:0x1b6f2d3844c6ae7d56ceb3c3643b9060ba28feb0
Method:addMargin
Parameters:
7. How to adjust take profit and stop loss price
Contract Address:0x1b6f2d3844c6ae7d56ceb3c3643b9060ba28feb0
Method:updateTradeTpAndSl
Parameters:
8. How to cancel the limit order
Contract Address:0x1b6f2d3844c6ae7d56ceb3c3643b9060ba28feb0
Method:cancelLimitOrder
Parameters:
Decimals Rules Summary Margin Amount Decimals: USDT:1e18 USDC:1e18 Price Decimal:1e8 Contract Qty Decimal:1e10
Attachment
1.ABI
2.The Ethereum Diamond Inspector Link
3.Index Price API
Last updated