LogoLogo
Join DiscordFollow on XBridge FundsLong $BERA
  • Doc Bros v1
    • Overview
    • Key Features
      • Speed & Liquidity is Key
      • Bropetual Markets
      • A Hub for Berachain DeFi
    • Proof-of-Liquidity
      • Reward Vault
    • Power of Points
    • Partners & Integrations
    • Campaigns
      • bro.trade Em Up
  • bullish bros
    • SuperBros NFT
  • Technicals
    • What is Proof-of-Liquidity?
    • One-Click Trading
    • Funding Rates
  • Liquidations & Insurance Fund
  • Vertex Edge Sequencer
  • Fees
  • PnL Settlements
  • Withdrawals
  • Pricing (Oracles)
  • links & resources
    • bro.trade Links
      • Website
      • Trade Bropetuals
      • Discord
      • X (Twitter)
      • Medium
      • Swap on OogaBooga
    • Berachain Links
      • Berachain.com
      • Official Bridge
      • BeraHub
      • Berascan
      • Bera Discord
      • Berachain X (Twitter)
      • Berachain Docs
    • FAQ
  • developer bros
    • API
      • Gateway
        • Executes
          • Place Order
          • Cancel Order
          • Cancel and Place
          • Cancel Product Order
          • Withdraw Colleteral
          • Transfer Quote
          • Liquidate Subaccount
          • Mint LP
          • Burn LP
          • Link Signer
        • Queries
          • All Products
          • Contracts
          • Fee Rates
          • Health Groups
          • Insurance
          • Linked Signer
          • Market Liquidity
          • Market Prices
          • Max Lp Mintable
          • Max Order Size
          • Max Withdrawable
          • Min Deposit Rates
          • Nonces
          • Order
          • Orders
          • Status
          • Subaccount Info
          • Symbols
        • Signing
          • Examples
          • Q A
      • Subscriptions
        • Authentication
        • Streams
        • Events
        • Rate Limits
      • Archive (indexer)
        • Candlesticks
        • Events
        • Funding Rate
        • Interest Funding Payments
        • Linked Signer Rate Limit
        • Liquidation Feed
        • Maker Statistics
        • Market Snapshots
        • Matches
        • Merkle Proofs
        • Oracle Price
        • Orders
        • Perp Prices
        • Product Snapshots
        • Rewards
        • Signatures
        • Subaccounts
        • Summary
        • HONEY Price
      • Trigger
        • Executes
          • Place Order
          • Cancel Orders
          • Cancel Product Orders
        • Queries
          • List Trigger Orders
      • V2
        • Apr
        • Assets
        • Contracts
        • Orderbook
        • Pairs
        • Tickers
        • Trades
      • Rate limits
      • Errors
      • Symbols
      • Depositing
      • Withdrawing (on-chain)
      • Integrate via Smart Contracts
      • Definitions / Formulas
    • On-Chain Contracts
Powered by GitBook
On this page
  • Rate limits
  • Single Product
  • Multiple Products
  1. developer bros
  2. API
  3. Gateway
  4. Queries

Market Prices

PreviousMarket LiquidityNextMax Lp Mintable

Last updated 3 months ago

Rate limits

  • 2400 requests/min or 40 requests/sec per IP address. (weight = 1) or length of product_ids for multi-product markets query.

See more details in .

Single Product

Request

Connect

WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]

Message

{
  "type": "market_price",
  "product_id": 1
}

GET [GATEWAY_REST_ENDPOINT]/query?type=market_price&product_id={product_id}

POST [GATEWAY_REST_ENDPOINT]/query

Body

{
  "type": "market_price",
  "product_id": 1
}

Request Parameters

Parameter
Type
Required
Description

product_id

number

Yes

Id of spot / perp product for which to retrieve market price data.

Response

{
  "status": "success",
  "data": {
    "product_id": 1,
    "bid_x18": "24224000000000000000000",
    "ask_x18": "24243000000000000000000"
  },
  "request_type": "query_market_price",
}

Multiple Products

Request

Connect

WEBSOCKET [CORE_WEBSOCKET_ENDPOINT]

Message

{
  "type": "market_prices",
  "product_ids": [1, 2]
}

POST /query

Body

{
  "type": "market_prices",
  "product_ids": [1, 2]
}

Request Parameters

Parameter
Type
Required
Description

product_ids

number[]

Yes

List of spot / perp products for which to retrieve market price data.

Response

{
  "status": "success",
  "data": {
    "market_prices": [
      {
        "product_id": 1,
        "bid_x18": "31315000000000000000000",
        "ask_x18": "31326000000000000000000"
      },
      {
        "product_id": 2,
        "bid_x18": "31291000000000000000000",
        "ask_x18": "31301000000000000000000"
      },
    ]
  },
  "request_type": "query_market_prices"
}
API Rate limits