Prepare Transaction Parameters#
This is a required preparatory step before initiating a subscription transaction. Call this endpoint to obtain the "available input token list", "receipt token", "yield tokens", and other information. These are required inputs when subsequently calling /transaction/enter or /transaction/exit to construct calldata.
URL: POST /api/v6/defi/product/detail/prepare
Request Parameters#
| Field | Type | Required | Explanation |
|---|---|---|---|
| investmentId | String | Yes | Investment product ID |
Request Example#
Example 1: Subscription Initialization#
Json
{
"investmentId": 12345
}
Response Parameters#
| Field | Type | Explanation |
|---|---|---|
| investWithTokenList | Array | Available input token list, used for the subscription enter endpoint |
| > tokenId | String | NFT TokenId |
| > tokenSymbol | String | Token symbol |
| > tokenName | String | Token name |
| > tokenAddress | String | Contract address |
| > tokenPrecision | String | Precision |
| > chainIndex | String | Chain ID |
| > network | String | Network |
| > coinAmount | String | Token amount |
| > currencyAmount | String | USD value |
| receiveTokenInfo | Object | Received receipt token |
| > tokenId | String | NFT TokenId |
| > tokenSymbol | String | Token symbol |
| > tokenName | String | Token name |
| > tokenAddress | String | Contract address |
| > tokenPrecision | String | Precision |
| > chainIndex | String | Chain ID |
| > network | String | Network |
| > coinAmount | String | Token amount |
| > currencyAmount | String | USD value |
| gainsTokenList | Array | Yield token list |
| > tokenId | String | NFT TokenId |
| > tokenSymbol | String | Token symbol |
| > tokenName | String | Token name |
| > tokenAddress | String | Contract address |
| > tokenPrecision | String | Precision |
| > chainIndex | String | Chain ID |
| > network | String | Network |
| > coinAmount | String | Token amount |
| > currencyAmount | String | USD value |
| isAllowSubscribe | Boolean | Whether subscription is allowed (has value when type=1) |
| feeRate | String | Fee rate (dex_pool exclusive) |
| currentTick | String | Current tick (corresponding to current price exchange rate) (dex_pool exclusive) |
| currentPrice | String | token0 current price exchange rate (dex_pool exclusive) |
| lowerPrice | String | Lower price bound when entering the initial page for adding positions (dex_pool exclusive) |
| upperPrice | String | Upper price bound when entering the initial page for adding positions (dex_pool exclusive) |
| tickSpacing | String | Tick spacing (dex_pool exclusive) |
| underlyingTokenList | Array | Underlying asset list, index0=token0, index1=token1 (dex_pool exclusive) |
| > tokenId | String | NFT Token ID (tokenId of the V3 position NFT) |
| > tokenSymbol | String | Token symbol, e.g. USDC, ETH |
| > tokenName | String | Token full name |
| > tokenLogo | String | Token logo image URL |
| > tokenAddress | String | Token contract address |
| > network | String | Network identifier, e.g. eth, bsc |
| > chainIndex | String | Chain ID, e.g. 1 (ETH), 56 (BSC) |
| > tokenPrecision | String | Token precision (i.e. decimals), e.g. 18, 6 |
| > isBaseToken | Boolean | Whether it is the chain's native token (e.g. ETH, BNB) |
Response Example#
Single Earn: Aave V3 USDC (Ethereum, investmentId=9502)
Json
{
"code": 0,
"msg": "",
"data": {
"investWithTokenList": [
{
"tokenSymbol": "USDC",
"tokenName": "USD Coin",
"tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/USDC.png",
"tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"network": "ETH",
"chainIndex": "1",
"tokenPrecision": "6",
"isBaseToken": false,
"coinAmount": "0",
"currencyAmount": "0",
"browserUrl": "https://web3.okx.com/explorer/eth/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
}
],
"receiveTokenInfo": {
"tokenSymbol": "aEthUSDC",
"tokenName": "Aave Ethereum USDC",
"tokenLogo": "https://static.coinall.ltd/cdn/web3/currency/token/1-0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c-97.png/type=png_350_0",
"tokenAddress": "0x98c23e9d8f34fefb1b7bd6a91b7ff122f4e16f5c",
"network": "ETH",
"chainIndex": "1",
"tokenPrecision": "6",
"coinAmount": "0"
},
"gainsTokenList": [
{
"tokenSymbol": "USDC",
"tokenName": "USD Coin",
"tokenLogo": "https://static.coinall.ltd/cdn/wallet/logo/USDC.png",
"tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"network": "ETH",
"tokenPrecision": "6",
"coinAmount": "0",
"dataType": "0"
}
]
}
}
Table of contents