{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/paradex/json-schema/paradex-requests-block-offer-request-schema.json",
  "title": "requests.BlockOfferRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paradex-blocktrades-api-openapi.yml#/components/schemas/requests.BlockOfferRequest",
  "type": "object",
  "required": [
    "nonce",
    "offering_account",
    "signature",
    "trades"
  ],
  "properties": {
    "nonce": {
      "description": "Unique nonce for this offer request",
      "type": "string"
    },
    "offering_account": {
      "description": "Starknet address of the account making this offer",
      "type": "string"
    },
    "signature": {
      "description": "Cryptographic signature authorizing this offer",
      "allOf": [
        {
          "$ref": "#/$defs/responses.BlockTradeSignature"
        }
      ]
    },
    "trades": {
      "description": "Map of market symbol to offer details",
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/requests.BlockOfferInfo"
      }
    }
  },
  "$defs": {
    "requests.BlockOfferInfo": {
      "type": "object",
      "required": [
        "offerer_order",
        "price",
        "size"
      ],
      "properties": {
        "offerer_order": {
          "description": "Order details from the offering account",
          "allOf": [
            {
              "$ref": "#/$defs/responses.BlockTradeOrder"
            }
          ]
        },
        "price": {
          "description": "Offered price for this market",
          "type": "string"
        },
        "size": {
          "description": "Offered size for this market",
          "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.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"
      ]
    }
  }
}