General Questions
What is the LFG SDK?
What is the LFG SDK?
The
@oraichain/lfg-client-js SDK is the official TypeScript/JavaScript client for interacting with the Oraichain LFG Perpetual DEX. It provides complete access to trading, market data, and account management.Which networks are supported?
Which networks are supported?
The SDK supports:
- Staging/Testnet: For development and testing with test tokens
- Mainnet: For production trading with real assets
Network.staging() and Network.mainnet().What are the system requirements?
What are the system requirements?
- Node.js 18+ or modern browser
- TypeScript 5+ (recommended)
- Internet connection for API access
Trading Questions
How do I place an order?
How do I place an order?
Use See the Orders Guide for details.
client.placeShortTermOrder() for quick orders or client.placeOrder() for long-term orders:What's the difference between short-term and long-term orders?
What's the difference between short-term and long-term orders?
- Short-term orders: Expire based on block height, lower gas, faster execution
- Long-term orders: Expire based on timestamp, can stay on orderbook for days
How do I cancel an order?
How do I cancel an order?
Use
client.cancelOrder() with the original client ID:Account Questions
What are subaccounts?
What are subaccounts?
Subaccounts are isolated trading accounts under your wallet. Each has:
- Separate collateral balance
- Independent positions and orders
- Risk isolation from other subaccounts
How do I deposit funds?
How do I deposit funds?
How do I check my balance?
How do I check my balance?
Query the Indexer:
Technical Questions
How do I handle network errors?
How do I handle network errors?
Implement retry logic:
Can I use this in the browser?
Can I use this in the browser?
Yes! The SDK works in modern browsers. However, never expose private keys in client-side code. Consider using a backend API for sensitive operations.
How do I use API keys for trading?
How do I use API keys for trading?
Create an API key wallet and use See the Wallets Guide for details.
SubaccountInfo.forPermissionedWallet():Troubleshooting
My order isn't filling
My order isn't filling
Common reasons:
- Price too far from market (limit order)
- Insufficient liquidity
- Order expired
Insufficient collateral error
Insufficient collateral error
You need more free collateral. Either:
- Deposit more USDC
- Close some positions
- Reduce order size
account.subaccount.freeCollateralTransaction failed
Transaction failed
Common causes:
- Insufficient gas
- Expired block height
- Network connectivity
- Invalid parameters