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

getPerpsLiquidityDepth

Read bid and ask depth buckets for a perps pair.

bucketSize must match one of the granularities pre-configured on the pair (see PerpsPairParam.bucketSizes); mismatched values are rejected by the contract. The vault is typically the dominant maker on both sides.

Signature

function getPerpsLiquidityDepth(
  client: Client,
  parameters: {
    pairId: string
    bucketSize: string
    limit?: number
    height?: number
  },
): Promise<PerpsLiquidityDepthResponse>

Example

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
 
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const depth = await client.getPerpsLiquidityDepth({
  pairId: "BTC-PERP",
  bucketSize: "10",
  limit: 50,
})

Parameters

pairIdstring. Perps pair identifier.

bucketSizestring. Price bucket width.

limitnumber, optional. Maximum buckets per side.

heightnumber, optional. Block height. Default 0 (latest).

Returns

PerpsLiquidityDepthResponse{ bids: Record<string, { size, notional }>, asks: Record<string, { size, notional }> }.

See also