Skip to main content

Installation

Configuration

Initialize the Perps SDK client:
The SDK targets DEFAULT_API_URL (https://develop.li.quest/v1/perps) by default. Override with apiUrl if needed:

Configuration Options

Provider Configuration

The providers option accepts two shapes. Pass an array of provider plugins (preferred for new code) to bind each DEX’s read surface to the client — looked up at runtime via client.getProvider(key):
Alternatively, pass a keyed ProviderConfigs object for per-provider tuning:
Storage for the agent / API-key signer is configured on the provider plugin (e.g. hyperliquidProvider({ storage })), not on createPerpsClient.

Request Interceptor

The requestInterceptor option lets you modify request options before each API call. This is useful for adding custom headers, logging, or integrating with authentication systems:
Get your integrator name and API key from the LI.FI Partner Portal. Both are required for API access.

Quick Start

Fetch available providers and assets:
For a complete end-to-end example including wallet setup, account setup, and placing an order, see SDK / Trading — End-to-End Example.

Request Cancellation

All service functions accept an optional options parameter with an AbortSignal for cancelling in-flight requests:
When the signal fires, the underlying fetch is aborted and the promise rejects with an AbortError.

Next steps