Pricer
POST /v1/user/delegate/pricer
Enable or disable the pricer for selling preconf or block.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X POST "$ETHGAS_API_URL/v1/user/delegate/pricer?enable=true"
import requests
url = f"{ETHGAS_API_URL}/v1/user/delegate/pricer"
payload = {'enable': True}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your-auth-token>'
}
response = requests.post(url, headers=headers, params=payload)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| enable | YES | boolean | Enable (true) or disable (false) pricer. |
Response Body
| Field | Type | Description |
|---|---|---|
| success | boolean | Indicates whether the request succeeded. |
GET /v1/user/pricer
Retrieve the pricer's current setting.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/user/pricer"
import requests
url = f"{ETHGAS_API_URL}/v1/user/pricer"
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers)
print(response.text)
Request
No parameters required.
Response Body
| Field | Type | Description |
|---|---|---|
| delegatedPricer | string | Indicates whether the pricer is "enabled" or "disabled". |
GET /v1/pricer/account-tokens
Retrieve all account tokens delegated to the pricer.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/pricer/account-tokens"
import requests
url = f"{ETHGAS_API_URL}/v1/pricer/account-tokens"
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers)
print(response.text)
Request
No parameters required.
Response Body
| Field | Type | Description |
|---|---|---|
| accountTokens | object[] | List of account tokens. |
| └ accountId | integer | Unique ID for each of the user's current & trading accounts assigned by ETHGas |
| └ tokenId | integer | ETHGas Token ID (see Token IDs) |
| └ quantity | string | Amount of token in account in USD |
| └ lockedQuantity | string | Amount covering pending limit orders (cannot be transferred out of account) |
| └ code | string | Token code |
| └ availableQuantity | string | Amount of unlocked tokens in account |
GET /v1/pricer/inclusion-preconf/orders
Retrieve inclusion preconf orders delegated to the pricer.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/pricer/inclusion-preconf/orders?accountId=123&instrumentId=abc&pending=true&limit=20"
import requests
url = f"{ETHGAS_API_URL}/v1/pricer/inclusion-preconf/orders"
params = {
'accountId': 123,
'instrumentId': 'abc',
'pending': True,
'limit': 20
}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers, params=params)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| accountId | NO | integer | Account ID for filtering orders. |
| instrumentId | NO | string | Instrument ID for filtering orders. |
| pending | NO | boolean | Whether to include only open orders. |
| done | NO | boolean | Whether to include only completed orders. |
| startId | NO | long | Order start ID for pagination. |
| limit | NO | integer | Maximum number of orders to return. |
| asc | NO | boolean | Sorting order (true for asc, false for desc). |
Response Body
| Field | Type | Description |
|---|---|---|
| orders | object | List of orders. |
GET /v1/pricer/inclusion-preconf/positions
Retrieve inclusion preconf positions delegated to the pricer.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/pricer/inclusion-preconf/positions?instrumentId=123&accountId=456"
import requests
url = f"{ETHGAS_API_URL}/v1/pricer/inclusion-preconf/positions"
params = {'instrumentId': '123', 'accountId': 456}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers, params=params)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| instrumentId | NO | string | Instrument ID for filtering positions. |
| accountId | NO | integer | Account ID for filtering positions. |
Response Body
| Field | Type | Description |
|---|---|---|
| positions | object | List of positions. |
GET /v1/pricer/wholeblock/orders
Retrieve whole block orders delegated to the pricer.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/pricer/wholeblock/orders?accountId=123&instrumentId=abc&pending=true&limit=20"
import requests
url = f"{ETHGAS_API_URL}/v1/pricer/wholeblock/orders"
params = {
'accountId': 123,
'instrumentId': 'abc',
'pending': True,
'limit': 20
}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers, params=params)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| accountId | NO | integer | Account ID for filtering orders. |
| instrumentId | NO | string | Instrument ID for filtering orders. |
| pending | NO | boolean | Whether to include only open orders. |
| done | NO | boolean | Whether to include only completed orders. |
| startId | NO | long | Order start ID for pagination. |
| limit | NO | integer | Maximum number of orders to return. |
| asc | NO | boolean | Sorting order (true for asc, false for desc). |
Response Body
| Field | Type | Description |
|---|---|---|
| orders | object | List of orders. |
GET /v1/pricer/wholeblock/positions
Retrieve wholeblock positions delegated to the pricer.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/pricer/wholeblock/positions?instrumentId=123&accountId=456"
import requests
url = f"{ETHGAS_API_URL}/v1/pricer/wholeblock/positions"
params = {'instrumentId': '123', 'accountId': 456}
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers, params=params)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| instrumentId | NO | string | Instrument ID for filtering positions. |
| accountId | NO | integer | Account ID for filtering positions. |
Response Body
| Field | Type | Description |
|---|---|---|
| positions | object | List of positions. |
GET /v1/pricer/markets/active
Retrieve all active markets that the pricer is responsible for.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/pricer/markets/active"
import requests
url = f"{ETHGAS_API_URL}/v1/pricer/markets/active"
headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.get(url, headers=headers)
print(response.text)
Request
No parameters required.
Response Body
| Field | Type | Description |
|---|---|---|
| inclusionPreconfMarkets | object | List of active inclusion preconf markets. |
| wholeBlockMarkets | object | List of active whole block markets. |