Trading

Trading Limits

Position limits, rate limits, and trading restrictions on LX DEX

Trading Limits

Specification: LP-9001 DEX Trading Engine

LX DEX implements limits to ensure system stability, prevent market manipulation, and comply with risk management best practices.

Position Limits

Maximum Position Size

AssetMax LongMax ShortMax Total
BTC-USD$100M$100M$150M
ETH-USD$50M$50M$75M
LUX-USD$25M$25M$40M
Other Major$10M$10M$15M
Minor Pairs$5M$5M$7.5M

Per-Account Limits

TierMax PositionMax Open OrdersMax Leverage
Standard$1M10020x
Verified$10M50050x
VIP$50M2,00050x
Institutional$100M10,00050x

Cross-Position Limits

Maximum Total Exposure = Sum of all position sizes

Standard Account:
- Max Total Exposure: $5M
- Max Correlation Risk: $2M per sector

Institutional Account:
- Max Total Exposure: $500M
- Max Correlation Risk: $100M per sector

Order Limits

Order Size Limits

TypeMin SizeMax SizeMin Notional
Spot0.0001 BTC100 BTC$10
Perpetual$10$10M$10
Margin$10$10M$10

Price Limits

Orders are rejected if price deviates too far from mark price:

Market TypeMax Deviation
Major Pairs±5%
Minor Pairs±10%
Volatile Markets±20%
Valid Price Range = Mark Price × (1 ± Max Deviation)

Example (BTC at $50,000):
- Minimum Valid: $47,500 (-5%)
- Maximum Valid: $52,500 (+5%)

Order Count Limits

Account TierOpen OrdersOrders per SymbolModifications/sec
Standard100205
Verified5005020
VIP2,00020050
Institutional10,0001,000200

Rate Limits

API Rate Limits

Endpoint TypeStandardVIPInstitutional
Public Data100/sec500/sec2,000/sec
Private Read50/sec200/sec1,000/sec
Private Write10/sec50/sec200/sec
WebSocket Subscriptions1005002,000

Order Rate Limits

ActionStandardVIPInstitutional
Place Order10/sec50/sec200/sec
Cancel Order20/sec100/sec500/sec
Modify Order5/sec25/sec100/sec
Batch Orders5/sec20/sec100/sec

Burst Allowance

Short bursts above rate limits are allowed:

Burst Window: 10 seconds
Burst Capacity: 5× sustained rate

Example (Standard tier orders):
- Sustained: 10/sec
- Burst: 50 orders in 10 sec window
- Recovery: Linear (10 orders/sec)

Leverage Limits

Maximum Leverage by Asset

Asset CategoryMax LeverageInitial MarginMaintenance
BTC, ETH50x2%0.5%
Major Alts30x3.33%1%
Minor Alts20x5%2%
New Listings10x10%5%

Dynamic Leverage

Leverage limits decrease as position size increases:

Position SizeMax Leverage
< $100K50x
$100K - $500K30x
$500K - $1M20x
$1M - $5M10x
> $5M5x
Effective Leverage = min(Requested Leverage, Max for Position Size)

Example:
- Requested: 50x
- Position Size: $2M
- Effective: 10x (capped by size)

Withdrawal Limits

Per-Transaction Limits

Verification LevelSingle WithdrawalDaily Total
Basic$10K$50K
Standard$100K$500K
Enhanced$1M$5M
InstitutionalUnlimitedUnlimited

Cooling Period

Large withdrawals may require additional verification:

AmountCooling PeriodCan Expedite
< $10KInstantN/A
$10K - $100K1 hourYes
$100K - $1M6 hoursYes
> $1M24 hoursManual review

Market-Specific Limits

Circuit Breakers

Trading pauses if price moves too rapidly:

TriggerThresholdPause Duration
Level 110% in 5 min5 minutes
Level 220% in 15 min15 minutes
Level 330% in 1 hour1 hour

Open Interest Limits

Maximum total open interest across all users:

MarketMax Long OIMax Short OI
BTC-USD$5B$5B
ETH-USD$2B$2B
Other$500M$500M

Checking Your Limits

API Methods

import { DEX } from '@luxfi/trading'

const dex = await DEX({ rpcUrl: 'https://api.lux.network/rpc' })

// Get account limits
const limits = await dex.getAccountLimits()

console.log('Position Limits:')
console.log(`  Max Position: $${limits.maxPosition}`)
console.log(`  Current Usage: $${limits.currentExposure}`)
console.log(`  Available: $${limits.availableExposure}`)

console.log('Rate Limits:')
console.log(`  Orders/sec: ${limits.orderRate.limit}`)
console.log(`  Current: ${limits.orderRate.current}`)
console.log(`  Resets: ${limits.orderRate.resetTime}`)

console.log('Leverage:')
console.log(`  Max Available: ${limits.maxLeverage}x`)

Pre-Trade Validation

// Check if order would be accepted
const validation = await dex.validateOrder({
  symbol: 'BTC-USD',
  side: 'buy',
  type: 'limit',
  price: '50000',
  quantity: '10',
  leverage: 20
})

if (!validation.valid) {
  console.log('Order would be rejected:')
  validation.errors.forEach(err => {
    console.log(`  - ${err.code}: ${err.message}`)
  })
}

Limit Upgrade Request

// Request limit increase
const request = await dex.requestLimitIncrease({
  type: 'position',
  currentLimit: '1000000',
  requestedLimit: '5000000',
  reason: 'Scaling trading operations',
  documents: ['balance_proof.pdf']
})

console.log(`Request ID: ${request.id}`)
console.log(`Status: ${request.status}`)
console.log(`ETA: ${request.estimatedReviewTime}`)

Error Codes

CodeMessageResolution
POSITION_LIMITPosition size exceeds limitReduce size or request upgrade
ORDER_LIMITToo many open ordersCancel existing orders
RATE_LIMITRate limit exceededWait for reset or upgrade
LEVERAGE_LIMITLeverage too high for sizeReduce leverage or size
PRICE_BOUNDSPrice outside valid rangeAdjust price closer to mark
MIN_NOTIONALOrder value too smallIncrease order size
WITHDRAWAL_LIMITWithdrawal exceeds limitSplit or request upgrade

Best Practices

Managing Rate Limits

  1. Use batch endpoints - Single request for multiple orders
  2. Implement exponential backoff - Handle 429 responses gracefully
  3. Cache public data - Reduce redundant requests
  4. Use WebSocket - Real-time updates without polling

Staying Within Position Limits

  1. Monitor exposure - Track total position value
  2. Set alerts - Notify when approaching limits
  3. Plan scaling - Request upgrades before needed
  4. Diversify - Spread across multiple instruments

Handling Limit Errors

try {
  await dex.placeOrder(orderParams)
} catch (error) {
  if (error.code === 'RATE_LIMIT') {
    // Wait and retry with exponential backoff
    await sleep(error.retryAfter * 1000)
    return dex.placeOrder(orderParams)
  }
  if (error.code === 'POSITION_LIMIT') {
    // Reduce position or wait for existing to close
    console.log(`Max position: ${error.limit}`)
    console.log(`Requested: ${error.requested}`)
  }
  throw error
}