> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decibel.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Get candlestick (OHLC) data

> Retrieve perp candlestick data for one perp market address and time range.
Spot candlesticks are available from the `market_candlestick:{marketAddr}:{interval}`
WebSocket topic; spot and perp markets with the same base asset have different
market addresses and must be requested separately.
Supports intervals: 1m, 15m, 1h, 4h, 1d. Missing intervals are interpolated using the last known close price.
Maximum 1000 candles per request.

Optionally set `filterWicks=true` to suppress extreme H/L wicks caused by liquidation
cascades or low-liquidity outlier fills. The filter computes a cross-candle
volume-weighted typical price and standard deviation, then clamps each candle's
high and low to `[VWAP ± nSigma × σ_v]` without touching open or close.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/candlesticks
openapi: 3.1.0
info:
  title: Decibel Trading API
  description: >-
    RESTful API for Decibel. Provides read-only endpoints for market data,
    trading operations, positions, and analytics.
  contact:
    name: Decibel Team
    url: https://decibel.trade/
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.mainnet.aptoslabs.com/decibel
    description: Mainnet
  - url: https://api.testnet.aptoslabs.com/decibel
    description: Testnet
security:
  - bearerAuth: []
tags:
  - name: Market Data
    description: Market information and real-time data endpoints
  - name: User
    description: User information and account management
  - name: Account
    description: Account-specific endpoints and data
  - name: Trades
    description: Trading operations and history
  - name: Positions
    description: User position management
  - name: Orders
    description: Order management and history
  - name: TWAP
    description: Time-weighted average price orders
  - name: Bulk Orders
    description: Bulk order management
  - name: Vaults
    description: Vault operations and management
  - name: Analytics
    description: Analytics and performance metrics
  - name: Points
    description: Points-related account metrics
  - name: Trading Points
    description: Trading points endpoints
  - name: Trading Hz
    description: Trading Hz endpoints
  - name: Tier
    description: Tier information endpoints
  - name: Streaks
    description: User streak tracking endpoints
  - name: Predeposit Rewards
    description: Season 0 predeposit USDC rewards
  - name: Referrals
    description: Referral code management and tracking
  - name: Affiliates
    description: Affiliate code and earnings endpoints
  - name: Campaigns
    description: On-chain reward campaign endpoints
paths:
  /api/v1/candlesticks:
    get:
      tags:
        - Market Data
      summary: Get candlestick (OHLC) data
      description: >-
        Retrieve perp candlestick data for one perp market address and time
        range.

        Spot candlesticks are available from the
        `market_candlestick:{marketAddr}:{interval}`

        WebSocket topic; spot and perp markets with the same base asset have
        different

        market addresses and must be requested separately.

        Supports intervals: 1m, 15m, 1h, 4h, 1d. Missing intervals are
        interpolated using the last known close price.

        Maximum 1000 candles per request.


        Optionally set `filterWicks=true` to suppress extreme H/L wicks caused
        by liquidation

        cascades or low-liquidity outlier fills. The filter computes a
        cross-candle

        volume-weighted typical price and standard deviation, then clamps each
        candle's

        high and low to `[VWAP ± nSigma × σ_v]` without touching open or close.
      operationId: handle_candlestick_snapshot
      parameters:
        - name: market
          in: query
          description: Market address
          required: true
          schema:
            type: string
          example: 0xmarket123...
        - name: interval
          in: query
          description: Candlestick interval (1m, 5m, 15m, 30m, 1h, 2h, 4h, 1d, 1w, 1mo)
          required: true
          schema:
            $ref: '#/components/schemas/Interval'
          example: 1h
        - name: startTime
          in: query
          description: Start time in milliseconds
          required: true
          schema:
            type: integer
            format: int64
          example: 1634567890000
        - name: endTime
          in: query
          description: End time in milliseconds
          required: true
          schema:
            type: integer
            format: int64
          example: 1634654290000
        - name: filterWicks
          in: query
          description: >-
            When true, caps extreme H/L wicks using cross-candle volume-weighted
            standard deviation.

            For each candle, H and L are clamped to [VWAP ± nSigma × σ_v] while
            preserving

            the candle body (open/close). No extra database queries are
            required.
          required: false
          schema:
            type: boolean
          example: false
        - name: nSigma
          in: query
          description: >-
            Number of volume-weighted standard deviations used as the
            wick-filter band (default: 3.0).

            Only applies when filterWicks is true.
          required: false
          schema:
            type: number
            format: double
          example: 3
      responses:
        '200':
          description: Candlestick data retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CandlestickResponseItemDto'
        '400':
          description: >-
            Invalid parameters (e.g., start_time > end_time or exceeds max
            candles)
        '404':
          description: Market not found
        '500':
          description: Database error
components:
  schemas:
    Interval:
      type: string
      enum:
        - 1m
        - 5m
        - 15m
        - 30m
        - 1h
        - 2h
        - 4h
        - 8h
        - 12h
        - 1d
        - 3d
        - 1w
        - 1mo
    CandlestickResponseItemDto:
      type: object
      required:
        - t
        - T
        - o
        - h
        - l
        - c
        - v
        - i
      properties:
        T:
          type: integer
          format: int64
          example: 1761591599999
        c:
          type: number
          format: double
          example: 100
        h:
          type: number
          format: double
          example: 102
        i:
          type: string
          example: 1h
        l:
          type: number
          format: double
          example: 98
        o:
          type: number
          format: double
          example: 100
        t:
          type: integer
          format: int64
          example: 1761588000000
        v:
          type: number
          format: double
          example: 1000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from Geomi. See
        [Authentication](/api-reference/rest/authentication) for setup
        instructions.

````