Overview
This API provides the necessary call data for executing redemption transactions in DeFi protocols. It enables users to securely and efficiently redeem their investments through wallet-as-a-service solutions.
API Endpoint
POST https://web3.okx.com/api/v5/defi/transaction/redemption
Request Parameters
| Parameter | Description | Type | Required | Data Type |
|---|---|---|---|---|
| address | Wallet address | Body | Yes | String |
| investmentId | Investment product ID | Body | Yes | String |
| userInputList | Token input details | Body | Yes | Array[Struct] |
| >chainId | Blockchain ID (default: investment network) | Body | No | String |
| >coinAmount | Redemption amount | Body | Yes | String |
| >tokenAddress | Token contract address (default: investment token) | Body | No | String |
| expectOutputList | Expected output details | Body | Yes | Array[Struct] |
| >chainId | Blockchain ID | Body | No | String |
| >coinAmount | Expected output amount | Body | Yes | String |
| >tokenAddress | Output token contract address | Body | No | String |
| extra | Additional metadata (see notes) | Body | No | String |
Response Parameters
| Parameter | Description | Data Type |
|---|---|---|
| dataList | Call data information | Array[Struct] |
| >from | Sender address | String |
| >to | Recipient contract address | String |
| >value | Transfer amount (native token) | String |
| >serializedData | Call data payload | String |
| >originalData | Raw transaction data | JSON String |
| >callDataType | Operation type (authorization, subscription, redemption, claim) | String |
| >signatureData | Verification signature | String |
Important Notes
Extra Parameter Usage:
- For SUI Staking: SUI staking details
- For SOL Staking: SOL staking details
Signature Verification:
- Derive r, s, v from signatureData
- Create verification hash from to + serializedData + originalData
- Recover public key for validation
๐ Learn more about secure DeFi transactions
Redemption Process Example
Request Example
{
"address": "0x123...abc",
"investmentId": "DEFI-001",
"userInputList": [
{
"coinAmount": "100",
"tokenAddress": "0x456...def"
}
],
"expectOutputList": [
{
"coinAmount": "95",
"tokenAddress": "0x789...ghi"
}
]
}Response Example
{
"dataList": [
{
"from": "0x123...abc",
"to": "0xDEF...456",
"value": "",
"serializedData": "0xabcdef...",
"originalData": {...},
"callDataType": "redemption",
"signatureData": "0x123456..."
}
]
}FAQs
What is redemption call data?
Redemption call data contains the encoded transaction instructions needed to execute an investment withdrawal from a DeFi protocol. It includes all necessary parameters for the blockchain transaction.
How do I verify the call data signature?
The signature can be verified by:
- Extracting signature components (r, s, v)
- Creating message hash from transaction details
- Recovering the signer's public key
๐ Explore advanced DeFi API features
What information do I need to provide for redemption?
You'll need:
- Your wallet address
- Investment product ID
- Redemption amount
- Expected output details
- (Optional) Chain-specific parameters
Can I redeem partial investments?
Yes, most protocols support partial redemptions. Specify your desired redemption amount in the coinAmount parameter.
How long do redemptions typically take?
Processing times vary by blockchain network and protocol rules. Ethereum transactions usually take 15 seconds to several minutes, while other chains may process faster.
Best Practices for Secure Redemptions
- Always verify call data signatures
- Double-check contract addresses
- Confirm expected output amounts
- Review gas fee estimates
- Monitor transaction status
This comprehensive guide covers all aspects of generating and executing redemption transactions through Web3 APIs. For more detailed implementation examples or specific protocol documentation, consult the official API references.