Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

queryPerpsCandles

Read historical perps candles for a pair at a given interval. Paginated cursor-style.

Signature

function queryPerpsCandles(
  client: Client,
  parameters: {
    pairId: string
    interval: CandleIntervals
    after?: string
    first?: number
    earlierThan?: DateTime
    laterThan?: DateTime
  },
): Promise<GraphqlQueryResult<PerpsCandle>>

Example

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
 
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const page = await client.queryPerpsCandles({
  pairId: "BTC-PERP",
  interval: "ONE_MINUTE",
  first: 100,
})

Parameters

pairIdstring. Perps pair identifier.

intervalCandleIntervals. Candle interval.

afterstring, optional. Cursor.

firstnumber, optional. Page size.

earlierThan, laterThanDateTime, optional. ISO 8601 bounds.

Returns

GraphqlQueryResult<PerpsCandle>{ pageInfo, nodes }.

See also