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
  • Available Granularities
  • Request
  • Request Parameters
  • Response
  • Response Fields
  1. developer bros
  2. API
  3. Archive (indexer)

Candlesticks

PreviousArchive (indexer)NextEvents

Last updated 2 months ago

Rate limits

  • Dynamic based on limit param provided (weight = 2 + limit / 10)

    • E.g: With limit=100, you can make up to 200 requests per min or 33 requests / 10 secs.

See more details in .

Available Granularities

Granularity name
Granularity value (in seconds)

1 minute

60

5 minutes

300

15 minutes

900

1 hour

3600

2 hours

7200

4 hours

14400

1 day

86400

1 week

604800

4 weeks

2419200

Request

Query product candlesticks ordered by timestamp desc.

POST [ARCHIVE_ENDPOINT]

Body

{
  "candlesticks": {
    "product_id": 1,
    "granularity": 60,
    "limit": 2
  }
}

Request Parameters

Parameter
Type
Required
Description

product_id

number

Yes

Id of product to fetch candlesticks for.

granularity

number

Yes

Granularity value in seconds.

max_time

number / string

No

When providing max_time (unix epoch in seconds), only return candlesticks with timestamp <= max_time

limit

number

No

Max number of candlesticks to return. defaults to 100. max possible of 500.

Response

{
  "candlesticks": [
    {
      "product_id": 1,
      "granularity": 60,
      "submission_idx": "627709",
      "timestamp": "1680118140",
      "open_x18": "27235000000000000000000",
      "high_x18": "27298000000000000000000",
      "low_x18": "27235000000000000000000",
      "close_x18": "27298000000000000000000",
      "volume": "1999999999999999998"
    },
    {
      "product_id": 1,
      "granularity": 60,
      "submission_idx": "627699",
      "timestamp": "1680118080",
      "open_x18": "27218000000000000000000",
      "high_x18": "27245000000000000000000",
      "low_x18": "27218000000000000000000",
      "close_x18": "27245000000000000000000",
      "volume": "11852999999999999995"
    }
  ]
}

Response Fields

Field name
Description

submission_idx

Id of the latest recorded transaction that contributes to the candle.

product_id

Id of product candle is associated to.

granularity

Candle time interval, expressed in seconds, representing the aggregation period for trading volume and price data

open_x18

The first fill price of the candle, multiplied by 10^18

high_x18

The highest recorded fill price during the defined interval of the candle, multiplied by 10^18

low_x18

The lowest recorded fill price during the defined interval of the candle, multiplied by 10^18

close_x18

The last price of the candle, multiplied by 10^18

volume

Asset volume, which represents the absolute cumulative fill amounts during the time interval of the candle, multiplied by 10^18

API Rate limits