-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathhyperliquid-rest-client.http
More file actions
101 lines (79 loc) · 2.04 KB
/
Copy pathhyperliquid-rest-client.http
File metadata and controls
101 lines (79 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
@hyperliquidBaseUrl = http://localhost:3100
@testAsset = ETH
# Replace with actual order ID from open orders or stop loss placement
@orderId = 35895628002
@stopLossTriggerPrice = 3400.0
@stopLossModifiedPrice = 3450.0
### Health Check
GET {{hyperliquidBaseUrl}}/health
### Place Market Order - Long
POST {{hyperliquidBaseUrl}}/api/trade/market
Content-Type: application/json
{
"asset": "{{testAsset}}",
"side": "long",
"size": 0.1,
"slippage_tolerance": 0.01
}
### Place Market Order - Short
POST {{hyperliquidBaseUrl}}/api/trade/market
Content-Type: application/json
{
"asset": "{{testAsset}}",
"side": "short",
"size": 0.1,
"slippage_tolerance": 0.01
}
### Place Limit Order - Long
POST {{hyperliquidBaseUrl}}/api/trade/limit
Content-Type: application/json
{
"asset": "{{testAsset}}",
"side": "long",
"size": 0.1,
"price": 3000.0,
"time_in_force": "GTC"
}
### Place Limit Order - Short
POST {{hyperliquidBaseUrl}}/api/trade/limit
Content-Type: application/json
{
"asset": "{{testAsset}}",
"side": "short",
"size": 0.1,
"price": 3500.0,
"time_in_force": "GTC"
}
### Get Current Positions
GET {{hyperliquidBaseUrl}}/api/positions
### Get Account Info
GET {{hyperliquidBaseUrl}}/api/account
### Cancel Order
POST {{hyperliquidBaseUrl}}/api/orders/{{orderId}}/cancel
### Get Available Assets (Universe)
GET {{hyperliquidBaseUrl}}/api/universe
### Get Open Orders
GET {{hyperliquidBaseUrl}}/api/orders
### Place Stop Loss
POST {{hyperliquidBaseUrl}}/api/stop-loss
Content-Type: application/json
{
"asset": "{{testAsset}}",
"trigger_price": {{stopLossTriggerPrice}}
}
### Modify Stop Loss
POST {{hyperliquidBaseUrl}}/api/stop-loss/modify
Content-Type: application/json
{
"asset": "{{testAsset}}",
"order_id": "{{orderId}}",
"new_trigger_price": {{stopLossModifiedPrice}}
}
### Cancel Stop Loss
POST {{hyperliquidBaseUrl}}/api/stop-loss/{{orderId}}/cancel
Content-Type: application/json
{
"asset": "{{testAsset}}"
}
### Get Stop Losses
GET {{hyperliquidBaseUrl}}/api/stop-loss