Query estimated calculation information for redemption#
Description: This API provides you with estimated redemption details for a specific investment. The content includes:
- Super node name and estimated gas fees.
- List of received tokens, details of token exchange, and token authorization status (including whether authorization is required).
- Redeemable amount, minimum redemption amount, maximum redemption amount, etc.
Request URL#
POST https://web3.okx.com/api/v5/defi/calculator/redeem-info
Request parameter#
| Parameter name | Description | Parameter type | Required | Data type | 
|---|---|---|---|---|
| address | User wallet address | Request body | No | String | 
| inputTokenAmount | Subscription token quantity | Request body | Yes | String | 
| investmentCategory | Subscription category: (e.g., 0: Default category; 1: BRC-20) | Request body | No | String | 
| investmentId | Investment ID (refer to here) | Request body | Yes | String | 
| isSingle | Determine if it's a single token investment: Yes: Single; No: Multiple | Request body | No | Boolean | 
| outputTokenAddress | Token smart contract address (refer to here) | Request body | Yes | String | 
| slippage | Slippage | Request body | No | String | 
Response parameters#
| Parameter name | Description | Data type | 
|---|---|---|
| isAllowRedeem | Whether redemption is allowed | Boolean | 
| estimateGasFee | Estimated gas limit | String | 
| isSwapInvest | Whether it is a swap investment | Boolean | 
| inputCurrencyAmount | Input currency value in USD | String | 
| receiveTokenList | List of received token information | Array[Struct] | 
| > coinAmount | Token quantity | String | 
| > currencyAmount | Token value in USD | String | 
| > tokenSymbol | Token symbol | String | 
| > tokenName | Token name | String | 
| > tokenAddress | Token smart contract address | String | 
| > tokenPrecision | Token decimal precision | String | 
| > isBaseToken | Whether the pledging token is the mainnet base token | Boolean | 
| > network | Token network | String | 
| > chainId | Token chain ID | String | 
| > dataType | 0: principle 1: rewards 2: tradingFee 3: Bonus | String | 
| swapFromTokenList | Token list during redemption: same structure as investWithTokenList | Array[Struct] | 
| mySupply | Redeemable amount: same structure as investWithTokenList | Struct | 
| approveStatusList | List of token authorization status | Array[Struct] | 
| > tokenSymbol | Token symbol | String | 
| > tokenAddress | Token smart contract address | String | 
| > tokenPrecision | Token decimal precision | String | 
| > isNeedApprove | Whether authorization is required | Boolean | 
| > approveAddress | Contract address requiring authorization | String | 
| > network | Token network | String | 
| > chainId | Token chain ID | String | 
| > orderType | Parameter passed to call data (3: buy authorization, 4: redemption authorization, 8: enter farm, 9: leave farm) | String | 
Request example#
shell
curl --location 'https://web3.okx.com/api/v5/defi/calculator/redeem-info' \
--header 'OK-ACCESS-KEY: 9c****77' \
--header 'OK-ACCESS-PASSPHRASE: p****d' \
--header 'Content-Type: application/json' \
--data '{
  "address": "0x7f****da",
  "inputTokenAmount": "1.000000146425127036",
  "investmentCategory": "0",
  "investmentId": "21033",
  "isSingle": false,
  "outputTokenAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
  "outputTokenDecimal": "18",
  "redeemId": "",
  "slippage": ""
}'
Response example#
200
{
    "code": 0,
    "msg": "",
    "data": {
        "receiveTokenList": [
            {
                "tokenSymbol": "DAI",
                "tokenName": "Dai Stablecoin",
                "tokenAddress": "0x6b****0f",
                "network": "ETH",
                "chainId": "1",
                "tokenPrecision": "18",
                "isBaseToken": false,
                "coinAmount": "1.000000146425127036",
                "currencyAmount": "0.9993097704396316094231068522159962",
                "dataType": "0"
            }
        ],
        "swapFromTokenList": [
            {
                "tokenSymbol": "DAI",
                "tokenName": "Dai Stablecoin",
                "tokenAddress": "0x6b****0f",
                "network": "ETH",
                "chainId": "1",
                "tokenPrecision": "18",
                "isBaseToken": false,
                "coinAmount": "1.000000146425127036",
                "currencyAmount": "0.9993097704396316094231068522159962"
            }
        ],
        "isSwapInvest": false,
        "estimateGasFee": "276614",
        "isAllowRedeem": true,
        "mySupply": {
            "tokenSymbol": "DAI",
            "tokenName": "Dai Stablecoin",
            "tokenAddress": "0x6b****0f",
            "network": "ETH",
            "chainId": "1",
            "tokenPrecision": "18",
            "isBaseToken": false,
            "coinAmount": "0",
            "currencyAmount": "0"
        },
        "inputCurrencyAmount": "0.9993097704396316094231068522159962"
    }
}
