Quick Start Guide
This guide walks you through setting up your account and executing your first trade on HyperDEX. The process differs slightly depending on which exchange you want to use.
For Lighter DEX Users: You must create an account on Lighter DEX, deposit funds, and generate API keys directly on their platform before using HyperDEX. See User Flow Documentation for details.
Step 1: Create a Server Wallet
Create a secure MPC-managed wallet for trading operations.
curl -X POST https://api.dexaggregatorbeta.xyz/api/wallets \
-H "Content-Type: application/json" \
-d '{"userId": "user_123"}'
Response:
{
"success": true,
"userId": "user_123",
"address": "0x173404aAAa4d6539e2C7dbcC1931Cf41b3A3D5c7",
"walletId": "29dd4dc0-1ff9-4df6-a19f-936f997cbc5a",
"publicKey": "04090ce18936a64a24c48624d5734edf..."
}
Save these values - you’ll need them for all subsequent operations:
walletId - For API requests
address - For funding the wallet
userId - Alternative identifier
Step 2: Register API Keys with Exchanges
For Aster
curl -X POST https://api.dexaggregatorbeta.xyz/api/trading/aster/apikey \
-H "Content-Type: application/json" \
-d '{"walletIdOrAddress": "user_123"}'
For Hyperliquid
curl -X POST https://api.dexaggregatorbeta.xyz/api/trading/hyperliquid/apikey \
-H "Content-Type: application/json" \
-d '{"walletIdOrAddress": "user_123"}'
For Lighter
Lighter is different: Create your account and generate API keys directly on Lighter DEX. You’ll need:
apiKeyPrivateKey - Your API key private key
apiKeyIndex - API key index number
accountIndex - Your account index
Step 3: Fund Your Server Wallet
Transfer tokens to your server wallet address from your personal wallet:
For Aster (BSC Network):
- USDT (for trading)
- BNB (for gas fees)
For Hyperliquid (Arbitrum Network):
- USDC (for trading)
- ETH (for gas fees)
# Example: Send to your wallet address
# To: 0x173404aAAa4d6539e2C7dbcC1931Cf41b3A3D5c7
# Amount: 100 USDT + 0.01 BNB (for gas)
Step 4: Deposit to Exchange
Aster Deposit
curl -X POST https://api.dexaggregatorbeta.xyz/api/trading/aster/deposit \
-H "Content-Type: application/json" \
-d '{
"walletIdOrAddress": "user_123",
"tokenSymbol": "USDT",
"amount": "100",
"network": "bnb"
}'
Hyperliquid Deposit
curl -X POST https://api.dexaggregatorbeta.xyz/api/trading/hyperliquid/deposit \
-H "Content-Type: application/json" \
-d '{
"walletIdOrAddress": "user_123",
"tokenSymbol": "USDC",
"amount": "100",
"network": "arbitrum"
}'
Response:
{
"success": true,
"data": {
"txHash": "0x1234abcd...",
"txUrl": "https://bscscan.com/tx/0x1234abcd...",
"amount": "100",
"token": "USDT"
}
}
Step 5: Place Your First Order
Aster Order
curl -X POST https://api.dexaggregatorbeta.xyz/api/trading/aster/orders \
-H "x-wallet-id: 29dd4dc0-1ff9-4df6-a19f-936f997cbc5a" \
-H "Content-Type: application/json" \
-d '{
"userId": "0x173404aAAa4d6539e2C7dbcC1931Cf41b3A3D5c7",
"symbol": "BTCUSDT",
"side": "BUY",
"type": "MARKET",
"quantity": "0.001"
}'
Hyperliquid Order
curl -X POST https://api.dexaggregatorbeta.xyz/api/trading/hyperliquid/orders \
-H "x-wallet-id: 29dd4dc0-1ff9-4df6-a19f-936f997cbc5a" \
-H "Content-Type: application/json" \
-d '{
"userId": "user_123",
"symbol": "BTC-PERP",
"side": "BUY",
"type": "MARKET",
"quantity": "0.001"
}'
Lighter Order
curl -X POST "https://api.dexaggregatorbeta.xyz/api/trading/lighter/orders?apiKeyPrivateKey=YOUR_KEY&apiKeyIndex=5&accountIndex=316225" \
-H "Content-Type: application/json" \
-d '{
"userId": "0x173404aAAa4d6539e2C7dbcC1931Cf41b3A3D5c7",
"symbol": "USDC",
"side": "BUY",
"type": "MARKET",
"quantity": "10"
}'
Response:
{
"success": true,
"orderId": "a1b2c3d4",
"status": "submitted",
"timestamp": 1698840000000
}
Next Steps
Now that you’ve completed your first trade, explore:
Important Security Notes
Server-Side Only: All wallet operations use MPC-secured server wallets. Never expose wallet credentials or API keys in client-side code.
Lighter API Keys: For Lighter DEX, obtain API credentials directly from their platform. These are different from your HyperDEX server wallet.
Test Small First: Start with small amounts to familiarize yourself with the flow before trading larger positions.
Common Issues
Insufficient Balance
- Ensure your server wallet has both trading tokens and gas tokens
- Check balances before depositing
Missing Wallet ID Header
- Include
x-wallet-id header for Aster and Hyperliquid orders
- Use the
walletId from Step 1
Lighter API Errors
- Verify you created an account on Lighter DEX
- Ensure you deposited funds on Lighter platform
- Check that API credentials are correct
For more help, see the User Flow Documentation with complete diagrams and troubleshooting.