Wallet API

Historical APY Line Chart#

When a user wants to view the historical yield trend of an investment product, use this endpoint. Pass in the product ID and time range (WEEK / MONTH / SEASON / YEAR), and it returns APY data at each time point, which can be used to plot a line chart showing the yield trend.

URL: GET /api/v6/defi/product/rate/chart

Request Parameters#

FieldTypeRequiredDefaultExplanation
investmentIdStringYesInvestment Product ID
timeRangeStringNoWEEKTime range: WEEK (one week), MONTH (one month), SEASON (three months), YEAR (one year)

Request Examples#

Example 1: Query APY Line Chart for Past Week (Default)#

GET /api/v6/defi/product/rate/chart?investmentId=124

Example 2: Query APY Line Chart for Past Three Months#

GET /api/v6/defi/product/rate/chart?investmentId=124&timeRange=SEASON

Response Parameters#

FieldTypeExplanation
timestampStringStatistical timestamp (milliseconds)
rateStringInvestment product yield (including base interest rate + mining coin reward)
bonusRateStringAdditional bonus yield (OKX Bonus/Merkl, etc.)
limitValueIntegerLimit value marking: 1=highest point, -1=lowest point, null=normal point
totalRewardStringTotal fee + bonus reward during the statistical period

Response Example#

Json
{
    "code": 0,
    "msg": "",
    "data": [
        {
            "timestamp": 1741737600000,
            "rate": "0.0312",
            "bonusRate": "0.0045",
            "limitValue": 1,
            "totalReward": "0.0357"
        },
        {
            "timestamp": 1741651200000,
            "rate": "0.0298",
            "bonusRate": "0.0045",
            "limitValue": null,
            "totalReward": "0.0343"
        }
    ]
}