{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/paradex/json-schema/paradex-responses-block-trade-detail-full-response-schema.json",
  "title": "responses.BlockTradeDetailFullResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paradex-blocktrades-api-openapi.yml#/components/schemas/responses.BlockTradeDetailFullResponse",
  "type": "object",
  "properties": {
    "block_expiration": {
      "description": "Unix timestamp in milliseconds when block expires",
      "type": "integer"
    },
    "block_id": {
      "description": "Backend-generated unique identifier",
      "type": "string"
    },
    "block_type": {
      "description": "Block type",
      "allOf": [
        {
          "$ref": "#/$defs/responses.BlockTradeType"
        }
      ]
    },
    "created_at": {
      "description": "When block was created",
      "type": "integer"
    },
    "failure_reason": {
      "description": "Reason for failure (if status is FAILED). Names a participant by role, never by address: <maker>, <taker>, <initiator>, <participant> (a party whose side is ambiguous), or <redacted> (an identifier belonging to no participant)",
      "type": "string"
    },
    "initiator": {
      "description": "Account that initiated this block trade",
      "type": "string"
    },
    "last_updated_at": {
      "description": "When block was last updated",
      "type": "integer"
    },
    "nonce": {
      "description": "Original block nonce",
      "type": "string"
    },
    "parent_block_id": {
      "description": "Parent block ID (if offer-based)",
      "type": "string"
    },
    "required_signers": {
      "description": "List of accounts that can participate in the block trade",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "signatures": {
      "description": "Current signatures on this block (for signature verification)",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/responses.BlockTradeSignature"
      }
    },
    "status": {
      "description": "Current status of the block trade",
      "allOf": [
        {
          "$ref": "#/$defs/responses.BlockTradeStatus"
        }
      ]
    },
    "trades": {
      "description": "Map of market to trade details",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/responses.BlockTradeDetailResponse"
      }
    }
  },
  "$defs": {
    "responses.BlockTradeConstraints": {
      "type": "object",
      "properties": {
        "max_price": {
          "description": "Maximum price allowed",
          "type": "string"
        },
        "max_size": {
          "description": "Maximum trade size allowed",
          "type": "string"
        },
        "min_price": {
          "description": "Minimum price allowed",
          "type": "string"
        },
        "min_size": {
          "description": "Minimum trade size allowed",
          "type": "string"
        }
      }
    },
    "responses.BlockTradeDetailResponse": {
      "type": "object",
      "properties": {
        "executed_at": {
          "description": "When this trade was executed",
          "type": "integer"
        },
        "failure_reason": {
          "description": "Reason for failure (if failed). Names a participant by role, never by address: <maker>, <taker>, <initiator>, <participant> (a party whose side is ambiguous), or <redacted> (an identifier belonging to no participant)",
          "type": "string"
        },
        "maker_account": {
          "description": "Maker account (if fully executable)",
          "type": "string"
        },
        "maker_fill": {
          "description": "Execution details (if executed)",
          "allOf": [
            {
              "$ref": "#/$defs/responses.FillResult"
            }
          ]
        },
        "maker_order": {
          "description": "Original maker order (for signature generation)",
          "allOf": [
            {
              "$ref": "#/$defs/responses.BlockTradeOrder"
            }
          ]
        },
        "market": {
          "description": "Trading pair for this trade",
          "type": "string"
        },
        "price": {
          "description": "Agreed price (if fully executable)",
          "type": "string"
        },
        "size": {
          "description": "Agreed size (if fully executable)",
          "type": "string"
        },
        "taker_account": {
          "description": "Taker account (if fully executable)",
          "type": "string"
        },
        "taker_fill": {
          "description": "Execution details (if executed)",
          "allOf": [
            {
              "$ref": "#/$defs/responses.FillResult"
            }
          ]
        },
        "taker_order": {
          "description": "Original taker order (for signature generation)",
          "allOf": [
            {
              "$ref": "#/$defs/responses.BlockTradeOrder"
            }
          ]
        },
        "trade_constraints": {
          "description": "Constraints for offers (if offer-based)",
          "allOf": [
            {
              "$ref": "#/$defs/responses.BlockTradeConstraints"
            }
          ]
        },
        "trade_id": {
          "description": "Backend-generated unique identifier for this trade",
          "type": "string"
        }
      }
    },
    "responses.BlockTradeOrder": {
      "type": "object",
      "required": [
        "side",
        "type"
      ],
      "properties": {
        "account": {
          "description": "Paradex account address of the order owner",
          "type": "string"
        },
        "client_id": {
          "description": "Client-provided identifier",
          "type": "string"
        },
        "flags": {
          "description": "Order flags. Requests may set only REDUCE_ONLY; MMP is set from the owner's protect_block_trades config. Returned only to the leg's owner",
          "type": "array",
          "items": {
            "$ref": "#/$defs/responses.OrderFlag"
          }
        },
        "market": {
          "description": "Trading pair for this order",
          "type": "string"
        },
        "price": {
          "description": "Order price (omitted for market orders)",
          "type": "string"
        },
        "side": {
          "description": "Order side",
          "allOf": [
            {
              "$ref": "#/$defs/responses.OrderSide"
            }
          ]
        },
        "signature": {
          "description": "Order signature",
          "type": "string"
        },
        "signature_timestamp": {
          "description": "Ignored on requests. In responses, the signature_timestamp the leg's account sent with its block signature (client-reported, not signed); omitted when 0",
          "type": "integer"
        },
        "size": {
          "description": "Order size",
          "type": "string"
        },
        "type": {
          "description": "Order type",
          "allOf": [
            {
              "$ref": "#/$defs/responses.OrderType"
            }
          ]
        }
      }
    },
    "responses.BlockTradeSignature": {
      "type": "object",
      "required": [
        "nonce",
        "signature_data",
        "signature_expiration",
        "signature_timestamp",
        "signature_type",
        "signer_account"
      ],
      "properties": {
        "nonce": {
          "description": "Unique nonce to prevent replay attacks",
          "type": "string"
        },
        "signature_data": {
          "description": "Order signature in as a string \"[r,s]\" signed by account's paradex private key",
          "type": "string"
        },
        "signature_expiration": {
          "description": "Unix timestamp in milliseconds when signature expires",
          "type": "integer"
        },
        "signature_timestamp": {
          "description": "Unix timestamp in milliseconds when signature was created",
          "type": "integer"
        },
        "signature_type": {
          "description": "Type of cryptographic signature used",
          "type": "string",
          "enum": [
            "STARKNET"
          ]
        },
        "signer_account": {
          "description": "Paradex account address of the signer",
          "type": "string"
        },
        "signer_public_key": {
          "description": "Hex pubkey used to sign (main account key or active subkey). Empty defaults to account main key.",
          "type": "string"
        }
      }
    },
    "responses.BlockTradeStatus": {
      "type": "string",
      "enum": [
        "CREATED",
        "OFFER_COLLECTION",
        "READY_TO_EXECUTE",
        "EXECUTING",
        "PENDING_SETTLEMENT",
        "COMPLETED",
        "FAILED",
        "CANCELLED"
      ],
      "x-enum-varnames": [
        "BlockTradeStatusCreated",
        "BlockTradeStatusOfferCollection",
        "BlockTradeStatusReadyToExecute",
        "BlockTradeStatusExecuting",
        "BlockTradeStatusPendingSettlement",
        "BlockTradeStatusCompleted",
        "BlockTradeStatusFailed",
        "BlockTradeStatusCancelled"
      ]
    },
    "responses.BlockTradeType": {
      "type": "string",
      "enum": [
        "DIRECT",
        "OFFER_BASED"
      ],
      "x-enum-varnames": [
        "BlockTradeTypeDirect",
        "BlockTradeTypeOffer"
      ]
    },
    "responses.FillFlag": {
      "type": "string",
      "enum": [
        "interactive",
        "rpi",
        "fastfill"
      ],
      "x-enum-comments": {
        "FillFlagFast": "Retail order was fast filled",
        "FillFlagInteractive": "Fill was generated from an interactive order (user-initiated)",
        "FillFlagRPI": "Fill qualifies for Retail Price Improvement"
      },
      "x-enum-varnames": [
        "FillFlagInteractive",
        "FillFlagRPI",
        "FillFlagFast"
      ]
    },
    "responses.FillResult": {
      "type": "object",
      "properties": {
        "account": {
          "description": "Account that made the fill",
          "type": "string"
        },
        "client_id": {
          "description": "Unique client assigned ID for the order",
          "type": "string"
        },
        "created_at": {
          "description": "Fill time",
          "type": "integer"
        },
        "fee": {
          "description": "Fee paid by the user",
          "type": "string"
        },
        "fee_currency": {
          "description": "Asset that fee is charged in",
          "type": "string"
        },
        "fill_type": {
          "description": "Fill type, can be FILL, LIQUIDATION or UNWIND_TRANSFER",
          "allOf": [
            {
              "$ref": "#/$defs/responses.FillType"
            }
          ]
        },
        "flags": {
          "description": "Fill flags indicating special properties",
          "type": "array",
          "items": {
            "$ref": "#/$defs/responses.FillFlag"
          }
        },
        "id": {
          "description": "Unique string ID of fill per FillType",
          "type": "string"
        },
        "liquidity": {
          "description": "Maker or Taker",
          "allOf": [
            {
              "$ref": "#/$defs/responses.TraderRole"
            }
          ]
        },
        "market": {
          "description": "Market name",
          "type": "string"
        },
        "order_id": {
          "description": "Order ID",
          "type": "string"
        },
        "orderbook_seq_no": {
          "description": "Orderbook sequence number after trade execution (post-execution state). Use seqno-1 for pre-execution. 0 for position transfers (liquidations, settlements)",
          "type": "integer"
        },
        "price": {
          "description": "Price at which order was filled",
          "type": "string"
        },
        "realized_funding": {
          "description": "Realized funding of the fill",
          "type": "string"
        },
        "realized_pnl": {
          "description": "Realized PnL of the fill",
          "type": "string"
        },
        "remaining_size": {
          "description": "Remaining size of the order",
          "type": "string"
        },
        "side": {
          "description": "Taker side",
          "allOf": [
            {
              "$ref": "#/$defs/responses.OrderSide"
            }
          ]
        },
        "size": {
          "description": "Size of the fill",
          "type": "string"
        },
        "underlying_price": {
          "description": "Underlying asset price of the fill (spot price)",
          "type": "string"
        }
      }
    },
    "responses.FillType": {
      "type": "string",
      "enum": [
        "LIQUIDATION",
        "UNWIND_TRANSFER",
        "FILL",
        "SETTLE_MARKET",
        "RPI",
        "BLOCK_TRADE"
      ],
      "x-enum-varnames": [
        "FillTypeLiquidation",
        "FillTypeUnwindTransfer",
        "FillTypeFill",
        "FillTypeSettleMarket",
        "FillTypeRPI",
        "FillTypeBlockTrade"
      ]
    },
    "responses.OrderFlag": {
      "type": "string",
      "enum": [
        "REDUCE_ONLY",
        "STOP_CONDITION_BELOW_TRIGGER",
        "STOP_CONDITION_ABOVE_TRIGGER",
        "INTERACTIVE",
        "TARGET_STRATEGY_VWAP",
        "MMP"
      ],
      "x-enum-varnames": [
        "FlagsReduceOnly",
        "FlagsStopConditionBelowTrigger",
        "FlagsStopConditionAboveTrigger",
        "FlagsInteractive",
        "FlagsTargetStrategyVWAP",
        "FlagsMMP"
      ]
    },
    "responses.OrderSide": {
      "type": "string",
      "enum": [
        "BUY",
        "SELL"
      ],
      "x-enum-varnames": [
        "OrderSideBuy",
        "OrderSideSell"
      ]
    },
    "responses.OrderType": {
      "type": "string",
      "enum": [
        "MARKET",
        "LIMIT",
        "STOP_LIMIT",
        "STOP_MARKET",
        "TAKE_PROFIT_LIMIT",
        "TAKE_PROFIT_MARKET",
        "STOP_LOSS_MARKET",
        "STOP_LOSS_LIMIT"
      ],
      "x-enum-varnames": [
        "OrderTypeMarket",
        "OrderTypeLimit",
        "OrderTypeStopLimit",
        "OrderTypeStopMarket",
        "OrderTypeTakeProfitLimit",
        "OrderTypeTakeProfitMarket",
        "OrderTypeStopLossMarket",
        "OrderTypeStopLossLimit"
      ]
    },
    "responses.TraderRole": {
      "type": "string",
      "enum": [
        "TAKER",
        "MAKER"
      ],
      "x-enum-varnames": [
        "TraderRoleTaker",
        "TraderRoleMaker"
      ]
    }
  }
}