Whole Block Trading
Authenticated endpoints for whole block order placement and management.
POST /v1/wholeblock/order
Create new whole block order.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X POST "$ETHGAS_API_URL/v1/wholeblock/order" \
-H "Content-Type: application/json" \
-d '{"instrumentId":"ETH-WB-9884031","accountId":128,"side":true,"orderType":2,"clientOrderId":"05d61624","passive":false,"price":"0.01"}'
import requests
url = f"{ETHGAS_API_URL}/v1/wholeblock/order"
payload = {
"instrumentId": "ETH-WB-9884031",
"accountId": 128,
"side": True,
"orderType": 2,
"clientOrderId": "05d61624",
"passive": False,
"price": "0.01"
}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your-auth-token>'
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
Request Body
| Parameter | Required | Type | Description |
|---|---|---|---|
| instrumentId | YES | string | Instrument ID |
| accountId | YES | integer | Account ID |
| side | YES | boolean | Order side (true = buy, false = sell) |
| orderType | YES | integer | Market = 1, Limit = 2, FOK = 3 |
| clientOrderId | YES | string | Client-generated order ID (max 32 chars) |
| passive | NO | boolean | Post-only (maker only) (default: false) |
| price | NO | string | Price (ETH per gas). Required for limit/FOK order |
| quantity | YES | string | Order quantity (1 for whole block orders) |
POST /v1/wholeblock/cancel-all-orders
Cancel all whole block orders for an account and instrument.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X POST "$ETHGAS_API_URL/v1/wholeblock/cancel-all-orders?accountId=128&instrumentId=ETH-WB-1012051"
import requests
url = f"{ETHGAS_API_URL}/v1/wholeblock/cancel-all-orders"
params = {"accountId": 128, "instrumentId": "ETH-WB-1012051"}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.post(url, headers=headers, params=params)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| accountId | YES | integer | Account ID |
| instrumentId | YES | string | Instrument ID |
POST /v1/wholeblock/cancel-batch-orders
Cancel specific whole block orders.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X POST "$ETHGAS_API_URL/v1/wholeblock/cancel-batch-orders?accountId=128&instrumentId=ETH-WB-1012051&orderIds=b25ab402,5e885ddd"
import requests
url = f"{ETHGAS_API_URL}/v1/wholeblock/cancel-batch-orders"
params = {
"accountId": 128,
"instrumentId": "ETH-WB-1012051",
"orderIds": "b25ab402,5e885ddd"
}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.post(url, headers=headers, params=params)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| accountId | YES | integer | Account ID |
| instrumentId | YES | string | Instrument ID |
| orderIds | YES | string | Comma-separated order IDs |
POST /v1/wholeblock/cancel-order
Cancel a single whole block order.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X POST "$ETHGAS_API_URL/v1/wholeblock/cancel-order" \
-H "Content-Type: application/json" \
-d '{"accountId":128,"instrumentId":"ETH-WB-1012051","orderId":"b25ab402"}'
import requests
url = f"{ETHGAS_API_URL}/v1/wholeblock/cancel-order"
payload = {
"accountId": 128,
"instrumentId": "ETH-WB-1012051",
"orderId": "b25ab402"
}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your-auth-token>'
}
response = requests.post(url, headers=headers, json=payload)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| accountId | YES | integer | Account ID |
| instrumentId | YES | string | Instrument ID |
| orderId | YES* | integer | Order ID (use orderId or clientOrderId) |
| clientOrderId | YES* | string | Client order ID (use orderId or clientOrderId) |
GET /v1/user/wholeblock/orders
Get user whole block orders for an account and instrument.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/user/wholeblock/orders?accountId=128&instrumentId=ETH-WB-9884031"
import requests
url = f"{ETHGAS_API_URL}/v1/user/wholeblock/orders"
params = {"accountId": 128, "instrumentId": "ETH-WB-9884031"}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers, params=params)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| accountId | YES | integer | Account ID |
| instrumentId | NO | string | Instrument ID |
| onBook | NO | boolean | Pending orders only |
| done | NO | boolean | Done orders only |
| startId | NO | integer | Start of order ID for pagination |
| limit | NO | integer | Max orders to return |
GET /v1/user/wholeblock/all-orders
Get all user whole block orders.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/user/wholeblock/all-orders?onBook=false&limit=10"
import requests
url = f"{ETHGAS_API_URL}/v1/user/wholeblock/all-orders"
params = {"onBook": False, "limit": 10}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers, params=params)
print(response.text)
GET /v1/user/wholeblock/positions
Get user whole block positions.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/user/wholeblock/positions?instrumentId=ETH-WB-9884031&limit=10"
import requests
url = f"{ETHGAS_API_URL}/v1/user/wholeblock/positions"
params = {"instrumentId": "ETH-WB-9884031", "limit": 10}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers, params=params)
print(response.text)
GET /v1/user/wholeblock/txs
Get user transactions for whole block market.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/user/wholeblock/txs?instrumentId=ETH-WB-63999&limit=100"
import requests
url = f"{ETHGAS_API_URL}/v1/user/wholeblock/txs"
params = {"instrumentId": "ETH-WB-63999", "limit": 100}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers, params=params)
print(response.text)