{
  "openapi": "3.1.0",
  "info": {
    "title": "Metadata API",
    "description": "Endpoints are authenticated with an API key: send api-access-key, api-timestamp, and api-signature on each request. Public endpoints (security: []) take no key.",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.pax.markets",
      "description": "Production API"
    }
  ],
  "paths": {
    "/v1/metadata/exchange-info": {
      "get": {
        "tags": [
          "MetadataService"
        ],
        "summary": "Get exchange info",
        "description": "List the exchange's markets, assets and fee rates.",
        "operationId": "MetadataService_GetExchangeInfo",
        "responses": {
          "default": {
            "description": "An error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "A successful response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/paxmetadata_apiGetExchangeInfoResponse"
                }
              }
            }
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "schemas": {
      "LegacyErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "description": "Why the request failed. Requests stopped before reaching the endpoint, for example by authentication, send an object with a code and a message; errors from the endpoint itself send a string.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              }
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "paxmetadata_apiGetExchangeInfoRequest": {
        "type": "object"
      },
      "paxmetadata_apiAssetInfo": {
        "type": "object",
        "properties": {
          "asset_id": {
            "description": "Asset id.",
            "type": "string",
            "format": "uint64"
          },
          "asset_name": {
            "description": "Asset name.",
            "type": "string"
          },
          "native_unit_name": {
            "description": "Name of the asset's smallest unit.",
            "type": "string"
          },
          "num_native_units": {
            "description": "Native units in one whole asset.",
            "type": "string",
            "format": "int64"
          }
        },
        "required": [
          "asset_id",
          "asset_name",
          "native_unit_name",
          "num_native_units"
        ]
      },
      "paxmetadata_apiMarketType": {
        "description": "Kind of market.\n\n- `SPOT`: Buy or sell the base asset outright.",
        "x-enum-numbers": [
          1
        ],
        "x-enum-descriptions": {
          "SPOT": "Buy or sell the base asset outright."
        },
        "type": "string",
        "enum": [
          "SPOT"
        ]
      },
      "paxmetadata_apiMarketInfo": {
        "type": "object",
        "properties": {
          "market_id": {
            "description": "Market id.",
            "type": "string",
            "format": "uint64"
          },
          "market_name": {
            "description": "Market name.",
            "type": "string"
          },
          "market_type": {
            "description": "Kind of market.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxmetadata_apiMarketType"
              }
            ]
          },
          "base_asset_id": {
            "description": "Asset bought or sold.",
            "type": "string",
            "format": "uint64"
          },
          "quote_asset_id": {
            "description": "Asset paid or received.",
            "type": "string",
            "format": "uint64"
          },
          "qty_unit_name": {
            "description": "Name of the base asset's native unit.",
            "type": "string"
          },
          "tick_unit_name": {
            "description": "Name of the quote asset's native unit.",
            "type": "string"
          },
          "tick_size": {
            "description": "Quote native units per tick.",
            "type": "string",
            "format": "uint64"
          },
          "qty_step_size": {
            "description": "Base native units per step.",
            "type": "string",
            "format": "int64"
          },
          "max_qty": {
            "description": "Largest order quantity, in base native units.",
            "type": "string",
            "format": "int64"
          },
          "notes": {
            "description": "Additional notes.",
            "type": "string"
          },
          "max_ticks": {
            "description": "Highest order price, in ticks.",
            "type": "integer",
            "format": "int32"
          },
          "min_notional": {
            "description": "Smallest order value at its limit price, in quote native units.",
            "type": "string",
            "format": "int64"
          }
        },
        "required": [
          "market_id",
          "market_name",
          "market_type",
          "base_asset_id",
          "quote_asset_id",
          "qty_unit_name",
          "tick_unit_name",
          "tick_size",
          "qty_step_size",
          "max_qty",
          "notes",
          "max_ticks",
          "min_notional"
        ]
      },
      "paxmetadata_apiFeeInfo": {
        "type": "object",
        "properties": {
          "lambda_taker_fee_bps": {
            "description": "Lambda taker fee, in bps of fill value. Rounded up.",
            "type": "string"
          },
          "lambda_maker_spread_multiplier": {
            "description": "Lambda maker fee, as a share of its spread. Rounded up.",
            "type": "string"
          },
          "lambda_maker_fee_cap_bps": {
            "description": "Lambda maker fee cap, in bps of fill value. Rounded up.",
            "type": "string"
          },
          "free_tier_rebate_multiplier": {
            "description": "Free-tier rebate, as a share of the lambda counterparty's fee. Rounded down.",
            "type": "string"
          },
          "free_tier_rebate_cap_bps": {
            "description": "Free-tier rebate cap, in bps of fill value. Rounded down.",
            "type": "string"
          }
        },
        "required": [
          "lambda_taker_fee_bps",
          "lambda_maker_spread_multiplier",
          "lambda_maker_fee_cap_bps",
          "free_tier_rebate_multiplier",
          "free_tier_rebate_cap_bps"
        ]
      },
      "paxmetadata_apiGetExchangeInfoResponse": {
        "type": "object",
        "properties": {
          "assets": {
            "description": "List of all traded assets.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/paxmetadata_apiAssetInfo"
            }
          },
          "markets": {
            "description": "List of all traded markets.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/paxmetadata_apiMarketInfo"
            }
          },
          "fees": {
            "description": "Fee and rebate rates, settled per fill in the quote asset.",
            "allOf": [
              {
                "$ref": "#/components/schemas/paxmetadata_apiFeeInfo"
              }
            ]
          }
        },
        "required": [
          "fees"
        ]
      }
    },
    "securitySchemes": {
      "ApiAccessKey": {
        "type": "apiKey",
        "in": "header",
        "name": "api-access-key",
        "description": "The key id of the API key making the request. Endpoints that need more than read access list `trade` or `withdraw` as a role."
      },
      "ApiTimestamp": {
        "type": "apiKey",
        "in": "header",
        "name": "api-timestamp",
        "description": "Request timestamp in milliseconds since the Unix epoch. Requests outside recvWindow are rejected."
      },
      "ApiSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "api-signature",
        "description": "Signature over the request, produced with the API key's secret."
      }
    }
  },
  "security": [
    {
      "ApiAccessKey": [],
      "ApiTimestamp": [],
      "ApiSignature": []
    }
  ],
  "tags": [
    {
      "name": "MetadataService"
    }
  ]
}