Official SDKs
Integrate Levret Exchange into your applications with our official SDKs. Built for developers, by developers.
Node.js SDK
TypeScript & JavaScript support
Python SDK
Full Python support
REST API Client
Complete REST API wrapper for all trading operations, account management, and market data
WebSocket Client
Real-time market data, order updates, and position changes via WebSocket connections
Market Data
Access to real-time price feeds, order books, candlestick data, and trade history
Trading Operations
Create, modify, and cancel orders with full support for all order types and strategies
Position Management
Manage positions, adjust leverage, add/reduce margin, and set stop-loss/take-profit
Secure Authentication
Built-in API key authentication with automatic signature generation and validation
Quick Start
Installation
npm install @levret/node-sdk # or yarn add @levret/node-sdk
pip install -r requirements.txt # or pip install requests python-socketio
Basic Usage
import { TradingRESTClient, TradingWSClient } from '@levret/node-sdk'
// REST API Client
const restClient = new TradingRESTClient(
'https://api.levret.io/api/v1',
'YOUR_API_KEY_ID',
'YOUR_API_KEY_SECRET'
)
// WebSocket Client
const wsClient = new TradingWSClient(
'wss://api.levret.io',
'YOUR_API_KEY_ID',
'YOUR_API_KEY_SECRET'
)
// Connect to WebSocket
await wsClient.connect()
// Subscribe to market data
wsClient.subscribeMarketData('BTC_USDT')
wsClient.on('marketUpdate', (data) => {
console.log('Market data:', data)
})
// Create an order
const order = await restClient.createOrder({
userId: 'your-user-id',
symbol: 'BTC_USDT',
side: 'buy',
orderType: 'limit',
size: 0.01,
price: 45000,
leverage: 10
})
console.log('Order created:', order)API Endpoints
Trading
Positions
Market Data
Account
WebSocket Events
marketUpdate
Real-time price updates for subscribed symbols
orderBookUpdate
Order book depth changes
orderCreated
New order confirmation
orderUpdate
Order status changes (filled, cancelled, etc.)
positionUpdate
Position changes (P&L, margin, etc.)
tradeUpdate
New trade executions
Ready to Get Started?
Download our SDKs and start building your trading applications today. Join thousands of developers already using Levret Exchange.