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

# private/get_block_trades

`POST /private/get_block_trades`

## Request

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

Returns a paginated history of the caller's block trades for a wallet or one of its subaccounts, newest first. Pages count blocks, not trades. Each block has its time, the caller's liquidity role and the caller's trades, one per leg, in the private/get_trade_history shape. Optional filters: a time window, an instrument name and a direction. A block matches the instrument filter if it has a trade in that instrument, and the direction filter if any of the caller's trades has that direction. A matching block returns all of its trades. A session key restricted to some subaccounts sees only their blocks.

## Request body

- GetBlockTradesRequest
  - `direction` 'buy' | 'sell', nullable
  - `from_timestamp` integer, nullable
  - `instrument_name` string, nullable: Returns the blocks with a trade in this instrument.
  - `page` integer, nullable
  - `page_size` integer, nullable
  - `subaccount_id` integer, nullable
  - `to_timestamp` integer, nullable
  - `wallet` string, nullable

## Response `200`

Success

- PaginatedBlockTradesResult
  - `block_trades` BlockTradeHistoryResponse[], required
    - `block_trade_id` string, uuid, required: UUID v4 string
    - `liquidity_role` 'maker' | 'taker', required
    - `timestamp` integer, required
    - `trades` TradeHistoryResponse[], required: One trade per leg.
      - `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, required
      - `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
  - `pagination` Pagination, required: Response envelope for paginated RPCs.
    - `count` integer, required
    - `num_pages` integer, required

## 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/get_block_trades/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)
