Package Exports
- @lifi/perps-sdk
- @lifi/perps-sdk/package.json
Readme
LI.FI Perps SDK
LI.FI Perps SDK provides a TypeScript SDK for the LI.FI Perps API. Trade perpetuals across multiple DEXes with a unified interface.
- Unified interface across multiple perpetual DEXes
- Low-level service functions for explicit signing control
- High-level
PerpsClientwith automatic agent signing (no wallet popups) - Full TypeScript support with all types and enums exported
Installation
pnpm add @lifi/perps-sdk
# or
npm install @lifi/perps-sdkQuick Start
import { createPerpsClient, getDexes, getMarkets } from '@lifi/perps-sdk'
// 1. Create a client (required before any API calls)
const client = createPerpsClient({
integrator: 'my-app',
apiKey: 'optional-api-key',
})
// 2. Fetch market data (no authentication required)
const { dexes } = await getDexes(client)
const { markets } = await getMarkets(client, { dex: 'hyperliquid' })Examples
See the examples/ folder for runnable code covering market data, account data, trading, agent-based trading, error handling, and custom storage.
Documentation
Changelog
See CHANGELOG.md.