Wallet API

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#

FieldTypeRequiredExplanation
addressStringYesUser wallet address
rewardTypeStringYesReward type (see below)
investmentIdStringNoInvestment product ID (required for all reward types except platform rewards)
analysisPlatformIdStringNoProtocol ID (required when claiming protocol rewards)
expectOutputListArrayNoExpected output token list
> chainIndexStringNoRequired when rewardType=REWARD_MERKLE_BONUS and expectOutputList is provided; Chain ID
> tokenAddressStringNoRequired when rewardType=REWARD_MERKLE_BONUS and expectOutputList is provided; Token contract address
> coinAmountStringNoRequired when rewardType=REWARD_MERKLE_BONUS and expectOutputList is provided; Amount (human-readable, e.g., "0.001")
tokenIdStringNoPosition tokenId required when claiming V3 fees
principalIndexStringNoMatured order index required when claiming matured principal

Supported rewardType values:

ValueExplanation
REWARD_INVESTMENTInvestment product mining rewards (most common)
REWARD_PLATFORMProtocol rewards (requires analysisPlatformId)
V3_FEEV3 fees (requires tokenId)
REWARD_OKX_BONUSOKX Bonus
REWARD_MERKLE_BONUSMerkle Bonus (requires expectOutputList)
UNLOCKED_PRINCIPALMatured principal (requires principalIndex)

Request Examples#

Example 1: Claim protocol rewards#

Json
{
    "rewardType": "REWARD_PLATFORM",
    "analysisPlatformId": "144",
    "address": "0x46e3420d02d628d3781fa16149e741bcb97da055",
    "expectOutputList": [
        {
            "chainIndex": "1",
            "tokenAddress": "0xc00e94Cb662C3520282E6f5717214004A7f26888",
            "coinAmount": "0.001"
        }
    ]
}

Example 2: Claim investment product mining rewards#

Json
{
    "rewardType": "REWARD_INVESTMENT",
    "investmentId": "27100",
    "address": "0x46e3420d02d628d3781fa16149e741bcb97da055"
}

Example 3: Claim V3 fees#

Json
{
    "rewardType": "V3_FEE",
    "investmentId": "42101",
    "address": "0x46e3420d02d628d3781fa16149e741bcb97da055",
    "tokenId": "64219"
}

Example 4: Claim OKX Bonus#

Json
{
    "rewardType": "REWARD_OKX_BONUS",
    "investmentId": "42101",
    "address": "0x46e3420d02d628d3781fa16149e741bcb97da055"
}

Example 5: Claim Merkle Bonus#

Json
{
    "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:

Json
{
    "rewardType": "UNLOCKED_PRINCIPAL",
    "investmentId": "10002",
    "address": "0x46e3420d02d628d3781fa16149e741bcb97da055",
    "principalIndex": "107580"
}

Response Parameters#

FieldTypeExplanation
dataListArrayCalldata result list
> callDataTypeStringOperation type (approve, subscribe, redeem, claim)
> fromStringFrom address (user wallet address)
> toStringTo address (target contract address)
> valueStringTransfer amount (native token quantity). Empty string or "0x0" when no native token transfer is needed
> serializedDataStringSerialized transaction data. EVM: hex calldata (0x prefix); Solana: base58 encoded; Sui: base64 encoded BCS bytes
> originalDataStringAuxiliary metadata (JSON string). EVM chains include function ABI; Aptos chains include module ABI JSON
> transactionPayloadStringTransaction template, only returned for Aptos chains
> signatureDataStringSignature data. EVM chains: Zap contract permit signature; non-EVM chains: server-side signature credential
> gasStringGas limit, only returned for non-EVM chains such as Aptos

Response Example#

Claim investment product mining rewards (REWARD_INVESTMENT)

Json
{
    "code": 0,
    "msg": "",
    "data": {
        "dataList": [
            {
                "callDataType": "CLAIM",
                "from": "0x46e3420d02d628d3781fa16149e741bcb97da055",
                "to": "0x197e90f9fad81970ba7976f33cbd77088e5d7cf7",
                "value": "0x0",
                "serializedData": "0x3111e7b3000000000000000000000000...",
                "originalData": "{\"callDataType\":\"CLAIM\",\"methodId\":\"0x3111e7b3\",...}",
                "signatureData": ""
            }
        ]
    }
}