Build DeFi Deposit Transaction
Build the unsigned transaction calldata for a DeFi deposit / stake. Returns an ordered dataList (typically [APPROVE, DEPOSIT], or [DEPOSIT] when the allowance is already sufficient) for the caller to sign and broadcast.
The caller does NOT pass binanceChainId — the service resolves it from investmentId. Set simulate=true to also receive a preview (projected balance change, estimated gas, and lending health-factor change) without broadcasting.
Build DeFi Deposit Transaction › Authorization
Headers
X-OC-APIKEYAPI Key issued by Binance Web3 API for authentication.
X-OC-TIMESTAMPCurrent UTC time in ISO 8601 format with milliseconds, e.g. 2026-05-11T10:08:57.715Z.
X-OC-SIGNRequest signature (Base64-encoded).
X-OC-RECV-WINDOWAllowed time deviation in milliseconds (default: 5000, max: 60000).
X-OC-NONCEUnique request identifier for anti-replay; falls back to X-OC-SIGN if omitted.
Build DeFi Deposit Transaction › Request Body
addressUser wallet address (the signer / sender).
investmentIdInvestment product ID (chain-agnostic). The service resolves the chain from this ID.
A (tokenAddress, amount) pair. amount is a human-readable decimal string (NOT the token's smallest unit); the service converts it according to the token's decimals. For the native asset use the sentinel 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee (40 es).
simulateWhen true, the response also includes a preview object. Default false. If the simulated transaction reverts, the request returns 40485 for a specific classified revert reason or 40484 for any other revert (see Error Codes).
Build DeFi Deposit Transaction › Responses
Deposit transaction calldata returned successfully.
codeBusiness status code. 0 indicates success.
msgHuman-readable status message.
Unified response of the five build endpoints (deposit / redeem / lp-add / lp-remove / claim). dataList is ordered: APPROVE items come first, the main action follows — sign and broadcast each item in order. preview is non-null only when the request set simulate=true. redeemDelayDays is populated only by /transaction/redeem.
timestampServer timestamp in milliseconds.
successWhether the request succeeded (mirrors code == 0).
Build DeFi Redeem Transaction
Build the unsigned transaction calldata for a DeFi redeem / withdraw. Returns an ordered dataList (typically [REDEEM] or [APPROVE, REDEEM]).
Redeem amount is decided by exactly one of ratio or token (mutually exclusive): - ratio omitted / blank → exact-amount redeem: the amount comes from
token (tokenAddress + amount); the position is not queried. token is required
in this mode (omitting token, or leaving amount blank, is rejected with 40001,
Parameter error; both ratio and token absent is also rejected with 40001).
ratiopresent → proportional redeem: must parse as a decimal in(0, 1]. The service queries the user's on-chain position underinvestmentIdand scales each token's amount byratio(floored to the token's decimals).ratio="1"is a full (max) redeem. In this modetokenis ignored — the output tokens and amounts are derived from the position.
slippageBps is the slippage tolerance in basis points (e.g. 300 = 3%). The caller does NOT pass binanceChainId — resolved from investmentId. Set simulate=true to also receive preview.
The response also carries redeemDelayDays — the redeem waiting period as a [min, max] day pair (e.g. ["7","10"] = 7–10 days, [] = instant). The wait starts after the redeem tx is confirmed on-chain. See the redeemDelayDays field on DefiTxResponse.
Build DeFi Redeem Transaction › Authorization
Headers
X-OC-APIKEYAPI Key issued by Binance Web3 API for authentication.
X-OC-TIMESTAMPCurrent UTC time in ISO 8601 format with milliseconds, e.g. 2026-05-11T10:08:57.715Z.
X-OC-SIGNRequest signature (Base64-encoded).
X-OC-RECV-WINDOWAllowed time deviation in milliseconds (default: 5000, max: 60000).
X-OC-NONCEUnique request identifier for anti-replay; falls back to X-OC-SIGN if omitted.
Build DeFi Redeem Transaction › Request Body
addressUser wallet address (the signer / sender).
investmentIdInvestment product ID (chain-agnostic). The service resolves the chain from this ID.
A (tokenAddress, amount) pair. amount is a human-readable decimal string (NOT the token's smallest unit); the service converts it according to the token's decimals. For the native asset use the sentinel 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee (40 es).
ratioRedeem ratio, mutually exclusive with token. Omitted / blank → exact-amount redeem via token (tokenAddress + amount, position not queried). Present → must parse as a decimal in (0, 1]; the service queries the on-chain position under investmentId and scales each token amount by ratio (floored to decimals). "1" = full (max) redeem; in this mode token is ignored.
slippageBpsSlippage tolerance in basis points (e.g. 300 = 3%).
simulateWhen true, the response also includes a preview object. Default false. If the simulated transaction reverts, the request returns an error code instead of a 200 with preview.success=false: 40485 when the redeem amount exceeds the current position, 40484 for any other revert (see Error Codes).
Build DeFi Redeem Transaction › Responses
Redeem transaction calldata returned successfully.
codeBusiness status code. 0 indicates success.
msgHuman-readable status message.
Unified response of the five build endpoints (deposit / redeem / lp-add / lp-remove / claim). dataList is ordered: APPROVE items come first, the main action follows — sign and broadcast each item in order. preview is non-null only when the request set simulate=true. redeemDelayDays is populated only by /transaction/redeem.
timestampServer timestamp in milliseconds.
successWhether the request succeeded (mirrors code == 0).
Build LP Add Transaction
Build the unsigned transaction calldata for adding liquidity. tokenList supports multiple tokens. Returns an ordered dataList (typically [APPROVE, LP_ADD]).
Tick range source (provide exactly one group):
nftId— append to an existing LP position (reuses its range).priceRange— percentage band (e.g."5"= ±5%) for a new position.tickLower+tickUpper— explicit rawint24pair for a new position. Rules:
-
If more than one group is supplied, only the highest-priority one above is used and the others are silently ignored (priority:
nftId>priceRange> explicit tick pair). -
If none is supplied, the request is rejected (
40453). -
tickLower/tickUpperare rawint24values and MUST be aligned to the pool'stickSpacing, otherwise the request is rejected (40453). -
The caller does NOT pass
binanceChainId— resolved frominvestmentId.
Build LP Add Transaction › Authorization
Headers
X-OC-APIKEYAPI Key issued by Binance Web3 API for authentication.
X-OC-TIMESTAMPCurrent UTC time in ISO 8601 format with milliseconds, e.g. 2026-05-11T10:08:57.715Z.
X-OC-SIGNRequest signature (Base64-encoded).
X-OC-RECV-WINDOWAllowed time deviation in milliseconds (default: 5000, max: 60000).
X-OC-NONCEUnique request identifier for anti-replay; falls back to X-OC-SIGN if omitted.
Build LP Add Transaction › Request Body
addressUser wallet address (the signer / sender).
investmentIdLP investment product ID (chain-agnostic).
Tokens to supply. Two tokens for a standard LP add.
tickLowerLower tick bound (raw int24) for a new position. MUST be aligned to the pool's tickSpacing. Pick exactly one tick-range source: tickLower+tickUpper, priceRange, or nftId (to append to an existing position). If several are supplied, the lowest-priority ones are ignored (priority: nftId > priceRange > explicit tick pair).
tickUpperUpper tick bound (raw int24) for a new position. MUST be aligned to the pool's tickSpacing. See tickLower for the pick-exactly-one rule.
priceRangePrice range as a percentage (e.g. "5" = ±5%) for a new position. Alternative to tickLower+tickUpper; see tickLower for the pick-exactly-one rule.
nftIdLP NFT token ID, decimal string (e.g. "7225901" or "#7225901"). Required when appending to an existing position (reuses its range); omit for a new position. Highest-priority tick-range source — see tickLower for the pick-exactly-one rule. The # prefix returned by the position list may be passed as-is — the service strips it automatically.
slippageBpsSlippage tolerance for the LP leg, in basis points (e.g. 300 = 3%).
simulateWhen true, the response also includes a preview object. Default false. If the simulated transaction reverts, the request returns 40485 for a specific classified revert reason or 40484 for any other revert (see Error Codes).
Build LP Add Transaction › Responses
LP add transaction calldata returned successfully.
codeBusiness status code. 0 indicates success.
msgHuman-readable status message.
Unified response of the five build endpoints (deposit / redeem / lp-add / lp-remove / claim). dataList is ordered: APPROVE items come first, the main action follows — sign and broadcast each item in order. preview is non-null only when the request set simulate=true. redeemDelayDays is populated only by /transaction/redeem.
timestampServer timestamp in milliseconds.
successWhether the request succeeded (mirrors code == 0).
Calculate LP Add Paired Amounts
Given a single input token, calculate the paired token amount needed for an LP add. This is a pure computation endpoint — it does not touch the chain and does not deduct any fee. Use it before /transaction/lp-add to size the paired token when only one side is supplied.
Tick range source rules are the same as /lp-add — provide exactly one group: nftId (existing position), priceRange, or tickLower+tickUpper.
-
If more than one group is supplied, only the highest-priority one is used and the others are silently ignored (priority:
nftId>priceRange> explicit tick pair). -
If none is supplied, the request is rejected.
-
The caller does NOT pass
binanceChainId— resolved frominvestmentId.
Calculate LP Add Paired Amounts › Authorization
Headers
X-OC-APIKEYAPI Key issued by Binance Web3 API for authentication.
X-OC-TIMESTAMPCurrent UTC time in ISO 8601 format with milliseconds, e.g. 2026-05-11T10:08:57.715Z.
X-OC-SIGNRequest signature (Base64-encoded).
X-OC-RECV-WINDOWAllowed time deviation in milliseconds (default: 5000, max: 60000).
X-OC-NONCEUnique request identifier for anti-replay; falls back to X-OC-SIGN if omitted.
Calculate LP Add Paired Amounts › Request Body
addressUser wallet address.
investmentIdLP investment product ID (chain-agnostic).
A (tokenAddress, amount) pair. amount is a human-readable decimal string (NOT the token's smallest unit); the service converts it according to the token's decimals. For the native asset use the sentinel 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee (40 es).
tickLowerLower tick bound (raw int24), aligned to the pool's tickSpacing.
tickUpperUpper tick bound (raw int24), aligned to the pool's tickSpacing.
priceRangePrice range as a percentage (e.g. "5" = ±5%).
nftIdRequired when calculating for an existing LP position.
Calculate LP Add Paired Amounts › Responses
Paired token amounts returned successfully.
codeBusiness status code. 0 indicates success.
msgHuman-readable status message.
Result of /transaction/lp-add/calculate. Returns the paired token amounts derived from the single input token. This endpoint is pure computation — it does not touch the chain and does not deduct any fee.
timestampServer timestamp in milliseconds.
successWhether the request succeeded (mirrors code == 0).
Build LP Remove Transaction
Build the unsigned transaction calldata for removing liquidity. Removal is by nftId + ratio (range (0, 1]) — no tokenList is needed; the per-token amounts are derived from the on-chain position. Returns an ordered dataList (typically [LP_REMOVE]).
slippageBps is the LP-leg slippage tolerance in basis points. The caller does NOT pass binanceChainId — resolved from investmentId.
Build LP Remove Transaction › Authorization
Headers
X-OC-APIKEYAPI Key issued by Binance Web3 API for authentication.
X-OC-TIMESTAMPCurrent UTC time in ISO 8601 format with milliseconds, e.g. 2026-05-11T10:08:57.715Z.
X-OC-SIGNRequest signature (Base64-encoded).
X-OC-RECV-WINDOWAllowed time deviation in milliseconds (default: 5000, max: 60000).
X-OC-NONCEUnique request identifier for anti-replay; falls back to X-OC-SIGN if omitted.
Build LP Remove Transaction › Request Body
addressUser wallet address (the signer / sender).
investmentIdLP investment product ID (chain-agnostic).
nftIdLP NFT token ID identifying the position to remove, decimal string (e.g. "7225901" or "#7225901"). The # prefix returned by the position list may be passed as-is — the service strips it automatically.
ratioRemoval ratio in the range (0, 1] as a decimal string (e.g. "0.04", "1").
slippageBpsSlippage tolerance for the LP leg, in basis points (e.g. 300 = 3%).
simulateWhen true, the response also includes a preview object. Default false. If the simulated transaction reverts, the request returns 40485 for a specific classified revert reason or 40484 for any other revert (see Error Codes).
Build LP Remove Transaction › Responses
LP remove transaction calldata returned successfully.
codeBusiness status code. 0 indicates success.
msgHuman-readable status message.
Unified response of the five build endpoints (deposit / redeem / lp-add / lp-remove / claim). dataList is ordered: APPROVE items come first, the main action follows — sign and broadcast each item in order. preview is non-null only when the request set simulate=true. redeemDelayDays is populated only by /transaction/redeem.
timestampServer timestamp in milliseconds.
successWhether the request succeeded (mirrors code == 0).
Build DeFi Claim Transaction
Build the unsigned claim calldata for one of four claim types — see DefiClaimType for which companion fields each type requires and which protocol constraints apply (e.g. REWARD_PROTOCOL is not supported for LP protocols; PancakeSwap V3 farming uses LP_FEE, not REWARD_INVESTMENT). Returns an ordered dataList (typically [CLAIM]).
binanceChainId resolution rules:
-
Normally resolved from
investmentId; the call always executes on that chain. -
For claim types other than
REWARD_PROTOCOL, any client-suppliedbinanceChainIdis silently ignored — passing a different chainId will not redirect the claim. -
Exception:
REWARD_PROTOCOLwith noinvestmentId— the client MUST passbinanceChainId(it is the only chain signal).
tokenAddressList optionally narrows the claim scope. Set simulate=true to also receive preview.
Build DeFi Claim Transaction › Authorization
Headers
X-OC-APIKEYAPI Key issued by Binance Web3 API for authentication.
X-OC-TIMESTAMPCurrent UTC time in ISO 8601 format with milliseconds, e.g. 2026-05-11T10:08:57.715Z.
X-OC-SIGNRequest signature (Base64-encoded).
X-OC-RECV-WINDOWAllowed time deviation in milliseconds (default: 5000, max: 60000).
X-OC-NONCEUnique request identifier for anti-replay; falls back to X-OC-SIGN if omitted.
Build DeFi Claim Transaction › Request Body
addressUser wallet address (the signer / sender).
claimTypeClaim routing type. Determines which companion fields are required:
REWARD_PROTOCOL: protocol-level rewards (e.g. Aave incentive, Radiant) — requiresdefiProtocolId+binanceChainIdREWARD_INVESTMENT: per-investment rewards — requiresinvestmentIdLP_FEE: Uniswap V3/V4 LP fees — requiresinvestmentId+nftIdREDEMPTION: redeem principal (Lista / Aster / Solv etc.) — requiresinvestmentId+redemptionId
Protocol constraints — not every claimType is valid for every protocol; an invalid
combination is rejected (40453 or 40454):
REWARD_PROTOCOLis not supported for LP (liquidity-pool) protocols in this release.REWARD_INVESTMENTis not supported for PancakeSwap V3 farming positions; useLP_FEEto claim farming incentives there.LP_FEEapplies only to concentrated-liquidity (V3/V4) LP positions.REDEMPTIONapplies only to protocols with a redemption / lock-up flow (Lista, Aster, Solv).
The valid claimTypes for a specific position are returned in that position's
positionDetail.claimTypes (see the position list) — branch on that rather than hard-coding
the mapping. Note: error messages may surface the protocol id with a chain prefix
(e.g. bsc_pancakeswap4); the canonical id in API fields is the un-prefixed form
(e.g. pancakeswap4).
binanceChainIdBinance chain ID. For REWARD_PROTOCOL (which does not use investmentId) this is the only chain signal and is required. For all other claim types the chain is resolved from investmentId and any client-supplied value is silently ignored — the call still executes on the investmentId chain, so a different chainId does not redirect the claim.
investmentIdRequired for REWARD_INVESTMENT, LP_FEE, and REDEMPTION. Not used for REWARD_PROTOCOL (which keys off defiProtocolId).
defiProtocolIdRequired for REWARD_PROTOCOL (e.g. pancakeswap3).
nftIdRequired for LP_FEE. The NFT token ID as a decimal string (e.g. "7225901" or "#7225901"). The # prefix returned by the position list may be passed as-is — the service strips it automatically.
redemptionIdRequired for REDEMPTION. Maps to the redemptionId returned in the position list (the on-line position index).
tokenAddressListOptional token address filter to narrow the claim scope.
simulateWhen true, the response also includes a preview object. Default false. If the simulated transaction reverts, the request returns 40485 for a specific classified revert reason or 40484 for any other revert (see Error Codes).
Build DeFi Claim Transaction › Responses
Claim transaction calldata returned successfully.
codeBusiness status code. 0 indicates success.
msgHuman-readable status message.
Unified response of the five build endpoints (deposit / redeem / lp-add / lp-remove / claim). dataList is ordered: APPROVE items come first, the main action follows — sign and broadcast each item in order. preview is non-null only when the request set simulate=true. redeemDelayDays is populated only by /transaction/redeem.
timestampServer timestamp in milliseconds.
successWhether the request succeeded (mirrors code == 0).