---
title: "private/execute_block_trade"
method: POST
path: "/private/execute_block_trade"
tags: ["RFQ"]
---

# private/execute_block_trade

`POST /private/execute_block_trade`

## Request

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

Settles a block trade: a multi-leg trade that two parties agree off the platform, directly or through a broker. Each party signs its own side. The maker side signs the same payload as an RFQ quote and the taker side signs the same payload as an RFQ execution, over the same priced legs. Anyone who holds both signed sides can submit them, and the submitter needs no access to either subaccount. A submitter can add a broker fee to each side with extra_fee and referral_code, up to that side's signed max_fee. The trade settles at the signed prices in one atomic step. The total cost must be inside the currency's RFQ price band for both sides, as within_price_band in private/simulate_block_trade and private/verify_block_trade reports. Each leg must be at least 100 times its instrument's minimum_amount. Returns the block_trade_id and the trades of each side. 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, and with invalid_amount (11012) if a leg is too small. Requires the block_trade off-chain scope; RFQ scopes do not cover block trades. A session key that signs a side needs block_trade and an RFQ trade scope for every instrument in the legs, or fails with unauthorized_key_scope (14031).

## Request body

- ExecuteBlockTradeRequest
  - `maker_params` SignedBlockTradeSideRequest, required: One party's side of a block trade, signed by that party.
    - `client` string
    - `direction` 'buy' | 'sell', required
    - `extra_fee` string, decimal: Broker fee for this side, in USD, paid to the owner of `referral_code`. It is not signed. The side's `max_fee` caps the total fee.
    - `label` string
    - `legs` PricedLegParamsAndResponse[], required
      - `amount` string, decimal, required: Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
      - `direction` 'buy' | 'sell', required
      - `instrument_name` string, required
      - `price` string, decimal, required: Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `max_fee` string, decimal, required: Highest total fee this side pays, in USD, including `extra_fee`.
    - `nonce` string, required
    - `referral_code` 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
  - `taker_params` SignedBlockTradeSideRequest, required: One party's side of a block trade, signed by that party.
    - `client` string
    - `direction` 'buy' | 'sell', required
    - `extra_fee` string, decimal: Broker fee for this side, in USD, paid to the owner of `referral_code`. It is not signed. The side's `max_fee` caps the total fee.
    - `label` string
    - `legs` PricedLegParamsAndResponse[], required
      - `amount` string, decimal, required: Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
      - `direction` 'buy' | 'sell', required
      - `instrument_name` string, required
      - `price` string, decimal, required: Non-negative decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `max_fee` string, decimal, required: Highest total fee this side pays, in USD, including `extra_fee`.
    - `nonce` string, required
    - `referral_code` 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 `200`

Success

- BlockTradeExecuteResponse: Result for `private/execute_block_trade`: the trades each side took.
  - `block_trade_id` string, uuid, required: UUID v4 string
  - `maker_trades` Trade[], required
    - `batch_status` 'Batching' | 'Executing' | 'Da' | 'Proving' | 'Settling' | 'Settled' | 'BatchingError' | 'ExecutingError' | 'DaError' | 'ProvingError' | 'SettlingError' | 'SettledError', nullable: Batch lifecycle status — the single source of lifecycle truth for every operation in the batch (individual ops carry no status of their own). Each stage has a healthy variant and a corresponding `...Error` variant meaning that stage failed. Serialized as the variant name (string) in API responses.
    - `block_trade_id` string, uuid, nullable, required: Optional UUID v4 string
    - `direction` 'buy' | 'sell', required
    - `expected_rebate` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `extra_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `index_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `instrument_name` string, required
    - `is_transfer` boolean, required
    - `label` string
    - `liquidity_role` 'maker' | 'taker', required
    - `mark_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `op_uuid` string, required
    - `order_id` string, required
    - `quote_id` string, uuid, nullable, required: Optional UUID v4 string
    - `realized_pnl` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `realized_pnl_excl_fees` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `rfq_id` string, uuid, nullable, required: Optional UUID v4 string
    - `subaccount_id` integer, required
    - `timestamp` integer, required
    - `trade_amount` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `trade_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `trade_id` string, required
    - `trade_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `tx_hash` string, nullable
  - `taker_trades` Trade[], required
    - `batch_status` 'Batching' | 'Executing' | 'Da' | 'Proving' | 'Settling' | 'Settled' | 'BatchingError' | 'ExecutingError' | 'DaError' | 'ProvingError' | 'SettlingError' | 'SettledError', nullable: Batch lifecycle status — the single source of lifecycle truth for every operation in the batch (individual ops carry no status of their own). Each stage has a healthy variant and a corresponding `...Error` variant meaning that stage failed. Serialized as the variant name (string) in API responses.
    - `block_trade_id` string, uuid, nullable, required: Optional UUID v4 string
    - `direction` 'buy' | 'sell', required
    - `expected_rebate` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `extra_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `index_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `instrument_name` string, required
    - `is_transfer` boolean, required
    - `label` string
    - `liquidity_role` 'maker' | 'taker', required
    - `mark_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `op_uuid` string, required
    - `order_id` string, required
    - `quote_id` string, uuid, nullable, required: Optional UUID v4 string
    - `realized_pnl` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `realized_pnl_excl_fees` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `rfq_id` string, uuid, nullable, required: Optional UUID v4 string
    - `subaccount_id` integer, required
    - `timestamp` integer, required
    - `trade_amount` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `trade_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `trade_id` string, required
    - `trade_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `tx_hash` string, nullable

## Other responses

- `default`: JSON-RPC error (see Error Codes)

## Changes

- **2026-11-12** `1daf38a69a7a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/lyra/apis/derive-v3-api/changes/private/execute_block_trade/post.md)

---

[API](https://skmtc.dev/lyra/apis/derive-v3-api.md) - [All operations](https://skmtc.dev/lyra/apis/derive-v3-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lyra/apis/derive-v3-api/revisions/415f8a73b10c?raw)
