OVERVIEW
GENERAL CONCEPTS
REFERENCE
Powered by TradeLayer
API REFERENCE
Positions
Positions
Get Open Positions
GET /positions?user_id=tl_user_9e8127
1{
2 "success": true,
3 "data": [
4 {
5 "position_id": "tl_pos_1234",
6 "symbol": "BTCUSDT",
7 "side": "LONG",
8 "size": "0.05",
9 "entry_price": "90000.0",
10 "mark_price": "92749.0",
11 "unrealized_pnl": "1374.50",
12 "margin_mode": "CROSS",
13 "leverage": 50,
14 "liquidation_price": "87000.0",
15 "created_at": 1700300000000,
16 "updated_at": 1700483073500
17 }
18 ]
19}Close Position (Market)
POST /positions/{position_id}/close
1{
2 "success": true,
3 "data": {
4 "position_id": "tl_pos_1234",
5 "status": "CLOSED",
6 "closed_size": "0.05",
7 "avg_close_price": "92760.0",
8 "realized_pnl": "1380.00",
9 "closed_at": 1700483082000
10 }
11}