private/simulate_block_trade
Changed onEstimates one side of a block trade for the caller's subaccount before it is signed. Takes the side's direction, the agreed priced legs and an optional extra_fee. Returns the total fee the side would pay, extra_fee included, its initial margin before and after the trade, and within_price_band, which is whether the total cost is inside the currency's RFQ price band for both sides, or null if the currency has no band. Also returns price_band_min_total_cost and price_band_max_total_cost, the lowest and highest total cost at which this side is inside the band. Fails with invalid_amount (11012) if a leg is smaller than 100 times its instrument's minimum_amount. A side without enough margin returns is_valid false and the reason, not an error. Requires the block_trade off-chain scope.
Request
- Base URLhttps://api.derive.xyz/v3
- AuthAPI key in header X-DeriveWallet and API key in header X-DeriveTimestamp and API key in header X-DeriveSignature
Request body
This side's direction. The taker side trades opposite the maker side.
Broker fee for this side, in USD.
The agreed priced legs, the same on both sides.
Response
Success
Result for private/simulate_block_trade and private/verify_block_trade: one side's fee and margin if it executed now.
The side's total fee, extra_fee included.
The last second at which the signed side can execute. Null for an unsigned side.
False if the side does not have enough margin for its trade and fees, or if the trade takes the subaccount over its maximum asset count.
Decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted
Decimal string of the human value (e.g. "1.5"), up to 12 fractional digits; a string or JSON number is accepted
The highest total cost at which this side is within the RFQ price band, as a decimal string. Null if the currency has no band.
The lowest total cost at which this side is within the RFQ price band, as a decimal string. A negative cost means the side receives. Null if the currency has no band.
Whether both sides are within the currency's RFQ price band. Null if it has no band.
Changes
- info
added the required property
price_band_max_total_costto the response with the status - info
added the required property
price_band_min_total_costto the response with the status
- info
- info
endpoint added
- info