Claim DeFi Protocol Rewards#
Call this endpoint when a user wants to claim rewards generated from DeFi investments. Key parameters: address (wallet address), rewardType (reward type). Common rewardType values include: REWARD_INVESTMENT (investment product mining rewards, most common), REWARD_PLATFORM (protocol rewards, requires analysisPlatformId), V3_FEE (V3 fees, requires tokenId), REWARD_OKX_BONUS (OKX Bonus), REWARD_MERKLE_BONUS (Merkle Bonus, requires expectOutputList), UNLOCKED_PRINCIPAL (matured principal, requires principalIndex).
URL: POST /api/v6/defi/transaction/claim
Request Parameters#
| Field | Type | Required | Explanation |
|---|---|---|---|
| address | String | Yes | User wallet address |
| rewardType | String | Yes | Reward type (see below) |
| investmentId | String | No | Investment product ID (required for all reward types except platform rewards) |
| analysisPlatformId | String | No | Protocol ID (required when claiming protocol rewards) |
| expectOutputList | Array | No | Expected output token list |
| > chainIndex | String | No | Required when rewardType=REWARD_MERKLE_BONUS and expectOutputList is provided; Chain ID |
| > tokenAddress | String | No | Required when rewardType=REWARD_MERKLE_BONUS and expectOutputList is provided; Token contract address |
| > coinAmount | String | No | Required when rewardType=REWARD_MERKLE_BONUS and expectOutputList is provided; Amount (human-readable, e.g., "0.001") |
| tokenId | String | No | Position tokenId required when claiming V3 fees |
| principalIndex | String | No | Matured order index required when claiming matured principal |
Supported rewardType values:
| Value | Explanation |
|---|---|
| REWARD_INVESTMENT | Investment product mining rewards (most common) |
| REWARD_PLATFORM | Protocol rewards (requires analysisPlatformId) |
| V3_FEE | V3 fees (requires tokenId) |
| REWARD_OKX_BONUS | OKX Bonus |
| REWARD_MERKLE_BONUS | Merkle Bonus (requires expectOutputList) |
| UNLOCKED_PRINCIPAL | Matured principal (requires principalIndex) |
Request Examples#
Example 1: Claim protocol rewards#
{
"rewardType": "REWARD_PLATFORM",
"analysisPlatformId": "144",
"address": "0x46e3420d02d628d3781fa16149e741bcb97da055",
"expectOutputList": [
{
"chainIndex": "1",
"tokenAddress": "0xc00e94Cb662C3520282E6f5717214004A7f26888",
"coinAmount": "0.001"
}
]
}
Example 2: Claim investment product mining rewards#
{
"rewardType": "REWARD_INVESTMENT",
"investmentId": "27100",
"address": "0x46e3420d02d628d3781fa16149e741bcb97da055"
}
Example 3: Claim V3 fees#
{
"rewardType": "V3_FEE",
"investmentId": "42101",
"address": "0x46e3420d02d628d3781fa16149e741bcb97da055",
"tokenId": "64219"
}
Example 4: Claim OKX Bonus#
{
"rewardType": "REWARD_OKX_BONUS",
"investmentId": "42101",
"address": "0x46e3420d02d628d3781fa16149e741bcb97da055"
}
Example 5: Claim Merkle Bonus#
{
"rewardType": "REWARD_MERKLE_BONUS",
"investmentId": "43304",
"address": "0x46e3420d02d628d3781fa16149e741bcb97da055",
"expectOutputList": [
{
"chainIndex": "747474",
"coinAmount": "10",
"tokenAddress": "0x2dca96907fde857dd3d816880a0df407eeb2d2f2"
}
]
}
Example 6: Claim matured principal#
For example, LSD: Lido requires a lock-up period after redemption. Once the lock-up period expires, claim the principal:
{
"rewardType": "UNLOCKED_PRINCIPAL",
"investmentId": "10002",
"address": "0x46e3420d02d628d3781fa16149e741bcb97da055",
"principalIndex": "107580"
}
Response Parameters#
| Field | Type | Explanation |
|---|---|---|
| dataList | Array | Calldata result list |
| > callDataType | String | Operation type (approve, subscribe, redeem, claim) |
| > from | String | From address (user wallet address) |
| > to | String | To address (target contract address) |
| > value | String | Transfer amount (native token quantity). Empty string or "0x0" when no native token transfer is needed |
| > serializedData | String | Serialized transaction data. EVM: hex calldata (0x prefix); Solana: base58 encoded; Sui: base64 encoded BCS bytes |
| > originalData | String | Auxiliary metadata (JSON string). EVM chains include function ABI; Aptos chains include module ABI JSON |
| > transactionPayload | String | Transaction template, only returned for Aptos chains |
| > signatureData | String | Signature data. EVM chains: Zap contract permit signature; non-EVM chains: server-side signature credential |
| > gas | String | Gas limit, only returned for non-EVM chains such as Aptos |
Response Example#
Claim investment product mining rewards (REWARD_INVESTMENT)
{
"code": 0,
"msg": "",
"data": {
"dataList": [
{
"callDataType": "CLAIM",
"from": "0x46e3420d02d628d3781fa16149e741bcb97da055",
"to": "0x197e90f9fad81970ba7976f33cbd77088e5d7cf7",
"value": "0x0",
"serializedData": "0x3111e7b3000000000000000000000000...",
"originalData": "{\"callDataType\":\"CLAIM\",\"methodId\":\"0x3111e7b3\",...}",
"signatureData": ""
}
]
}
}