🔌 API Reference
REST API Obelisk DEX — Base URL: http://localhost:3001
Authentification
Toutes les requêtes nécessitent un header Authorization: Bearer <token>.
Obtenez votre token via POST /api/auth/login avec votre wallet signature.
En mode démo, le header est optionnel.
Endpoints Principaux
| Méthode | Endpoint | Description |
|---|---|---|
| GET | /api/markets | Liste tous les marchés disponibles avec prix, volume, spread. |
| GET | /api/trade/equity | Equity, positions ouvertes et PnL du compte. |
| POST | /api/trade/order | Placer un ordre market ou limit. |
| POST | /api/trade/venue/close | Fermer une position par ID ou symbole. |
| GET | /api/blockchain/chains | Chains supportées et balances. |
| POST | /api/blockchain/batch | Batch settlement multi-transactions (80% économie gas). |
Exemple — Placer un Ordre
POST /api/trade/order
curl -X POST http://localhost:3001/api/trade/order \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{
"symbol": "BTC/USDC",
"side": "buy",
"size": 5,
"leverage": 3,
"stopLoss": 2,
"takeProfit": 4,
"source": "api"
}'