JSPM

  • Created
  • Published
  • Downloads 86
  • Score
    100M100P100Q91138F
  • License Apache-2.0

LI.FI Perps SDK for perpetuals trading

Package Exports

  • @lifi/perps-sdk
  • @lifi/perps-sdk/package.json

Readme

license npm latest package npm downloads Follow on Twitter

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 PerpsClient with 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-sdk

Quick 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.