Quickstart
A comprehensive guide to setting up your Mudrex API key and executing your first futures trade through the API
API Key Generation
Here's a quick walkthrough to set up your Mudrex API key and unlock API trading in just a few steps.
PAN & Aadhaar Verification
Verify your identity via DigiLocker to unlock API trading for your account.
Set Up 2FA
Enable TOTP two-factor authentication. You'll need this for creating, rotating, or revoking API keys and performing other sensitive actions.
Create API Key
Give your key a clear, descriptive name and click "Generate Key" (v1.0 allows one key per user).
Copy API Key & Secret
Copy both values and store them securely. The secret is displayed only once. Use the API Secret in the X-Authentication header for every request.
Trade execution
This quickstart walks you through a futures trade execution via APIs:
Transfer Funds to Futures
curl -X POST "https://trade.mudrex.com/fapi/v1/wallet/futures/transfer" \
-H "Content-Type: application/json" \
-H "X-Authentication: <secret-key>" \
-d '{
"from_wallet_type": "SPOT",
"to_wallet_type": "FUTURES",
"amount": "10.5"
}'Use this endpoint to transfer funds from your SPOT wallet to your Futures wallet. This operation moves assets so you can start trading in the futures market.
Currently, Mudrex API Trading supports USDT Margined Futures only. INR Margined Futures will be live soon
Set Leverage
curl -X POST "https://trade.mudrex.com/fapi/v1/futures/BTCUSDT/leverage" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"margin_type": "ISOLATED",
"leverage": "1.5"
}'Set the leverage for your futures position by choosing a margin type (e.g., ISOLATED) and leverage level. This determines the amount of margin you'll use in your trades.
Place Order
curl -X POST "https://trade.mudrex.com/fapi/v1/futures/BTCUSDT/order" \
-H "Content-Type: application/json" \
-H "X-Authentication: your-secret-key" \
-d '{
"leverage": "5",
"quantity": "0.001",
"order_price": "107526",
"order_type": "LONG",
"trigger_type": "MARKET",
"is_takeprofit": true,
"is_stoploss": true,
"stoploss_price": "106900",
"takeprofit_price": "110000",
"reduce_only": false
}'Place a market or limit order for your futures position by specifying the symbol, quantity, price (for limit orders), and optional take-profit or stop-loss parameters.
