RFQ

private/send_block_proposal

Changed on

Posts the caller's signed maker side of a block trade as a block proposal, for a taker to accept with private/accept_block_proposal. The side is signed as the maker side of private/execute_block_trade. The exchange keeps the signature, and no other user can see it. With recipient_wallet, only that wallet can see and accept the proposal. With listed true, the proposal is on the public list that public/get_block_proposals returns, and anyone can accept it. With neither, anyone who has the proposal_id can read and accept the proposal, so share the id only with the intended counterparty. A listed proposal cannot have a recipient_wallet. The proposal can be accepted while the signed side can execute: until 60 seconds before its signature_expiry_sec, or 59 minutes after its nonce time, whichever is first. The response gives that time as expires_at_sec. So the signed signature_expiry_sec sets how long the proposal stays open. A proposal must stay open for at least 60 seconds, or the call fails with invalid_params (-32602). The side must pass the checks that private/verify_block_trade makes for a maker side, except that its nonce time can be up to 59 minutes old. Its total cost must be inside the currency's RFQ price band. A proposal trades with no broker fee. A wallet can have a limited number of open proposals. Returns the proposal with its proposal_id. Its maker and its recipient also receive it on the {wallet}.block_proposals channel. Fails with block_trade_outside_price_band (11123) if the total cost is outside the band, with block_trades_not_available_for_currency (11124) if the currency has no band, with insufficient_funds (11000) if the side does not have enough margin, with block_trade_same_owner (11115) if recipient_wallet is the caller's wallet, with non_unique_nonce (11017) if an open proposal already uses the nonce, and with rate_limit_exceeded (-32000) if the wallet has too many open proposals. Requires the block_trade off-chain scope. A session key that signs the side needs block_trade and an RFQ trade scope for every instrument in the legs.

post/private/send_block_proposal

Request

  • Base URL
    https://api.derive.xyz/v3
  • Auth
    API key in header X-DeriveWallet and API key in header X-DeriveTimestamp and API key in header X-DeriveSignature

Request body

SendBlockProposalRequest required

The caller's maker side of a block trade, signed as for private/execute_block_trade, and who can accept it.

direction, 'buy' | 'sell' required
legs, PricedLegParamsAndResponse[] required
listed, boolean

Whether the proposal is on the public list.

max_fee, string decimal required

Highest total fee this side pays, in USD.

nonce, string required
recipient_wallet, string nullable

20-byte Ethereum address as a 0x-prefixed lowercase hex string.

signature, string required
signature_expiry_sec, integer required
signer, string required

20-byte Ethereum address as a 0x-prefixed lowercase hex string.

subaccount_id, integer required

Response

Success

BlockProposalPrivateResponse required

A block proposal as its maker and its recipient see it.

block_trade_id, string uuid nullable required

The block trade, once the proposal executes.

creation_timestamp, integer required
currency, string required
direction, 'buy' | 'sell' required

The maker's direction. The taker trades the opposite.

expires_at_sec, integer required

The last second (UTC) at which the proposal can be accepted.

last_update_timestamp, integer required
legs, PricedLegParamsAndResponse[] required
listed, boolean required

Whether the proposal is on the public list.

maker_wallet, string required

20-byte Ethereum address as a 0x-prefixed lowercase hex string.

proposal_id, string uuid required

UUID v4 string

recipient_wallet, string nullable

20-byte Ethereum address as a 0x-prefixed lowercase hex string.

risk_universe_id, integer required
status, union required

Changes