diff --git a/artifacts/apidocs/market_data_api.md b/artifacts/apidocs/market_data_api.md
index 92bb6c7..04a289b 100644
--- a/artifacts/apidocs/market_data_api.md
+++ b/artifacts/apidocs/market_data_api.md
@@ -1964,7 +1964,8 @@ LITE ENDPOINT: lite/v1/trade
"interest_rate": 0.0003,
"forward_price": "65038.01",
"trade_id": "209358-2",
- "venue": "ORDERBOOK"
+ "venue": "ORDERBOOK",
+ "is_rpi": false
}]
}
```
@@ -1982,7 +1983,8 @@ LITE ENDPOINT: lite/v1/trade
"ir": 0.0003,
"fp": "65038.01",
"ti": "209358-2",
- "v": "ORDERBOOK"
+ "v": "ORDERBOOK",
+ "ir1": false
}]
}
```
@@ -2284,7 +2286,8 @@ LITE ENDPOINT: lite/v1/trade_history
"interest_rate": 0.0003,
"forward_price": "65038.01",
"trade_id": "209358-2",
- "venue": "ORDERBOOK"
+ "venue": "ORDERBOOK",
+ "is_rpi": false
}],
"next": "Qw0918="
}
@@ -2303,7 +2306,8 @@ LITE ENDPOINT: lite/v1/trade_history
"ir": 0.0003,
"fp": "65038.01",
"ti": "209358-2",
- "v": "ORDERBOOK"
+ "v": "ORDERBOOK",
+ "ir1": false
}],
"n": "Qw0918="
}
@@ -3053,7 +3057,8 @@ LITE ENDPOINT: lite/v1/funding
"instrument": "BTC_USDT_Perp",
"funding_rate": 0.0003,
"funding_time": "1697788800000000000",
- "mark_price": "65038.01"
+ "mark_price": "65038.01",
+ "funding_rate_8_h_avg": 0.0003
}],
"next": "Qw0918="
}
@@ -3065,7 +3070,8 @@ LITE ENDPOINT: lite/v1/funding
"i": "BTC_USDT_Perp",
"fr": 0.0003,
"ft": "1697788800000000000",
- "mp": "65038.01"
+ "mp": "65038.01",
+ "fr1": 0.0003
}],
"n": "Qw0918="
}
diff --git a/artifacts/apidocs/market_data_streams.md b/artifacts/apidocs/market_data_streams.md
index 463c4dc..235b6ed 100644
--- a/artifacts/apidocs/market_data_streams.md
+++ b/artifacts/apidocs/market_data_streams.md
@@ -3532,7 +3532,8 @@ STREAM: v1.trade
"interest_rate": 0.0003,
"forward_price": "65038.01",
"trade_id": "209358-2",
- "venue": "ORDERBOOK"
+ "venue": "ORDERBOOK",
+ "is_rpi": false
}
}
```
@@ -3553,7 +3554,8 @@ STREAM: v1.trade
"ir": 0.0003,
"fp": "65038.01",
"ti": "209358-2",
- "v": "ORDERBOOK"
+ "v": "ORDERBOOK",
+ "ir1": false
}
}
```
diff --git a/artifacts/apidocs/schemas/api_create_order_request.md b/artifacts/apidocs/schemas/api_create_order_request.md
index 5cffa3d..e03d2a6 100644
--- a/artifacts/apidocs/schemas/api_create_order_request.md
+++ b/artifacts/apidocs/schemas/api_create_order_request.md
@@ -32,6 +32,7 @@
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
+ |`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
@@ -79,6 +80,7 @@
|-|-|-|-|
|trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
+ |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.
Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.
@@ -147,3 +149,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/api_create_order_response.md b/artifacts/apidocs/schemas/api_create_order_response.md
index 67e514b..a566135 100644
--- a/artifacts/apidocs/schemas/api_create_order_response.md
+++ b/artifacts/apidocs/schemas/api_create_order_response.md
@@ -30,6 +30,7 @@
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
+ |`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
@@ -77,6 +78,7 @@
|-|-|-|-|
|trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
+ |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.
Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.
@@ -145,3 +147,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/api_fill_history_response.md b/artifacts/apidocs/schemas/api_fill_history_response.md
index 3b8a06e..65a847a 100644
--- a/artifacts/apidocs/schemas/api_fill_history_response.md
+++ b/artifacts/apidocs/schemas/api_fill_history_response.md
@@ -26,6 +26,7 @@
|client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]
When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|signer
`s1` |string|True|The address (public key) of the wallet signing the payload|
|broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order|
+ |is_rpi
`ir1` |boolean|True|If the trade is a RPI trade|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/api_funding_rate_response.md b/artifacts/apidocs/schemas/api_funding_rate_response.md
index ba70608..01e2a1c 100644
--- a/artifacts/apidocs/schemas/api_funding_rate_response.md
+++ b/artifacts/apidocs/schemas/api_funding_rate_response.md
@@ -10,3 +10,4 @@
|funding_rate
`fr` |string|True|The funding rate of the instrument, expressed in percentage points|
|funding_time
`ft` |string|True|The funding timestamp of the funding rate, expressed in unix nanoseconds|
|mark_price
`mp` |string|True|The mark price of the instrument at funding timestamp, expressed in `9` decimals|
+ |funding_rate_8_h_avg
`fr1` |string|True|The 8h average funding rate of the instrument, expressed in percentage points|
diff --git a/artifacts/apidocs/schemas/api_get_order_response.md b/artifacts/apidocs/schemas/api_get_order_response.md
index 86f37bb..66eb23b 100644
--- a/artifacts/apidocs/schemas/api_get_order_response.md
+++ b/artifacts/apidocs/schemas/api_get_order_response.md
@@ -30,6 +30,7 @@
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
+ |`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
@@ -77,6 +78,7 @@
|-|-|-|-|
|trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
+ |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.
Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.
@@ -145,3 +147,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/api_open_orders_response.md b/artifacts/apidocs/schemas/api_open_orders_response.md
index 8ec0f03..6c60f8c 100644
--- a/artifacts/apidocs/schemas/api_open_orders_response.md
+++ b/artifacts/apidocs/schemas/api_open_orders_response.md
@@ -32,6 +32,7 @@
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
+ |`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
@@ -79,6 +80,7 @@
|-|-|-|-|
|trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
+ |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.
Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.
@@ -147,3 +149,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/api_order_history_response.md b/artifacts/apidocs/schemas/api_order_history_response.md
index 9a72efd..cb9c57c 100644
--- a/artifacts/apidocs/schemas/api_order_history_response.md
+++ b/artifacts/apidocs/schemas/api_order_history_response.md
@@ -31,6 +31,7 @@
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
+ |`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
@@ -78,6 +79,7 @@
|-|-|-|-|
|trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
+ |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.
Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.
@@ -146,3 +148,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/api_trade_history_response.md b/artifacts/apidocs/schemas/api_trade_history_response.md
index 634a047..4128825 100644
--- a/artifacts/apidocs/schemas/api_trade_history_response.md
+++ b/artifacts/apidocs/schemas/api_trade_history_response.md
@@ -19,6 +19,7 @@
|forward_price
`fp` |string|True|[Options] The forward price of the option at point of trade, expressed in `9` decimals|
|trade_id
`ti` |string|True|A trade identifier, globally unique, and monotonically increasing (not by `1`).
All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.
`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`.|
|venue
`v` |Venue|True|The venue where the trade occurred|
+ |is_rpi
`ir1` |boolean|True|If the trade is a RPI trade|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/api_trade_response.md b/artifacts/apidocs/schemas/api_trade_response.md
index 8e1f882..f16f396 100644
--- a/artifacts/apidocs/schemas/api_trade_response.md
+++ b/artifacts/apidocs/schemas/api_trade_response.md
@@ -18,6 +18,7 @@
|forward_price
`fp` |string|True|[Options] The forward price of the option at point of trade, expressed in `9` decimals|
|trade_id
`ti` |string|True|A trade identifier, globally unique, and monotonically increasing (not by `1`).
All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.
`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`.|
|venue
`v` |Venue|True|The venue where the trade occurred|
+ |is_rpi
`ir1` |boolean|True|If the trade is a RPI trade|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/api_transfer_ack.md b/artifacts/apidocs/schemas/api_transfer_ack.md
new file mode 100644
index 0000000..d98ee1d
--- /dev/null
+++ b/artifacts/apidocs/schemas/api_transfer_ack.md
@@ -0,0 +1,5 @@
+!!! info "[ApiTransferAck](/../../schemas/api_transfer_ack)"
+ |Name
`Lite`|Type|Required
`Default`| Description |
+ |-|-|-|-|
+ |ack
`a` |boolean|True|Gravity has acknowledged that the transfer has been successfully processed. If true, a `tx_id` will be returned. If false, an error will be returned.|
+ |tx_id
`ti` |string|True|The transaction ID of the transfer. This is only returned if the transfer is successful.|
diff --git a/artifacts/apidocs/schemas/api_transfer_history_response.md b/artifacts/apidocs/schemas/api_transfer_history_response.md
index cbdac79..10b7def 100644
--- a/artifacts/apidocs/schemas/api_transfer_history_response.md
+++ b/artifacts/apidocs/schemas/api_transfer_history_response.md
@@ -63,3 +63,5 @@
|`STANDARD` = 1|Standard transfer that has nothing to do with bridging|
|`FAST_ARB_DEPOSIT` = 2|Fast Arb Deposit Metadata type|
|`FAST_ARB_WITHDRAWAL` = 3|Fast Arb Withdrawal Metadata type|
+ |`NON_NATIVE_BRIDGE_DEPOSIT` = 4|Transfer type for non native bridging deposit|
+ |`NON_NATIVE_BRIDGE_WITHDRAWAL` = 5|Transfer type for non native bridging withdrawal|
diff --git a/artifacts/apidocs/schemas/api_transfer_request.md b/artifacts/apidocs/schemas/api_transfer_request.md
index 836d0f6..0719169 100644
--- a/artifacts/apidocs/schemas/api_transfer_request.md
+++ b/artifacts/apidocs/schemas/api_transfer_request.md
@@ -58,3 +58,5 @@
|`STANDARD` = 1|Standard transfer that has nothing to do with bridging|
|`FAST_ARB_DEPOSIT` = 2|Fast Arb Deposit Metadata type|
|`FAST_ARB_WITHDRAWAL` = 3|Fast Arb Withdrawal Metadata type|
+ |`NON_NATIVE_BRIDGE_DEPOSIT` = 4|Transfer type for non native bridging deposit|
+ |`NON_NATIVE_BRIDGE_WITHDRAWAL` = 5|Transfer type for non native bridging withdrawal|
diff --git a/artifacts/apidocs/schemas/api_transfer_response.md b/artifacts/apidocs/schemas/api_transfer_response.md
new file mode 100644
index 0000000..85fae34
--- /dev/null
+++ b/artifacts/apidocs/schemas/api_transfer_response.md
@@ -0,0 +1,11 @@
+!!! info "[ApiTransferResponse](/../../schemas/api_transfer_response)"
+ Used to acknowledge a transfer request outcome
+
+ |Name
`Lite`|Type|Required
`Default`| Description |
+ |-|-|-|-|
+ |result
`r` |ApiTransferAck|True|The Transfer response object|
+ ??? info "[ApiTransferAck](/../../schemas/api_transfer_ack)"
+ |Name
`Lite`|Type|Required
`Default`| Description |
+ |-|-|-|-|
+ |ack
`a` |boolean|True|Gravity has acknowledged that the transfer has been successfully processed. If true, a `tx_id` will be returned. If false, an error will be returned.|
+ |tx_id
`ti` |string|True|The transaction ID of the transfer. This is only returned if the transfer is successful.|
diff --git a/artifacts/apidocs/schemas/bridge_type.md b/artifacts/apidocs/schemas/bridge_type.md
index 626d2aa..f9749cc 100644
--- a/artifacts/apidocs/schemas/bridge_type.md
+++ b/artifacts/apidocs/schemas/bridge_type.md
@@ -2,3 +2,4 @@
|Value| Description |
|-|-|
|`XY` = 1|XY Bridge type|
+ |`RHINO` = 2|Rhino Bridge type|
diff --git a/artifacts/apidocs/schemas/cancel_status_feed.md b/artifacts/apidocs/schemas/cancel_status_feed.md
index e36c34f..108c338 100644
--- a/artifacts/apidocs/schemas/cancel_status_feed.md
+++ b/artifacts/apidocs/schemas/cancel_status_feed.md
@@ -41,6 +41,8 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
??? info "[CancelStatus](/../../schemas/cancel_status)"
|Value| Description |
|-|-|
diff --git a/artifacts/apidocs/schemas/fill.md b/artifacts/apidocs/schemas/fill.md
index d5462e4..f0f4482 100644
--- a/artifacts/apidocs/schemas/fill.md
+++ b/artifacts/apidocs/schemas/fill.md
@@ -21,6 +21,7 @@
|client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]
When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|signer
`s1` |string|True|The address (public key) of the wallet signing the payload|
|broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order|
+ |is_rpi
`ir1` |boolean|True|If the trade is a RPI trade|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/funding_rate.md b/artifacts/apidocs/schemas/funding_rate.md
index 8f47179..09d883d 100644
--- a/artifacts/apidocs/schemas/funding_rate.md
+++ b/artifacts/apidocs/schemas/funding_rate.md
@@ -5,3 +5,4 @@
|funding_rate
`fr` |string|True|The funding rate of the instrument, expressed in percentage points|
|funding_time
`ft` |string|True|The funding timestamp of the funding rate, expressed in unix nanoseconds|
|mark_price
`mp` |string|True|The mark price of the instrument at funding timestamp, expressed in `9` decimals|
+ |funding_rate_8_h_avg
`fr1` |string|True|The 8h average funding rate of the instrument, expressed in percentage points|
diff --git a/artifacts/apidocs/schemas/order.md b/artifacts/apidocs/schemas/order.md
index 8a203d1..f999be7 100644
--- a/artifacts/apidocs/schemas/order.md
+++ b/artifacts/apidocs/schemas/order.md
@@ -26,6 +26,7 @@
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
+ |`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
@@ -73,6 +74,7 @@
|-|-|-|-|
|trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
+ |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.
Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.
@@ -141,3 +143,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/order_metadata.md b/artifacts/apidocs/schemas/order_metadata.md
index 571cd2c..6d45848 100644
--- a/artifacts/apidocs/schemas/order_metadata.md
+++ b/artifacts/apidocs/schemas/order_metadata.md
@@ -29,6 +29,7 @@
|-|-|-|-|
|trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
+ |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.
Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.
diff --git a/artifacts/apidocs/schemas/order_reject_reason.md b/artifacts/apidocs/schemas/order_reject_reason.md
index efa0bbf..9dac95d 100644
--- a/artifacts/apidocs/schemas/order_reject_reason.md
+++ b/artifacts/apidocs/schemas/order_reject_reason.md
@@ -32,3 +32,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/order_state.md b/artifacts/apidocs/schemas/order_state.md
index 73b9d1f..88b4504 100644
--- a/artifacts/apidocs/schemas/order_state.md
+++ b/artifacts/apidocs/schemas/order_state.md
@@ -49,3 +49,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/order_state_feed.md b/artifacts/apidocs/schemas/order_state_feed.md
index 0fbb189..744b2b8 100644
--- a/artifacts/apidocs/schemas/order_state_feed.md
+++ b/artifacts/apidocs/schemas/order_state_feed.md
@@ -55,3 +55,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/time_in_force.md b/artifacts/apidocs/schemas/time_in_force.md
index 22bf1f3..b71f052 100644
--- a/artifacts/apidocs/schemas/time_in_force.md
+++ b/artifacts/apidocs/schemas/time_in_force.md
@@ -11,3 +11,4 @@
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
+ |`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
diff --git a/artifacts/apidocs/schemas/time_interval.md b/artifacts/apidocs/schemas/time_interval.md
new file mode 100644
index 0000000..7929ec0
--- /dev/null
+++ b/artifacts/apidocs/schemas/time_interval.md
@@ -0,0 +1,9 @@
+!!! info "[TimeInterval](/../../schemas/time_interval)"
+ Time interval can be used as a filter in metric/portfolio management APIs
+
+ |Value| Description |
+ |-|-|
+ |`INTERVAL_1_D` = 1|1 day|
+ |`INTERVAL_7_D` = 2|7 days|
+ |`INTERVAL_30_D` = 3|30 days|
+ |`INTERVAL_90_D` = 4|90 days|
diff --git a/artifacts/apidocs/schemas/tpsl_order_metadata.md b/artifacts/apidocs/schemas/tpsl_order_metadata.md
index 0b760a8..3ce57e0 100644
--- a/artifacts/apidocs/schemas/tpsl_order_metadata.md
+++ b/artifacts/apidocs/schemas/tpsl_order_metadata.md
@@ -5,6 +5,7 @@
|-|-|-|-|
|trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
+ |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.
Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.
diff --git a/artifacts/apidocs/schemas/trade.md b/artifacts/apidocs/schemas/trade.md
index 6958f5e..e41914e 100644
--- a/artifacts/apidocs/schemas/trade.md
+++ b/artifacts/apidocs/schemas/trade.md
@@ -14,6 +14,7 @@
|forward_price
`fp` |string|True|[Options] The forward price of the option at point of trade, expressed in `9` decimals|
|trade_id
`ti` |string|True|A trade identifier, globally unique, and monotonically increasing (not by `1`).
All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.
`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`.|
|venue
`v` |Venue|True|The venue where the trade occurred|
+ |is_rpi
`ir1` |boolean|True|If the trade is a RPI trade|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/transfer_history.md b/artifacts/apidocs/schemas/transfer_history.md
index fa698b0..abb24e9 100644
--- a/artifacts/apidocs/schemas/transfer_history.md
+++ b/artifacts/apidocs/schemas/transfer_history.md
@@ -58,3 +58,5 @@
|`STANDARD` = 1|Standard transfer that has nothing to do with bridging|
|`FAST_ARB_DEPOSIT` = 2|Fast Arb Deposit Metadata type|
|`FAST_ARB_WITHDRAWAL` = 3|Fast Arb Withdrawal Metadata type|
+ |`NON_NATIVE_BRIDGE_DEPOSIT` = 4|Transfer type for non native bridging deposit|
+ |`NON_NATIVE_BRIDGE_WITHDRAWAL` = 5|Transfer type for non native bridging withdrawal|
diff --git a/artifacts/apidocs/schemas/transfer_type.md b/artifacts/apidocs/schemas/transfer_type.md
index ccce00b..ad56b70 100644
--- a/artifacts/apidocs/schemas/transfer_type.md
+++ b/artifacts/apidocs/schemas/transfer_type.md
@@ -4,3 +4,5 @@
|`STANDARD` = 1|Standard transfer that has nothing to do with bridging|
|`FAST_ARB_DEPOSIT` = 2|Fast Arb Deposit Metadata type|
|`FAST_ARB_WITHDRAWAL` = 3|Fast Arb Withdrawal Metadata type|
+ |`NON_NATIVE_BRIDGE_DEPOSIT` = 4|Transfer type for non native bridging deposit|
+ |`NON_NATIVE_BRIDGE_WITHDRAWAL` = 5|Transfer type for non native bridging withdrawal|
diff --git a/artifacts/apidocs/schemas/trigger_order_metadata.md b/artifacts/apidocs/schemas/trigger_order_metadata.md
index 4a97256..ab881b4 100644
--- a/artifacts/apidocs/schemas/trigger_order_metadata.md
+++ b/artifacts/apidocs/schemas/trigger_order_metadata.md
@@ -20,6 +20,7 @@
|-|-|-|-|
|trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
+ |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.
Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.
diff --git a/artifacts/apidocs/schemas/vault_type.md b/artifacts/apidocs/schemas/vault_type.md
new file mode 100644
index 0000000..e49495d
--- /dev/null
+++ b/artifacts/apidocs/schemas/vault_type.md
@@ -0,0 +1,5 @@
+!!! info "[VaultType](/../../schemas/vault_type)"
+ |Value| Description |
+ |-|-|
+ |`PRIME` = 1|Prime vault|
+ |`LAUNCH_PAD` = 2|Launchpad vault|
diff --git a/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md b/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md
index 2924a18..4e84b87 100644
--- a/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md
+++ b/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md
@@ -48,6 +48,8 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
??? info "[CancelStatus](/../../schemas/cancel_status)"
|Value| Description |
|-|-|
diff --git a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md
index d78ab8c..c2b42f1 100644
--- a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md
+++ b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md
@@ -28,6 +28,7 @@
|client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]
When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId|
|signer
`s1` |string|True|The address (public key) of the wallet signing the payload|
|broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order|
+ |is_rpi
`ir1` |boolean|True|If the trade is a RPI trade|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md
index de7f87a..2c5db71 100644
--- a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md
+++ b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md
@@ -33,6 +33,7 @@
|`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)|
|`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it|
|`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it|
+ |`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.|
??? info "[OrderLeg](/../../schemas/order_leg)"
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
@@ -80,6 +81,7 @@
|-|-|-|-|
|trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order|
|trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.|
+ |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached|
??? info "[TriggerBy](/../../schemas/trigger_by)"
Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.
Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.
@@ -148,3 +150,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/ws_order_state_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_state_feed_data_v1.md
index e371c6c..aa4634a 100644
--- a/artifacts/apidocs/schemas/ws_order_state_feed_data_v1.md
+++ b/artifacts/apidocs/schemas/ws_order_state_feed_data_v1.md
@@ -62,3 +62,5 @@
|`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set|
|`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered|
|`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered|
+ |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size|
+ |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request|
diff --git a/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md b/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md
index 8328e51..cb587b4 100644
--- a/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md
+++ b/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md
@@ -21,6 +21,7 @@
|forward_price
`fp` |string|True|[Options] The forward price of the option at point of trade, expressed in `9` decimals|
|trade_id
`ti` |string|True|A trade identifier, globally unique, and monotonically increasing (not by `1`).
All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.
`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`.|
|venue
`v` |Venue|True|The venue where the trade occurred|
+ |is_rpi
`ir1` |boolean|True|If the trade is a RPI trade|
??? info "[Venue](/../../schemas/venue)"
The list of Trading Venues that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md
index 0f2328b..04628f1 100644
--- a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md
+++ b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md
@@ -67,3 +67,5 @@
|`STANDARD` = 1|Standard transfer that has nothing to do with bridging|
|`FAST_ARB_DEPOSIT` = 2|Fast Arb Deposit Metadata type|
|`FAST_ARB_WITHDRAWAL` = 3|Fast Arb Withdrawal Metadata type|
+ |`NON_NATIVE_BRIDGE_DEPOSIT` = 4|Transfer type for non native bridging deposit|
+ |`NON_NATIVE_BRIDGE_WITHDRAWAL` = 5|Transfer type for non native bridging withdrawal|
diff --git a/artifacts/apidocs/trading_api.md b/artifacts/apidocs/trading_api.md
index 5e804f0..642c74a 100644
--- a/artifacts/apidocs/trading_api.md
+++ b/artifacts/apidocs/trading_api.md
@@ -44,7 +44,8 @@ LITE ENDPOINT: lite/v1/create_order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -82,7 +83,8 @@ LITE ENDPOINT: lite/v1/create_order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -128,7 +130,8 @@ LITE ENDPOINT: lite/v1/create_order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -175,7 +178,8 @@ LITE ENDPOINT: lite/v1/create_order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -243,9 +247,15 @@ LITE ENDPOINT: lite/v1/create_order
|2110|400|Invalid trigger by|
|2111|400|Unsupported trigger by|
|2112|400|Invalid trigger order|
+ |2113|400|Trigger price must be non-zero|
+ |2114|400|Invalid position linked TPSL orders, position linked TPSL must be a reduce-only order|
+ |2115|400|Invalid position linked TPSL orders, position linked TPSL must not have smaller size than the position|
+ |2116|400|Position linked TPSL order for this asset already exists|
|3004|500|Instrument does not have a valid maintenance margin configuration|
|3005|500|Instrument's underlying currency does not have a valid balance decimal configuration|
|3006|500|Instrument's quote currency does not have a valid balance decimal configuration|
+ |2400|400|Reduce only order with no position|
+ |2401|400|Reduce only order must not increase position size|
!!! failure
@@ -305,7 +315,8 @@ LITE ENDPOINT: lite/v1/create_order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -351,7 +362,8 @@ LITE ENDPOINT: lite/v1/create_order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -397,7 +409,8 @@ LITE ENDPOINT: lite/v1/create_order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -443,7 +456,8 @@ LITE ENDPOINT: lite/v1/create_order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -490,7 +504,8 @@ LITE ENDPOINT: lite/v1/create_order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -536,7 +551,8 @@ LITE ENDPOINT: lite/v1/create_order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -582,7 +598,8 @@ LITE ENDPOINT: lite/v1/create_order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -628,7 +645,8 @@ LITE ENDPOINT: lite/v1/create_order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -675,7 +693,8 @@ LITE ENDPOINT: lite/v1/create_order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -721,7 +740,8 @@ LITE ENDPOINT: lite/v1/create_order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -767,7 +787,8 @@ LITE ENDPOINT: lite/v1/create_order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -813,7 +834,8 @@ LITE ENDPOINT: lite/v1/create_order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -860,7 +882,8 @@ LITE ENDPOINT: lite/v1/create_order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -906,7 +929,8 @@ LITE ENDPOINT: lite/v1/create_order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -952,7 +976,8 @@ LITE ENDPOINT: lite/v1/create_order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -998,7 +1023,8 @@ LITE ENDPOINT: lite/v1/create_order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -1812,7 +1838,8 @@ LITE ENDPOINT: lite/v1/order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -1859,7 +1886,8 @@ LITE ENDPOINT: lite/v1/order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -2242,7 +2270,8 @@ LITE ENDPOINT: lite/v1/open_orders
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -2289,7 +2318,8 @@ LITE ENDPOINT: lite/v1/open_orders
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -2694,7 +2724,8 @@ LITE ENDPOINT: lite/v1/order_history
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -2742,7 +2773,8 @@ LITE ENDPOINT: lite/v1/order_history
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -3136,3406 +3168,15 @@ LITE ENDPOINT: lite/v1/order_history
```
-### Pre Order Check
-```
-FULL ENDPOINT: full/v1/pre_order_check
-LITE ENDPOINT: lite/v1/pre_order_check
-```
-
-=== "Request"
-
- -8<- "docs/schemas/api_pre_order_check_request.md"
-
-
- !!! question "Query"
- **Full Request**
- ``` { .json .copy }
- {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- ```
- **Lite Request**
- ``` { .json .copy }
- {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- ```
-
-=== "Response"
-
- -8<- "docs/schemas/api_pre_order_check_response.md"
-
-
- !!! success
- **Full Response**
- ``` { .json .copy }
- {
- "results": [{
- "max_qty": [{
- "asset": null,
- "max_buy_qty": 100.0,
- "max_sell_qty": 100.0
- }],
- "margin_required": 1000.0,
- "order_valid": true,
- "reason": "",
- "settle_currency": "USDT"
- }]
- }
- ```
- **Lite Response**
- ``` { .json .copy }
- {
- "r": [{
- "mq": [{
- "a": null,
- "mb": 100.0,
- "ms": 100.0
- }],
- "mr": 1000.0,
- "ov": true,
- "r": "",
- "sc": "USDT"
- }]
- }
- ```
-
-=== "Errors"
-
- !!! info "Error Codes"
- |Code|HttpStatus| Description |
- |-|-|-|
- |1000|401|You need to authenticate prior to using this functionality|
- |1001|403|You are not authorized to access this functionality|
- |1002|500|Internal Server Error|
- |1003|400|Request could not be processed due to malformed syntax|
- |1006|429|You have surpassed the allocated rate limit for your tier|
- |1008|401|Your IP has not been whitelisted for access|
- |3004|500|Instrument does not have a valid maintenance margin configuration|
- |3005|500|Instrument's underlying currency does not have a valid balance decimal configuration|
- |3006|500|Instrument's quote currency does not have a valid balance decimal configuration|
-
-
- !!! failure
- **Full Error Response**
- ``` { .json .copy }
- {
- "request_id":1,
- "code":1000,
- "message":"You need to authenticate prior to using this functionality",
- "status":401
- }
- ```
- **Lite Error Response**
- ``` { .json .copy }
- {
- "ri":1,
- "c":1000,
- "m":"You need to authenticate prior to using this functionality",
- "s":401
- }
- ```
-
-=== "Try it out"
- -8<- "sections/auth_closed.md"
- === "DEV"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/pre_order_check' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/pre_order_check",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/pre_order_check' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/pre_order_check",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "STAGING"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/pre_order_check' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/pre_order_check",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/pre_order_check' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/pre_order_check",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "TESTNET"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/pre_order_check' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/pre_order_check",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/pre_order_check' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/pre_order_check",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "PROD"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/pre_order_check' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/pre_order_check",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/pre_order_check' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/pre_order_check",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- },
- "i": 123
- }
- ' -w 360
- ```
-
-
-### Cancel On Disconnect
-```
-FULL ENDPOINT: full/v1/cancel_on_disconnect
-LITE ENDPOINT: lite/v1/cancel_on_disconnect
-```
-
-=== "Request"
-
- -8<- "docs/schemas/api_cancel_on_disconnect_request.md"
-
-
- !!! question "Query"
- **Full Request**
- ``` { .json .copy }
- {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "countdown_time": 300
- }
- ```
- **Lite Request**
- ``` { .json .copy }
- {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "ct": 300
- }
- ```
-
-=== "Response"
-
- -8<- "docs/schemas/ack_response.md"
-
-
- !!! success
- **Full Response**
- ``` { .json .copy }
- {
- "result": {
- "ack": "true"
- }
- }
- ```
- **Lite Response**
- ``` { .json .copy }
- {
- "r": {
- "a": "true"
- }
- }
- ```
-
-=== "Errors"
-
- !!! info "Error Codes"
- |Code|HttpStatus| Description |
- |-|-|-|
- |1000|401|You need to authenticate prior to using this functionality|
- |1001|403|You are not authorized to access this functionality|
- |1002|500|Internal Server Error|
- |1003|400|Request could not be processed due to malformed syntax|
- |1006|429|You have surpassed the allocated rate limit for your tier|
- |1008|401|Your IP has not been whitelisted for access|
- |6000|400|Countdown time is bigger than 300s supported|
-
-
- !!! failure
- **Full Error Response**
- ``` { .json .copy }
- {
- "request_id":1,
- "code":1000,
- "message":"You need to authenticate prior to using this functionality",
- "status":401
- }
- ```
- **Lite Error Response**
- ``` { .json .copy }
- {
- "ri":1,
- "c":1000,
- "m":"You need to authenticate prior to using this functionality",
- "s":401
- }
- ```
-
-=== "Try it out"
- -8<- "sections/auth_closed.md"
- === "DEV"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_on_disconnect' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "countdown_time": 300
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/cancel_on_disconnect",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "countdown_time": 300
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_on_disconnect' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "ct": 300
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/cancel_on_disconnect",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "ct": 300
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "STAGING"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_on_disconnect' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "countdown_time": 300
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/cancel_on_disconnect",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "countdown_time": 300
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_on_disconnect' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "ct": 300
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/cancel_on_disconnect",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "ct": 300
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "TESTNET"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_on_disconnect' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "countdown_time": 300
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/cancel_on_disconnect",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "countdown_time": 300
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_on_disconnect' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "ct": 300
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/cancel_on_disconnect",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "ct": 300
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "PROD"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/cancel_on_disconnect' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "countdown_time": 300
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/cancel_on_disconnect",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "countdown_time": 300
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/cancel_on_disconnect' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "ct": 300
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/cancel_on_disconnect",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "ct": 300
- },
- "i": 123
- }
- ' -w 360
- ```
-
-
-### Create Bulk Orders
-```
-FULL ENDPOINT: full/v1/create_bulk_orders
-LITE ENDPOINT: lite/v1/create_bulk_orders
-```
-
-=== "Request"
-
- -8<- "docs/schemas/api_create_bulk_orders_request.md"
-
-
- !!! question "Query"
- **Full Request**
- ``` { .json .copy }
- {
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- ```
- **Lite Request**
- ``` { .json .copy }
- {
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- ```
-
-=== "Response"
-
- -8<- "docs/schemas/api_create_bulk_orders_response.md"
-
-
- !!! success
- **Full Response**
- ``` { .json .copy }
- {
- "result": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- ```
- **Lite Response**
- ``` { .json .copy }
- {
- "r": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- ```
-
-=== "Errors"
-
- !!! info "Error Codes"
- |Code|HttpStatus| Description |
- |-|-|-|
- |1000|401|You need to authenticate prior to using this functionality|
- |1001|403|You are not authorized to access this functionality|
- |1002|500|Internal Server Error|
- |1003|400|Request could not be processed due to malformed syntax|
- |1004|404|Data Not Found|
- |1005|500|Unknown Error|
- |1006|429|You have surpassed the allocated rate limit for your tier|
- |1008|401|Your IP has not been whitelisted for access|
- |1400|403|Signer does not have trade permission|
- |1009|503|We are temporarily deactivating this API endpoint, please try again later|
- |2000|403|Order signature is from an unauthorized signer|
- |2001|403|Order signature has expired|
- |2002|403|Order signature does not match payload|
- |2003|403|Order sub account does not match logged in user|
- |2004|403|Order signature is from an expired session key|
- |2006|403|Order signature R/S must have exactly 64 characters long without 0x prefix|
- |2005|403|Order signature V must be 27/28|
- |2007|403|Order signature S must be in the lower half of the curve|
- |2010|400|Order ID should be empty when creating an order|
- |2011|400|Client Order ID should be supplied when creating an order|
- |2012|400|Client Order ID overlaps with existing active order|
- |2030|400|Orderbook Orders must have a TimeInForce of GTT/IOC/FOK|
- |2031|400|RFQ Orders must have a TimeInForce of GTT/AON/IOC/FOK|
- |2032|400|Post Only can only be set to true for GTT/AON orders|
- |2020|400|Market Order must always be supplied without a limit price|
- |2021|400|Limit Order must always be supplied with a limit price|
- |2040|400|Order must contain at least one leg|
- |2041|400|Order Legs must be sorted by Derivative.Instrument/Underlying/BaseCurrency/Expiration/StrikePrice|
- |2042|400|Orderbook Orders must contain only one leg|
- |2050|400|Order state must be empty upon creation|
- |2051|400|Order execution metadata must be empty upon creation|
- |2060|400|Order Legs contain one or more inactive derivative|
- |2061|400|Unsupported Instrument Requested|
- |2062|400|Order size smaller than min size|
- |2063|400|Order size smaller than min block size in block trade venue|
- |2064|400|Invalid limit price tick|
- |2065|400|Order size too granular|
- |2070|400|Liquidation Order is not supported|
- |2080|400|Insufficient margin to create order|
- |2081|400|Order Fill would result in exceeding maximum position size|
- |2082|400|Pre-order check failed|
- |2083|400|Order Fill would result in exceeding maximum position size under current configurable leverage tier|
- |2090|429|Max open orders exceeded|
- |2110|400|Invalid trigger by|
- |2111|400|Unsupported trigger by|
- |2112|400|Invalid trigger order|
- |3004|500|Instrument does not have a valid maintenance margin configuration|
- |3005|500|Instrument's underlying currency does not have a valid balance decimal configuration|
- |3006|500|Instrument's quote currency does not have a valid balance decimal configuration|
- |2220|400|No orders provided|
- |2221|400|Invalid number of orders|
- |2222|400|Order is not a TPSL order|
- |2223|400|Unsupported bulk order type|
-
-
- !!! failure
- **Full Error Response**
- ``` { .json .copy }
- {
- "request_id":1,
- "code":1000,
- "message":"You need to authenticate prior to using this functionality",
- "status":401
- }
- ```
- **Lite Error Response**
- ``` { .json .copy }
- {
- "ri":1,
- "c":1000,
- "m":"You need to authenticate prior to using this functionality",
- "s":401
- }
- ```
-
-=== "Try it out"
- -8<- "sections/auth_closed.md"
- === "DEV"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/create_bulk_orders' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/create_bulk_orders",
- "params": {
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/create_bulk_orders' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/create_bulk_orders",
- "p": {
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "STAGING"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/create_bulk_orders' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/create_bulk_orders",
- "params": {
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/create_bulk_orders' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/create_bulk_orders",
- "p": {
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "TESTNET"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/create_bulk_orders' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/create_bulk_orders",
- "params": {
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/create_bulk_orders' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/create_bulk_orders",
- "p": {
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "PROD"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/create_bulk_orders' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/create_bulk_orders",
- "params": {
- "orders": [{
- "order_id": "0x1234567890abcdef",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "is_market": false,
- "time_in_force": "GOOD_TILL_TIME",
- "post_only": false,
- "reduce_only": false,
- "legs": [{
- "instrument": "BTC_USDT_Perp",
- "size": "10.5",
- "limit_price": "65038.01",
- "is_buying_asset": true
- }],
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "metadata": {
- "client_order_id": "23042",
- "create_time": "1697788800000000000",
- "trigger": {
- "trigger_type": "TAKE_PROFIT",
- "tpsl": {
- "trigger_by": "LAST",
- "trigger_price": "65038.10"
- }
- },
- "broker": "BROKER_CODE"
- },
- "state": {
- "status": "PENDING",
- "reject_reason": "CLIENT_CANCEL",
- "book_size": ["10.5"],
- "traded_size": ["1.5"],
- "update_time": "1697788800000000000",
- "avg_fill_price": ["60000.4"]
- }
- }]
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/create_bulk_orders' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/create_bulk_orders",
- "p": {
- "o": [{
- "oi": "0x1234567890abcdef",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "im": false,
- "ti": "GOOD_TILL_TIME",
- "po": false,
- "ro": false,
- "l": [{
- "i": "BTC_USDT_Perp",
- "s": "10.5",
- "lp": "65038.01",
- "ib": true
- }],
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "m": {
- "co": "23042",
- "ct": "1697788800000000000",
- "t": {
- "tt": "TAKE_PROFIT",
- "t": {
- "tb": "LAST",
- "tp": "65038.10"
- }
- },
- "b": "BROKER_CODE"
- },
- "s1": {
- "s": "PENDING",
- "rr": "CLIENT_CANCEL",
- "bs": ["10.5"],
- "ts": ["1.5"],
- "ut": "1697788800000000000",
- "af": ["60000.4"]
- }
- }]
- },
- "i": 123
- }
- ' -w 360
- ```
-
-
-### Get Order Group
-```
-FULL ENDPOINT: full/v1/order_group
-LITE ENDPOINT: lite/v1/order_group
-```
-
-=== "Request"
-
- -8<- "docs/schemas/api_get_order_group_request.md"
-
-
- !!! question "Query"
- **Full Request**
- ``` { .json .copy }
- {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- ```
- **Lite Request**
- ``` { .json .copy }
- {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- ```
-
-=== "Response"
-
- -8<- "docs/schemas/api_get_order_group_response.md"
-
-
- !!! success
- **Full Response**
- ``` { .json .copy }
- {
- "result": [{
- "group_id": "0x10000101000203040506",
- "client_order_id": ["[23042, 54232]"],
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- }]
- }
- ```
- **Lite Response**
- ``` { .json .copy }
- {
- "r": [{
- "gi": "0x10000101000203040506",
- "co": ["[23042, 54232]"],
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- }]
- }
- ```
-
-=== "Errors"
-
- !!! info "Error Codes"
- |Code|HttpStatus| Description |
- |-|-|-|
- |1000|401|You need to authenticate prior to using this functionality|
- |1001|403|You are not authorized to access this functionality|
- |1002|500|Internal Server Error|
- |1003|400|Request could not be processed due to malformed syntax|
- |1006|429|You have surpassed the allocated rate limit for your tier|
- |1008|401|Your IP has not been whitelisted for access|
- |1004|404|Data Not Found|
- |3020|400|Sub account ID must be an uint64 integer|
- |3021|400|Either order ID or client order ID must be supplied|
-
-
- !!! failure
- **Full Error Response**
- ``` { .json .copy }
- {
- "request_id":1,
- "code":1000,
- "message":"You need to authenticate prior to using this functionality",
- "status":401
- }
- ```
- **Lite Error Response**
- ``` { .json .copy }
- {
- "ri":1,
- "c":1000,
- "m":"You need to authenticate prior to using this functionality",
- "s":401
- }
- ```
-
-=== "Try it out"
- -8<- "sections/auth_closed.md"
- === "DEV"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/order_group' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/order_group",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/order_group' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/order_group",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "STAGING"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/order_group' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/order_group",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/order_group' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/order_group",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "TESTNET"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/order_group' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/order_group",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/order_group' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/order_group",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "PROD"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/order_group' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/order_group",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/order_group' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/order_group",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- },
- "i": 123
- }
- ' -w 360
- ```
-
-
-## Execution
-### Fill History
-```
-FULL ENDPOINT: full/v1/fill_history
-LITE ENDPOINT: lite/v1/fill_history
-```
-
-=== "Request"
-
- -8<- "docs/schemas/api_fill_history_request.md"
-
-
- !!! question "Query"
- **Full Request**
- ``` { .json .copy }
- {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
- }
- ```
- **Lite Request**
- ``` { .json .copy }
- {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
- }
- ```
-
-=== "Response"
-
- -8<- "docs/schemas/api_fill_history_response.md"
-
-
- !!! success
- **Full Response**
- ``` { .json .copy }
- {
- "result": [{
- "event_time": "1697788800000000000",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
- "is_buyer": true,
- "is_taker": true,
- "size": "0.30",
- "price": "65038.01",
- "mark_price": "65038.01",
- "index_price": "65038.01",
- "interest_rate": 0.0003,
- "forward_price": "65038.01",
- "realized_pnl": "2400.50",
- "fee": "9.75",
- "fee_rate": 0.0003,
- "trade_id": "209358-2",
- "order_id": "0x10000101000203040506",
- "venue": "ORDERBOOK",
- "client_order_id": "23042",
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "broker": "UNSPECIFIED"
- }],
- "next": "Qw0918="
- }
- ```
- **Lite Response**
- ``` { .json .copy }
- {
- "r": [{
- "et": "1697788800000000000",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
- "ib": true,
- "it": true,
- "s": "0.30",
- "p": "65038.01",
- "mp": "65038.01",
- "ip": "65038.01",
- "ir": 0.0003,
- "fp": "65038.01",
- "rp": "2400.50",
- "f": "9.75",
- "fr": 0.0003,
- "ti": "209358-2",
- "oi": "0x10000101000203040506",
- "v": "ORDERBOOK",
- "co": "23042",
- "s1": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "b": "UNSPECIFIED"
- }],
- "n": "Qw0918="
- }
- ```
-
-=== "Errors"
-
- !!! info "Error Codes"
- |Code|HttpStatus| Description |
- |-|-|-|
- |1000|401|You need to authenticate prior to using this functionality|
- |1001|403|You are not authorized to access this functionality|
- |1002|500|Internal Server Error|
- |1003|400|Request could not be processed due to malformed syntax|
- |1006|429|You have surpassed the allocated rate limit for your tier|
- |1008|401|Your IP has not been whitelisted for access|
-
-
- !!! failure
- **Full Error Response**
- ``` { .json .copy }
- {
- "request_id":1,
- "code":1000,
- "message":"You need to authenticate prior to using this functionality",
- "status":401
- }
- ```
- **Lite Error Response**
- ``` { .json .copy }
- {
- "ri":1,
- "c":1000,
- "m":"You need to authenticate prior to using this functionality",
- "s":401
- }
- ```
-
-=== "Try it out"
- -8<- "sections/auth_closed.md"
- === "DEV"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/fill_history' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/fill_history",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/fill_history' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/fill_history",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "STAGING"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/fill_history' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/fill_history",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/fill_history' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/fill_history",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "TESTNET"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/fill_history' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/fill_history",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/fill_history' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/fill_history",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
- },
- "i": 123
- }
- ' -w 360
- ```
-
- === "PROD"
-
- !!! example "REST Full"
- ``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/fill_history' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
- }
- '
- ```
- !!! example "JSONRPC Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "v1/fill_history",
- "params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
- },
- "id": 123
- }
- ' -w 360
- ```
-
-
- !!! example "REST Lite"
- ``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/fill_history' \
- --header "Cookie: $GRVT_COOKIE" \
- --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- --data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
- }
- '
- ```
- !!! example "JSONRPC Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/fill_history",
- "p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
- },
- "i": 123
- }
- ' -w 360
- ```
-
-
-### Positions
+### Cancel On Disconnect
```
-FULL ENDPOINT: full/v1/positions
-LITE ENDPOINT: lite/v1/positions
+FULL ENDPOINT: full/v1/cancel_on_disconnect
+LITE ENDPOINT: lite/v1/cancel_on_disconnect
```
=== "Request"
- -8<- "docs/schemas/api_positions_request.md"
+ -8<- "docs/schemas/api_cancel_on_disconnect_request.md"
!!! question "Query"
@@ -6543,69 +3184,37 @@ LITE ENDPOINT: lite/v1/positions
``` { .json .copy }
{
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"]
+ "countdown_time": 300
}
```
**Lite Request**
``` { .json .copy }
{
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"]
+ "ct": 300
}
```
=== "Response"
- -8<- "docs/schemas/api_positions_response.md"
+ -8<- "docs/schemas/ack_response.md"
!!! success
**Full Response**
``` { .json .copy }
{
- "result": [{
- "event_time": "1697788800000000000",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
- "size": "2635000.50",
- "notional": "2635000.50",
- "entry_price": "65038.01",
- "exit_price": "65038.01",
- "mark_price": "65038.01",
- "unrealized_pnl": "135000.50",
- "realized_pnl": "-35000.30",
- "total_pnl": "100000.20",
- "roi": "10.20",
- "quote_index_price": "1.0000102",
- "est_liquidation_price": 60000.25,
- "leverage": "10"
- }]
+ "result": {
+ "ack": "true"
+ }
}
```
**Lite Response**
``` { .json .copy }
{
- "r": [{
- "et": "1697788800000000000",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
- "s": "2635000.50",
- "n": "2635000.50",
- "ep": "65038.01",
- "ep1": "65038.01",
- "mp": "65038.01",
- "up": "135000.50",
- "rp": "-35000.30",
- "tp": "100000.20",
- "r": "10.20",
- "qi": "1.0000102",
- "el": 60000.25,
- "l": "10"
- }]
+ "r": {
+ "a": "true"
+ }
}
```
@@ -6620,6 +3229,7 @@ LITE ENDPOINT: lite/v1/positions
|1003|400|Request could not be processed due to malformed syntax|
|1006|429|You have surpassed the allocated rate limit for your tier|
|1008|401|Your IP has not been whitelisted for access|
+ |6000|400|Countdown time is bigger than 300s supported|
!!! failure
@@ -6648,14 +3258,12 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/positions' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_on_disconnect' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"]
+ "countdown_time": 300
}
'
```
@@ -6667,12 +3275,10 @@ LITE ENDPOINT: lite/v1/positions
-x '
{
"jsonrpc": "2.0",
- "method": "v1/positions",
+ "method": "v1/cancel_on_disconnect",
"params": {
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"]
+ "countdown_time": 300
},
"id": 123
}
@@ -6682,14 +3288,12 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/positions' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_on_disconnect' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"]
+ "ct": 300
}
'
```
@@ -6701,12 +3305,10 @@ LITE ENDPOINT: lite/v1/positions
-x '
{
"j": "2.0",
- "m": "v1/positions",
+ "m": "v1/cancel_on_disconnect",
"p": {
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"]
+ "ct": 300
},
"i": 123
}
@@ -6717,14 +3319,12 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/positions' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_on_disconnect' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"]
+ "countdown_time": 300
}
'
```
@@ -6736,12 +3336,10 @@ LITE ENDPOINT: lite/v1/positions
-x '
{
"jsonrpc": "2.0",
- "method": "v1/positions",
+ "method": "v1/cancel_on_disconnect",
"params": {
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"]
+ "countdown_time": 300
},
"id": 123
}
@@ -6751,14 +3349,12 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/positions' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_on_disconnect' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"]
+ "ct": 300
}
'
```
@@ -6770,12 +3366,10 @@ LITE ENDPOINT: lite/v1/positions
-x '
{
"j": "2.0",
- "m": "v1/positions",
+ "m": "v1/cancel_on_disconnect",
"p": {
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"]
+ "ct": 300
},
"i": 123
}
@@ -6786,14 +3380,12 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/positions' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_on_disconnect' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"]
+ "countdown_time": 300
}
'
```
@@ -6805,12 +3397,10 @@ LITE ENDPOINT: lite/v1/positions
-x '
{
"jsonrpc": "2.0",
- "method": "v1/positions",
+ "method": "v1/cancel_on_disconnect",
"params": {
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"]
+ "countdown_time": 300
},
"id": 123
}
@@ -6820,14 +3410,12 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/positions' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_on_disconnect' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"]
+ "ct": 300
}
'
```
@@ -6839,12 +3427,10 @@ LITE ENDPOINT: lite/v1/positions
-x '
{
"j": "2.0",
- "m": "v1/positions",
+ "m": "v1/cancel_on_disconnect",
"p": {
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"]
+ "ct": 300
},
"i": 123
}
@@ -6855,14 +3441,12 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/positions' \
+ curl --location 'https://trades.grvt.io/full/v1/cancel_on_disconnect' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"]
+ "countdown_time": 300
}
'
```
@@ -6874,12 +3458,10 @@ LITE ENDPOINT: lite/v1/positions
-x '
{
"jsonrpc": "2.0",
- "method": "v1/positions",
+ "method": "v1/cancel_on_disconnect",
"params": {
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "kind": ["PERPETUAL"],
- "base": ["BTC", "ETH"],
- "quote": ["USDT", "USDC"]
+ "countdown_time": 300
},
"id": 123
}
@@ -6889,14 +3471,12 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/positions' \
+ curl --location 'https://trades.grvt.io/lite/v1/cancel_on_disconnect' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"]
+ "ct": 300
}
'
```
@@ -6908,12 +3488,10 @@ LITE ENDPOINT: lite/v1/positions
-x '
{
"j": "2.0",
- "m": "v1/positions",
+ "m": "v1/cancel_on_disconnect",
"p": {
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "k": ["PERPETUAL"],
- "b": ["BTC", "ETH"],
- "q": ["USDT", "USDC"]
+ "ct": 300
},
"i": 123
}
@@ -6921,15 +3499,16 @@ LITE ENDPOINT: lite/v1/positions
```
-### Funding Payment History
+## Execution
+### Fill History
```
-FULL ENDPOINT: full/v1/funding_payment_history
-LITE ENDPOINT: lite/v1/funding_payment_history
+FULL ENDPOINT: full/v1/fill_history
+LITE ENDPOINT: lite/v1/fill_history
```
=== "Request"
- -8<- "docs/schemas/api_funding_payment_history_request.md"
+ -8<- "docs/schemas/api_fill_history_request.md"
!!! question "Query"
@@ -6937,7 +3516,9 @@ LITE ENDPOINT: lite/v1/funding_payment_history
``` { .json .copy }
{
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
@@ -6948,7 +3529,9 @@ LITE ENDPOINT: lite/v1/funding_payment_history
``` { .json .copy }
{
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
@@ -6958,7 +3541,7 @@ LITE ENDPOINT: lite/v1/funding_payment_history
=== "Response"
- -8<- "docs/schemas/api_funding_payment_history_response.md"
+ -8<- "docs/schemas/api_fill_history_response.md"
!!! success
@@ -6969,9 +3552,24 @@ LITE ENDPOINT: lite/v1/funding_payment_history
"event_time": "1697788800000000000",
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"instrument": "BTC_USDT_Perp",
- "currency": "USDT",
- "amount": "9.75",
- "tx_id": "209358"
+ "is_buyer": true,
+ "is_taker": true,
+ "size": "0.30",
+ "price": "65038.01",
+ "mark_price": "65038.01",
+ "index_price": "65038.01",
+ "interest_rate": 0.0003,
+ "forward_price": "65038.01",
+ "realized_pnl": "2400.50",
+ "fee": "9.75",
+ "fee_rate": 0.0003,
+ "trade_id": "209358-2",
+ "order_id": "0x10000101000203040506",
+ "venue": "ORDERBOOK",
+ "client_order_id": "23042",
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "broker": "UNSPECIFIED",
+ "is_rpi": false
}],
"next": "Qw0918="
}
@@ -6983,9 +3581,24 @@ LITE ENDPOINT: lite/v1/funding_payment_history
"et": "1697788800000000000",
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
"i": "BTC_USDT_Perp",
- "c": "USDT",
- "a": "9.75",
- "ti": "209358"
+ "ib": true,
+ "it": true,
+ "s": "0.30",
+ "p": "65038.01",
+ "mp": "65038.01",
+ "ip": "65038.01",
+ "ir": 0.0003,
+ "fp": "65038.01",
+ "rp": "2400.50",
+ "f": "9.75",
+ "fr": 0.0003,
+ "ti": "209358-2",
+ "oi": "0x10000101000203040506",
+ "v": "ORDERBOOK",
+ "co": "23042",
+ "s1": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "b": "UNSPECIFIED",
+ "ir1": false
}],
"n": "Qw0918="
}
@@ -7030,12 +3643,14 @@ LITE ENDPOINT: lite/v1/funding_payment_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/funding_payment_history' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/fill_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
@@ -7051,10 +3666,12 @@ LITE ENDPOINT: lite/v1/funding_payment_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/funding_payment_history",
+ "method": "v1/fill_history",
"params": {
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
@@ -7068,12 +3685,14 @@ LITE ENDPOINT: lite/v1/funding_payment_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/funding_payment_history' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/fill_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
@@ -7089,10 +3708,12 @@ LITE ENDPOINT: lite/v1/funding_payment_history
-x '
{
"j": "2.0",
- "m": "v1/funding_payment_history",
+ "m": "v1/fill_history",
"p": {
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
@@ -7107,12 +3728,14 @@ LITE ENDPOINT: lite/v1/funding_payment_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/funding_payment_history' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/fill_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
@@ -7128,10 +3751,12 @@ LITE ENDPOINT: lite/v1/funding_payment_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/funding_payment_history",
+ "method": "v1/fill_history",
"params": {
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
@@ -7145,12 +3770,14 @@ LITE ENDPOINT: lite/v1/funding_payment_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/funding_payment_history' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/fill_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
@@ -7166,10 +3793,12 @@ LITE ENDPOINT: lite/v1/funding_payment_history
-x '
{
"j": "2.0",
- "m": "v1/funding_payment_history",
+ "m": "v1/fill_history",
"p": {
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
@@ -7184,12 +3813,14 @@ LITE ENDPOINT: lite/v1/funding_payment_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/funding_payment_history' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/fill_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
@@ -7205,10 +3836,12 @@ LITE ENDPOINT: lite/v1/funding_payment_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/funding_payment_history",
+ "method": "v1/fill_history",
"params": {
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
@@ -7222,12 +3855,14 @@ LITE ENDPOINT: lite/v1/funding_payment_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/funding_payment_history' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/fill_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
@@ -7243,10 +3878,12 @@ LITE ENDPOINT: lite/v1/funding_payment_history
-x '
{
"j": "2.0",
- "m": "v1/funding_payment_history",
+ "m": "v1/fill_history",
"p": {
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
@@ -7261,12 +3898,14 @@ LITE ENDPOINT: lite/v1/funding_payment_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/funding_payment_history' \
+ curl --location 'https://trades.grvt.io/full/v1/fill_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
@@ -7282,10 +3921,12 @@ LITE ENDPOINT: lite/v1/funding_payment_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/funding_payment_history",
+ "method": "v1/fill_history",
"params": {
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
@@ -7299,12 +3940,14 @@ LITE ENDPOINT: lite/v1/funding_payment_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/funding_payment_history' \
+ curl --location 'https://trades.grvt.io/lite/v1/fill_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
@@ -7320,10 +3963,12 @@ LITE ENDPOINT: lite/v1/funding_payment_history
-x '
{
"j": "2.0",
- "m": "v1/funding_payment_history",
+ "m": "v1/fill_history",
"p": {
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
@@ -7335,45 +3980,40 @@ LITE ENDPOINT: lite/v1/funding_payment_history
```
-## Transfer
-### Deposit History
+### Positions
```
-FULL ENDPOINT: full/v1/deposit_history
-LITE ENDPOINT: lite/v1/deposit_history
+FULL ENDPOINT: full/v1/positions
+LITE ENDPOINT: lite/v1/positions
```
=== "Request"
- -8<- "docs/schemas/api_deposit_history_request.md"
+ -8<- "docs/schemas/api_positions_request.md"
!!! question "Query"
**Full Request**
``` { .json .copy }
{
- "currency": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": "",
- "main_account_id": null
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"]
}
```
**Lite Request**
``` { .json .copy }
{
- "c": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c1": "",
- "ma": null
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"]
}
```
=== "Response"
- -8<- "docs/schemas/api_deposit_history_response.md"
+ -8<- "docs/schemas/api_positions_response.md"
!!! success
@@ -7381,32 +4021,44 @@ LITE ENDPOINT: lite/v1/deposit_history
``` { .json .copy }
{
"result": [{
- "l_1_hash": "0x10000101000203040506",
- "l_2_hash": "0x10000101000203040506",
- "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "currency": "USDT",
- "num_tokens": "1500.0",
- "initiated_time": "1697788800000000000",
- "confirmed_time": "1697788800000000000",
- "from_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"
- }],
- "next": "Qw0918="
+ "event_time": "1697788800000000000",
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "size": "2635000.50",
+ "notional": "2635000.50",
+ "entry_price": "65038.01",
+ "exit_price": "65038.01",
+ "mark_price": "65038.01",
+ "unrealized_pnl": "135000.50",
+ "realized_pnl": "-35000.30",
+ "total_pnl": "100000.20",
+ "roi": "10.20",
+ "quote_index_price": "1.0000102",
+ "est_liquidation_price": 60000.25,
+ "leverage": "10"
+ }]
}
```
**Lite Response**
``` { .json .copy }
{
"r": [{
- "l1": "0x10000101000203040506",
- "l2": "0x10000101000203040506",
- "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "c": "USDT",
- "nt": "1500.0",
- "it": "1697788800000000000",
- "ct": "1697788800000000000",
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"
- }],
- "n": "Qw0918="
+ "et": "1697788800000000000",
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "s": "2635000.50",
+ "n": "2635000.50",
+ "ep": "65038.01",
+ "ep1": "65038.01",
+ "mp": "65038.01",
+ "up": "135000.50",
+ "rp": "-35000.30",
+ "tp": "100000.20",
+ "r": "10.20",
+ "qi": "1.0000102",
+ "el": 60000.25,
+ "l": "10"
+ }]
}
```
@@ -7449,16 +4101,14 @@ LITE ENDPOINT: lite/v1/deposit_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/deposit_history' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/positions' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "currency": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": "",
- "main_account_id": null
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"]
}
'
```
@@ -7470,14 +4120,12 @@ LITE ENDPOINT: lite/v1/deposit_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/deposit_history",
+ "method": "v1/positions",
"params": {
- "currency": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": "",
- "main_account_id": null
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"]
},
"id": 123
}
@@ -7487,16 +4135,14 @@ LITE ENDPOINT: lite/v1/deposit_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/deposit_history' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/positions' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "c": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c1": "",
- "ma": null
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"]
}
'
```
@@ -7508,14 +4154,12 @@ LITE ENDPOINT: lite/v1/deposit_history
-x '
{
"j": "2.0",
- "m": "v1/deposit_history",
+ "m": "v1/positions",
"p": {
- "c": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c1": "",
- "ma": null
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"]
},
"i": 123
}
@@ -7526,16 +4170,14 @@ LITE ENDPOINT: lite/v1/deposit_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/deposit_history' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/positions' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "currency": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": "",
- "main_account_id": null
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"]
}
'
```
@@ -7547,14 +4189,12 @@ LITE ENDPOINT: lite/v1/deposit_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/deposit_history",
+ "method": "v1/positions",
"params": {
- "currency": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": "",
- "main_account_id": null
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"]
},
"id": 123
}
@@ -7564,16 +4204,14 @@ LITE ENDPOINT: lite/v1/deposit_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/deposit_history' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/positions' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "c": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c1": "",
- "ma": null
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"]
}
'
```
@@ -7585,14 +4223,12 @@ LITE ENDPOINT: lite/v1/deposit_history
-x '
{
"j": "2.0",
- "m": "v1/deposit_history",
+ "m": "v1/positions",
"p": {
- "c": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c1": "",
- "ma": null
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"]
},
"i": 123
}
@@ -7603,16 +4239,14 @@ LITE ENDPOINT: lite/v1/deposit_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/deposit_history' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/positions' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "currency": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": "",
- "main_account_id": null
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"]
}
'
```
@@ -7624,14 +4258,12 @@ LITE ENDPOINT: lite/v1/deposit_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/deposit_history",
+ "method": "v1/positions",
"params": {
- "currency": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": "",
- "main_account_id": null
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"]
},
"id": 123
}
@@ -7641,16 +4273,14 @@ LITE ENDPOINT: lite/v1/deposit_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/deposit_history' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/positions' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "c": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c1": "",
- "ma": null
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"]
}
'
```
@@ -7662,14 +4292,12 @@ LITE ENDPOINT: lite/v1/deposit_history
-x '
{
"j": "2.0",
- "m": "v1/deposit_history",
+ "m": "v1/positions",
"p": {
- "c": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c1": "",
- "ma": null
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"]
},
"i": 123
}
@@ -7680,16 +4308,14 @@ LITE ENDPOINT: lite/v1/deposit_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/deposit_history' \
+ curl --location 'https://trades.grvt.io/full/v1/positions' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "currency": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": "",
- "main_account_id": null
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"]
}
'
```
@@ -7701,14 +4327,12 @@ LITE ENDPOINT: lite/v1/deposit_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/deposit_history",
+ "method": "v1/positions",
"params": {
- "currency": ["USDT", "USDC"],
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": "",
- "main_account_id": null
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "kind": ["PERPETUAL"],
+ "base": ["BTC", "ETH"],
+ "quote": ["USDT", "USDC"]
},
"id": 123
}
@@ -7718,16 +4342,14 @@ LITE ENDPOINT: lite/v1/deposit_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/deposit_history' \
+ curl --location 'https://trades.grvt.io/lite/v1/positions' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "c": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c1": "",
- "ma": null
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"]
}
'
```
@@ -7739,14 +4361,12 @@ LITE ENDPOINT: lite/v1/deposit_history
-x '
{
"j": "2.0",
- "m": "v1/deposit_history",
+ "m": "v1/positions",
"p": {
- "c": ["USDT", "USDC"],
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c1": "",
- "ma": null
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "k": ["PERPETUAL"],
+ "b": ["BTC", "ETH"],
+ "q": ["USDT", "USDC"]
},
"i": 123
}
@@ -7754,81 +4374,73 @@ LITE ENDPOINT: lite/v1/deposit_history
```
-### Transfer
+### Funding Payment History
```
-FULL ENDPOINT: full/v1/transfer
-LITE ENDPOINT: lite/v1/transfer
+FULL ENDPOINT: full/v1/funding_payment_history
+LITE ENDPOINT: lite/v1/funding_payment_history
```
=== "Request"
- -8<- "docs/schemas/api_transfer_request.md"
+ -8<- "docs/schemas/api_funding_payment_history_request.md"
-
- !!! question "Query"
- **Full Request**
- ``` { .json .copy }
- {
- "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "currency": "USDT",
- "num_tokens": "1500.0",
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "transfer_type": "STANDARD",
- "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+
+ !!! question "Query"
+ **Full Request**
+ ``` { .json .copy }
+ {
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
}
```
**Lite Request**
``` { .json .copy }
{
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "fs": "'$GRVT_SUB_ACCOUNT_ID'",
- "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "ts": "'$GRVT_SUB_ACCOUNT_ID'",
- "c": "USDT",
- "nt": "1500.0",
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "tt": "STANDARD",
- "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
}
```
=== "Response"
- -8<- "docs/schemas/ack_response.md"
+ -8<- "docs/schemas/api_funding_payment_history_response.md"
!!! success
**Full Response**
``` { .json .copy }
{
- "result": {
- "ack": "true"
- }
+ "result": [{
+ "event_time": "1697788800000000000",
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "currency": "USDT",
+ "amount": "9.75",
+ "tx_id": "209358"
+ }],
+ "next": "Qw0918="
}
```
**Lite Response**
``` { .json .copy }
{
- "r": {
- "a": "true"
- }
+ "r": [{
+ "et": "1697788800000000000",
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "c": "USDT",
+ "a": "9.75",
+ "ti": "209358"
+ }],
+ "n": "Qw0918="
}
```
@@ -7843,12 +4455,6 @@ LITE ENDPOINT: lite/v1/transfer
|1003|400|Request could not be processed due to malformed syntax|
|1006|429|You have surpassed the allocated rate limit for your tier|
|1008|401|Your IP has not been whitelisted for access|
- |5000|400|Transfer Metadata does not match the expected structure.|
- |5001|400|Transfer Provider does not match the expected provider.|
- |5002|400|Direction of the transfer does not match the expected direction.|
- |5003|400|Endpoint account ID is invalid.|
- |5004|400|Funding account does not exist in our system.|
- |5005|400|Invalid ChainID for the transfer request.|
!!! failure
@@ -7877,26 +4483,16 @@ LITE ENDPOINT: lite/v1/transfer
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/transfer' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/funding_payment_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "currency": "USDT",
- "num_tokens": "1500.0",
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "transfer_type": "STANDARD",
- "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
}
'
```
@@ -7908,24 +4504,14 @@ LITE ENDPOINT: lite/v1/transfer
-x '
{
"jsonrpc": "2.0",
- "method": "v1/transfer",
+ "method": "v1/funding_payment_history",
"params": {
- "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "currency": "USDT",
- "num_tokens": "1500.0",
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "transfer_type": "STANDARD",
- "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
},
"id": 123
}
@@ -7935,26 +4521,16 @@ LITE ENDPOINT: lite/v1/transfer
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/transfer' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/funding_payment_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "fs": "'$GRVT_SUB_ACCOUNT_ID'",
- "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "ts": "'$GRVT_SUB_ACCOUNT_ID'",
- "c": "USDT",
- "nt": "1500.0",
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "tt": "STANDARD",
- "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
}
'
```
@@ -7966,24 +4542,14 @@ LITE ENDPOINT: lite/v1/transfer
-x '
{
"j": "2.0",
- "m": "v1/transfer",
+ "m": "v1/funding_payment_history",
"p": {
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "fs": "'$GRVT_SUB_ACCOUNT_ID'",
- "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "ts": "'$GRVT_SUB_ACCOUNT_ID'",
- "c": "USDT",
- "nt": "1500.0",
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "tt": "STANDARD",
- "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
},
"i": 123
}
@@ -7994,26 +4560,16 @@ LITE ENDPOINT: lite/v1/transfer
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/transfer' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/funding_payment_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "currency": "USDT",
- "num_tokens": "1500.0",
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "transfer_type": "STANDARD",
- "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
}
'
```
@@ -8025,24 +4581,14 @@ LITE ENDPOINT: lite/v1/transfer
-x '
{
"jsonrpc": "2.0",
- "method": "v1/transfer",
+ "method": "v1/funding_payment_history",
"params": {
- "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "currency": "USDT",
- "num_tokens": "1500.0",
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "transfer_type": "STANDARD",
- "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
},
"id": 123
}
@@ -8052,55 +4598,35 @@ LITE ENDPOINT: lite/v1/transfer
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/transfer' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/funding_payment_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "fs": "'$GRVT_SUB_ACCOUNT_ID'",
- "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "ts": "'$GRVT_SUB_ACCOUNT_ID'",
- "c": "USDT",
- "nt": "1500.0",
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "tt": "STANDARD",
- "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
}
'
```
!!! example "JSONRPC Lite"
``` { .bash .copy }
wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "v1/transfer",
- "p": {
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "fs": "'$GRVT_SUB_ACCOUNT_ID'",
- "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "ts": "'$GRVT_SUB_ACCOUNT_ID'",
- "c": "USDT",
- "nt": "1500.0",
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "tt": "STANDARD",
- "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ -H "Cookie: $GRVT_COOKIE" \
+ -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
+ -x '
+ {
+ "j": "2.0",
+ "m": "v1/funding_payment_history",
+ "p": {
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
},
"i": 123
}
@@ -8111,26 +4637,16 @@ LITE ENDPOINT: lite/v1/transfer
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/transfer' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/funding_payment_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "currency": "USDT",
- "num_tokens": "1500.0",
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "transfer_type": "STANDARD",
- "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
}
'
```
@@ -8142,24 +4658,14 @@ LITE ENDPOINT: lite/v1/transfer
-x '
{
"jsonrpc": "2.0",
- "method": "v1/transfer",
+ "method": "v1/funding_payment_history",
"params": {
- "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "currency": "USDT",
- "num_tokens": "1500.0",
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "transfer_type": "STANDARD",
- "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
},
"id": 123
}
@@ -8169,26 +4675,16 @@ LITE ENDPOINT: lite/v1/transfer
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/transfer' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/funding_payment_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "fs": "'$GRVT_SUB_ACCOUNT_ID'",
- "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "ts": "'$GRVT_SUB_ACCOUNT_ID'",
- "c": "USDT",
- "nt": "1500.0",
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "tt": "STANDARD",
- "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
}
'
```
@@ -8200,24 +4696,14 @@ LITE ENDPOINT: lite/v1/transfer
-x '
{
"j": "2.0",
- "m": "v1/transfer",
+ "m": "v1/funding_payment_history",
"p": {
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "fs": "'$GRVT_SUB_ACCOUNT_ID'",
- "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "ts": "'$GRVT_SUB_ACCOUNT_ID'",
- "c": "USDT",
- "nt": "1500.0",
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "tt": "STANDARD",
- "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
},
"i": 123
}
@@ -8228,26 +4714,16 @@ LITE ENDPOINT: lite/v1/transfer
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/transfer' \
+ curl --location 'https://trades.grvt.io/full/v1/funding_payment_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "currency": "USDT",
- "num_tokens": "1500.0",
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "transfer_type": "STANDARD",
- "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
}
'
```
@@ -8259,24 +4735,14 @@ LITE ENDPOINT: lite/v1/transfer
-x '
{
"jsonrpc": "2.0",
- "method": "v1/transfer",
+ "method": "v1/funding_payment_history",
"params": {
- "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "currency": "USDT",
- "num_tokens": "1500.0",
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "transfer_type": "STANDARD",
- "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
},
"id": 123
}
@@ -8286,26 +4752,16 @@ LITE ENDPOINT: lite/v1/transfer
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/transfer' \
+ curl --location 'https://trades.grvt.io/lite/v1/funding_payment_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "fs": "'$GRVT_SUB_ACCOUNT_ID'",
- "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "ts": "'$GRVT_SUB_ACCOUNT_ID'",
- "c": "USDT",
- "nt": "1500.0",
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "tt": "STANDARD",
- "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
}
'
```
@@ -8317,24 +4773,14 @@ LITE ENDPOINT: lite/v1/transfer
-x '
{
"j": "2.0",
- "m": "v1/transfer",
+ "m": "v1/funding_payment_history",
"p": {
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "fs": "'$GRVT_SUB_ACCOUNT_ID'",
- "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "ts": "'$GRVT_SUB_ACCOUNT_ID'",
- "c": "USDT",
- "nt": "1500.0",
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "tt": "STANDARD",
- "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
},
"i": 123
}
@@ -8342,15 +4788,16 @@ LITE ENDPOINT: lite/v1/transfer
```
-### Transfer History
+## Transfer
+### Deposit History
```
-FULL ENDPOINT: full/v1/transfer_history
-LITE ENDPOINT: lite/v1/transfer_history
+FULL ENDPOINT: full/v1/deposit_history
+LITE ENDPOINT: lite/v1/deposit_history
```
=== "Request"
- -8<- "docs/schemas/api_transfer_history_request.md"
+ -8<- "docs/schemas/api_deposit_history_request.md"
!!! question "Query"
@@ -8362,7 +4809,6 @@ LITE ENDPOINT: lite/v1/transfer_history
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
- "tx_id": "1028403",
"main_account_id": null
}
```
@@ -8374,14 +4820,13 @@ LITE ENDPOINT: lite/v1/transfer_history
"et": "1697788800000000000",
"l": 500,
"c1": "",
- "ti": "1028403",
"ma": null
}
```
=== "Response"
- -8<- "docs/schemas/api_transfer_history_response.md"
+ -8<- "docs/schemas/api_deposit_history_response.md"
!!! success
@@ -8389,24 +4834,14 @@ LITE ENDPOINT: lite/v1/transfer_history
``` { .json .copy }
{
"result": [{
- "tx_id": "1028403",
- "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "l_1_hash": "0x10000101000203040506",
+ "l_2_hash": "0x10000101000203040506",
"to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
- "signature": {
- "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "expiration": "1697788800000000000",
- "nonce": 1234567890
- },
- "event_time": "1697788800000000000",
- "transfer_type": "STANDARD",
- "transfer_metadata": null
+ "initiated_time": "1697788800000000000",
+ "confirmed_time": "1697788800000000000",
+ "from_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"
}],
"next": "Qw0918="
}
@@ -8415,24 +4850,14 @@ LITE ENDPOINT: lite/v1/transfer_history
``` { .json .copy }
{
"r": [{
- "ti": "1028403",
- "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "l1": "0x10000101000203040506",
+ "l2": "0x10000101000203040506",
"ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
- "nt": "1500.0",
- "s": {
- "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
- "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
- "v": 28,
- "e": "1697788800000000000",
- "n": 1234567890
- },
- "et": "1697788800000000000",
- "tt": "STANDARD",
- "tm": null
+ "nt": "1500.0",
+ "it": "1697788800000000000",
+ "ct": "1697788800000000000",
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"
}],
"n": "Qw0918="
}
@@ -8477,7 +4902,7 @@ LITE ENDPOINT: lite/v1/transfer_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/transfer_history' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/deposit_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -8486,7 +4911,6 @@ LITE ENDPOINT: lite/v1/transfer_history
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
- "tx_id": "1028403",
"main_account_id": null
}
'
@@ -8499,14 +4923,13 @@ LITE ENDPOINT: lite/v1/transfer_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/transfer_history",
+ "method": "v1/deposit_history",
"params": {
"currency": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
- "tx_id": "1028403",
"main_account_id": null
},
"id": 123
@@ -8517,7 +4940,7 @@ LITE ENDPOINT: lite/v1/transfer_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/transfer_history' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/deposit_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -8526,7 +4949,6 @@ LITE ENDPOINT: lite/v1/transfer_history
"et": "1697788800000000000",
"l": 500,
"c1": "",
- "ti": "1028403",
"ma": null
}
'
@@ -8539,14 +4961,13 @@ LITE ENDPOINT: lite/v1/transfer_history
-x '
{
"j": "2.0",
- "m": "v1/transfer_history",
+ "m": "v1/deposit_history",
"p": {
"c": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
"c1": "",
- "ti": "1028403",
"ma": null
},
"i": 123
@@ -8558,7 +4979,7 @@ LITE ENDPOINT: lite/v1/transfer_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/transfer_history' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/deposit_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -8567,7 +4988,6 @@ LITE ENDPOINT: lite/v1/transfer_history
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
- "tx_id": "1028403",
"main_account_id": null
}
'
@@ -8580,14 +5000,13 @@ LITE ENDPOINT: lite/v1/transfer_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/transfer_history",
+ "method": "v1/deposit_history",
"params": {
"currency": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
- "tx_id": "1028403",
"main_account_id": null
},
"id": 123
@@ -8598,7 +5017,7 @@ LITE ENDPOINT: lite/v1/transfer_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/transfer_history' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/deposit_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -8607,7 +5026,6 @@ LITE ENDPOINT: lite/v1/transfer_history
"et": "1697788800000000000",
"l": 500,
"c1": "",
- "ti": "1028403",
"ma": null
}
'
@@ -8620,14 +5038,13 @@ LITE ENDPOINT: lite/v1/transfer_history
-x '
{
"j": "2.0",
- "m": "v1/transfer_history",
+ "m": "v1/deposit_history",
"p": {
"c": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
"c1": "",
- "ti": "1028403",
"ma": null
},
"i": 123
@@ -8639,7 +5056,7 @@ LITE ENDPOINT: lite/v1/transfer_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/transfer_history' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/deposit_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -8648,7 +5065,6 @@ LITE ENDPOINT: lite/v1/transfer_history
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
- "tx_id": "1028403",
"main_account_id": null
}
'
@@ -8661,14 +5077,13 @@ LITE ENDPOINT: lite/v1/transfer_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/transfer_history",
+ "method": "v1/deposit_history",
"params": {
"currency": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
- "tx_id": "1028403",
"main_account_id": null
},
"id": 123
@@ -8679,7 +5094,7 @@ LITE ENDPOINT: lite/v1/transfer_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/transfer_history' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/deposit_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -8688,7 +5103,6 @@ LITE ENDPOINT: lite/v1/transfer_history
"et": "1697788800000000000",
"l": 500,
"c1": "",
- "ti": "1028403",
"ma": null
}
'
@@ -8701,14 +5115,13 @@ LITE ENDPOINT: lite/v1/transfer_history
-x '
{
"j": "2.0",
- "m": "v1/transfer_history",
+ "m": "v1/deposit_history",
"p": {
"c": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
"c1": "",
- "ti": "1028403",
"ma": null
},
"i": 123
@@ -8720,7 +5133,7 @@ LITE ENDPOINT: lite/v1/transfer_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/transfer_history' \
+ curl --location 'https://trades.grvt.io/full/v1/deposit_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -8729,7 +5142,6 @@ LITE ENDPOINT: lite/v1/transfer_history
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
- "tx_id": "1028403",
"main_account_id": null
}
'
@@ -8742,14 +5154,13 @@ LITE ENDPOINT: lite/v1/transfer_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/transfer_history",
+ "method": "v1/deposit_history",
"params": {
"currency": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
- "tx_id": "1028403",
"main_account_id": null
},
"id": 123
@@ -8760,7 +5171,7 @@ LITE ENDPOINT: lite/v1/transfer_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/transfer_history' \
+ curl --location 'https://trades.grvt.io/lite/v1/deposit_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -8769,7 +5180,6 @@ LITE ENDPOINT: lite/v1/transfer_history
"et": "1697788800000000000",
"l": 500,
"c1": "",
- "ti": "1028403",
"ma": null
}
'
@@ -8782,14 +5192,13 @@ LITE ENDPOINT: lite/v1/transfer_history
-x '
{
"j": "2.0",
- "m": "v1/transfer_history",
+ "m": "v1/deposit_history",
"p": {
"c": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
"c1": "",
- "ti": "1028403",
"ma": null
},
"i": 123
@@ -8798,15 +5207,15 @@ LITE ENDPOINT: lite/v1/transfer_history
```
-### Withdrawal
+### Transfer
```
-FULL ENDPOINT: full/v1/withdrawal
-LITE ENDPOINT: lite/v1/withdrawal
+FULL ENDPOINT: full/v1/transfer
+LITE ENDPOINT: lite/v1/transfer
```
=== "Request"
- -8<- "docs/schemas/api_withdrawal_request.md"
+ -8<- "docs/schemas/api_transfer_request.md"
!!! question "Query"
@@ -8814,7 +5223,9 @@ LITE ENDPOINT: lite/v1/withdrawal
``` { .json .copy }
{
"from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
"signature": {
@@ -8824,14 +5235,18 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"expiration": "1697788800000000000",
"nonce": 1234567890
- }
+ },
+ "transfer_type": "STANDARD",
+ "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
}
```
**Lite Request**
``` { .json .copy }
{
"fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
"nt": "1500.0",
"s": {
@@ -8841,13 +5256,15 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"e": "1697788800000000000",
"n": 1234567890
- }
+ },
+ "tt": "STANDARD",
+ "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
}
```
=== "Response"
- -8<- "docs/schemas/ack_response.md"
+ -8<- "docs/schemas/api_transfer_response.md"
!!! success
@@ -8855,7 +5272,8 @@ LITE ENDPOINT: lite/v1/withdrawal
``` { .json .copy }
{
"result": {
- "ack": "true"
+ "ack": "true",
+ "tx_id": "1028403"
}
}
```
@@ -8863,7 +5281,8 @@ LITE ENDPOINT: lite/v1/withdrawal
``` { .json .copy }
{
"r": {
- "a": "true"
+ "a": "true",
+ "ti": "1028403"
}
}
```
@@ -8879,7 +5298,13 @@ LITE ENDPOINT: lite/v1/withdrawal
|1003|400|Request could not be processed due to malformed syntax|
|1006|429|You have surpassed the allocated rate limit for your tier|
|1008|401|Your IP has not been whitelisted for access|
- |4010|400|This wallet is not supported. Please try another wallet.|
+ |5000|400|Transfer Metadata does not match the expected structure.|
+ |5001|400|Transfer Provider does not match the expected provider.|
+ |4002|400|Transfer failed with an unrefined failure reason, please report to GRVT|
+ |5002|400|Direction of the transfer does not match the expected direction.|
+ |5003|400|Endpoint account ID is invalid.|
+ |5004|400|Funding account does not exist in our system.|
+ |5005|400|Invalid ChainID for the transfer request.|
!!! failure
@@ -8908,12 +5333,14 @@ LITE ENDPOINT: lite/v1/withdrawal
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/withdrawal' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/transfer' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
"signature": {
@@ -8923,7 +5350,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"expiration": "1697788800000000000",
"nonce": 1234567890
- }
+ },
+ "transfer_type": "STANDARD",
+ "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
}
'
```
@@ -8935,10 +5364,12 @@ LITE ENDPOINT: lite/v1/withdrawal
-x '
{
"jsonrpc": "2.0",
- "method": "v1/withdrawal",
+ "method": "v1/transfer",
"params": {
"from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
"signature": {
@@ -8948,7 +5379,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"expiration": "1697788800000000000",
"nonce": 1234567890
- }
+ },
+ "transfer_type": "STANDARD",
+ "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
},
"id": 123
}
@@ -8958,12 +5391,14 @@ LITE ENDPOINT: lite/v1/withdrawal
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/withdrawal' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/transfer' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
"nt": "1500.0",
"s": {
@@ -8973,7 +5408,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"e": "1697788800000000000",
"n": 1234567890
- }
+ },
+ "tt": "STANDARD",
+ "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
}
'
```
@@ -8985,10 +5422,12 @@ LITE ENDPOINT: lite/v1/withdrawal
-x '
{
"j": "2.0",
- "m": "v1/withdrawal",
+ "m": "v1/transfer",
"p": {
"fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
"nt": "1500.0",
"s": {
@@ -8998,7 +5437,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"e": "1697788800000000000",
"n": 1234567890
- }
+ },
+ "tt": "STANDARD",
+ "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
},
"i": 123
}
@@ -9009,12 +5450,14 @@ LITE ENDPOINT: lite/v1/withdrawal
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/withdrawal' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/transfer' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
"signature": {
@@ -9024,7 +5467,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"expiration": "1697788800000000000",
"nonce": 1234567890
- }
+ },
+ "transfer_type": "STANDARD",
+ "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
}
'
```
@@ -9036,10 +5481,12 @@ LITE ENDPOINT: lite/v1/withdrawal
-x '
{
"jsonrpc": "2.0",
- "method": "v1/withdrawal",
+ "method": "v1/transfer",
"params": {
"from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
"signature": {
@@ -9049,7 +5496,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"expiration": "1697788800000000000",
"nonce": 1234567890
- }
+ },
+ "transfer_type": "STANDARD",
+ "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
},
"id": 123
}
@@ -9059,12 +5508,14 @@ LITE ENDPOINT: lite/v1/withdrawal
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/withdrawal' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/transfer' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
"nt": "1500.0",
"s": {
@@ -9074,7 +5525,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"e": "1697788800000000000",
"n": 1234567890
- }
+ },
+ "tt": "STANDARD",
+ "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
}
'
```
@@ -9086,10 +5539,12 @@ LITE ENDPOINT: lite/v1/withdrawal
-x '
{
"j": "2.0",
- "m": "v1/withdrawal",
+ "m": "v1/transfer",
"p": {
"fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
"nt": "1500.0",
"s": {
@@ -9099,7 +5554,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"e": "1697788800000000000",
"n": 1234567890
- }
+ },
+ "tt": "STANDARD",
+ "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
},
"i": 123
}
@@ -9110,12 +5567,14 @@ LITE ENDPOINT: lite/v1/withdrawal
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/withdrawal' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/transfer' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
"signature": {
@@ -9125,7 +5584,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"expiration": "1697788800000000000",
"nonce": 1234567890
- }
+ },
+ "transfer_type": "STANDARD",
+ "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
}
'
```
@@ -9137,10 +5598,12 @@ LITE ENDPOINT: lite/v1/withdrawal
-x '
{
"jsonrpc": "2.0",
- "method": "v1/withdrawal",
+ "method": "v1/transfer",
"params": {
"from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
"signature": {
@@ -9150,7 +5613,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"expiration": "1697788800000000000",
"nonce": 1234567890
- }
+ },
+ "transfer_type": "STANDARD",
+ "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
},
"id": 123
}
@@ -9160,12 +5625,14 @@ LITE ENDPOINT: lite/v1/withdrawal
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/withdrawal' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/transfer' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
"nt": "1500.0",
"s": {
@@ -9175,7 +5642,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"e": "1697788800000000000",
"n": 1234567890
- }
+ },
+ "tt": "STANDARD",
+ "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
}
'
```
@@ -9187,10 +5656,12 @@ LITE ENDPOINT: lite/v1/withdrawal
-x '
{
"j": "2.0",
- "m": "v1/withdrawal",
+ "m": "v1/transfer",
"p": {
"fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
"nt": "1500.0",
"s": {
@@ -9200,7 +5671,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"e": "1697788800000000000",
"n": 1234567890
- }
+ },
+ "tt": "STANDARD",
+ "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
},
"i": 123
}
@@ -9211,12 +5684,14 @@ LITE ENDPOINT: lite/v1/withdrawal
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/withdrawal' \
+ curl --location 'https://trades.grvt.io/full/v1/transfer' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
"signature": {
@@ -9226,7 +5701,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"expiration": "1697788800000000000",
"nonce": 1234567890
- }
+ },
+ "transfer_type": "STANDARD",
+ "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
}
'
```
@@ -9238,10 +5715,12 @@ LITE ENDPOINT: lite/v1/withdrawal
-x '
{
"jsonrpc": "2.0",
- "method": "v1/withdrawal",
+ "method": "v1/transfer",
"params": {
"from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
"signature": {
@@ -9251,7 +5730,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"expiration": "1697788800000000000",
"nonce": 1234567890
- }
+ },
+ "transfer_type": "STANDARD",
+ "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
},
"id": 123
}
@@ -9261,12 +5742,14 @@ LITE ENDPOINT: lite/v1/withdrawal
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/withdrawal' \
+ curl --location 'https://trades.grvt.io/lite/v1/transfer' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
"fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
"nt": "1500.0",
"s": {
@@ -9276,7 +5759,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"e": "1697788800000000000",
"n": 1234567890
- }
+ },
+ "tt": "STANDARD",
+ "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
}
'
```
@@ -9288,10 +5773,12 @@ LITE ENDPOINT: lite/v1/withdrawal
-x '
{
"j": "2.0",
- "m": "v1/withdrawal",
+ "m": "v1/transfer",
"p": {
"fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
"nt": "1500.0",
"s": {
@@ -9301,7 +5788,9 @@ LITE ENDPOINT: lite/v1/withdrawal
"v": 28,
"e": "1697788800000000000",
"n": 1234567890
- }
+ },
+ "tt": "STANDARD",
+ "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"}
},
"i": 123
}
@@ -9309,15 +5798,15 @@ LITE ENDPOINT: lite/v1/withdrawal
```
-### Withdrawal History
+### Transfer History
```
-FULL ENDPOINT: full/v1/withdrawal_history
-LITE ENDPOINT: lite/v1/withdrawal_history
+FULL ENDPOINT: full/v1/transfer_history
+LITE ENDPOINT: lite/v1/transfer_history
```
=== "Request"
- -8<- "docs/schemas/api_withdrawal_history_request.md"
+ -8<- "docs/schemas/api_transfer_history_request.md"
!!! question "Query"
@@ -9329,6 +5818,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
+ "tx_id": "1028403",
"main_account_id": null
}
```
@@ -9340,13 +5830,14 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"et": "1697788800000000000",
"l": 500,
"c1": "",
+ "ti": "1028403",
"ma": null
}
```
=== "Response"
- -8<- "docs/schemas/api_withdrawal_history_response.md"
+ -8<- "docs/schemas/api_transfer_history_response.md"
!!! success
@@ -9356,7 +5847,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"result": [{
"tx_id": "1028403",
"from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"currency": "USDT",
"num_tokens": "1500.0",
"signature": {
@@ -9367,7 +5860,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"expiration": "1697788800000000000",
"nonce": 1234567890
},
- "event_time": "1697788800000000000"
+ "event_time": "1697788800000000000",
+ "transfer_type": "STANDARD",
+ "transfer_metadata": null
}],
"next": "Qw0918="
}
@@ -9378,7 +5873,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"r": [{
"ti": "1028403",
"fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "fs": "'$GRVT_SUB_ACCOUNT_ID'",
+ "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "ts": "'$GRVT_SUB_ACCOUNT_ID'",
"c": "USDT",
"nt": "1500.0",
"s": {
@@ -9389,7 +5886,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"e": "1697788800000000000",
"n": 1234567890
},
- "et": "1697788800000000000"
+ "et": "1697788800000000000",
+ "tt": "STANDARD",
+ "tm": null
}],
"n": "Qw0918="
}
@@ -9434,7 +5933,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/withdrawal_history' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/transfer_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -9443,6 +5942,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
+ "tx_id": "1028403",
"main_account_id": null
}
'
@@ -9455,13 +5955,14 @@ LITE ENDPOINT: lite/v1/withdrawal_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/withdrawal_history",
+ "method": "v1/transfer_history",
"params": {
"currency": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
+ "tx_id": "1028403",
"main_account_id": null
},
"id": 123
@@ -9472,7 +5973,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/withdrawal_history' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/transfer_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -9481,6 +5982,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"et": "1697788800000000000",
"l": 500,
"c1": "",
+ "ti": "1028403",
"ma": null
}
'
@@ -9493,13 +5995,14 @@ LITE ENDPOINT: lite/v1/withdrawal_history
-x '
{
"j": "2.0",
- "m": "v1/withdrawal_history",
+ "m": "v1/transfer_history",
"p": {
"c": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
"c1": "",
+ "ti": "1028403",
"ma": null
},
"i": 123
@@ -9511,7 +6014,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/withdrawal_history' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/transfer_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -9520,6 +6023,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
+ "tx_id": "1028403",
"main_account_id": null
}
'
@@ -9532,13 +6036,14 @@ LITE ENDPOINT: lite/v1/withdrawal_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/withdrawal_history",
+ "method": "v1/transfer_history",
"params": {
"currency": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
+ "tx_id": "1028403",
"main_account_id": null
},
"id": 123
@@ -9549,7 +6054,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/withdrawal_history' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/transfer_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -9558,6 +6063,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"et": "1697788800000000000",
"l": 500,
"c1": "",
+ "ti": "1028403",
"ma": null
}
'
@@ -9570,13 +6076,14 @@ LITE ENDPOINT: lite/v1/withdrawal_history
-x '
{
"j": "2.0",
- "m": "v1/withdrawal_history",
+ "m": "v1/transfer_history",
"p": {
"c": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
"c1": "",
+ "ti": "1028403",
"ma": null
},
"i": 123
@@ -9588,7 +6095,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/withdrawal_history' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/transfer_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -9597,6 +6104,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
+ "tx_id": "1028403",
"main_account_id": null
}
'
@@ -9609,13 +6117,14 @@ LITE ENDPOINT: lite/v1/withdrawal_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/withdrawal_history",
+ "method": "v1/transfer_history",
"params": {
"currency": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
+ "tx_id": "1028403",
"main_account_id": null
},
"id": 123
@@ -9626,7 +6135,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/withdrawal_history' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/transfer_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -9635,6 +6144,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"et": "1697788800000000000",
"l": 500,
"c1": "",
+ "ti": "1028403",
"ma": null
}
'
@@ -9647,13 +6157,14 @@ LITE ENDPOINT: lite/v1/withdrawal_history
-x '
{
"j": "2.0",
- "m": "v1/withdrawal_history",
+ "m": "v1/transfer_history",
"p": {
"c": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
"c1": "",
+ "ti": "1028403",
"ma": null
},
"i": 123
@@ -9665,7 +6176,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/withdrawal_history' \
+ curl --location 'https://trades.grvt.io/full/v1/transfer_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -9674,6 +6185,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
+ "tx_id": "1028403",
"main_account_id": null
}
'
@@ -9686,13 +6198,14 @@ LITE ENDPOINT: lite/v1/withdrawal_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/withdrawal_history",
+ "method": "v1/transfer_history",
"params": {
"currency": ["USDT", "USDC"],
"start_time": "1697788800000000000",
"end_time": "1697788800000000000",
"limit": 500,
"cursor": "",
+ "tx_id": "1028403",
"main_account_id": null
},
"id": 123
@@ -9703,7 +6216,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/withdrawal_history' \
+ curl --location 'https://trades.grvt.io/lite/v1/transfer_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -9712,6 +6225,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history
"et": "1697788800000000000",
"l": 500,
"c1": "",
+ "ti": "1028403",
"ma": null
}
'
@@ -9724,13 +6238,14 @@ LITE ENDPOINT: lite/v1/withdrawal_history
-x '
{
"j": "2.0",
- "m": "v1/withdrawal_history",
+ "m": "v1/transfer_history",
"p": {
"c": ["USDT", "USDC"],
"st": "1697788800000000000",
"et": "1697788800000000000",
"l": 500,
"c1": "",
+ "ti": "1028403",
"ma": null
},
"i": 123
@@ -9739,52 +6254,73 @@ LITE ENDPOINT: lite/v1/withdrawal_history
```
-## PreDepositCheck
-### Pre Deposit Check
+### Withdrawal
```
-FULL ENDPOINT: full/v1/pre_deposit_check
-LITE ENDPOINT: lite/v1/pre_deposit_check
+FULL ENDPOINT: full/v1/withdrawal
+LITE ENDPOINT: lite/v1/withdrawal
```
=== "Request"
- -8<- "docs/schemas/api_pre_deposit_check_request.md"
+ -8<- "docs/schemas/api_withdrawal_request.md"
!!! question "Query"
**Full Request**
``` { .json .copy }
{
+ "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"currency": "USDT",
- "bridge": "XY"
+ "num_tokens": "1500.0",
+ "signature": {
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "expiration": "1697788800000000000",
+ "nonce": 1234567890
+ }
}
```
**Lite Request**
``` { .json .copy }
{
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"c": "USDT",
- "b": "XY"
+ "nt": "1500.0",
+ "s": {
+ "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "e": "1697788800000000000",
+ "n": 1234567890
+ }
}
```
=== "Response"
- -8<- "docs/schemas/api_pre_deposit_check_response.md"
+ -8<- "docs/schemas/ack_response.md"
!!! success
**Full Response**
``` { .json .copy }
{
- "max_deposit_limit": "3945034.23",
- "currency": "USDT"
+ "result": {
+ "ack": "true"
+ }
}
```
**Lite Response**
``` { .json .copy }
{
- "md": "3945034.23",
- "c": "USDT"
+ "r": {
+ "a": "true"
+ }
}
```
@@ -9793,11 +6329,13 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
!!! info "Error Codes"
|Code|HttpStatus| Description |
|-|-|-|
+ |1000|401|You need to authenticate prior to using this functionality|
+ |1001|403|You are not authorized to access this functionality|
|1002|500|Internal Server Error|
|1003|400|Request could not be processed due to malformed syntax|
|1006|429|You have surpassed the allocated rate limit for your tier|
- |1007|404|The currency you are requesting for is not currently supported|
|1008|401|Your IP has not been whitelisted for access|
+ |4010|400|This wallet is not supported. Please try another wallet.|
!!! failure
@@ -9805,18 +6343,18 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
``` { .json .copy }
{
"request_id":1,
- "code":1002,
- "message":"Internal Server Error",
- "status":500
+ "code":1000,
+ "message":"You need to authenticate prior to using this functionality",
+ "status":401
}
```
**Lite Error Response**
``` { .json .copy }
{
"ri":1,
- "c":1002,
- "m":"Internal Server Error",
- "s":500
+ "c":1000,
+ "m":"You need to authenticate prior to using this functionality",
+ "s":401
}
```
@@ -9826,12 +6364,22 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/pre_deposit_check' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/withdrawal' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"currency": "USDT",
- "bridge": "XY"
+ "num_tokens": "1500.0",
+ "signature": {
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "expiration": "1697788800000000000",
+ "nonce": 1234567890
+ }
}
'
```
@@ -9843,10 +6391,20 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
-x '
{
"jsonrpc": "2.0",
- "method": "v1/pre_deposit_check",
+ "method": "v1/withdrawal",
"params": {
+ "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"currency": "USDT",
- "bridge": "XY"
+ "num_tokens": "1500.0",
+ "signature": {
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "expiration": "1697788800000000000",
+ "nonce": 1234567890
+ }
},
"id": 123
}
@@ -9856,12 +6414,22 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/pre_deposit_check' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/withdrawal' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"c": "USDT",
- "b": "XY"
+ "nt": "1500.0",
+ "s": {
+ "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "e": "1697788800000000000",
+ "n": 1234567890
+ }
}
'
```
@@ -9873,10 +6441,20 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
-x '
{
"j": "2.0",
- "m": "v1/pre_deposit_check",
+ "m": "v1/withdrawal",
"p": {
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"c": "USDT",
- "b": "XY"
+ "nt": "1500.0",
+ "s": {
+ "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "e": "1697788800000000000",
+ "n": 1234567890
+ }
},
"i": 123
}
@@ -9887,12 +6465,22 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/pre_deposit_check' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/withdrawal' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"currency": "USDT",
- "bridge": "XY"
+ "num_tokens": "1500.0",
+ "signature": {
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "expiration": "1697788800000000000",
+ "nonce": 1234567890
+ }
}
'
```
@@ -9904,10 +6492,20 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
-x '
{
"jsonrpc": "2.0",
- "method": "v1/pre_deposit_check",
+ "method": "v1/withdrawal",
"params": {
+ "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"currency": "USDT",
- "bridge": "XY"
+ "num_tokens": "1500.0",
+ "signature": {
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "expiration": "1697788800000000000",
+ "nonce": 1234567890
+ }
},
"id": 123
}
@@ -9917,12 +6515,22 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/pre_deposit_check' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/withdrawal' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"c": "USDT",
- "b": "XY"
+ "nt": "1500.0",
+ "s": {
+ "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "e": "1697788800000000000",
+ "n": 1234567890
+ }
}
'
```
@@ -9934,10 +6542,20 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
-x '
{
"j": "2.0",
- "m": "v1/pre_deposit_check",
+ "m": "v1/withdrawal",
"p": {
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"c": "USDT",
- "b": "XY"
+ "nt": "1500.0",
+ "s": {
+ "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "e": "1697788800000000000",
+ "n": 1234567890
+ }
},
"i": 123
}
@@ -9948,12 +6566,22 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/pre_deposit_check' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/withdrawal' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"currency": "USDT",
- "bridge": "XY"
+ "num_tokens": "1500.0",
+ "signature": {
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "expiration": "1697788800000000000",
+ "nonce": 1234567890
+ }
}
'
```
@@ -9965,10 +6593,20 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
-x '
{
"jsonrpc": "2.0",
- "method": "v1/pre_deposit_check",
+ "method": "v1/withdrawal",
"params": {
+ "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"currency": "USDT",
- "bridge": "XY"
+ "num_tokens": "1500.0",
+ "signature": {
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "expiration": "1697788800000000000",
+ "nonce": 1234567890
+ }
},
"id": 123
}
@@ -9978,12 +6616,22 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/pre_deposit_check' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/withdrawal' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"c": "USDT",
- "b": "XY"
+ "nt": "1500.0",
+ "s": {
+ "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "e": "1697788800000000000",
+ "n": 1234567890
+ }
}
'
```
@@ -9995,10 +6643,20 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
-x '
{
"j": "2.0",
- "m": "v1/pre_deposit_check",
+ "m": "v1/withdrawal",
"p": {
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"c": "USDT",
- "b": "XY"
+ "nt": "1500.0",
+ "s": {
+ "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "e": "1697788800000000000",
+ "n": 1234567890
+ }
},
"i": 123
}
@@ -10009,12 +6667,22 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/pre_deposit_check' \
+ curl --location 'https://trades.grvt.io/full/v1/withdrawal' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"currency": "USDT",
- "bridge": "XY"
+ "num_tokens": "1500.0",
+ "signature": {
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "expiration": "1697788800000000000",
+ "nonce": 1234567890
+ }
}
'
```
@@ -10026,10 +6694,20 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
-x '
{
"jsonrpc": "2.0",
- "method": "v1/pre_deposit_check",
+ "method": "v1/withdrawal",
"params": {
+ "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"currency": "USDT",
- "bridge": "XY"
+ "num_tokens": "1500.0",
+ "signature": {
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "expiration": "1697788800000000000",
+ "nonce": 1234567890
+ }
},
"id": 123
}
@@ -10039,12 +6717,22 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/pre_deposit_check' \
+ curl --location 'https://trades.grvt.io/lite/v1/withdrawal' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"c": "USDT",
- "b": "XY"
+ "nt": "1500.0",
+ "s": {
+ "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "e": "1697788800000000000",
+ "n": 1234567890
+ }
}
'
```
@@ -10056,10 +6744,20 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
-x '
{
"j": "2.0",
- "m": "v1/pre_deposit_check",
+ "m": "v1/withdrawal",
"p": {
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
"c": "USDT",
- "b": "XY"
+ "nt": "1500.0",
+ "s": {
+ "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "e": "1697788800000000000",
+ "n": 1234567890
+ }
},
"i": 123
}
@@ -10067,114 +6765,89 @@ LITE ENDPOINT: lite/v1/pre_deposit_check
```
-## Account
-### Sub Account Summary
+### Withdrawal History
```
-FULL ENDPOINT: full/v1/account_summary
-LITE ENDPOINT: lite/v1/account_summary
+FULL ENDPOINT: full/v1/withdrawal_history
+LITE ENDPOINT: lite/v1/withdrawal_history
```
=== "Request"
- -8<- "docs/schemas/api_sub_account_summary_request.md"
+ -8<- "docs/schemas/api_withdrawal_history_request.md"
!!! question "Query"
**Full Request**
``` { .json .copy }
{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
+ "currency": ["USDT", "USDC"],
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": "",
+ "main_account_id": null
}
```
**Lite Request**
``` { .json .copy }
{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
+ "c": ["USDT", "USDC"],
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c1": "",
+ "ma": null
}
```
=== "Response"
- -8<- "docs/schemas/api_sub_account_summary_response.md"
+ -8<- "docs/schemas/api_withdrawal_history_response.md"
!!! success
**Full Response**
``` { .json .copy }
{
- "result": {
- "event_time": "1697788800000000000",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "margin_type": "SIMPLE_CROSS_MARGIN",
- "settle_currency": "USDT",
- "unrealized_pnl": "123456.78",
- "total_equity": "123456.78",
- "initial_margin": "123456.78",
- "maintenance_margin": "123456.78",
- "available_balance": "123456.78",
- "spot_balances": [{
- "currency": "USDT",
- "balance": "123456.78",
- "index_price": "1.0000102"
- }],
- "positions": [{
- "event_time": "1697788800000000000",
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "instrument": "BTC_USDT_Perp",
- "size": "2635000.50",
- "notional": "2635000.50",
- "entry_price": "65038.01",
- "exit_price": "65038.01",
- "mark_price": "65038.01",
- "unrealized_pnl": "135000.50",
- "realized_pnl": "-35000.30",
- "total_pnl": "100000.20",
- "roi": "10.20",
- "quote_index_price": "1.0000102",
- "est_liquidation_price": 60000.25,
- "leverage": "10"
- }],
- "settle_index_price": "1.0000102"
- }
+ "result": [{
+ "tx_id": "1028403",
+ "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "currency": "USDT",
+ "num_tokens": "1500.0",
+ "signature": {
+ "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "expiration": "1697788800000000000",
+ "nonce": 1234567890
+ },
+ "event_time": "1697788800000000000"
+ }],
+ "next": "Qw0918="
}
```
**Lite Response**
``` { .json .copy }
{
- "r": {
- "et": "1697788800000000000",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "mt": "SIMPLE_CROSS_MARGIN",
- "sc": "USDT",
- "up": "123456.78",
- "te": "123456.78",
- "im": "123456.78",
- "mm": "123456.78",
- "ab": "123456.78",
- "sb": [{
- "c": "USDT",
- "b": "123456.78",
- "ip": "1.0000102"
- }],
- "p": [{
- "et": "1697788800000000000",
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "i": "BTC_USDT_Perp",
- "s": "2635000.50",
- "n": "2635000.50",
- "ep": "65038.01",
- "ep1": "65038.01",
- "mp": "65038.01",
- "up": "135000.50",
- "rp": "-35000.30",
- "tp": "100000.20",
- "r": "10.20",
- "qi": "1.0000102",
- "el": 60000.25,
- "l": "10"
- }],
- "si": "1.0000102"
- }
+ "r": [{
+ "ti": "1028403",
+ "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "c": "USDT",
+ "nt": "1500.0",
+ "s": {
+ "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8",
+ "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d",
+ "v": 28,
+ "e": "1697788800000000000",
+ "n": 1234567890
+ },
+ "et": "1697788800000000000"
+ }],
+ "n": "Qw0918="
}
```
@@ -10217,11 +6890,16 @@ LITE ENDPOINT: lite/v1/account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/account_summary' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/withdrawal_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
+ "currency": ["USDT", "USDC"],
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": "",
+ "main_account_id": null
}
'
```
@@ -10233,9 +6911,14 @@ LITE ENDPOINT: lite/v1/account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/account_summary",
+ "method": "v1/withdrawal_history",
"params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
+ "currency": ["USDT", "USDC"],
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": "",
+ "main_account_id": null
},
"id": 123
}
@@ -10245,11 +6928,16 @@ LITE ENDPOINT: lite/v1/account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/account_summary' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/withdrawal_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
+ "c": ["USDT", "USDC"],
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c1": "",
+ "ma": null
}
'
```
@@ -10261,9 +6949,14 @@ LITE ENDPOINT: lite/v1/account_summary
-x '
{
"j": "2.0",
- "m": "v1/account_summary",
+ "m": "v1/withdrawal_history",
"p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
+ "c": ["USDT", "USDC"],
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c1": "",
+ "ma": null
},
"i": 123
}
@@ -10274,11 +6967,16 @@ LITE ENDPOINT: lite/v1/account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/account_summary' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/withdrawal_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
+ "currency": ["USDT", "USDC"],
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": "",
+ "main_account_id": null
}
'
```
@@ -10290,9 +6988,14 @@ LITE ENDPOINT: lite/v1/account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/account_summary",
+ "method": "v1/withdrawal_history",
"params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
+ "currency": ["USDT", "USDC"],
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": "",
+ "main_account_id": null
},
"id": 123
}
@@ -10302,11 +7005,16 @@ LITE ENDPOINT: lite/v1/account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/account_summary' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/withdrawal_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
+ "c": ["USDT", "USDC"],
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c1": "",
+ "ma": null
}
'
```
@@ -10318,9 +7026,14 @@ LITE ENDPOINT: lite/v1/account_summary
-x '
{
"j": "2.0",
- "m": "v1/account_summary",
+ "m": "v1/withdrawal_history",
"p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
+ "c": ["USDT", "USDC"],
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c1": "",
+ "ma": null
},
"i": 123
}
@@ -10331,11 +7044,16 @@ LITE ENDPOINT: lite/v1/account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/account_summary' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/withdrawal_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
+ "currency": ["USDT", "USDC"],
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": "",
+ "main_account_id": null
}
'
```
@@ -10347,9 +7065,14 @@ LITE ENDPOINT: lite/v1/account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/account_summary",
+ "method": "v1/withdrawal_history",
"params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
+ "currency": ["USDT", "USDC"],
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": "",
+ "main_account_id": null
},
"id": 123
}
@@ -10359,11 +7082,16 @@ LITE ENDPOINT: lite/v1/account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/account_summary' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/withdrawal_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
+ "c": ["USDT", "USDC"],
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c1": "",
+ "ma": null
}
'
```
@@ -10375,9 +7103,14 @@ LITE ENDPOINT: lite/v1/account_summary
-x '
{
"j": "2.0",
- "m": "v1/account_summary",
+ "m": "v1/withdrawal_history",
"p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
+ "c": ["USDT", "USDC"],
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c1": "",
+ "ma": null
},
"i": 123
}
@@ -10388,11 +7121,16 @@ LITE ENDPOINT: lite/v1/account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/account_summary' \
+ curl --location 'https://trades.grvt.io/full/v1/withdrawal_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
+ "currency": ["USDT", "USDC"],
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": "",
+ "main_account_id": null
}
'
```
@@ -10404,9 +7142,14 @@ LITE ENDPOINT: lite/v1/account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/account_summary",
+ "method": "v1/withdrawal_history",
"params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
+ "currency": ["USDT", "USDC"],
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": "",
+ "main_account_id": null
},
"id": 123
}
@@ -10416,11 +7159,16 @@ LITE ENDPOINT: lite/v1/account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/account_summary' \
+ curl --location 'https://trades.grvt.io/lite/v1/withdrawal_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
+ "c": ["USDT", "USDC"],
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c1": "",
+ "ma": null
}
'
```
@@ -10432,9 +7180,14 @@ LITE ENDPOINT: lite/v1/account_summary
-x '
{
"j": "2.0",
- "m": "v1/account_summary",
+ "m": "v1/withdrawal_history",
"p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
+ "c": ["USDT", "USDC"],
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c1": "",
+ "ma": null
},
"i": 123
}
@@ -10442,49 +7195,42 @@ LITE ENDPOINT: lite/v1/account_summary
```
-### Sub Account History
+## Account
+### Sub Account Summary
```
-FULL ENDPOINT: full/v1/account_history
-LITE ENDPOINT: lite/v1/account_history
+FULL ENDPOINT: full/v1/account_summary
+LITE ENDPOINT: lite/v1/account_summary
```
=== "Request"
- -8<- "docs/schemas/api_sub_account_history_request.md"
+ -8<- "docs/schemas/api_sub_account_summary_request.md"
!!! question "Query"
**Full Request**
``` { .json .copy }
{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
}
```
**Lite Request**
``` { .json .copy }
{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'"
}
```
=== "Response"
- -8<- "docs/schemas/api_sub_account_history_response.md"
+ -8<- "docs/schemas/api_sub_account_summary_response.md"
!!! success
**Full Response**
``` { .json .copy }
{
- "result": [{
+ "result": {
"event_time": "1697788800000000000",
"sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
"margin_type": "SIMPLE_CROSS_MARGIN",
@@ -10517,14 +7263,13 @@ LITE ENDPOINT: lite/v1/account_history
"leverage": "10"
}],
"settle_index_price": "1.0000102"
- }],
- "next": "Qw0918="
+ }
}
```
**Lite Response**
``` { .json .copy }
{
- "r": [{
+ "r": {
"et": "1697788800000000000",
"sa": "'$GRVT_SUB_ACCOUNT_ID'",
"mt": "SIMPLE_CROSS_MARGIN",
@@ -10557,8 +7302,7 @@ LITE ENDPOINT: lite/v1/account_history
"l": "10"
}],
"si": "1.0000102"
- }],
- "n": "Qw0918="
+ }
}
```
@@ -10601,15 +7345,11 @@ LITE ENDPOINT: lite/v1/account_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/account_history' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
}
'
```
@@ -10621,13 +7361,9 @@ LITE ENDPOINT: lite/v1/account_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/account_history",
+ "method": "v1/account_summary",
"params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
},
"id": 123
}
@@ -10637,15 +7373,11 @@ LITE ENDPOINT: lite/v1/account_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/account_history' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'"
}
'
```
@@ -10657,13 +7389,9 @@ LITE ENDPOINT: lite/v1/account_history
-x '
{
"j": "2.0",
- "m": "v1/account_history",
+ "m": "v1/account_summary",
"p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'"
},
"i": 123
}
@@ -10674,15 +7402,11 @@ LITE ENDPOINT: lite/v1/account_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/account_history' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
}
'
```
@@ -10694,13 +7418,9 @@ LITE ENDPOINT: lite/v1/account_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/account_history",
+ "method": "v1/account_summary",
"params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
},
"id": 123
}
@@ -10710,15 +7430,11 @@ LITE ENDPOINT: lite/v1/account_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/account_history' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'"
}
'
```
@@ -10730,13 +7446,9 @@ LITE ENDPOINT: lite/v1/account_history
-x '
{
"j": "2.0",
- "m": "v1/account_history",
+ "m": "v1/account_summary",
"p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'"
},
"i": 123
}
@@ -10747,15 +7459,11 @@ LITE ENDPOINT: lite/v1/account_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/account_history' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
}
'
```
@@ -10767,13 +7475,9 @@ LITE ENDPOINT: lite/v1/account_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/account_history",
+ "method": "v1/account_summary",
"params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
},
"id": 123
}
@@ -10783,15 +7487,11 @@ LITE ENDPOINT: lite/v1/account_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/account_history' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'"
}
'
```
@@ -10803,13 +7503,9 @@ LITE ENDPOINT: lite/v1/account_history
-x '
{
"j": "2.0",
- "m": "v1/account_history",
+ "m": "v1/account_summary",
"p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'"
},
"i": 123
}
@@ -10820,15 +7516,11 @@ LITE ENDPOINT: lite/v1/account_history
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/account_history' \
+ curl --location 'https://trades.grvt.io/full/v1/account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
}
'
```
@@ -10840,13 +7532,9 @@ LITE ENDPOINT: lite/v1/account_history
-x '
{
"jsonrpc": "2.0",
- "method": "v1/account_history",
+ "method": "v1/account_summary",
"params": {
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
- "start_time": "1697788800000000000",
- "end_time": "1697788800000000000",
- "limit": 500,
- "cursor": ""
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
},
"id": 123
}
@@ -10856,15 +7544,11 @@ LITE ENDPOINT: lite/v1/account_history
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/account_history' \
+ curl --location 'https://trades.grvt.io/lite/v1/account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'"
}
'
```
@@ -10876,13 +7560,9 @@ LITE ENDPOINT: lite/v1/account_history
-x '
{
"j": "2.0",
- "m": "v1/account_history",
+ "m": "v1/account_summary",
"p": {
- "sa": "'$GRVT_SUB_ACCOUNT_ID'",
- "st": "1697788800000000000",
- "et": "1697788800000000000",
- "l": 500,
- "c": ""
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'"
},
"i": 123
}
@@ -10890,61 +7570,123 @@ LITE ENDPOINT: lite/v1/account_history
```
-### Aggregated Account Summary
+### Sub Account History
```
-FULL ENDPOINT: full/v1/aggregated_account_summary
-LITE ENDPOINT: lite/v1/aggregated_account_summary
+FULL ENDPOINT: full/v1/account_history
+LITE ENDPOINT: lite/v1/account_history
```
=== "Request"
- -8<- "docs/schemas/empty_request.md"
+ -8<- "docs/schemas/api_sub_account_history_request.md"
!!! question "Query"
**Full Request**
``` { .json .copy }
{
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
}
```
**Lite Request**
``` { .json .copy }
{
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
}
```
=== "Response"
- -8<- "docs/schemas/api_aggregated_account_summary_response.md"
+ -8<- "docs/schemas/api_sub_account_history_response.md"
!!! success
**Full Response**
``` { .json .copy }
{
- "result": {
- "main_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "total_equity": "3945034.23",
+ "result": [{
+ "event_time": "1697788800000000000",
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "margin_type": "SIMPLE_CROSS_MARGIN",
+ "settle_currency": "USDT",
+ "unrealized_pnl": "123456.78",
+ "total_equity": "123456.78",
+ "initial_margin": "123456.78",
+ "maintenance_margin": "123456.78",
+ "available_balance": "123456.78",
"spot_balances": [{
"currency": "USDT",
"balance": "123456.78",
"index_price": "1.0000102"
- }]
- }
+ }],
+ "positions": [{
+ "event_time": "1697788800000000000",
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "instrument": "BTC_USDT_Perp",
+ "size": "2635000.50",
+ "notional": "2635000.50",
+ "entry_price": "65038.01",
+ "exit_price": "65038.01",
+ "mark_price": "65038.01",
+ "unrealized_pnl": "135000.50",
+ "realized_pnl": "-35000.30",
+ "total_pnl": "100000.20",
+ "roi": "10.20",
+ "quote_index_price": "1.0000102",
+ "est_liquidation_price": 60000.25,
+ "leverage": "10"
+ }],
+ "settle_index_price": "1.0000102"
+ }],
+ "next": "Qw0918="
}
```
**Lite Response**
``` { .json .copy }
{
- "r": {
- "ma": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "te": "3945034.23",
+ "r": [{
+ "et": "1697788800000000000",
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "mt": "SIMPLE_CROSS_MARGIN",
+ "sc": "USDT",
+ "up": "123456.78",
+ "te": "123456.78",
+ "im": "123456.78",
+ "mm": "123456.78",
+ "ab": "123456.78",
"sb": [{
"c": "USDT",
"b": "123456.78",
"ip": "1.0000102"
- }]
- }
+ }],
+ "p": [{
+ "et": "1697788800000000000",
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "i": "BTC_USDT_Perp",
+ "s": "2635000.50",
+ "n": "2635000.50",
+ "ep": "65038.01",
+ "ep1": "65038.01",
+ "mp": "65038.01",
+ "up": "135000.50",
+ "rp": "-35000.30",
+ "tp": "100000.20",
+ "r": "10.20",
+ "qi": "1.0000102",
+ "el": 60000.25,
+ "l": "10"
+ }],
+ "si": "1.0000102"
+ }],
+ "n": "Qw0918="
}
```
@@ -10953,6 +7695,8 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
!!! info "Error Codes"
|Code|HttpStatus| Description |
|-|-|-|
+ |1000|401|You need to authenticate prior to using this functionality|
+ |1001|403|You are not authorized to access this functionality|
|1002|500|Internal Server Error|
|1003|400|Request could not be processed due to malformed syntax|
|1006|429|You have surpassed the allocated rate limit for your tier|
@@ -10964,18 +7708,18 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
``` { .json .copy }
{
"request_id":1,
- "code":1002,
- "message":"Internal Server Error",
- "status":500
+ "code":1000,
+ "message":"You need to authenticate prior to using this functionality",
+ "status":401
}
```
**Lite Error Response**
``` { .json .copy }
{
"ri":1,
- "c":1002,
- "m":"Internal Server Error",
- "s":500
+ "c":1000,
+ "m":"You need to authenticate prior to using this functionality",
+ "s":401
}
```
@@ -10985,10 +7729,15 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/aggregated_account_summary' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/account_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
}
'
```
@@ -11000,8 +7749,13 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/aggregated_account_summary",
+ "method": "v1/account_history",
"params": {
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
},
"id": 123
}
@@ -11011,10 +7765,15 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/aggregated_account_summary' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/account_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
}
'
```
@@ -11026,8 +7785,13 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
-x '
{
"j": "2.0",
- "m": "v1/aggregated_account_summary",
+ "m": "v1/account_history",
"p": {
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
},
"i": 123
}
@@ -11038,10 +7802,15 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/aggregated_account_summary' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/account_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
}
'
```
@@ -11053,8 +7822,13 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/aggregated_account_summary",
+ "method": "v1/account_history",
"params": {
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
},
"id": 123
}
@@ -11064,10 +7838,15 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/aggregated_account_summary' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/account_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
}
'
```
@@ -11079,8 +7858,13 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
-x '
{
"j": "2.0",
- "m": "v1/aggregated_account_summary",
+ "m": "v1/account_history",
"p": {
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
},
"i": 123
}
@@ -11091,10 +7875,15 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/aggregated_account_summary' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/account_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
}
'
```
@@ -11106,8 +7895,13 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/aggregated_account_summary",
+ "method": "v1/account_history",
"params": {
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
},
"id": 123
}
@@ -11117,10 +7911,15 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/aggregated_account_summary' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/account_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
}
'
```
@@ -11132,8 +7931,13 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
-x '
{
"j": "2.0",
- "m": "v1/aggregated_account_summary",
+ "m": "v1/account_history",
"p": {
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
},
"i": 123
}
@@ -11144,10 +7948,15 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/aggregated_account_summary' \
+ curl --location 'https://trades.grvt.io/full/v1/account_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
}
'
```
@@ -11159,8 +7968,13 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/aggregated_account_summary",
+ "method": "v1/account_history",
"params": {
+ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'",
+ "start_time": "1697788800000000000",
+ "end_time": "1697788800000000000",
+ "limit": 500,
+ "cursor": ""
},
"id": 123
}
@@ -11170,10 +7984,15 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/aggregated_account_summary' \
+ curl --location 'https://trades.grvt.io/lite/v1/account_history' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
}
'
```
@@ -11185,8 +8004,13 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
-x '
{
"j": "2.0",
- "m": "v1/aggregated_account_summary",
+ "m": "v1/account_history",
"p": {
+ "sa": "'$GRVT_SUB_ACCOUNT_ID'",
+ "st": "1697788800000000000",
+ "et": "1697788800000000000",
+ "l": 500,
+ "c": ""
},
"i": 123
}
@@ -11194,10 +8018,10 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
```
-### Funding Account Summary
+### Aggregated Account Summary
```
-FULL ENDPOINT: full/v1/funding_account_summary
-LITE ENDPOINT: lite/v1/funding_account_summary
+FULL ENDPOINT: full/v1/aggregated_account_summary
+LITE ENDPOINT: lite/v1/aggregated_account_summary
```
=== "Request"
@@ -11219,7 +8043,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
=== "Response"
- -8<- "docs/schemas/api_funding_account_summary_response.md"
+ -8<- "docs/schemas/api_aggregated_account_summary_response.md"
!!! success
@@ -11257,6 +8081,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! info "Error Codes"
|Code|HttpStatus| Description |
|-|-|-|
+ |1001|403|You are not authorized to access this functionality|
|1002|500|Internal Server Error|
|1003|400|Request could not be processed due to malformed syntax|
|1006|429|You have surpassed the allocated rate limit for your tier|
@@ -11268,18 +8093,18 @@ LITE ENDPOINT: lite/v1/funding_account_summary
``` { .json .copy }
{
"request_id":1,
- "code":1002,
- "message":"Internal Server Error",
- "status":500
+ "code":1001,
+ "message":"You are not authorized to access this functionality",
+ "status":403
}
```
**Lite Error Response**
``` { .json .copy }
{
"ri":1,
- "c":1002,
- "m":"Internal Server Error",
- "s":500
+ "c":1001,
+ "m":"You are not authorized to access this functionality",
+ "s":403
}
```
@@ -11289,7 +8114,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/funding_account_summary' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/aggregated_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11304,7 +8129,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/funding_account_summary",
+ "method": "v1/aggregated_account_summary",
"params": {
},
"id": 123
@@ -11315,7 +8140,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/funding_account_summary' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/aggregated_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11330,7 +8155,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
-x '
{
"j": "2.0",
- "m": "v1/funding_account_summary",
+ "m": "v1/aggregated_account_summary",
"p": {
},
"i": 123
@@ -11342,7 +8167,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/funding_account_summary' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/aggregated_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11357,7 +8182,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/funding_account_summary",
+ "method": "v1/aggregated_account_summary",
"params": {
},
"id": 123
@@ -11368,7 +8193,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/funding_account_summary' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/aggregated_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11383,7 +8208,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
-x '
{
"j": "2.0",
- "m": "v1/funding_account_summary",
+ "m": "v1/aggregated_account_summary",
"p": {
},
"i": 123
@@ -11395,7 +8220,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/funding_account_summary' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/aggregated_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11410,7 +8235,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/funding_account_summary",
+ "method": "v1/aggregated_account_summary",
"params": {
},
"id": 123
@@ -11421,7 +8246,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/funding_account_summary' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/aggregated_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11436,7 +8261,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
-x '
{
"j": "2.0",
- "m": "v1/funding_account_summary",
+ "m": "v1/aggregated_account_summary",
"p": {
},
"i": 123
@@ -11448,7 +8273,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/funding_account_summary' \
+ curl --location 'https://trades.grvt.io/full/v1/aggregated_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11463,7 +8288,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
-x '
{
"jsonrpc": "2.0",
- "method": "v1/funding_account_summary",
+ "method": "v1/aggregated_account_summary",
"params": {
},
"id": 123
@@ -11474,7 +8299,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/funding_account_summary' \
+ curl --location 'https://trades.grvt.io/lite/v1/aggregated_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11489,7 +8314,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
-x '
{
"j": "2.0",
- "m": "v1/funding_account_summary",
+ "m": "v1/aggregated_account_summary",
"p": {
},
"i": 123
@@ -11498,11 +8323,10 @@ LITE ENDPOINT: lite/v1/funding_account_summary
```
-## SocializedLoss
-### Socialized Loss Status
+### Funding Account Summary
```
-FULL ENDPOINT: full/v1/socialized_loss_status
-LITE ENDPOINT: lite/v1/socialized_loss_status
+FULL ENDPOINT: full/v1/funding_account_summary
+LITE ENDPOINT: lite/v1/funding_account_summary
```
=== "Request"
@@ -11524,22 +8348,36 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
=== "Response"
- -8<- "docs/schemas/api_socialized_loss_status_response.md"
+ -8<- "docs/schemas/api_funding_account_summary_response.md"
!!! success
**Full Response**
``` { .json .copy }
{
- "is_active": "false",
- "haircut_ratio": "0.34"
+ "result": {
+ "main_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "total_equity": "3945034.23",
+ "spot_balances": [{
+ "currency": "USDT",
+ "balance": "123456.78",
+ "index_price": "1.0000102"
+ }]
+ }
}
```
**Lite Response**
``` { .json .copy }
{
- "ia": "false",
- "hr": "0.34"
+ "r": {
+ "ma": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
+ "te": "3945034.23",
+ "sb": [{
+ "c": "USDT",
+ "b": "123456.78",
+ "ip": "1.0000102"
+ }]
+ }
}
```
@@ -11548,6 +8386,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
!!! info "Error Codes"
|Code|HttpStatus| Description |
|-|-|-|
+ |1001|403|You are not authorized to access this functionality|
|1002|500|Internal Server Error|
|1003|400|Request could not be processed due to malformed syntax|
|1006|429|You have surpassed the allocated rate limit for your tier|
@@ -11559,18 +8398,18 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
``` { .json .copy }
{
"request_id":1,
- "code":1002,
- "message":"Internal Server Error",
- "status":500
+ "code":1001,
+ "message":"You are not authorized to access this functionality",
+ "status":403
}
```
**Lite Error Response**
``` { .json .copy }
{
"ri":1,
- "c":1002,
- "m":"Internal Server Error",
- "s":500
+ "c":1001,
+ "m":"You are not authorized to access this functionality",
+ "s":403
}
```
@@ -11580,7 +8419,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/full/v1/socialized_loss_status' \
+ curl --location 'https://trades.dev.gravitymarkets.io/full/v1/funding_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11595,7 +8434,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
-x '
{
"jsonrpc": "2.0",
- "method": "v1/socialized_loss_status",
+ "method": "v1/funding_account_summary",
"params": {
},
"id": 123
@@ -11606,7 +8445,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/socialized_loss_status' \
+ curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/funding_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11621,7 +8460,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
-x '
{
"j": "2.0",
- "m": "v1/socialized_loss_status",
+ "m": "v1/funding_account_summary",
"p": {
},
"i": 123
@@ -11633,7 +8472,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/full/v1/socialized_loss_status' \
+ curl --location 'https://trades.staging.gravitymarkets.io/full/v1/funding_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11648,7 +8487,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
-x '
{
"jsonrpc": "2.0",
- "method": "v1/socialized_loss_status",
+ "method": "v1/funding_account_summary",
"params": {
},
"id": 123
@@ -11659,7 +8498,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/socialized_loss_status' \
+ curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/funding_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11674,7 +8513,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
-x '
{
"j": "2.0",
- "m": "v1/socialized_loss_status",
+ "m": "v1/funding_account_summary",
"p": {
},
"i": 123
@@ -11686,7 +8525,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/full/v1/socialized_loss_status' \
+ curl --location 'https://trades.testnet.grvt.io/full/v1/funding_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11701,7 +8540,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
-x '
{
"jsonrpc": "2.0",
- "method": "v1/socialized_loss_status",
+ "method": "v1/funding_account_summary",
"params": {
},
"id": 123
@@ -11712,7 +8551,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.testnet.grvt.io/lite/v1/socialized_loss_status' \
+ curl --location 'https://trades.testnet.grvt.io/lite/v1/funding_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11727,7 +8566,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
-x '
{
"j": "2.0",
- "m": "v1/socialized_loss_status",
+ "m": "v1/funding_account_summary",
"p": {
},
"i": 123
@@ -11739,7 +8578,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
!!! example "REST Full"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/full/v1/socialized_loss_status' \
+ curl --location 'https://trades.grvt.io/full/v1/funding_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11754,7 +8593,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
-x '
{
"jsonrpc": "2.0",
- "method": "v1/socialized_loss_status",
+ "method": "v1/funding_account_summary",
"params": {
},
"id": 123
@@ -11765,7 +8604,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
!!! example "REST Lite"
``` { .bash .copy }
- curl --location 'https://trades.grvt.io/lite/v1/socialized_loss_status' \
+ curl --location 'https://trades.grvt.io/lite/v1/funding_account_summary' \
--header "Cookie: $GRVT_COOKIE" \
--header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
--data '{
@@ -11780,7 +8619,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
-x '
{
"j": "2.0",
- "m": "v1/socialized_loss_status",
+ "m": "v1/funding_account_summary",
"p": {
},
"i": 123
diff --git a/artifacts/apidocs/trading_streams.md b/artifacts/apidocs/trading_streams.md
index c4bd5cd..d9344bf 100644
--- a/artifacts/apidocs/trading_streams.md
+++ b/artifacts/apidocs/trading_streams.md
@@ -136,7 +136,8 @@ STREAM: v1.order
"trigger_type": "TAKE_PROFIT",
"tpsl": {
"trigger_by": "LAST",
- "trigger_price": "65038.10"
+ "trigger_price": "65038.10",
+ "close_position": false
}
},
"broker": "BROKER_CODE"
@@ -186,7 +187,8 @@ STREAM: v1.order
"tt": "TAKE_PROFIT",
"t": {
"tb": "LAST",
- "tp": "65038.10"
+ "tp": "65038.10",
+ "cp": false
}
},
"b": "BROKER_CODE"
@@ -1877,601 +1879,6 @@ STREAM: v1.cancel
```
-### Order Group
-```
-STREAM: v1.group
-```
-
-=== "Feed Selector"
-
- -8<- "docs/schemas/ws_order_group_feed_selector_v1.md"
- ??? info "JSONRPC Wrappers"
- -8<- "docs/schemas/jsonrpc_request.md"
- -8<- "docs/schemas/jsonrpc_response.md"
- -8<- "docs/schemas/ws_subscribe_params.md"
- -8<- "docs/schemas/ws_subscribe_result.md"
- -8<- "docs/schemas/ws_unsubscribe_params.md"
- -8<- "docs/schemas/ws_unsubscribe_result.md"
- -8<- "docs/schemas/ws_subscribe_request_v1_legacy.md"
- -8<- "docs/schemas/ws_subscribe_response_v1_legacy.md"
-
-
- ???+ question "Subscribe"
- **Full Subscribe Request**
- ``` { .json .copy }
- {
- "jsonrpc": "2.0",
- "method": "subscribe",
- "params": {
- "stream": "v1.group",
- "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123
- }
- ```
- **Full Subscribe Response**
- ``` { .json .copy }
- {
- "jsonrpc": "2.0",
- "result": {
- "stream": "v1.group",
- "subs": ["'$GRVT_SUB_ACCOUNT_ID'"],
- "unsubs": [],
- "num_snapshots": [10],
- "first_sequence_number": [872634876]
- },
- "id": 123,
- "method": "subscribe"
- }
- ```
- ??? question "Unsubscribe"
- **Full Unsubscribe Request**
- ``` { .json .copy }
- {
- "jsonrpc": "2.0",
- "method": "unsubscribe",
- "params": {
- "stream": "v1.group",
- "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123
- }
- ```
- **Full Unsubscribe Response**
- ``` { .json .copy }
- {
- "jsonrpc": "2.0",
- "result": {
- "stream": "v1.group",
- "unsubs": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123,
- "method": "subscribe"
- }
- ```
- ??? question "Legacy Subscribe"
- **Full Subscribe Request**
- ``` { .json .copy }
- {
- "request_id":1,
- "stream":"v1.group",
- "feed":["'$GRVT_SUB_ACCOUNT_ID'"],
- "method":"subscribe",
- "is_full":true
- }
- ```
- **Full Subscribe Response**
- ``` { .json .copy }
- {
- "request_id":1,
- "stream":"v1.group",
- "subs":["'$GRVT_SUB_ACCOUNT_ID'"],
- "unsubs":[],
- "num_snapshots":[1],
- "first_sequence_number":[2813]
- }
- ```
-
-=== "Feed Data"
-
- -8<- "docs/schemas/ws_order_group_feed_data_v1.md"
-
-
- !!! success
- **Full Feed Response**
- ``` { .json .copy }
- {
- "stream": "v1.group",
- "selector": "'$GRVT_SUB_ACCOUNT_ID'",
- "sequence_number": "872634876",
- "feed": {
- "group_id": "0x10000101000203040506",
- "client_order_id": ["[23042, 54232]"],
- "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- }
- ```
- **Lite Feed Response**
- ``` { .json .copy }
- {
- "s": "v1.group",
- "s1": "'$GRVT_SUB_ACCOUNT_ID'",
- "sn": "872634876",
- "f": {
- "gi": "0x10000101000203040506",
- "co": ["[23042, 54232]"],
- "sa": "'$GRVT_SUB_ACCOUNT_ID'"
- }
- }
- ```
-
-=== "Errors"
-
- !!! info "Error Codes"
- |Code|HttpStatus| Description |
- |-|-|-|
- |1000|401|You need to authenticate prior to using this functionality|
- |1001|403|You are not authorized to access this functionality|
- |1002|500|Internal Server Error|
- |1008|401|Your IP has not been whitelisted for access|
- |1101|400|Feed Format must be in the format of @|
- |1102|400|Wrong number of primary selectors|
- |1103|400|Wrong number of secondary selectors|
- |1103|400|Wrong number of secondary selectors|
- |3000|400|Instrument is invalid|
- |3020|400|Sub account ID must be an uint64 integer|
- -8<- "docs/schemas/jsonrpc_response.md"
-
-
- !!! failure "Error"
- **Full Error Response**
- ``` { .json .copy }
- {
- "jsonrpc": "2.0",
- "error": {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality"
- },
- "id": 123,
- "method": "subscribe"
- }
- ```
- **Lite Error Response**
- ``` { .json .copy }
- {
- "j": "2.0",
- "e": {
- "c": 1000,
- "m": "You need to authenticate prior to using this functionality"
- },
- "i": 123,
- "m": "subscribe"
- }
- ```
- **Legacy Error Response**
- ``` { .json .copy }
- {
- "code":1000,
- "message":"You need to authenticate prior to using this functionality",
- "status":401
- }
- ```
-
-=== "Try it out"
- -8<- "sections/auth_closed.md"
- === "DEV"
-
- !!! example "Subscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "subscribe",
- "params": {
- "stream": "v1.group",
- "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123
- }
- ' -w 360
- ```
- !!! example "Unsubscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "unsubscribe",
- "params": {
- "stream": "v1.group",
- "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123
- }
- ' -w 360
- ```
- !!! example "Legacy Subscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "request_id":1,
- "stream":"v1.group",
- "feed":["'$GRVT_SUB_ACCOUNT_ID'"],
- "method":"subscribe",
- "is_full":true
- }
- ' -w 360
- ```
-
-
- !!! example "Subscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "subscribe",
- "p": {
- "s": "v1.group",
- "s1": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "i": 123
- }
- ' -w 360
- ```
- !!! example "Unsubscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "unsubscribe",
- "p": {
- "s": "v1.group",
- "s1": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "i": 123
- }
- ' -w 360
- ```
- !!! example "Legacy Subscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.dev.gravitymarkets.io/ws" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "request_id":1,
- "stream":"v1.group",
- "feed":["'$GRVT_SUB_ACCOUNT_ID'"],
- "method":"subscribe",
- "is_full":false
- }
- ' -w 360
- ```
-
- === "STAGING"
-
- !!! example "Subscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "subscribe",
- "params": {
- "stream": "v1.group",
- "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123
- }
- ' -w 360
- ```
- !!! example "Unsubscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "unsubscribe",
- "params": {
- "stream": "v1.group",
- "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123
- }
- ' -w 360
- ```
- !!! example "Legacy Subscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "request_id":1,
- "stream":"v1.group",
- "feed":["'$GRVT_SUB_ACCOUNT_ID'"],
- "method":"subscribe",
- "is_full":true
- }
- ' -w 360
- ```
-
-
- !!! example "Subscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "subscribe",
- "p": {
- "s": "v1.group",
- "s1": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "i": 123
- }
- ' -w 360
- ```
- !!! example "Unsubscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "unsubscribe",
- "p": {
- "s": "v1.group",
- "s1": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "i": 123
- }
- ' -w 360
- ```
- !!! example "Legacy Subscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.staging.gravitymarkets.io/ws" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "request_id":1,
- "stream":"v1.group",
- "feed":["'$GRVT_SUB_ACCOUNT_ID'"],
- "method":"subscribe",
- "is_full":false
- }
- ' -w 360
- ```
-
- === "TESTNET"
-
- !!! example "Subscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "subscribe",
- "params": {
- "stream": "v1.group",
- "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123
- }
- ' -w 360
- ```
- !!! example "Unsubscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "unsubscribe",
- "params": {
- "stream": "v1.group",
- "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123
- }
- ' -w 360
- ```
- !!! example "Legacy Subscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "request_id":1,
- "stream":"v1.group",
- "feed":["'$GRVT_SUB_ACCOUNT_ID'"],
- "method":"subscribe",
- "is_full":true
- }
- ' -w 360
- ```
-
-
- !!! example "Subscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "subscribe",
- "p": {
- "s": "v1.group",
- "s1": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "i": 123
- }
- ' -w 360
- ```
- !!! example "Unsubscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "unsubscribe",
- "p": {
- "s": "v1.group",
- "s1": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "i": 123
- }
- ' -w 360
- ```
- !!! example "Legacy Subscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.testnet.grvt.io/ws" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "request_id":1,
- "stream":"v1.group",
- "feed":["'$GRVT_SUB_ACCOUNT_ID'"],
- "method":"subscribe",
- "is_full":false
- }
- ' -w 360
- ```
-
- === "PROD"
-
- !!! example "Subscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "subscribe",
- "params": {
- "stream": "v1.group",
- "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123
- }
- ' -w 360
- ```
- !!! example "Unsubscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/full" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "jsonrpc": "2.0",
- "method": "unsubscribe",
- "params": {
- "stream": "v1.group",
- "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "id": 123
- }
- ' -w 360
- ```
- !!! example "Legacy Subscribe Full"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "request_id":1,
- "stream":"v1.group",
- "feed":["'$GRVT_SUB_ACCOUNT_ID'"],
- "method":"subscribe",
- "is_full":true
- }
- ' -w 360
- ```
-
-
- !!! example "Subscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "subscribe",
- "p": {
- "s": "v1.group",
- "s1": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "i": 123
- }
- ' -w 360
- ```
- !!! example "Unsubscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws/lite" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "j": "2.0",
- "m": "unsubscribe",
- "p": {
- "s": "v1.group",
- "s1": ["'$GRVT_SUB_ACCOUNT_ID'"]
- },
- "i": 123
- }
- ' -w 360
- ```
- !!! example "Legacy Subscribe Lite"
- ``` { .bash .copy }
- wscat -c "wss://trades.grvt.io/ws" \
- -H "Cookie: $GRVT_COOKIE" \
- -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
- -x '
- {
- "request_id":1,
- "stream":"v1.group",
- "feed":["'$GRVT_SUB_ACCOUNT_ID'"],
- "method":"subscribe",
- "is_full":false
- }
- ' -w 360
- ```
-
-
## Execution
### Fill
```
@@ -2600,7 +2007,8 @@ STREAM: v1.fill
"venue": "ORDERBOOK",
"client_order_id": "23042",
"signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "broker": "UNSPECIFIED"
+ "broker": "UNSPECIFIED",
+ "is_rpi": false
}
}
```
@@ -2630,7 +2038,8 @@ STREAM: v1.fill
"v": "ORDERBOOK",
"co": "23042",
"s1": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0",
- "b": "UNSPECIFIED"
+ "b": "UNSPECIFIED",
+ "ir1": false
}
}
```
diff --git a/artifacts/pysdk/grvt_raw_async.py b/artifacts/pysdk/grvt_raw_async.py
index c9b143a..2a626a8 100644
--- a/artifacts/pysdk/grvt_raw_async.py
+++ b/artifacts/pysdk/grvt_raw_async.py
@@ -96,14 +96,6 @@ async def funding_rate_v1(
return GrvtError(**resp)
return from_dict(types.ApiFundingRateResponse, resp, Config(cast=[Enum]))
- async def drop_client_ws(
- self, req: types.ApiDropClientWsRequest
- ) -> types.ApiDropClientWsResponse | GrvtError:
- resp = await self._post(True, self.td_rpc + "/full/v1/drop_client_ws", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiDropClientWsResponse, resp, Config(cast=[Enum]))
-
async def create_order_v1(
self, req: types.ApiCreateOrderRequest
) -> types.ApiCreateOrderResponse | GrvtError:
@@ -152,22 +144,6 @@ async def order_history_v1(
return GrvtError(**resp)
return from_dict(types.ApiOrderHistoryResponse, resp, Config(cast=[Enum]))
- async def pre_order_check_v1(
- self, req: types.ApiPreOrderCheckRequest
- ) -> types.ApiPreOrderCheckResponse | GrvtError:
- resp = await self._post(True, self.td_rpc + "/full/v1/pre_order_check", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiPreOrderCheckResponse, resp, Config(cast=[Enum]))
-
- async def dedust_position_v1(
- self, req: types.ApiDedustPositionRequest
- ) -> types.ApiDedustPositionResponse | GrvtError:
- resp = await self._post(True, self.td_rpc + "/full/v1/dedust_position", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiDedustPositionResponse, resp, Config(cast=[Enum]))
-
async def cancel_on_disconnect_v1(
self, req: types.ApiCancelOnDisconnectRequest
) -> types.AckResponse | GrvtError:
@@ -176,22 +152,6 @@ async def cancel_on_disconnect_v1(
return GrvtError(**resp)
return from_dict(types.AckResponse, resp, Config(cast=[Enum]))
- async def create_bulk_orders_v1(
- self, req: types.ApiCreateBulkOrdersRequest
- ) -> types.ApiCreateBulkOrdersResponse | GrvtError:
- resp = await self._post(True, self.td_rpc + "/full/v1/create_bulk_orders", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiCreateBulkOrdersResponse, resp, Config(cast=[Enum]))
-
- async def get_order_group_v1(
- self, req: types.ApiGetOrderGroupRequest
- ) -> types.ApiGetOrderGroupResponse | GrvtError:
- resp = await self._post(True, self.td_rpc + "/full/v1/order_group", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiGetOrderGroupResponse, resp, Config(cast=[Enum]))
-
async def fill_history_v1(
self, req: types.ApiFillHistoryRequest
) -> types.ApiFillHistoryResponse | GrvtError:
@@ -230,11 +190,11 @@ async def deposit_history_v1(
async def transfer_v1(
self, req: types.ApiTransferRequest
- ) -> types.AckResponse | GrvtError:
+ ) -> types.ApiTransferResponse | GrvtError:
resp = await self._post(True, self.td_rpc + "/full/v1/transfer", req)
if resp.get("code"):
return GrvtError(**resp)
- return from_dict(types.AckResponse, resp, Config(cast=[Enum]))
+ return from_dict(types.ApiTransferResponse, resp, Config(cast=[Enum]))
async def transfer_history_v1(
self, req: types.ApiTransferHistoryRequest
@@ -260,14 +220,6 @@ async def withdrawal_history_v1(
return GrvtError(**resp)
return from_dict(types.ApiWithdrawalHistoryResponse, resp, Config(cast=[Enum]))
- async def pre_deposit_check_v1(
- self, req: types.ApiPreDepositCheckRequest
- ) -> types.ApiPreDepositCheckResponse | GrvtError:
- resp = await self._post(True, self.td_rpc + "/full/v1/pre_deposit_check", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiPreDepositCheckResponse, resp, Config(cast=[Enum]))
-
async def sub_account_summary_v1(
self, req: types.ApiSubAccountSummaryRequest
) -> types.ApiSubAccountSummaryResponse | GrvtError:
@@ -308,16 +260,6 @@ async def funding_account_summary_v1(
types.ApiFundingAccountSummaryResponse, resp, Config(cast=[Enum])
)
- async def socialized_loss_status_v1(
- self, req: types.EmptyRequest
- ) -> types.ApiSocializedLossStatusResponse | GrvtError:
- resp = await self._post(
- True, self.td_rpc + "/full/v1/socialized_loss_status", req
- )
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiSocializedLossStatusResponse, resp, Config(cast=[Enum]))
-
async def get_all_initial_leverage_v1(
self, req: types.ApiGetAllInitialLeverageRequest
) -> types.ApiGetAllInitialLeverageResponse | GrvtError:
@@ -337,21 +279,3 @@ async def set_initial_leverage_v1(
if resp.get("code"):
return GrvtError(**resp)
return from_dict(types.ApiSetInitialLeverageResponse, resp, Config(cast=[Enum]))
-
- async def get_margin_tiers_v1(
- self, req: types.EmptyRequest
- ) -> types.ApiGetMarginTiersResponse | GrvtError:
- resp = await self._post(True, self.td_rpc + "/full/v1/get_margin_tiers", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiGetMarginTiersResponse, resp, Config(cast=[Enum]))
-
- async def query_trading_performance_v1(
- self, req: types.ApiQueryTradingPerformanceRequest
- ) -> types.ApiQueryTradingPerformanceResponse | GrvtError:
- resp = await self._post(True, self.td_rpc + "/full/v1/trading_performance", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(
- types.ApiQueryTradingPerformanceResponse, resp, Config(cast=[Enum])
- )
diff --git a/artifacts/pysdk/grvt_raw_sync.py b/artifacts/pysdk/grvt_raw_sync.py
index 7d078f3..61b979c 100644
--- a/artifacts/pysdk/grvt_raw_sync.py
+++ b/artifacts/pysdk/grvt_raw_sync.py
@@ -94,14 +94,6 @@ def funding_rate_v1(
return GrvtError(**resp)
return from_dict(types.ApiFundingRateResponse, resp, Config(cast=[Enum]))
- def drop_client_ws(
- self, req: types.ApiDropClientWsRequest
- ) -> types.ApiDropClientWsResponse | GrvtError:
- resp = self._post(True, self.td_rpc + "/full/v1/drop_client_ws", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiDropClientWsResponse, resp, Config(cast=[Enum]))
-
def create_order_v1(
self, req: types.ApiCreateOrderRequest
) -> types.ApiCreateOrderResponse | GrvtError:
@@ -150,22 +142,6 @@ def order_history_v1(
return GrvtError(**resp)
return from_dict(types.ApiOrderHistoryResponse, resp, Config(cast=[Enum]))
- def pre_order_check_v1(
- self, req: types.ApiPreOrderCheckRequest
- ) -> types.ApiPreOrderCheckResponse | GrvtError:
- resp = self._post(True, self.td_rpc + "/full/v1/pre_order_check", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiPreOrderCheckResponse, resp, Config(cast=[Enum]))
-
- def dedust_position_v1(
- self, req: types.ApiDedustPositionRequest
- ) -> types.ApiDedustPositionResponse | GrvtError:
- resp = self._post(True, self.td_rpc + "/full/v1/dedust_position", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiDedustPositionResponse, resp, Config(cast=[Enum]))
-
def cancel_on_disconnect_v1(
self, req: types.ApiCancelOnDisconnectRequest
) -> types.AckResponse | GrvtError:
@@ -174,22 +150,6 @@ def cancel_on_disconnect_v1(
return GrvtError(**resp)
return from_dict(types.AckResponse, resp, Config(cast=[Enum]))
- def create_bulk_orders_v1(
- self, req: types.ApiCreateBulkOrdersRequest
- ) -> types.ApiCreateBulkOrdersResponse | GrvtError:
- resp = self._post(True, self.td_rpc + "/full/v1/create_bulk_orders", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiCreateBulkOrdersResponse, resp, Config(cast=[Enum]))
-
- def get_order_group_v1(
- self, req: types.ApiGetOrderGroupRequest
- ) -> types.ApiGetOrderGroupResponse | GrvtError:
- resp = self._post(True, self.td_rpc + "/full/v1/order_group", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiGetOrderGroupResponse, resp, Config(cast=[Enum]))
-
def fill_history_v1(
self, req: types.ApiFillHistoryRequest
) -> types.ApiFillHistoryResponse | GrvtError:
@@ -224,11 +184,13 @@ def deposit_history_v1(
return GrvtError(**resp)
return from_dict(types.ApiDepositHistoryResponse, resp, Config(cast=[Enum]))
- def transfer_v1(self, req: types.ApiTransferRequest) -> types.AckResponse | GrvtError:
+ def transfer_v1(
+ self, req: types.ApiTransferRequest
+ ) -> types.ApiTransferResponse | GrvtError:
resp = self._post(True, self.td_rpc + "/full/v1/transfer", req)
if resp.get("code"):
return GrvtError(**resp)
- return from_dict(types.AckResponse, resp, Config(cast=[Enum]))
+ return from_dict(types.ApiTransferResponse, resp, Config(cast=[Enum]))
def transfer_history_v1(
self, req: types.ApiTransferHistoryRequest
@@ -254,14 +216,6 @@ def withdrawal_history_v1(
return GrvtError(**resp)
return from_dict(types.ApiWithdrawalHistoryResponse, resp, Config(cast=[Enum]))
- def pre_deposit_check_v1(
- self, req: types.ApiPreDepositCheckRequest
- ) -> types.ApiPreDepositCheckResponse | GrvtError:
- resp = self._post(True, self.td_rpc + "/full/v1/pre_deposit_check", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiPreDepositCheckResponse, resp, Config(cast=[Enum]))
-
def sub_account_summary_v1(
self, req: types.ApiSubAccountSummaryRequest
) -> types.ApiSubAccountSummaryResponse | GrvtError:
@@ -298,14 +252,6 @@ def funding_account_summary_v1(
types.ApiFundingAccountSummaryResponse, resp, Config(cast=[Enum])
)
- def socialized_loss_status_v1(
- self, req: types.EmptyRequest
- ) -> types.ApiSocializedLossStatusResponse | GrvtError:
- resp = self._post(True, self.td_rpc + "/full/v1/socialized_loss_status", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiSocializedLossStatusResponse, resp, Config(cast=[Enum]))
-
def get_all_initial_leverage_v1(
self, req: types.ApiGetAllInitialLeverageRequest
) -> types.ApiGetAllInitialLeverageResponse | GrvtError:
@@ -323,21 +269,3 @@ def set_initial_leverage_v1(
if resp.get("code"):
return GrvtError(**resp)
return from_dict(types.ApiSetInitialLeverageResponse, resp, Config(cast=[Enum]))
-
- def get_margin_tiers_v1(
- self, req: types.EmptyRequest
- ) -> types.ApiGetMarginTiersResponse | GrvtError:
- resp = self._post(True, self.td_rpc + "/full/v1/get_margin_tiers", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(types.ApiGetMarginTiersResponse, resp, Config(cast=[Enum]))
-
- def query_trading_performance_v1(
- self, req: types.ApiQueryTradingPerformanceRequest
- ) -> types.ApiQueryTradingPerformanceResponse | GrvtError:
- resp = self._post(True, self.td_rpc + "/full/v1/trading_performance", req)
- if resp.get("code"):
- return GrvtError(**resp)
- return from_dict(
- types.ApiQueryTradingPerformanceResponse, resp, Config(cast=[Enum])
- )
diff --git a/artifacts/pysdk/grvt_raw_types.py b/artifacts/pysdk/grvt_raw_types.py
index 8d3196d..8c1c738 100644
--- a/artifacts/pysdk/grvt_raw_types.py
+++ b/artifacts/pysdk/grvt_raw_types.py
@@ -13,6 +13,8 @@
class BridgeType(Enum):
# XY Bridge type
XY = "XY"
+ # Rhino Bridge type
+ RHINO = "RHINO"
class BrokerTag(Enum):
@@ -286,6 +288,10 @@ class OrderRejectReason(Enum):
CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED = "CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED"
# the OCO counter part order was triggered
OCO_COUNTER_PART_TRIGGERED = "OCO_COUNTER_PART_TRIGGERED"
+ # the remaining order size was cancelled because it exceeded current position size
+ REDUCE_ONLY_LIMIT = "REDUCE_ONLY_LIMIT"
+ # the order was replaced by a client replace request
+ CLIENT_REPLACE = "CLIENT_REPLACE"
class OrderStatus(Enum):
@@ -344,6 +350,19 @@ class TimeInForce(Enum):
IMMEDIATE_OR_CANCEL = "IMMEDIATE_OR_CANCEL"
# FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it
FILL_OR_KILL = "FILL_OR_KILL"
+ # RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.
+ RETAIL_PRICE_IMPROVEMENT = "RETAIL_PRICE_IMPROVEMENT"
+
+
+class TimeInterval(Enum):
+ # 1 day
+ INTERVAL_1_D = "INTERVAL_1_D"
+ # 7 days
+ INTERVAL_7_D = "INTERVAL_7_D"
+ # 30 days
+ INTERVAL_30_D = "INTERVAL_30_D"
+ # 90 days
+ INTERVAL_90_D = "INTERVAL_90_D"
class TransferType(Enum):
@@ -353,6 +372,10 @@ class TransferType(Enum):
FAST_ARB_DEPOSIT = "FAST_ARB_DEPOSIT"
# Fast Arb Withdrawal Metadata type
FAST_ARB_WITHDRAWAL = "FAST_ARB_WITHDRAWAL"
+ # Transfer type for non native bridging deposit
+ NON_NATIVE_BRIDGE_DEPOSIT = "NON_NATIVE_BRIDGE_DEPOSIT"
+ # Transfer type for non native bridging withdrawal
+ NON_NATIVE_BRIDGE_WITHDRAWAL = "NON_NATIVE_BRIDGE_WITHDRAWAL"
class TriggerBy(Enum):
@@ -389,6 +412,13 @@ class TriggerType(Enum):
STOP_LOSS = "STOP_LOSS"
+class VaultType(Enum):
+ # Prime vault
+ PRIME = "PRIME"
+ # Launchpad vault
+ LAUNCH_PAD = "LAUNCH_PAD"
+
+
class Venue(Enum):
# the trade is cleared on the orderbook venue
ORDERBOOK = "ORDERBOOK"
@@ -548,6 +578,8 @@ class Fill:
client_order_id: str
# The address (public key) of the wallet signing the payload
signer: str
+ # If the trade is a RPI trade
+ is_rpi: bool
# Specifies the broker who brokered the order
broker: BrokerTag | None = None
@@ -712,23 +744,6 @@ class ApiSubAccountHistoryResponse:
next: str
-@dataclass
-class ApiLatestSnapSubAccountsRequest:
- """
- The request to get the latest snapshot of list sub account
-
- """
-
- # The list of sub account ids to query
- sub_account_i_ds: list[str]
-
-
-@dataclass
-class ApiLatestSnapSubAccountsResponse:
- # The sub account history matching the request sub account
- result: list[SubAccount]
-
-
@dataclass
class AggregatedAccountSummary:
# The main account ID of the account to which the summary belongs
@@ -761,26 +776,6 @@ class ApiFundingAccountSummaryResponse:
result: FundingAccountSummary
-@dataclass
-class ApiSocializedLossStatusResponse:
- # Whether the socialized loss is active
- is_active: bool
- # The socialized loss haircut ratio in centi-beeps
- haircut_ratio: str
-
-
-@dataclass
-class ApiListAggregatedAccountSummaryRequest:
- # The list of main account ID to request for
- main_account_ids: list[bytes]
-
-
-@dataclass
-class ApiListAggregatedAccountSummaryResponse:
- # The list of aggregated account summaries of requested main accounts
- account_summaries: list[ApiAggregatedAccountSummaryResponse]
-
-
@dataclass
class ApiSetInitialLeverageRequest:
# The sub account ID to set the leverage for
@@ -1015,6 +1010,8 @@ class Trade:
trade_id: str
# The venue where the trade occurred
venue: Venue
+ # If the trade is a RPI trade
+ is_rpi: bool
@dataclass
@@ -1201,6 +1198,8 @@ class FundingRate:
funding_time: str
# The mark price of the instrument at funding timestamp, expressed in `9` decimals
mark_price: str
+ # The 8h average funding rate of the instrument, expressed in percentage points
+ funding_rate_8_h_avg: str
@dataclass
@@ -1211,48 +1210,6 @@ class ApiFundingRateResponse:
next: str | None = None
-@dataclass
-class ApiSettlementPriceRequest:
- """
- Lookup the historical settlement price of various pairs.
-
- Pagination works as follows:- We perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.
- The lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.
- If a `cursor` is provided, it will be used to fetch results from that point onwards.
- Pagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.
- """
-
- # The base currency to select
- base: Currency
- # The quote currency to select
- quote: Currency
- # Start time of settlement price in unix nanoseconds
- start_time: str | None = None
- # End time of settlement price in unix nanoseconds
- end_time: str | None = None
- # The limit to query for. Defaults to 500; Max 1000
- limit: int | None = None
- # The cursor to indicate when to start the query from
- cursor: str | None = None
-
-
-@dataclass
-class APISettlementPrice:
- # The base currency of the settlement price
- base: Currency
- # The quote currency of the settlement price
- quote: Currency
- # The settlement timestamp of the settlement price, expressed in unix nanoseconds
- settlement_time: str
- # The settlement price, expressed in `9` decimals
- settlement_price: str
-
-
-@dataclass
-class ApiSettlementPriceResponse:
- # The funding rate result set for given interval
- result: list[APISettlementPrice]
- # The cursor to indicate when to start the next query from
- next: str | None = None
-
-
@dataclass
class JSONRPCRequest:
"""
@@ -1547,12 +1504,6 @@ class WSTickerFeedDataV1:
prev_sequence_number: str
-@dataclass
-class ApiTickerFeedDataV1:
- # The mini ticker matching the request asset
- result: Ticker
-
-
@dataclass
class WSTradeFeedSelectorV1:
# The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
@@ -1660,36 +1611,6 @@ class ApiGetAllInstrumentsResponse:
result: list[Instrument]
-@dataclass
-class SnapFundingAccountSummary:
- # Time at which the event was emitted in unix nanoseconds
- event_time: str
- # The start of the interval in unix nanoseconds
- start_interval: str
- # The main account ID of the account to which the summary belongs
- main_account_id: str
- # Total equity of the main account, denominated in USD
- total_equity: str
- # The list of spot assets owned by this main account, and their balances
- spot_balances: list[SpotBalance]
-
-
-@dataclass
-class ApiQueryTradingPerformanceRequest:
- # The asset to filter by
- asset: bytes
- # Optional: The subaccount ID to filter by
- sub_account_id: str | None = None
-
-
-@dataclass
-class ApiQueryTradingPerformanceResponse:
- # Trading volume in USDT
- trading_volume: str
- # Realized PnL in USDT
- realized_pnl: str
-
-
@dataclass
class OrderLeg:
# The instrument to trade in this leg
@@ -1743,6 +1664,8 @@ class TPSLOrderMetadata:
trigger_by: TriggerBy
# The Trigger Price of the order, expressed in `9` decimals.
trigger_price: str
+ # If True, the order will close the position when the trigger price is reached
+ close_position: bool
@dataclass
@@ -1900,12 +1823,6 @@ class ApiCancelOrderRequest:
time_to_live_ms: str | None = None
-@dataclass
-class ApiCancelOrderResponse:
- # The cancelled order
- result: Order
-
-
@dataclass
class ApiCancelAllOrdersRequest:
# The subaccount ID cancelling all orders
@@ -1918,12 +1835,6 @@ class ApiCancelAllOrdersRequest:
quote: list[Currency] | None = None
-@dataclass
-class ApiCancelAllOrdersResponse:
- # The number of orders cancelled
- result: int
-
-
@dataclass
class ApiOpenOrdersRequest:
# The subaccount ID to filter by
@@ -1993,22 +1904,6 @@ class AckResponse:
result: Ack
-@dataclass
-class ApiOrderStateRequest:
- # The subaccount ID to filter by
- sub_account_id: str
- # Filter for `order_id`
- order_id: str | None = None
- # Filter for `client_order_id`
- client_order_id: str | None = None
-
-
-@dataclass
-class ApiOrderStateResponse:
- # The order state for the requested filter
- state: OrderState
-
-
@dataclass
class ApiGetOrderRequest:
# The subaccount ID to filter by
@@ -2025,96 +1920,6 @@ class ApiGetOrderResponse:
result: Order
-@dataclass
-class ApiPreOrderCheckRequest:
- # The subaccount ID of orders to query
- sub_account_id: str
- # The order to do pre-order check
- orders: list[Order]
-
-
-@dataclass
-class AssetMaxQty:
- # The asset associated with the max quantity
- asset: str
- # The maximum buy quantity
- max_buy_qty: str
- # The maximum sell quantity
- max_sell_qty: str
-
-
-@dataclass
-class PreOrderCheckResult:
- # The maximum quantity for each leg
- max_qty: list[AssetMaxQty]
- # The margin required for the order (reported in `settle_currency`)
- margin_required: str
- # Whether the order is valid
- order_valid: bool
- # The reason the order is invalid, if any
- reason: str
- # The subAccount settle currency
- settle_currency: Currency
-
-
-@dataclass
-class ApiPreOrderCheckResponse:
- # Pre order check for each new order in the request
- results: list[PreOrderCheckResult]
-
-
-@dataclass
-class ApiPreDepositCheckRequest:
- # The currency you hold the deposit in
- currency: Currency
- # The bridge type to conduct checks for
- bridge: BridgeType
-
-
-@dataclass
-class ApiPreDepositCheckResponse:
- # Max Deposit Limit reported for the Bridge Account reported in the currency balance
- max_deposit_limit: str
- # The currency you hold the deposit in
- currency: Currency
-
-
-@dataclass
-class ApiDedustPositionRequest:
- # The order to create
- order: Order
-
-
-@dataclass
-class ApiDedustPositionResponse:
- # The created order
- result: Order
-
-
-@dataclass
-class ApiCreateBulkOrdersRequest:
- """
- Create multiple orders simultaneously for this trading account.
-
- This endpoint supports the following order scenarios:
- - One-Cancels-Other (OCO) orders combining TP/SL
- - One-Sends-Other (OSO) orders
-
- Usage:
- - For OCO (TP/SL pair): Send exactly 2 orders in the same request - one Take Profit and one Stop Loss order
- - For OSO: Send exactly one main order and one contingent order (TP and/or SL)
- """
-
- # The orders to create
- orders: list[Order]
-
-
-@dataclass
-class ApiCreateBulkOrdersResponse:
- # The created orders in same order as requested
- result: list[Order]
-
-
@dataclass
class ApiCancelOnDisconnectRequest:
"""
@@ -2145,661 +1950,6 @@ class ApiCancelOnDisconnectRequest:
countdown_time: str | None = None
-@dataclass
-class ApiGetOrderGroupRequest:
- """
- Retrieves the grouping of non-cancelled, non-filled client orders for a given subaccount when the grouping exist.
-
- helping to identify TP/SL pairs or other order relationships within the account.
- """
-
- # The subaccount ID for which the order groups should be retrieved.
- sub_account_id: str
-
-
-@dataclass
-class ClientOrderIDsByGroup:
- """
- Grouping for the client order id and their associated groups.
-
- This is used to define TP/SL pairs or other order groupings after loading the list of Open Orders.
- """
-
- # The group this order belongs to. It can be used to define TP/SL pairs or other order groupings
- group_id: str
- # List of client order IDs in the group
- client_order_id: list[str]
- # The sub account ID that these orders belong to
- sub_account_id: str
-
-
-@dataclass
-class ApiGetOrderGroupResponse:
- """
- A list of client orders grouped by their associated order group.
- Each entry in the list contains a `groupID` and the corresponding `clientOrderID`s
- that belong to that group.
- """
-
- result: list[ClientOrderIDsByGroup]
-
-
-@dataclass
-class ApiGetUserEcosystemPointRequest:
- # The off chain account id
- account_id: str
- # Start time of the epoch - phase
- calculate_from: str
- # Include user rank in the response
- include_user_rank: bool
-
-
-@dataclass
-class EcosystemPoint:
- # The off chain account id
- account_id: str
- # The main account id
- main_account_id: str
- # Total ecosystem point
- total_point: str
- # Direct invite count
- direct_invite_count: int
- # Indirect invite count
- indirect_invite_count: int
- # Direct invite trading volume
- direct_invite_trading_volume: str
- # Indirect invite trading volume
- indirect_invite_trading_volume: str
- # The time when the ecosystem point is calculated
- calculate_at: str
- # Start time of the epoch - phase
- calculate_from: str
- # End time of the epoch - phase
- calculate_to: str
- # The rank of the account in the ecosystem
- rank: int
- # The epoch number of the ecosystem point
- epoch: int
- # Brokered trading volume
- brokered_trading_volume: str
- # Brokered trading point
- brokered_trading_point: str
- # Referee KYC point
- referee_kyc_point: str
- # Referrer KYC point
- referrer_kyc_point: str
-
-
-@dataclass
-class ApiGetUserEcosystemPointResponse:
- # The list of ecosystem points
- points: list[EcosystemPoint]
-
-
-@dataclass
-class ApiGetEcosystemLeaderboardRequest:
- # Start time of the epoch - phase
- calculate_from: str
- # The number of accounts to return
- limit: int
-
-
-@dataclass
-class ApiGetVerifiedEcosystemLeaderboardRequest:
- # Start time of the epoch
- calculate_from: str
- # Completed KYC before this time
- completed_kyc_before: str
-
-
-@dataclass
-class ApiGetEcosystemLeaderboardResponse:
- # The list of ecosystem points
- points: list[EcosystemPoint]
-
-
-@dataclass
-class ApiGetEcosystemReferralStatResponse:
- # Direct invite count
- direct_invite_count: int
- # Indirect invite count
- indirect_invite_count: int
- # Total volume traded by direct invites multiple by 1e9
- direct_invite_trading_volume: str
- # Total volume traded by indirect invites multiple by 1e9
- indirect_invite_trading_volume: str
-
-
-@dataclass
-class ApiResolveEpochEcosystemMetricResponse:
- # The name of the epoch
- epoch_name: str
- # Ecosystem points up to the most recently calculated time within this epoch
- point: int
- # The time in unix nanoseconds when the ecosystem points were last calculated
- last_calculated_time: str
-
-
-@dataclass
-class EcosystemMetric:
- # Direct invite count
- direct_invite_count: int
- # Indirect invite count
- indirect_invite_count: int
- # Direct invite trading volume
- direct_invite_trading_volume: str
- # Indirect invite trading volume
- indirect_invite_trading_volume: str
- # Total ecosystem point of this epoch/phase
- total_point: str
-
-
-@dataclass
-class ApiFindFirstEpochMetricResponse:
- # Phase zero metric
- phase_zero_metric: EcosystemMetric
- # Phase one metric
- phase_one_metric: EcosystemMetric
- # The rank of the account in the ecosystem
- rank: int
- # The total number of accounts in the ecosystem
- total: int
- # Total ecosystem point of the first epoch
- total_point: str
- # The time when the ecosystem points were last calculated
- last_calculated_at: str
-
-
-@dataclass
-class ApiFindEcosystemEpochMetricResponse:
- # The epoch metric
- metric: EcosystemMetric
- # The rank of the account in the ecosystem
- rank: int
- # The total number of accounts in the ecosystem
- total: int
- # The time when the ecosystem points were last calculated
- last_calculated_at: str
- # Direct invite count without relying on epochs
- total_direct_invite_count: int
- # Indirect invite count without relying on epochs
- total_indirect_invite_count: int
-
-
-@dataclass
-class EcosystemLeaderboardUser:
- # The off chain account id
- account_id: str
- # The rank of the account in the ecosystem
- rank: int
- # Total ecosystem point
- total_point: str
- # The twitter username of the account
- twitter_username: str
-
-
-@dataclass
-class ApiFindEcosystemLeaderboardResponse:
- # The list of ecosystem leaderboard users
- users: list[EcosystemLeaderboardUser]
-
-
-@dataclass
-class QueryFindEpochRequest:
- # The time to query the epoch
- time: str | None = None
- # The epoch number
- epoch: int | None = None
-
-
-@dataclass
-class Epoch:
- # The epoch number
- epoch: int
- # The start time of the epoch
- start_time: str
- # The end time of the epoch
- end_time: str
-
-
-@dataclass
-class QueryFindEpochResponse:
- # The epoch
- epoch: Epoch
-
-
-@dataclass
-class QueryGetListEpochRequest:
- # The limit to query for
- limit: int | None = None
-
-
-@dataclass
-class QueryGetListEpochResponse:
- # The list of epochs
- result: list[Epoch]
-
-
-@dataclass
-class QueryEpochBadgeRequest:
- # The off chain account id to get referral stats
- account_id: str | None = None
- # The numerical epoch index
- epoch: int | None = None
- # The type of the reward program
- type: RewardProgramType | None = None
- # The limit to query for. Defaults to 500; Max 1000
- limit: int | None = None
- # The cursor to indicate when to start the query from
- cursor: str | None = None
-
-
-@dataclass
-class EpochBadge:
- # The off chain account id
- account_id: str
- # The account ID
- main_account_id: str
- # The type of the reward program
- type: RewardProgramType
- # The epoch number
- epoch: int
- # The start time of the epoch
- epoch_start_time: str
- # The end time of the epoch
- epoch_end_time: str
- # The type of the badge
- badge: EpochBadgeType
- # The distributed badges
- distributed_badges: list[EpochBadgeType]
- # Total point
- total_point: str
- # Rank
- rank: int
- # The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process
- claimed_at: str
-
-
-@dataclass
-class QueryEpochBadgeResponse:
- # The list of epoch badges
- result: list[EpochBadge]
- # The cursor to indicate when to start the query from
- next: str
-
-
-@dataclass
-class QueryEpochBadgePointDistributionRequest:
- # The type of the reward program
- type: RewardProgramType
- # The numerical epoch index
- epoch: int | None = None
-
-
-@dataclass
-class EpochBadgePointDistribution:
- # The type of the badge
- badge: EpochBadgeType
- # The epoch number
- epoch: int
- # The type of the reward program
- type: RewardProgramType
- # The minimum point to get the badge
- min_point: str
- # The maximum point to get the badge
- max_point: str
- # The minimum rank to get the badge
- min_rank: int
- # The maximum rank to get the badge
- max_rank: int
- # The total point to get the badge
- total_point: str
- # The number of users to get the badge
- count: int
-
-
-@dataclass
-class QueryEpochBadgePointDistributionResponse:
- # The list of epoch badges
- result: list[EpochBadgePointDistribution]
-
-
-@dataclass
-class ApiGetListEpochBadgeResponse:
- # The list of epoch badges
- result: list[EpochBadge]
-
-
-@dataclass
-class GetClaimableEcosystemBadgeResponse:
- # The epoch badge
- badge: EpochBadge
- # Whether the badge is claimable
- is_claimable: bool
- # The time when the badge is claimable
- claimable_until: str
-
-
-@dataclass
-class ClaimEcosystemBadgeResponse:
- # The epoch badge
- badge: EpochBadge
-
-
-@dataclass
-class ApiGetListFlatReferralRequest:
- # The off chain referrer account id to get all flat referrals
- referral_id: str
- # The off chain account id to get all user's referrers
- account_id: str
- # Optional. Start time in unix nanoseconds
- start_time: str | None = None
- # Optional. End time in unix nanoseconds
- end_time: str | None = None
-
-
-@dataclass
-class FlatReferral:
- # The off chain account id
- account_id: str
- # The off chain referrer account id
- referrer_id: str
- # The referrer level; 1: direct referrer, 2: indirect referrer
- referrer_level: int
- # The account creation time
- account_create_time: str
- # The main account id
- main_account_id: str
- # The referrer main account id
- referrer_main_account_id: str
- # The account is a business account or not
- is_business: bool
- # The account is KYC verified or not
- is_kyc_completed: bool
- # The KYC completed time
- kyc_completed_at: str
- # The KYC type, can be 'individual' or 'business'
- kyc_type: str
- # The first KYC completed time
- kyc_first_completed_at: str
-
-
-@dataclass
-class ApiGetListFlatReferralResponse:
- # The list of flat referrals
- flat_referrals: list[FlatReferral]
-
-
-@dataclass
-class ApiQueryFlatReferralStatRequest:
- # The off chain account id to get referral stats
- account_id: str
-
-
-@dataclass
-class ApiQueryFlatReferralStatResponse:
- # Direct invite count
- direct_invite_count: int
- # Indirect invite count
- indirect_invite_count: int
-
-
-@dataclass
-class LPSnapshot:
- # The main account id
- main_account_id: str
- # The LP Asset
- lp_asset: str
- # Underlying multiplier
- underlying_multiplier: str
- # Maker trading volume
- maker_trading_volume: str
- # Fast market multiplier
- bid_fast_market_multiplier: int
- # Fast market multiplier
- ask_fast_market_multiplier: int
- # Liquidity score
- liquidity_score: str
- # The time when the snapshot was calculated
- calculate_at: str
-
-
-@dataclass
-class ApproximateLPSnapshot:
- # The main account id
- main_account_id: str
- # Underlying multiplier
- underlying_multiplier: str
- # Market share multiplier
- market_share_multiplier: str
- # Fast market multiplier
- bid_fast_market_multiplier: int
- # Fast market multiplier
- ask_fast_market_multiplier: int
- # Liquidity score
- liquidity_score: str
- # The time when the snapshot was calculated
- calculate_at: str
-
-
-@dataclass
-class LPPoint:
- # The main account id
- main_account_id: str
- # Liquidity score
- liquidity_score: str
- # The rank of user in the LP leaderboard
- rank: int
-
-
-@dataclass
-class ApproximateLPPoint:
- # The off chain account id
- off_chain_account_id: str
- # Liquidity score
- liquidity_score: str
- # The rank of user in the LP leaderboard
- rank: int
-
-
-@dataclass
-class QueryGetLatestLPSnapshotResponse:
- # The latest LP snapshot
- snapshot: LPSnapshot
-
-
-@dataclass
-class ApiGetLatestLPSnapshotRequest:
- # The kind filter to apply
- kind: Kind | None = None
- # The base filter to apply
- base: Currency | None = None
-
-
-@dataclass
-class ApiGetLatestLPSnapshotResponse:
- # The latest LP snapshot
- snapshot: ApproximateLPSnapshot
-
-
-@dataclass
-class ApiGetLPLeaderboardRequest:
- # The number of accounts to return
- limit: int
- # The kind filter to apply
- kind: Kind
- # The base filter to apply
- base: Currency
- # The epoch to filter
- epoch: int | None = None
-
-
-@dataclass
-class ApiGetLPLeaderboardResponse:
- # The list of LP points
- points: list[ApproximateLPPoint]
-
-
-@dataclass
-class ApiGetLPPointRequest:
- # The epoch to filter
- epoch: int | None = None
- # Optional. The kind filter to apply
- kind: Kind | None = None
- # Optional. The base filter to apply
- base: Currency | None = None
-
-
-@dataclass
-class ApiGetLPPointResponse:
- # LP points of user
- point: LPPoint
- # The number of maker
- maker_count: int
-
-
-@dataclass
-class ApiGetLPInfoRequest:
- # The kind filter to apply
- kind: Kind
- # The base filter to apply
- base: Currency | None = None
-
-
-@dataclass
-class ApiGetLPInfoResponse:
- # Is LP maker
- is_lp_maker: bool
- # The spread score value multiplier
- spread_score_value_multiplier: str
- # The depth score value multiplier
- depth_score_value_multiplier: str
- # The market share value multiplier
- market_share_value_multiplier: str
- # Underlying multiplier
- underlying_multiplier: str
- # The market share multiplier, equal to the maker trading volume in the past 2 hours
- market_share_multiplier: str
- # Ask fast market multiplier
- ask_fast_market_multiplier: int
- # Bid fast market multiplier
- bid_fast_market_multiplier: int
-
-
-@dataclass
-class RewardEpochInfo:
- # The epoch number
- epoch: int
- # The start time of the epoch
- epoch_start_time: str
- # The end time of the epoch
- epoch_end_time: str
- # The status of the epoch
- status: RewardEpochStatus
-
-
-@dataclass
-class ApiGetListRewardEpochResponse:
- # The list of epoch for ecosystem reward
- ecosystem_epochs: list[RewardEpochInfo]
- # The list of epoch for trader reward and lp reward
- trading_epochs: list[RewardEpochInfo]
-
-
-@dataclass
-class ApiSubAccountTradeAggregationRequest:
- # Optional. The limit of the number of results to return
- limit: int
- # The interval of each sub account trade
- interval: SubAccountTradeInterval
- # The list of sub account ids to query
- sub_account_i_ds: list[str]
- # Optional. The starting time in unix nanoseconds of a specific interval to query
- start_interval: str
- # Filter on the maker of the trade
- is_maker: bool
- # Filter on the taker of the trade
- is_taker: bool
- # Whether to group trades by signer per sub account
- group_by_signer: bool
- # Optional. Start time in unix nanoseconds
- start_time: str | None = None
- # Optional. End time in unix nanoseconds
- end_time: str | None = None
- # The cursor to indicate when to start the next query from
- cursor: str | None = None
-
-
-@dataclass
-class SubAccountTradeAggregation:
- # The sub account id
- sub_account_id: str
- # Total fee paid
- total_fee: str
- # Total volume traded
- total_trade_volume: str
- # Number of trades
- num_traded: str
- # Total positive fee paid by user
- positive_fee: str
- # The signer of the trade
- signer: str
- # Realized PnL
- realized_pnl: str
-
-
-@dataclass
-class ApiSubAccountTradeAggregationResponse:
- # The sub account trade aggregation result set for given interval
- result: list[SubAccountTradeAggregation]
- # The cursor to indicate when to start the next query from
- next: str | None = None
-
-
-@dataclass
-class ApiGetTraderStatResponse:
- # Total fee paid
- total_fee: str
-
-
-@dataclass
-class TraderMetric:
- # Total fee paid
- total_fee: str
- # Total trader point of this epoch/phase
- total_point: float
-
-
-@dataclass
-class ApiFindTraderEpochMetricResponse:
- # Phase zero metric
- metric: TraderMetric
- # The rank of the account in the trader
- rank: int
- # The total number of accounts in the trader
- total: int
- # The time when the trader points were last calculated
- last_calculated_at: str
-
-
-@dataclass
-class TraderLeaderboardUser:
- # The off chain account id
- account_id: str
- # The rank of the account in the Trader
- rank: int
- # Total Trader point
- total_point: float
- # The twitter username of the account
- twitter_username: str
-
-
-@dataclass
-class ApiFindTraderLeaderboardResponse:
- # The list of trader leaderboard users
- users: list[TraderLeaderboardUser]
-
-
@dataclass
class WSOrderFeedSelectorV1:
"""
@@ -3157,167 +2307,6 @@ class WSCancelFeedSelectorV1:
sub_account_id: str
-@dataclass
-class WSOrderGroupFeedSelectorV1:
- """
- Subscribes to a feed of order group to get updated when a new group is created for the subAccount specified.
-
- """
-
- # The subaccount ID to filter by
- sub_account_id: str
-
-
-@dataclass
-class WSOrderGroupFeedDataV1:
- # Stream name
- stream: str
- # Primary selector
- selector: str
- """
- A sequence number used to determine message order within a stream.
- - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
- - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
- - A single cluster payload can be multiplexed into multiple stream payloads.
- - To distinguish each stream payload, a `dedupCounter` is included.
- - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
- """
- sequence_number: str
- # The order object being created or updated
- feed: ClientOrderIDsByGroup
- # The previous sequence number that determines the message order
- prev_sequence_number: str
-
-
-@dataclass
-class ApiDropClientWsRequest:
- main_account_id: str
-
-
-@dataclass
-class ApiDropClientWsResponse:
- num_dropped: int
-
-
-@dataclass
-class MarginTierResponse:
- lower_bound: str
- rate: str
-
-
-@dataclass
-class AssetMarginTierResponse:
- asset: str
- tiers: list[MarginTierResponse]
-
-
-@dataclass
-class ApiGetMarginTiersResponse:
- results: list[AssetMarginTierResponse]
-
-
-@dataclass
-class SessionInformation:
- # country code of user based on IP address
- country_code: str
- # unique identity of the session generated from client
- client_session_id: str
- # screen size
- device_screen_size: str
- # OS of user's device
- device_os: str
- # OS version of user's device
- device_os_version: str
-
-
-@dataclass
-class UserVaultCategoryEventPayLoad:
- # category ID of event
- category_id: str
- # vault ID
- vault_id: str
- # action of event. search/filter/invest...
- action: str
- # number of bumps in this event. default 1
- num_bumps: str
-
-
-@dataclass
-class ApiUserCategoryAffinityScoreRequest:
- # The off chain account id
- account_id: str
- # The start time of query. Can leave empty to query from the beginning
- start_time: str
- # The end time of query. Can leave empty to query until now
- end_time: str
-
-
-@dataclass
-class UserCategoryAffinityScore:
- # The off chain account id
- account_id: str
- # target category
- category_id: str
- # affinity score
- affinity_score: float
-
-
-@dataclass
-class ApiUserCategoryAffinityScoreResponse:
- # The list of categoryAffinities score
- result: list[UserCategoryAffinityScore]
-
-
-@dataclass
-class ApiCategoryAffinityScoreRequest:
- # The start time of query. Can leave empty to query from the beginning
- start_time: str
- # The end time of query. Can leave empty to query until now
- end_time: str
-
-
-@dataclass
-class ApiCategoryAffinityScoreResponse:
- # The list of categoryAffinities score
- result: list[UserCategoryAffinityScore]
-
-
-@dataclass
-class UserTrackingEvent:
- # uuid for event
- event_id: str
- # version of tracking
- tracking_version: int
- # timestamp of event
- event_time: str
- # event type
- event_type: str
- # event sub type
- event_sub_type: str
- # unique identity of the session generated from client
- client_session_id: str
- # OS of user's device
- device_os: str
- # OS version of user's device
- device_os_version: str
- # sub account id
- sub_account_id: str
- # trading session key
- trading_address: str
- # screen size
- screen_size: str
- # event data
- event_data: str
- # user id
- user_id: str
- # account id
- account_id: str
- # auth session hash of the authenticated session on backend
- auth_session_hash: str
- # country code of user based on IP address
- country_code: str
-
-
@dataclass
class ApiWithdrawalRequest:
"""
@@ -3376,6 +2365,20 @@ class ApiTransferRequest:
transfer_metadata: str
+@dataclass
+class ApiTransferAck:
+ # Gravity has acknowledged that the transfer has been successfully processed. If true, a `tx_id` will be returned. If false, an error will be returned.
+ ack: bool
+ # The transaction ID of the transfer. This is only returned if the transfer is successful.
+ tx_id: str
+
+
+@dataclass
+class ApiTransferResponse:
+ # The Transfer response object
+ result: ApiTransferAck
+
+
@dataclass
class ApiDepositHistoryRequest:
"""
diff --git a/src/codegen/apispec.json b/src/codegen/apispec.json
index 1cce840..25a5197 100644
--- a/src/codegen/apispec.json
+++ b/src/codegen/apispec.json
@@ -701,47 +701,6 @@
}
],
"rpcs": [
- {
- "namespace": "Admin",
- "name": "RPCDropClientWS",
- "version": 1,
- "route": "/drop_client_ws",
- "auth_required": true,
- "request": "ApiDropClientWsRequest",
- "response": "ApiDropClientWsResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- }
- ]
- },
{
"namespace": "Order",
"name": "RPCCreateOrderV1",
@@ -981,6 +940,26 @@
"message": "Invalid trigger order",
"status": 400
},
+ {
+ "code": 2113,
+ "message": "Trigger price must be non-zero",
+ "status": 400
+ },
+ {
+ "code": 2114,
+ "message": "Invalid position linked TPSL orders, position linked TPSL must be a reduce-only order",
+ "status": 400
+ },
+ {
+ "code": 2115,
+ "message": "Invalid position linked TPSL orders, position linked TPSL must not have smaller size than the position",
+ "status": 400
+ },
+ {
+ "code": 2116,
+ "message": "Position linked TPSL order for this asset already exists",
+ "status": 400
+ },
{
"code": 3004,
"message": "Instrument does not have a valid maintenance margin configuration",
@@ -995,6 +974,16 @@
"code": 3006,
"message": "Instrument's quote currency does not have a valid balance decimal configuration",
"status": 500
+ },
+ {
+ "code": 2400,
+ "message": "Reduce only order with no position",
+ "status": 400
+ },
+ {
+ "code": 2401,
+ "message": "Reduce only order must not increase position size",
+ "status": 400
}
]
},
@@ -1230,12 +1219,12 @@
},
{
"namespace": "Order",
- "name": "RPCPreOrderCheckV1",
+ "name": "RPCCancelOnDisconnectV1",
"version": 1,
- "route": "/pre_order_check",
+ "route": "/cancel_on_disconnect",
"auth_required": true,
- "request": "ApiPreOrderCheckRequest",
- "response": "ApiPreOrderCheckResponse",
+ "request": "ApiCancelOnDisconnectRequest",
+ "response": "AckResponse",
"on_request_errors": [
{
"code": 1000,
@@ -1268,30 +1257,61 @@
"status": 401
},
{
- "code": 3004,
- "message": "Instrument does not have a valid maintenance margin configuration",
- "status": 500
+ "code": 6000,
+ "message": "Countdown time is bigger than 300s supported",
+ "status": 400
+ }
+ ]
+ },
+ {
+ "namespace": "Execution",
+ "name": "RPCFillHistoryV1",
+ "version": 1,
+ "route": "/fill_history",
+ "auth_required": true,
+ "request": "ApiFillHistoryRequest",
+ "response": "ApiFillHistoryResponse",
+ "on_request_errors": [
+ {
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
},
{
- "code": 3005,
- "message": "Instrument's underlying currency does not have a valid balance decimal configuration",
- "status": 500
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
+ "status": 403
},
{
- "code": 3006,
- "message": "Instrument's quote currency does not have a valid balance decimal configuration",
+ "code": 1002,
+ "message": "Internal Server Error",
"status": 500
+ },
+ {
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
+ "status": 400
+ },
+ {
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
+ },
+ {
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
}
]
},
{
- "namespace": "Position",
- "name": "RPCDedustPositionV1",
+ "namespace": "Execution",
+ "name": "RPCPositionsV1",
"version": 1,
- "route": "/dedust_position",
+ "route": "/positions",
"auth_required": true,
- "request": "ApiDedustPositionRequest",
- "response": "ApiDedustPositionResponse",
+ "request": "ApiPositionsRequest",
+ "response": "ApiPositionsResponse",
"on_request_errors": [
{
"code": 1000,
@@ -1314,15 +1334,46 @@
"status": 400
},
{
- "code": 1004,
- "message": "Data Not Found",
- "status": 404
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
},
{
- "code": 1005,
- "message": "Unknown Error",
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
+ }
+ ]
+ },
+ {
+ "namespace": "Execution",
+ "name": "RPCFundingPaymentHistoryV1",
+ "version": 1,
+ "route": "/funding_payment_history",
+ "auth_required": true,
+ "request": "ApiFundingPaymentHistoryRequest",
+ "response": "ApiFundingPaymentHistoryResponse",
+ "on_request_errors": [
+ {
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
+ },
+ {
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
+ "status": 403
+ },
+ {
+ "code": 1002,
+ "message": "Internal Server Error",
"status": 500
},
+ {
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
+ "status": 400
+ },
{
"code": 1006,
"message": "You have surpassed the allocated rate limit for your tier",
@@ -1332,197 +1383,262 @@
"code": 1008,
"message": "Your IP has not been whitelisted for access",
"status": 401
+ }
+ ]
+ },
+ {
+ "namespace": "Transfer",
+ "name": "RPCDepositHistoryV1",
+ "version": 1,
+ "route": "/deposit_history",
+ "auth_required": true,
+ "request": "ApiDepositHistoryRequest",
+ "response": "ApiDepositHistoryResponse",
+ "on_request_errors": [
+ {
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
},
{
- "code": 1400,
- "message": "Signer does not have trade permission",
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
"status": 403
},
{
- "code": 1009,
- "message": "We are temporarily deactivating this API endpoint, please try again later",
- "status": 503
+ "code": 1002,
+ "message": "Internal Server Error",
+ "status": 500
},
{
- "code": 2000,
- "message": "Order signature is from an unauthorized signer",
- "status": 403
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
+ "status": 400
},
{
- "code": 2001,
- "message": "Order signature has expired",
- "status": 403
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
},
{
- "code": 2002,
- "message": "Order signature does not match payload",
- "status": 403
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
+ }
+ ]
+ },
+ {
+ "namespace": "Transfer",
+ "name": "RPCTransferV1",
+ "version": 1,
+ "route": "/transfer",
+ "auth_required": true,
+ "request": "ApiTransferRequest",
+ "response": "ApiTransferResponse",
+ "on_request_errors": [
+ {
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
},
{
- "code": 2003,
- "message": "Order sub account does not match logged in user",
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
"status": 403
},
{
- "code": 2004,
- "message": "Order signature is from an expired session key",
- "status": 403
+ "code": 1002,
+ "message": "Internal Server Error",
+ "status": 500
},
{
- "code": 2010,
- "message": "Order ID should be empty when creating an order",
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
"status": 400
},
{
- "code": 2011,
- "message": "Client Order ID should be supplied when creating an order",
- "status": 400
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
},
{
- "code": 2012,
- "message": "Client Order ID overlaps with existing active order",
- "status": 400
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
},
{
- "code": 2030,
- "message": "Orderbook Orders must have a TimeInForce of GTT/IOC/FOK",
+ "code": 5000,
+ "message": "Transfer Metadata does not match the expected structure.",
"status": 400
},
{
- "code": 2031,
- "message": "RFQ Orders must have a TimeInForce of GTT/AON/IOC/FOK",
+ "code": 5001,
+ "message": "Transfer Provider does not match the expected provider.",
"status": 400
},
{
- "code": 2032,
- "message": "Post Only can only be set to true for GTT/AON orders",
+ "code": 4002,
+ "message": "Transfer failed with an unrefined failure reason, please report to GRVT",
"status": 400
},
{
- "code": 2020,
- "message": "Market Order must always be supplied without a limit price",
+ "code": 5002,
+ "message": "Direction of the transfer does not match the expected direction.",
"status": 400
},
{
- "code": 2021,
- "message": "Limit Order must always be supplied with a limit price",
+ "code": 5003,
+ "message": "Endpoint account ID is invalid.",
"status": 400
},
{
- "code": 2040,
- "message": "Order must contain at least one leg",
+ "code": 5004,
+ "message": "Funding account does not exist in our system.",
"status": 400
},
{
- "code": 2041,
- "message": "Order Legs must be sorted by Derivative.Instrument/Underlying/BaseCurrency/Expiration/StrikePrice",
+ "code": 5005,
+ "message": "Invalid ChainID for the transfer request.",
"status": 400
- },
+ }
+ ]
+ },
+ {
+ "namespace": "Transfer",
+ "name": "RPCTransferHistoryV1",
+ "version": 1,
+ "route": "/transfer_history",
+ "auth_required": true,
+ "request": "ApiTransferHistoryRequest",
+ "response": "ApiTransferHistoryResponse",
+ "on_request_errors": [
{
- "code": 2042,
- "message": "Orderbook Orders must contain only one leg",
- "status": 400
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
},
{
- "code": 2050,
- "message": "Order state must be empty upon creation",
- "status": 400
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
+ "status": 403
},
{
- "code": 2051,
- "message": "Order execution metadata must be empty upon creation",
- "status": 400
+ "code": 1002,
+ "message": "Internal Server Error",
+ "status": 500
},
{
- "code": 2060,
- "message": "Order Legs contain one or more inactive derivative",
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
"status": 400
},
{
- "code": 2061,
- "message": "Unsupported Instrument Requested",
- "status": 400
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
},
{
- "code": 2063,
- "message": "Order size smaller than min block size in block trade venue",
- "status": 400
- },
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
+ }
+ ]
+ },
+ {
+ "namespace": "Transfer",
+ "name": "RPCWithdrawalV1",
+ "version": 1,
+ "route": "/withdrawal",
+ "auth_required": true,
+ "request": "ApiWithdrawalRequest",
+ "response": "AckResponse",
+ "on_request_errors": [
{
- "code": 2064,
- "message": "Invalid limit price tick",
- "status": 400
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
},
{
- "code": 2200,
- "message": "Order size should exactly tally to the dust portion (i.e., smaller than minimum size) of a position",
- "status": 400
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
+ "status": 403
},
{
- "code": 2201,
- "message": "Order level should match or beat mark price",
- "status": 400
+ "code": 1002,
+ "message": "Internal Server Error",
+ "status": 500
},
{
- "code": 2202,
- "message": "Cannot dedust position via a market order",
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
"status": 400
},
{
- "code": 2203,
- "message": "Cannot dedust position via a post-only order",
- "status": 400
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
},
{
- "code": 2204,
- "message": "Can only dedust position via a fill-or-kill order",
- "status": 400
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
},
{
- "code": 2205,
- "message": "Can only dedust position via a reduce-only order",
+ "code": 4010,
+ "message": "This wallet is not supported. Please try another wallet.",
"status": 400
- },
+ }
+ ]
+ },
+ {
+ "namespace": "Transfer",
+ "name": "RPCWithdrawalHistoryV1",
+ "version": 1,
+ "route": "/withdrawal_history",
+ "auth_required": true,
+ "request": "ApiWithdrawalHistoryRequest",
+ "response": "ApiWithdrawalHistoryResponse",
+ "on_request_errors": [
{
- "code": 2206,
- "message": "Attempting to trade the wrong buy/sell direction for dedusting position",
- "status": 400
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
},
{
- "code": 2070,
- "message": "Liquidation Order is not supported",
- "status": 400
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
+ "status": 403
},
{
- "code": 2080,
- "message": "Insufficient margin to create order",
- "status": 400
+ "code": 1002,
+ "message": "Internal Server Error",
+ "status": 500
},
{
- "code": 2081,
- "message": "Order Fill would result in exceeding maximum position size",
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
"status": 400
},
{
- "code": 2082,
- "message": "Pre-order check failed",
- "status": 400
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
},
{
- "code": 2090,
- "message": "Max open orders exceeded",
- "status": 429
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
}
]
},
{
- "namespace": "Order",
- "name": "RPCCancelOnDisconnectV1",
+ "namespace": "Account",
+ "name": "RPCSubAccountSummaryV1",
"version": 1,
- "route": "/cancel_on_disconnect",
+ "route": "/account_summary",
"auth_required": true,
- "request": "ApiCancelOnDisconnectRequest",
- "response": "AckResponse",
+ "request": "ApiSubAccountSummaryRequest",
+ "response": "ApiSubAccountSummaryResponse",
"on_request_errors": [
{
"code": 1000,
@@ -1553,22 +1669,17 @@
"code": 1008,
"message": "Your IP has not been whitelisted for access",
"status": 401
- },
- {
- "code": 6000,
- "message": "Countdown time is bigger than 300s supported",
- "status": 400
}
]
},
{
- "namespace": "Order",
- "name": "RPCCreateBulkOrdersV1",
+ "namespace": "Account",
+ "name": "RPCSubAccountHistoryV1",
"version": 1,
- "route": "/create_bulk_orders",
+ "route": "/account_history",
"auth_required": true,
- "request": "ApiCreateBulkOrdersRequest",
- "response": "ApiCreateBulkOrdersResponse",
+ "request": "ApiSubAccountHistoryRequest",
+ "response": "ApiSubAccountHistoryResponse",
"on_request_errors": [
{
"code": 1000,
@@ -1590,16 +1701,6 @@
"message": "Request could not be processed due to malformed syntax",
"status": 400
},
- {
- "code": 1004,
- "message": "Data Not Found",
- "status": 404
- },
- {
- "code": 1005,
- "message": "Unknown Error",
- "status": 500
- },
{
"code": 1006,
"message": "You have surpassed the allocated rate limit for your tier",
@@ -1609,243 +1710,288 @@
"code": 1008,
"message": "Your IP has not been whitelisted for access",
"status": 401
- },
- {
- "code": 1400,
- "message": "Signer does not have trade permission",
- "status": 403
- },
- {
- "code": 1009,
- "message": "We are temporarily deactivating this API endpoint, please try again later",
- "status": 503
- },
+ }
+ ]
+ },
+ {
+ "namespace": "Account",
+ "name": "RPCAggregatedAccountSummaryV1",
+ "version": 1,
+ "route": "/aggregated_account_summary",
+ "auth_required": true,
+ "request": "EmptyRequest",
+ "response": "ApiAggregatedAccountSummaryResponse",
+ "on_request_errors": [
{
- "code": 2000,
- "message": "Order signature is from an unauthorized signer",
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
"status": 403
},
{
- "code": 2001,
- "message": "Order signature has expired",
- "status": 403
+ "code": 1002,
+ "message": "Internal Server Error",
+ "status": 500
},
{
- "code": 2002,
- "message": "Order signature does not match payload",
- "status": 403
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
+ "status": 400
},
{
- "code": 2003,
- "message": "Order sub account does not match logged in user",
- "status": 403
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
},
{
- "code": 2004,
- "message": "Order signature is from an expired session key",
- "status": 403
- },
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
+ }
+ ]
+ },
+ {
+ "namespace": "Account",
+ "name": "RPCFundingAccountSummaryV1",
+ "version": 1,
+ "route": "/funding_account_summary",
+ "auth_required": true,
+ "request": "EmptyRequest",
+ "response": "ApiFundingAccountSummaryResponse",
+ "on_request_errors": [
{
- "code": 2006,
- "message": "Order signature R/S must have exactly 64 characters long without 0x prefix",
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
"status": 403
},
{
- "code": 2005,
- "message": "Order signature V must be 27/28",
- "status": 403
+ "code": 1002,
+ "message": "Internal Server Error",
+ "status": 500
},
{
- "code": 2007,
- "message": "Order signature S must be in the lower half of the curve",
- "status": 403
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
+ "status": 400
},
{
- "code": 2010,
- "message": "Order ID should be empty when creating an order",
- "status": 400
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
},
{
- "code": 2011,
- "message": "Client Order ID should be supplied when creating an order",
- "status": 400
- },
- {
- "code": 2012,
- "message": "Client Order ID overlaps with existing active order",
- "status": 400
- },
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
+ }
+ ]
+ },
+ {
+ "namespace": "InitialLeverage",
+ "name": "RPCGetAllInitialLeverageV1",
+ "version": 1,
+ "route": "/get_all_initial_leverage",
+ "auth_required": true,
+ "request": "ApiGetAllInitialLeverageRequest",
+ "response": "ApiGetAllInitialLeverageResponse",
+ "on_request_errors": [
{
- "code": 2030,
- "message": "Orderbook Orders must have a TimeInForce of GTT/IOC/FOK",
- "status": 400
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
},
{
- "code": 2031,
- "message": "RFQ Orders must have a TimeInForce of GTT/AON/IOC/FOK",
- "status": 400
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
+ "status": 403
},
{
- "code": 2032,
- "message": "Post Only can only be set to true for GTT/AON orders",
- "status": 400
+ "code": 1002,
+ "message": "Internal Server Error",
+ "status": 500
},
{
- "code": 2020,
- "message": "Market Order must always be supplied without a limit price",
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
"status": 400
},
{
- "code": 2021,
- "message": "Limit Order must always be supplied with a limit price",
- "status": 400
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
},
{
- "code": 2040,
- "message": "Order must contain at least one leg",
- "status": 400
- },
+ "code": 1004,
+ "message": "Data Not Found",
+ "status": 404
+ }
+ ]
+ },
+ {
+ "namespace": "InitialLeverage",
+ "name": "RPCSetInitialLeverageV1",
+ "version": 1,
+ "route": "/set_initial_leverage",
+ "auth_required": true,
+ "request": "ApiSetInitialLeverageRequest",
+ "response": "ApiSetInitialLeverageResponse",
+ "on_request_errors": [
{
- "code": 2041,
- "message": "Order Legs must be sorted by Derivative.Instrument/Underlying/BaseCurrency/Expiration/StrikePrice",
- "status": 400
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
},
{
- "code": 2042,
- "message": "Orderbook Orders must contain only one leg",
- "status": 400
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
+ "status": 403
},
{
- "code": 2050,
- "message": "Order state must be empty upon creation",
- "status": 400
+ "code": 1002,
+ "message": "Internal Server Error",
+ "status": 500
},
{
- "code": 2051,
- "message": "Order execution metadata must be empty upon creation",
+ "code": 1003,
+ "message": "Request could not be processed due to malformed syntax",
"status": 400
},
{
- "code": 2060,
- "message": "Order Legs contain one or more inactive derivative",
- "status": 400
+ "code": 1006,
+ "message": "You have surpassed the allocated rate limit for your tier",
+ "status": 429
},
{
- "code": 2061,
- "message": "Unsupported Instrument Requested",
- "status": 400
+ "code": 1004,
+ "message": "Data Not Found",
+ "status": 404
},
{
- "code": 2062,
- "message": "Order size smaller than min size",
+ "code": 2100,
+ "message": "Invalid initial leverage",
"status": 400
- },
+ }
+ ]
+ }
+ ],
+ "streams": [
+ {
+ "namespace": "Order",
+ "name": "StreamOrderV1",
+ "channel": "v1.order",
+ "auth_required": true,
+ "feed_selector": "WSOrderFeedSelectorV1",
+ "feed": "WSOrderFeedDataV1",
+ "on_subscribe_errors": [
{
- "code": 2063,
- "message": "Order size smaller than min block size in block trade venue",
- "status": 400
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
},
{
- "code": 2064,
- "message": "Invalid limit price tick",
- "status": 400
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
+ "status": 403
},
{
- "code": 2065,
- "message": "Order size too granular",
- "status": 400
+ "code": 1002,
+ "message": "Internal Server Error",
+ "status": 500
},
{
- "code": 2070,
- "message": "Liquidation Order is not supported",
- "status": 400
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
},
{
- "code": 2080,
- "message": "Insufficient margin to create order",
+ "code": 1101,
+ "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
"status": 400
},
{
- "code": 2081,
- "message": "Order Fill would result in exceeding maximum position size",
+ "code": 1102,
+ "message": "Wrong number of primary selectors",
"status": 400
},
{
- "code": 2082,
- "message": "Pre-order check failed",
+ "code": 1103,
+ "message": "Wrong number of secondary selectors",
"status": 400
},
{
- "code": 2083,
- "message": "Order Fill would result in exceeding maximum position size under current configurable leverage tier",
+ "code": 3000,
+ "message": "Instrument is invalid",
"status": 400
},
{
- "code": 2090,
- "message": "Max open orders exceeded",
- "status": 429
- },
- {
- "code": 2110,
- "message": "Invalid trigger by",
+ "code": 3020,
+ "message": "Sub account ID must be an uint64 integer",
"status": 400
- },
+ }
+ ]
+ },
+ {
+ "namespace": "Order",
+ "name": "StreamOrderStateV1",
+ "channel": "v1.state",
+ "auth_required": true,
+ "feed_selector": "WSOrderStateFeedSelectorV1",
+ "feed": "WSOrderStateFeedDataV1",
+ "on_subscribe_errors": [
{
- "code": 2111,
- "message": "Unsupported trigger by",
- "status": 400
+ "code": 1000,
+ "message": "You need to authenticate prior to using this functionality",
+ "status": 401
},
{
- "code": 2112,
- "message": "Invalid trigger order",
- "status": 400
+ "code": 1001,
+ "message": "You are not authorized to access this functionality",
+ "status": 403
},
{
- "code": 3004,
- "message": "Instrument does not have a valid maintenance margin configuration",
+ "code": 1002,
+ "message": "Internal Server Error",
"status": 500
},
{
- "code": 3005,
- "message": "Instrument's underlying currency does not have a valid balance decimal configuration",
- "status": 500
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
},
{
- "code": 3006,
- "message": "Instrument's quote currency does not have a valid balance decimal configuration",
- "status": 500
+ "code": 1101,
+ "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
+ "status": 400
},
{
- "code": 2220,
- "message": "No orders provided",
+ "code": 1102,
+ "message": "Wrong number of primary selectors",
"status": 400
},
{
- "code": 2221,
- "message": "Invalid number of orders",
+ "code": 1103,
+ "message": "Wrong number of secondary selectors",
"status": 400
},
{
- "code": 2222,
- "message": "Order is not a TPSL order",
+ "code": 3000,
+ "message": "Instrument is invalid",
"status": 400
},
{
- "code": 2223,
- "message": "Unsupported bulk order type",
+ "code": 3020,
+ "message": "Sub account ID must be an uint64 integer",
"status": 400
}
]
},
{
"namespace": "Order",
- "name": "RPCGetOrderGroupV1",
- "version": 1,
- "route": "/order_group",
+ "name": "StreamCancelStatusV1",
+ "channel": "v1.cancel",
"auth_required": true,
- "request": "ApiGetOrderGroupRequest",
- "response": "ApiGetOrderGroupResponse",
- "on_request_errors": [
+ "feed_selector": "WSCancelFeedSelectorV1",
+ "feed": "WSCancelFeedDataV1",
+ "on_subscribe_errors": [
{
"code": 1000,
"message": "You need to authenticate prior to using this functionality",
@@ -1862,46 +2008,45 @@
"status": 500
},
{
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
+ },
+ {
+ "code": 1101,
+ "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
"status": 400
},
{
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
+ "code": 1102,
+ "message": "Wrong number of primary selectors",
+ "status": 400
},
{
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
+ "code": 1103,
+ "message": "Wrong number of secondary selectors",
+ "status": 400
},
{
- "code": 1004,
- "message": "Data Not Found",
- "status": 404
+ "code": 3000,
+ "message": "Instrument is invalid",
+ "status": 400
},
{
"code": 3020,
"message": "Sub account ID must be an uint64 integer",
"status": 400
- },
- {
- "code": 3021,
- "message": "Either order ID or client order ID must be supplied",
- "status": 400
}
]
},
{
"namespace": "Execution",
- "name": "RPCFillHistoryV1",
- "version": 1,
- "route": "/fill_history",
+ "name": "StreamFillV1",
+ "channel": "v1.fill",
"auth_required": true,
- "request": "ApiFillHistoryRequest",
- "response": "ApiFillHistoryResponse",
- "on_request_errors": [
+ "feed_selector": "WSFillFeedSelectorV1",
+ "feed": "WSFillFeedDataV1",
+ "on_subscribe_errors": [
{
"code": 1000,
"message": "You need to authenticate prior to using this functionality",
@@ -1917,73 +2062,46 @@
"message": "Internal Server Error",
"status": 500
},
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
{
"code": 1008,
"message": "Your IP has not been whitelisted for access",
"status": 401
- }
- ]
- },
- {
- "namespace": "Execution",
- "name": "RPCPositionsV1",
- "version": 1,
- "route": "/positions",
- "auth_required": true,
- "request": "ApiPositionsRequest",
- "response": "ApiPositionsResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
},
{
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
+ "code": 1101,
+ "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
+ "status": 400
},
{
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
+ "code": 1102,
+ "message": "Wrong number of primary selectors",
+ "status": 400
},
{
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
+ "code": 1103,
+ "message": "Wrong number of secondary selectors",
"status": 400
},
{
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
+ "code": 3000,
+ "message": "Instrument is invalid",
+ "status": 400
},
{
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
+ "code": 3020,
+ "message": "Sub account ID must be an uint64 integer",
+ "status": 400
}
]
},
{
"namespace": "Execution",
- "name": "RPCFundingPaymentHistoryV1",
- "version": 1,
- "route": "/funding_payment_history",
+ "name": "StreamPositionsV1",
+ "channel": "v1.position",
"auth_required": true,
- "request": "ApiFundingPaymentHistoryRequest",
- "response": "ApiFundingPaymentHistoryResponse",
- "on_request_errors": [
+ "feed_selector": "WSPositionsFeedSelectorV1",
+ "feed": "WSPositionsFeedDataV1",
+ "on_subscribe_errors": [
{
"code": 1000,
"message": "You need to authenticate prior to using this functionality",
@@ -2000,6164 +2118,569 @@
"status": 500
},
{
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
+ },
+ {
+ "code": 1101,
+ "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
"status": 400
},
{
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
+ "code": 1102,
+ "message": "Wrong number of primary selectors",
+ "status": 400
},
{
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
+ "code": 1103,
+ "message": "Wrong number of secondary selectors",
+ "status": 400
+ },
+ {
+ "code": 3000,
+ "message": "Instrument is invalid",
+ "status": 400
+ },
+ {
+ "code": 3020,
+ "message": "Sub account ID must be an uint64 integer",
+ "status": 400
}
]
},
{
"namespace": "Transfer",
- "name": "RPCDepositHistoryV1",
- "version": 1,
- "route": "/deposit_history",
+ "name": "StreamDepositV1",
+ "channel": "v1.deposit",
"auth_required": true,
- "request": "ApiDepositHistoryRequest",
- "response": "ApiDepositHistoryResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
+ "feed_selector": "WSDepositFeedSelectorV1",
+ "feed": "WSDepositFeedDataV1",
+ "on_subscribe_errors": [
{
"code": 1001,
"message": "You are not authorized to access this functionality",
"status": 403
},
{
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
},
{
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
+ "code": 1101,
+ "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
"status": 400
},
{
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
+ "code": 1102,
+ "message": "Wrong number of primary selectors",
+ "status": 400
},
{
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
+ "code": 1103,
+ "message": "Wrong number of secondary selectors",
+ "status": 400
}
]
},
{
"namespace": "Transfer",
- "name": "RPCTransferV1",
- "version": 1,
- "route": "/transfer",
+ "name": "StreamTransferV1",
+ "channel": "v1.transfer",
"auth_required": true,
- "request": "ApiTransferRequest",
- "response": "AckResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
+ "feed_selector": "WSTransferFeedSelectorV1",
+ "feed": "WSTransferFeedDataV1",
+ "on_subscribe_errors": [
{
"code": 1001,
"message": "You are not authorized to access this functionality",
"status": 403
},
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
{
"code": 1008,
"message": "Your IP has not been whitelisted for access",
"status": 401
},
{
- "code": 5000,
- "message": "Transfer Metadata does not match the expected structure.",
- "status": 400
- },
- {
- "code": 5001,
- "message": "Transfer Provider does not match the expected provider.",
- "status": 400
- },
- {
- "code": 5002,
- "message": "Direction of the transfer does not match the expected direction.",
+ "code": 1101,
+ "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
"status": 400
},
{
- "code": 5003,
- "message": "Endpoint account ID is invalid.",
+ "code": 1102,
+ "message": "Wrong number of primary selectors",
"status": 400
},
{
- "code": 5004,
- "message": "Funding account does not exist in our system.",
+ "code": 1103,
+ "message": "Wrong number of secondary selectors",
"status": 400
},
{
- "code": 5005,
- "message": "Invalid ChainID for the transfer request.",
+ "code": 3020,
+ "message": "Sub account ID must be an uint64 integer",
"status": 400
}
]
},
{
"namespace": "Transfer",
- "name": "RPCTransferHistoryV1",
- "version": 1,
- "route": "/transfer_history",
+ "name": "StreamWithdrawalV1",
+ "channel": "v1.withdrawal",
"auth_required": true,
- "request": "ApiTransferHistoryRequest",
- "response": "ApiTransferHistoryResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
+ "feed_selector": "WSWithdrawalFeedSelectorV1",
+ "feed": "WSWithdrawalFeedDataV1",
+ "on_subscribe_errors": [
{
"code": 1001,
"message": "You are not authorized to access this functionality",
"status": 403
},
{
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
+ "code": 1008,
+ "message": "Your IP has not been whitelisted for access",
+ "status": 401
},
{
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
+ "code": 1101,
+ "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
"status": 400
},
{
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
+ "code": 1102,
+ "message": "Wrong number of primary selectors",
+ "status": 400
},
{
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
+ "code": 1103,
+ "message": "Wrong number of secondary selectors",
+ "status": 400
}
]
- },
+ }
+ ]
+ }
+ ],
+ "structs": [
+ {
+ "name": "ApiPositionsRequest",
+ "is_root": true,
+ "fields": [
{
- "namespace": "Transfer",
- "name": "RPCWithdrawalV1",
- "version": 1,
- "route": "/withdrawal",
- "auth_required": true,
- "request": "ApiWithdrawalRequest",
- "response": "AckResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- },
- {
- "code": 4010,
- "message": "This wallet is not supported. Please try another wallet.",
- "status": 400
- }
- ]
- },
- {
- "namespace": "Transfer",
- "name": "RPCWithdrawalHistoryV1",
- "version": 1,
- "route": "/withdrawal_history",
- "auth_required": true,
- "request": "ApiWithdrawalHistoryRequest",
- "response": "ApiWithdrawalHistoryResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- }
- ]
- },
- {
- "namespace": "PreDepositCheck",
- "name": "RPCPreDepositCheckV1",
- "version": 1,
- "route": "/pre_deposit_check",
- "auth_required": true,
- "request": "ApiPreDepositCheckRequest",
- "response": "ApiPreDepositCheckResponse",
- "on_request_errors": [
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1007,
- "message": "The currency you are requesting for is not currently supported",
- "status": 404
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- }
- ]
- },
- {
- "namespace": "Account",
- "name": "RPCSubAccountSummaryV1",
- "version": 1,
- "route": "/account_summary",
- "auth_required": true,
- "request": "ApiSubAccountSummaryRequest",
- "response": "ApiSubAccountSummaryResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- }
- ]
- },
- {
- "namespace": "Account",
- "name": "RPCSubAccountHistoryV1",
- "version": 1,
- "route": "/account_history",
- "auth_required": true,
- "request": "ApiSubAccountHistoryRequest",
- "response": "ApiSubAccountHistoryResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- }
- ]
- },
- {
- "namespace": "Account",
- "name": "RPCAggregatedAccountSummaryV1",
- "version": 1,
- "route": "/aggregated_account_summary",
- "auth_required": true,
- "request": "EmptyRequest",
- "response": "ApiAggregatedAccountSummaryResponse",
- "on_request_errors": [
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- }
- ]
- },
- {
- "namespace": "Account",
- "name": "RPCFundingAccountSummaryV1",
- "version": 1,
- "route": "/funding_account_summary",
- "auth_required": true,
- "request": "EmptyRequest",
- "response": "ApiFundingAccountSummaryResponse",
- "on_request_errors": [
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- }
- ]
- },
- {
- "namespace": "SocializedLoss",
- "name": "RPCSocializedLossStatusV1",
- "version": 1,
- "route": "/socialized_loss_status",
- "auth_required": true,
- "request": "EmptyRequest",
- "response": "ApiSocializedLossStatusResponse",
- "on_request_errors": [
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- }
- ]
- },
- {
- "namespace": "InitialLeverage",
- "name": "RPCGetAllInitialLeverageV1",
- "version": 1,
- "route": "/get_all_initial_leverage",
- "auth_required": true,
- "request": "ApiGetAllInitialLeverageRequest",
- "response": "ApiGetAllInitialLeverageResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1004,
- "message": "Data Not Found",
- "status": 404
- }
- ]
- },
- {
- "namespace": "InitialLeverage",
- "name": "RPCSetInitialLeverageV1",
- "version": 1,
- "route": "/set_initial_leverage",
- "auth_required": true,
- "request": "ApiSetInitialLeverageRequest",
- "response": "ApiSetInitialLeverageResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1004,
- "message": "Data Not Found",
- "status": 404
- },
- {
- "code": 2100,
- "message": "Invalid initial leverage",
- "status": 400
- }
- ]
- },
- {
- "namespace": "Margin",
- "name": "RPCGetMarginTiersV1",
- "version": 1,
- "route": "/get_margin_tiers",
- "auth_required": true,
- "request": "EmptyRequest",
- "response": "ApiGetMarginTiersResponse",
- "on_request_errors": [
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- }
- ]
- },
- {
- "namespace": "Order",
- "name": "RPCQueryTradingPerformanceV1",
- "version": 1,
- "route": "/trading_performance",
- "auth_required": true,
- "request": "ApiQueryTradingPerformanceRequest",
- "response": "ApiQueryTradingPerformanceResponse",
- "on_request_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1003,
- "message": "Request could not be processed due to malformed syntax",
- "status": 400
- },
- {
- "code": 1006,
- "message": "You have surpassed the allocated rate limit for your tier",
- "status": 429
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- }
- ]
- }
- ],
- "streams": [
- {
- "namespace": "Order",
- "name": "StreamOrderV1",
- "channel": "v1.order",
- "auth_required": true,
- "feed_selector": "WSOrderFeedSelectorV1",
- "feed": "WSOrderFeedDataV1",
- "on_subscribe_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- },
- {
- "code": 1101,
- "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
- "status": 400
- },
- {
- "code": 1102,
- "message": "Wrong number of primary selectors",
- "status": 400
- },
- {
- "code": 1103,
- "message": "Wrong number of secondary selectors",
- "status": 400
- },
- {
- "code": 3000,
- "message": "Instrument is invalid",
- "status": 400
- },
- {
- "code": 3020,
- "message": "Sub account ID must be an uint64 integer",
- "status": 400
- }
- ]
- },
- {
- "namespace": "Order",
- "name": "StreamOrderStateV1",
- "channel": "v1.state",
- "auth_required": true,
- "feed_selector": "WSOrderStateFeedSelectorV1",
- "feed": "WSOrderStateFeedDataV1",
- "on_subscribe_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- },
- {
- "code": 1101,
- "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
- "status": 400
- },
- {
- "code": 1102,
- "message": "Wrong number of primary selectors",
- "status": 400
- },
- {
- "code": 1103,
- "message": "Wrong number of secondary selectors",
- "status": 400
- },
- {
- "code": 3000,
- "message": "Instrument is invalid",
- "status": 400
- },
- {
- "code": 3020,
- "message": "Sub account ID must be an uint64 integer",
- "status": 400
- }
- ]
- },
- {
- "namespace": "Order",
- "name": "StreamCancelStatusV1",
- "channel": "v1.cancel",
- "auth_required": true,
- "feed_selector": "WSCancelFeedSelectorV1",
- "feed": "WSCancelFeedDataV1",
- "on_subscribe_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- },
- {
- "code": 1101,
- "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
- "status": 400
- },
- {
- "code": 1102,
- "message": "Wrong number of primary selectors",
- "status": 400
- },
- {
- "code": 1103,
- "message": "Wrong number of secondary selectors",
- "status": 400
- },
- {
- "code": 3000,
- "message": "Instrument is invalid",
- "status": 400
- },
- {
- "code": 3020,
- "message": "Sub account ID must be an uint64 integer",
- "status": 400
- }
- ]
- },
- {
- "namespace": "Order",
- "name": "StreamOrderGroupV1",
- "channel": "v1.group",
- "auth_required": true,
- "feed_selector": "WSOrderGroupFeedSelectorV1",
- "feed": "WSOrderGroupFeedDataV1",
- "on_subscribe_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- },
- {
- "code": 1101,
- "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
- "status": 400
- },
- {
- "code": 1102,
- "message": "Wrong number of primary selectors",
- "status": 400
- },
- {
- "code": 1103,
- "message": "Wrong number of secondary selectors",
- "status": 400
- },
- {
- "code": 1103,
- "message": "Wrong number of secondary selectors",
- "status": 400
- },
- {
- "code": 3000,
- "message": "Instrument is invalid",
- "status": 400
- },
- {
- "code": 3020,
- "message": "Sub account ID must be an uint64 integer",
- "status": 400
- }
- ]
- },
- {
- "namespace": "Execution",
- "name": "StreamFillV1",
- "channel": "v1.fill",
- "auth_required": true,
- "feed_selector": "WSFillFeedSelectorV1",
- "feed": "WSFillFeedDataV1",
- "on_subscribe_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- },
- {
- "code": 1101,
- "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
- "status": 400
- },
- {
- "code": 1102,
- "message": "Wrong number of primary selectors",
- "status": 400
- },
- {
- "code": 1103,
- "message": "Wrong number of secondary selectors",
- "status": 400
- },
- {
- "code": 3000,
- "message": "Instrument is invalid",
- "status": 400
- },
- {
- "code": 3020,
- "message": "Sub account ID must be an uint64 integer",
- "status": 400
- }
- ]
- },
- {
- "namespace": "Execution",
- "name": "StreamPositionsV1",
- "channel": "v1.position",
- "auth_required": true,
- "feed_selector": "WSPositionsFeedSelectorV1",
- "feed": "WSPositionsFeedDataV1",
- "on_subscribe_errors": [
- {
- "code": 1000,
- "message": "You need to authenticate prior to using this functionality",
- "status": 401
- },
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1002,
- "message": "Internal Server Error",
- "status": 500
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- },
- {
- "code": 1101,
- "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
- "status": 400
- },
- {
- "code": 1102,
- "message": "Wrong number of primary selectors",
- "status": 400
- },
- {
- "code": 1103,
- "message": "Wrong number of secondary selectors",
- "status": 400
- },
- {
- "code": 3000,
- "message": "Instrument is invalid",
- "status": 400
- },
- {
- "code": 3020,
- "message": "Sub account ID must be an uint64 integer",
- "status": 400
- }
- ]
- },
- {
- "namespace": "Transfer",
- "name": "StreamDepositV1",
- "channel": "v1.deposit",
- "auth_required": true,
- "feed_selector": "WSDepositFeedSelectorV1",
- "feed": "WSDepositFeedDataV1",
- "on_subscribe_errors": [
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- },
- {
- "code": 1101,
- "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
- "status": 400
- },
- {
- "code": 1102,
- "message": "Wrong number of primary selectors",
- "status": 400
- },
- {
- "code": 1103,
- "message": "Wrong number of secondary selectors",
- "status": 400
- }
- ]
- },
- {
- "namespace": "Transfer",
- "name": "StreamTransferV1",
- "channel": "v1.transfer",
- "auth_required": true,
- "feed_selector": "WSTransferFeedSelectorV1",
- "feed": "WSTransferFeedDataV1",
- "on_subscribe_errors": [
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- },
- {
- "code": 1101,
- "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
- "status": 400
- },
- {
- "code": 1102,
- "message": "Wrong number of primary selectors",
- "status": 400
- },
- {
- "code": 1103,
- "message": "Wrong number of secondary selectors",
- "status": 400
- },
- {
- "code": 3020,
- "message": "Sub account ID must be an uint64 integer",
- "status": 400
- }
- ]
- },
- {
- "namespace": "Transfer",
- "name": "StreamWithdrawalV1",
- "channel": "v1.withdrawal",
- "auth_required": true,
- "feed_selector": "WSWithdrawalFeedSelectorV1",
- "feed": "WSWithdrawalFeedDataV1",
- "on_subscribe_errors": [
- {
- "code": 1001,
- "message": "You are not authorized to access this functionality",
- "status": 403
- },
- {
- "code": 1008,
- "message": "Your IP has not been whitelisted for access",
- "status": 401
- },
- {
- "code": 1101,
- "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e",
- "status": 400
- },
- {
- "code": 1102,
- "message": "Wrong number of primary selectors",
- "status": 400
- },
- {
- "code": 1103,
- "message": "Wrong number of secondary selectors",
- "status": 400
- }
- ]
- }
- ]
- }
- ],
- "structs": [
- {
- "name": "ApiPositionsRequest",
- "is_root": true,
- "fields": [
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The sub account ID to request for"
- ]
- },
- {
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
- "index": 1,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['PERPETUAL']",
- "comment": [
- "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 2,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['BTC', 'ETH']",
- "comment": [
- "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 3,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['USDT', 'USDC']",
- "comment": [
- "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
- ]
- }
- ],
- "comment": [
- "Query the positions of a sub account"
- ]
- },
- {
- "name": "Positions",
- "is_root": false,
- "fields": [
- {
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Time at which the event was emitted in unix nanoseconds"
- ]
- },
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The sub account ID that participated in the trade"
- ]
- },
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The instrument being represented"
- ]
- },
- {
- "name": "size",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'2635000.50'",
- "comment": [
- "The size of the position, expressed in base asset decimal units. Negative for short positions"
- ]
- },
- {
- "name": "notional",
- "lite_name": "n",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'2635000.50'",
- "comment": [
- "The notional value of the position, negative for short assets, expressed in quote asset decimal units"
- ]
- },
- {
- "name": "entry_price",
- "lite_name": "ep",
- "semantic_type": "string",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The entry price of the position, expressed in `9` decimals",
- "Whenever increasing the size of a position, the entry price is updated to the new average entry price",
- "`new_entry_price = (old_entry_price * old_size + trade_price * trade_size) / (old_size + trade_size)`"
- ]
- },
- {
- "name": "exit_price",
- "lite_name": "ep1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The exit price of the position, expressed in `9` decimals",
- "Whenever decreasing the size of a position, the exit price is updated to the new average exit price",
- "`new_exit_price = (old_exit_price * old_exit_trade_size + trade_price * trade_size) / (old_exit_trade_size + trade_size)`"
- ]
- },
- {
- "name": "mark_price",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 7,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The mark price of the position, expressed in `9` decimals"
- ]
- },
- {
- "name": "unrealized_pnl",
- "lite_name": "up",
- "semantic_type": "string",
- "json_type": "string",
- "index": 8,
- "array_depth": 0,
- "optional": false,
- "example": "'135000.50'",
- "comment": [
- "The unrealized PnL of the position, expressed in quote asset decimal units",
- "`unrealized_pnl = (mark_price - entry_price) * size`"
- ]
- },
- {
- "name": "realized_pnl",
- "lite_name": "rp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 9,
- "array_depth": 0,
- "optional": false,
- "example": "'-35000.30'",
- "comment": [
- "The realized PnL of the position, expressed in quote asset decimal units",
- "`realized_pnl = (exit_price - entry_price) * exit_trade_size`"
- ]
- },
- {
- "name": "total_pnl",
- "lite_name": "tp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 10,
- "array_depth": 0,
- "optional": false,
- "example": "'100000.20'",
- "comment": [
- "The total PnL of the position, expressed in quote asset decimal units",
- "`total_pnl = realized_pnl + unrealized_pnl`"
- ]
- },
- {
- "name": "roi",
- "lite_name": "r",
- "semantic_type": "string",
- "json_type": "string",
- "index": 11,
- "array_depth": 0,
- "optional": false,
- "example": "'10.20'",
- "comment": [
- "The ROI of the position, expressed as a percentage",
- "`roi = (total_pnl / (entry_price * abs(size))) * 100^`"
- ]
- },
- {
- "name": "quote_index_price",
- "lite_name": "qi",
- "semantic_type": "string",
- "json_type": "string",
- "index": 12,
- "array_depth": 0,
- "optional": false,
- "example": "'1.0000102'",
- "comment": [
- "The index price of the quote currency. (reported in `USD`)"
- ]
- },
- {
- "name": "est_liquidation_price",
- "lite_name": "el",
- "semantic_type": "string",
- "json_type": "string",
- "index": 13,
- "array_depth": 0,
- "optional": false,
- "example": "60000.25",
- "comment": [
- "The estimated liquidation price"
- ]
- },
- {
- "name": "leverage",
- "lite_name": "l",
- "semantic_type": "string",
- "json_type": "string",
- "index": 14,
- "array_depth": 0,
- "optional": false,
- "example": "'10'",
- "comment": [
- "The current leverage value for this position"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiPositionsResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Positions",
- "json_type": "Positions",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The positions matching the request filter"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiFillHistoryRequest",
- "is_root": true,
- "fields": [
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The sub account ID to request for"
- ]
- },
- {
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
- "index": 1,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['PERPETUAL']",
- "comment": [
- "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 2,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['BTC', 'ETH']",
- "comment": [
- "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 3,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['USDT', 'USDC']",
- "comment": [
- "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "int64",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
- "comment": [
- "The start time to apply in unix nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "int64",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
- "comment": [
- "The end time to apply in unix nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 6,
- "array_depth": 0,
- "optional": true,
- "default": "500",
- "example": "500",
- "comment": [
- "The limit to query for. Defaults to 500; Max 1000"
- ]
- },
- {
- "name": "cursor",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
- "index": 7,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "''",
- "comment": [
- "The cursor to indicate when to start the query from"
- ]
- }
- ],
- "comment": [
- "Query for all historical fills made by a single account. A single order can be matched multiple times, hence there is no real way to uniquely identify a trade.",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "Fill",
- "is_root": false,
- "fields": [
- {
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Time at which the event was emitted in unix nanoseconds"
- ]
- },
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The sub account ID that participated in the trade"
- ]
- },
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The instrument being represented"
- ]
- },
- {
- "name": "is_buyer",
- "lite_name": "ib",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "true",
- "comment": [
- "The side that the subaccount took on the trade"
- ]
- },
- {
- "name": "is_taker",
- "lite_name": "it",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "true",
- "comment": [
- "The role that the subaccount took on the trade"
- ]
- },
- {
- "name": "size",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": false,
- "example": "'0.30'",
- "comment": [
- "The number of assets being traded, expressed in base asset decimal units"
- ]
- },
- {
- "name": "price",
- "lite_name": "p",
- "semantic_type": "string",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The traded price, expressed in `9` decimals"
- ]
- },
- {
- "name": "mark_price",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 7,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The mark price of the instrument at point of trade, expressed in `9` decimals"
- ]
- },
- {
- "name": "index_price",
- "lite_name": "ip",
- "semantic_type": "string",
- "json_type": "string",
- "index": 8,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The index price of the instrument at point of trade, expressed in `9` decimals"
- ]
- },
- {
- "name": "interest_rate",
- "lite_name": "ir",
- "semantic_type": "string",
- "json_type": "string",
- "index": 9,
- "array_depth": 0,
- "optional": false,
- "example": "0.0003",
- "comment": [
- "The interest rate of the underlying at point of trade, expressed in centibeeps (1/100th of a basis point)"
- ]
- },
- {
- "name": "forward_price",
- "lite_name": "fp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 10,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "[Options] The forward price of the option at point of trade, expressed in `9` decimals"
- ]
- },
- {
- "name": "realized_pnl",
- "lite_name": "rp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 11,
- "array_depth": 0,
- "optional": false,
- "example": "'2400.50'",
- "comment": [
- "The realized PnL of the trade, expressed in quote asset decimal units (0 if increasing position size)"
- ]
- },
- {
- "name": "fee",
- "lite_name": "f",
- "semantic_type": "string",
- "json_type": "string",
- "index": 12,
- "array_depth": 0,
- "optional": false,
- "example": "'9.75'",
- "comment": [
- "The fees paid on the trade, expressed in quote asset decimal unit (negative if maker rebate applied)"
- ]
- },
- {
- "name": "fee_rate",
- "lite_name": "fr",
- "semantic_type": "string",
- "json_type": "string",
- "index": 13,
- "array_depth": 0,
- "optional": false,
- "example": "0.0003",
- "comment": [
- "The fee rate paid on the trade"
- ]
- },
- {
- "name": "trade_id",
- "lite_name": "ti",
- "semantic_type": "string",
- "json_type": "string",
- "index": 14,
- "array_depth": 0,
- "optional": false,
- "example": "'209358-2'",
- "comment": [
- "A trade identifier, globally unique, and monotonically increasing (not by `1`).",
- "All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.",
- "`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`."
- ]
- },
- {
- "name": "order_id",
- "lite_name": "oi",
- "semantic_type": "uint128",
- "json_type": "string",
- "index": 15,
- "array_depth": 0,
- "optional": false,
- "example": "'0x10000101000203040506'",
- "comment": [
- "An order identifier"
- ]
- },
- {
- "name": "venue",
- "lite_name": "v",
- "semantic_type": "Venue",
- "json_type": "Venue",
- "index": 16,
- "array_depth": 0,
- "optional": false,
- "example": "'ORDERBOOK'",
- "comment": [
- "The venue where the trade occurred"
- ]
- },
- {
- "name": "client_order_id",
- "lite_name": "co",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 18,
- "array_depth": 0,
- "optional": false,
- "example": "'23042'",
- "comment": [
- "A unique identifier for the active order within a subaccount, specified by the client",
- "This is used to identify the order in the client's system",
- "This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer",
- "This field will not be propagated to the smart contract, and should not be signed by the client",
- "This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected",
- "Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]",
- "To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]",
- "",
- "When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId"
- ]
- },
- {
- "name": "signer",
- "lite_name": "s1",
- "semantic_type": "uint256",
- "json_type": "string",
- "index": 20,
- "array_depth": 0,
- "optional": false,
- "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
- "comment": [
- "The address (public key) of the wallet signing the payload"
- ]
- },
- {
- "name": "broker",
- "lite_name": "b",
- "semantic_type": "BrokerTag",
- "json_type": "BrokerTag",
- "index": 21,
- "array_depth": 0,
- "optional": true,
- "default": "",
- "comment": [
- "Specifies the broker who brokered the order"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiFillHistoryResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Fill",
- "json_type": "Fill",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The private trades matching the request asset"
- ]
- },
- {
- "name": "next",
- "lite_name": "n",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'Qw0918='",
- "comment": [
- "The cursor to indicate when to start the query from"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiFundingPaymentHistoryRequest",
- "is_root": true,
- "fields": [
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The sub account ID to request for"
- ]
- },
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "all",
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The perpetual instrument to filter for"
- ]
- },
- {
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "int64",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
- "comment": [
- "The start time to apply in unix nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "int64",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
- "comment": [
- "The end time to apply in unix nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "500",
- "example": "500",
- "comment": [
- "The limit to query for. Defaults to 500; Max 1000"
- ]
- },
- {
- "name": "cursor",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "''",
- "comment": [
- "The cursor to indicate when to start the query from"
- ]
- }
- ],
- "comment": [
- "Query for all historical funding payments made by a single account.",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "FundingPayment",
- "is_root": false,
- "fields": [
- {
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Time at which the event was emitted in unix nanoseconds"
- ]
- },
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The sub account ID that made the funding payment"
- ]
- },
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The perpetual instrument being funded"
- ]
- },
- {
- "name": "currency",
- "lite_name": "c",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'USDT'",
- "comment": [
- "The currency of the funding payment"
- ]
- },
- {
- "name": "amount",
- "lite_name": "a",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'9.75'",
- "comment": [
- "The amount of the funding payment. Positive if paid, negative if received"
- ]
- },
- {
- "name": "tx_id",
- "lite_name": "ti",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": false,
- "example": "'209358'",
- "comment": [
- "The transaction ID of the funding payment.",
- "Funding payments can be triggered by a trade, transfer, or liquidation.",
- "The `tx_id` will match the corresponding `trade_id` or `tx_id`."
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiFundingPaymentHistoryResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "FundingPayment",
- "json_type": "FundingPayment",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The funding payments matching the request asset"
- ]
- },
- {
- "name": "next",
- "lite_name": "n",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'Qw0918='",
- "comment": [
- "The cursor to indicate when to start the query from"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiSubAccountSummaryRequest",
- "is_root": true,
- "fields": [
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The subaccount ID to filter by"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "SpotBalance",
- "is_root": false,
- "fields": [
- {
- "name": "currency",
- "lite_name": "c",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'USDT'",
- "comment": [
- "The currency you hold a spot balance in"
- ]
- },
- {
- "name": "balance",
- "lite_name": "b",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "This currency's balance in this trading account."
- ]
- },
- {
- "name": "index_price",
- "lite_name": "ip",
- "semantic_type": "string",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'1.0000102'",
- "comment": [
- "The index price of this currency. (reported in `USD`)"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "SubAccount",
- "is_root": false,
- "fields": [
- {
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Time at which the event was emitted in unix nanoseconds"
- ]
- },
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The sub account ID this entry refers to"
- ]
- },
- {
- "name": "margin_type",
- "lite_name": "mt",
- "semantic_type": "MarginType",
- "json_type": "MarginType",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'SIMPLE_CROSS_MARGIN'",
- "comment": [
- "The type of margin algorithm this subaccount uses"
- ]
- },
- {
- "name": "settle_currency",
- "lite_name": "sc",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'USDT'",
- "comment": [
- "The settlement, margin, and reporting currency of this account.",
- "This subaccount can only open positions quoted in this currency",
- "",
- "In the future, when users select a Multi-Currency Margin Type, this will be USD",
- "All other assets are converted to this currency for the purpose of calculating margin"
- ]
- },
- {
- "name": "unrealized_pnl",
- "lite_name": "up",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The total unrealized PnL of all positions owned by this subaccount, denominated in quote currency decimal units.",
- "`unrealized_pnl = sum(position.unrealized_pnl * position.quote_index_price) / settle_index_price`"
- ]
- },
- {
- "name": "total_equity",
- "lite_name": "te",
- "semantic_type": "string",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The notional value of your account if all positions are closed, excluding trading fees (reported in `settle_currency`).",
- "`total_equity = sum(spot_balance.balance * spot_balance.index_price) / settle_index_price + unrealized_pnl`"
- ]
- },
- {
- "name": "initial_margin",
- "lite_name": "im",
- "semantic_type": "string",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The `total_equity` required to open positions in the account (reported in `settle_currency`).",
- "Computation is different depending on account's `margin_type`"
- ]
- },
- {
- "name": "maintenance_margin",
- "lite_name": "mm",
- "semantic_type": "string",
- "json_type": "string",
- "index": 7,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The `total_equity` required to avoid liquidation of positions in the account (reported in `settle_currency`).",
- "Computation is different depending on account's `margin_type`"
- ]
- },
- {
- "name": "available_balance",
- "lite_name": "ab",
- "semantic_type": "string",
- "json_type": "string",
- "index": 8,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The notional value available to transfer out of the trading account into the funding account (reported in `settle_currency`).",
- "`available_balance = total_equity - initial_margin - min(unrealized_pnl, 0)`"
- ]
- },
- {
- "name": "spot_balances",
- "lite_name": "sb",
- "semantic_type": "SpotBalance",
- "json_type": "SpotBalance",
- "index": 9,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of spot assets owned by this sub account, and their balances"
- ]
- },
- {
- "name": "positions",
- "lite_name": "p",
- "semantic_type": "Positions",
- "json_type": "Positions",
- "index": 10,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of positions owned by this sub account"
- ]
- },
- {
- "name": "settle_index_price",
- "lite_name": "si",
- "semantic_type": "string",
- "json_type": "string",
- "index": 11,
- "array_depth": 0,
- "optional": false,
- "example": "'1.0000102'",
- "comment": [
- "The index price of the settle currency. (reported in `USD`)"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiSubAccountSummaryResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "SubAccount",
- "json_type": "SubAccount",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The sub account matching the request sub account"
- ]
- }
- ],
- "comment": [
- "Query for sub-account details, including base currency balance, all derivative positions, margin levels, and P\u0026L."
- ]
- },
- {
- "name": "ApiSubAccountHistoryRequest",
- "is_root": true,
- "fields": [
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The sub account ID to request for"
- ]
- },
- {
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
- "comment": [
- "Start time of sub account history in unix nanoseconds"
- ]
- },
- {
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
- "comment": [
- "End time of sub account history in unix nanoseconds"
- ]
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "500",
- "example": "500",
- "comment": [
- "The limit to query for. Defaults to 500; Max 1000"
- ]
- },
- {
- "name": "cursor",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "''",
- "comment": [
- "The cursor to indicate when to start the next query from"
- ]
- }
- ],
- "comment": [
- "The request to get the history of a sub account",
- "SubAccount Summary values are snapshotted once every hour",
- "No snapshots are taken if the sub account has no activity in the hourly window",
- "History is preserved only for the last 30 days",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "ApiSubAccountHistoryResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "SubAccount",
- "json_type": "SubAccount",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The sub account history matching the request sub account"
- ]
- },
- {
- "name": "next",
- "lite_name": "n",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'Qw0918='",
- "comment": [
- "The cursor to indicate when to start the next query from"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiLatestSnapSubAccountsRequest",
- "is_root": true,
- "fields": [
- {
- "name": "sub_account_i_ds",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "example": "['2376', '5821']",
- "comment": [
- "The list of sub account ids to query"
- ]
- }
- ],
- "comment": [
- "The request to get the latest snapshot of list sub account",
- ""
- ]
- },
- {
- "name": "ApiLatestSnapSubAccountsResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "SubAccount",
- "json_type": "SubAccount",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The sub account history matching the request sub account"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "AggregatedAccountSummary",
- "is_root": false,
- "fields": [
- {
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "address",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
- "comment": [
- "The main account ID of the account to which the summary belongs"
- ]
- },
- {
- "name": "total_equity",
- "lite_name": "te",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'3945034.23'",
- "comment": [
- "Total equity of the main (+ sub) account, denominated in USD"
- ]
- },
- {
- "name": "spot_balances",
- "lite_name": "sb",
- "semantic_type": "SpotBalance",
- "json_type": "SpotBalance",
- "index": 2,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of spot assets owned by this main (+ sub) account, and their balances"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiAggregatedAccountSummaryResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "AggregatedAccountSummary",
- "json_type": "AggregatedAccountSummary",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The aggregated account summary"
- ]
- }
- ],
- "comment": [
- "The aggregated account summary, that reports the total equity and spot balances of a funding (main) account, and its constituent trading (sub) accounts"
- ]
- },
- {
- "name": "FundingAccountSummary",
- "is_root": true,
- "fields": [
- {
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "address",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
- "comment": [
- "The main account ID of the account to which the summary belongs"
- ]
- },
- {
- "name": "total_equity",
- "lite_name": "te",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'3945034.23'",
- "comment": [
- "Total equity of the main account, denominated in USD"
- ]
- },
- {
- "name": "spot_balances",
- "lite_name": "sb",
- "semantic_type": "SpotBalance",
- "json_type": "SpotBalance",
- "index": 2,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of spot assets owned by this main account, and their balances"
- ]
- }
- ],
- "comment": [
- "The funding account summary, that reports the total equity and spot balances of a funding (main) account"
- ]
- },
- {
- "name": "ApiFundingAccountSummaryResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "FundingAccountSummary",
- "json_type": "FundingAccountSummary",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The funding account summary"
- ]
- }
- ],
- "comment": [
- "The funding account summary, that reports the total equity and spot balances of a funding (main) account"
- ]
- },
- {
- "name": "ApiSocializedLossStatusResponse",
- "is_root": true,
- "fields": [
- {
- "name": "is_active",
- "lite_name": "ia",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'false'",
- "comment": [
- "Whether the socialized loss is active"
- ]
- },
- {
- "name": "haircut_ratio",
- "lite_name": "hr",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'0.34'",
- "comment": [
- "The socialized loss haircut ratio in centi-beeps"
- ]
- }
- ],
- "comment": [
- "The socialized loss status."
- ]
- },
- {
- "name": "ApiListAggregatedAccountSummaryRequest",
- "is_root": true,
- "fields": [
- {
- "name": "main_account_ids",
- "lite_name": "ma",
- "semantic_type": "[]byte",
- "json_type": "unknown",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of main account ID to request for"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiListAggregatedAccountSummaryResponse",
- "is_root": true,
- "fields": [
- {
- "name": "account_summaries",
- "lite_name": "as",
- "semantic_type": "ApiAggregatedAccountSummaryResponse",
- "json_type": "ApiAggregatedAccountSummaryResponse",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of aggregated account summaries of requested main accounts"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiSetInitialLeverageRequest",
- "is_root": true,
- "fields": [
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The sub account ID to set the leverage for"
- ]
- },
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The instrument to set the leverage for"
- ]
- },
- {
- "name": "leverage",
- "lite_name": "l",
- "semantic_type": "string",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'10'",
- "comment": [
- "The leverage to set for the sub account"
- ]
- }
- ],
- "comment": [
- "The request to set the initial leverage of a sub account"
- ]
- },
- {
- "name": "ApiSetInitialLeverageResponse",
- "is_root": true,
- "fields": [
- {
- "name": "success",
- "lite_name": "s",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'true'",
- "comment": [
- "Whether the leverage was set successfully"
- ]
- }
- ],
- "comment": [
- "The response to set the initial leverage of a sub account"
- ]
- },
- {
- "name": "ApiGetAllInitialLeverageRequest",
- "is_root": true,
- "fields": [
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The sub account ID to get the leverage for"
- ]
- }
- ],
- "comment": [
- "The request to get the initial leverage of a sub account"
- ]
- },
- {
- "name": "InitialLeverageResult",
- "is_root": false,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The instrument to get the leverage for"
- ]
- },
- {
- "name": "leverage",
- "lite_name": "l",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'10'",
- "comment": [
- "The initial leverage of the sub account"
- ]
- },
- {
- "name": "min_leverage",
- "lite_name": "ml",
- "semantic_type": "string",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'10'",
- "comment": [
- "The min leverage this sub account can set"
- ]
- },
- {
- "name": "max_leverage",
- "lite_name": "ml1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'50'",
- "comment": [
- "The max leverage this sub account can set"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetAllInitialLeverageResponse",
- "is_root": true,
- "fields": [
- {
- "name": "results",
- "lite_name": "r",
- "semantic_type": "InitialLeverageResult",
- "json_type": "InitialLeverageResult",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The initial leverage of the sub account"
- ]
- }
- ],
- "comment": [
- "The response to get the initial leverage of a sub account"
- ]
- },
- {
- "name": "ApiOrderbookLevelsRequest",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "depth",
- "lite_name": "d",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "50",
- "comment": [
- "Depth of the order book to be retrieved (10, 50, 100, 500)"
- ]
- }
- ],
- "comment": [
- "Retrieves aggregated price depth for a single instrument, with a maximum depth of 10 levels. Do not use this to poll for data -- a websocket subscription is much more performant, and useful."
- ]
- },
- {
- "name": "OrderbookLevel",
- "is_root": false,
- "fields": [
- {
- "name": "price",
- "lite_name": "p",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The price of the level, expressed in `9` decimals"
- ]
- },
- {
- "name": "size",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'3456.78'",
- "comment": [
- "The number of assets offered, expressed in base asset decimal units"
- ]
- },
- {
- "name": "num_orders",
- "lite_name": "no",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'123'",
- "comment": [
- "The number of open orders at this level"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "OrderbookLevels",
- "is_root": false,
- "fields": [
- {
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Time at which the event was emitted in unix nanoseconds"
- ]
- },
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "bids",
- "lite_name": "b",
- "semantic_type": "OrderbookLevel",
- "json_type": "OrderbookLevel",
- "index": 2,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of best bids up till query depth"
- ]
- },
- {
- "name": "asks",
- "lite_name": "a",
- "semantic_type": "OrderbookLevel",
- "json_type": "OrderbookLevel",
- "index": 3,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of best asks up till query depth"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiOrderbookLevelsResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "OrderbookLevels",
- "json_type": "OrderbookLevels",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The orderbook levels objects matching the request asset"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiMiniTickerRequest",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- }
- ],
- "comment": [
- "Retrieves a single mini ticker value for a single instrument. Please do not use this to repeatedly poll for data -- a websocket subscription is much more performant, and useful."
- ]
- },
- {
- "name": "MiniTicker",
- "is_root": false,
- "fields": [
- {
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": true,
- "example": "'1697788800000000000'",
- "comment": [
- "Time at which the event was emitted in unix nanoseconds"
- ]
- },
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "mark_price",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The mark price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "index_price",
- "lite_name": "ip",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The index price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "last_price",
- "lite_name": "lp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The last traded price of the instrument (also close price), expressed in `9` decimals"
- ]
- },
- {
- "name": "last_size",
- "lite_name": "ls",
- "semantic_type": "string",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The number of assets traded in the last trade, expressed in base asset decimal units"
- ]
- },
- {
- "name": "mid_price",
- "lite_name": "mp1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The mid price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "best_bid_price",
- "lite_name": "bb",
- "semantic_type": "string",
- "json_type": "string",
- "index": 7,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The best bid price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "best_bid_size",
- "lite_name": "bb1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 8,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The number of assets offered on the best bid price of the instrument, expressed in base asset decimal units"
- ]
- },
- {
- "name": "best_ask_price",
- "lite_name": "ba",
- "semantic_type": "string",
- "json_type": "string",
- "index": 9,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The best ask price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "best_ask_size",
- "lite_name": "ba1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 10,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The number of assets offered on the best ask price of the instrument, expressed in base asset decimal units"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiMiniTickerResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "MiniTicker",
- "json_type": "MiniTicker",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The mini ticker matching the request asset"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiTickerRequest",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- }
- ],
- "comment": [
- "Retrieves a single ticker value for a single instrument. Please do not use this to repeatedly poll for data -- a websocket subscription is much more performant, and useful."
- ]
- },
- {
- "name": "Ticker",
- "is_root": false,
- "fields": [
- {
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": true,
- "example": "'1697788800000000000'",
- "comment": [
- "Time at which the event was emitted in unix nanoseconds"
- ]
- },
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "mark_price",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The mark price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "index_price",
- "lite_name": "ip",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The index price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "last_price",
- "lite_name": "lp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The last traded price of the instrument (also close price), expressed in `9` decimals"
- ]
- },
- {
- "name": "last_size",
- "lite_name": "ls",
- "semantic_type": "string",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The number of assets traded in the last trade, expressed in base asset decimal units"
- ]
- },
- {
- "name": "mid_price",
- "lite_name": "mp1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The mid price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "best_bid_price",
- "lite_name": "bb",
- "semantic_type": "string",
- "json_type": "string",
- "index": 7,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The best bid price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "best_bid_size",
- "lite_name": "bb1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 8,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The number of assets offered on the best bid price of the instrument, expressed in base asset decimal units"
- ]
- },
- {
- "name": "best_ask_price",
- "lite_name": "ba",
- "semantic_type": "string",
- "json_type": "string",
- "index": 9,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The best ask price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "best_ask_size",
- "lite_name": "ba1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 10,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The number of assets offered on the best ask price of the instrument, expressed in base asset decimal units"
- ]
- },
- {
- "name": "funding_rate_8h_curr",
- "lite_name": "fr",
- "semantic_type": "string",
- "json_type": "string",
- "index": 11,
- "array_depth": 0,
- "optional": true,
- "example": "0.0003",
- "comment": [
- "The current funding rate of the instrument, expressed in percentage points"
- ]
- },
- {
- "name": "funding_rate_8h_avg",
- "lite_name": "fr1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 12,
- "array_depth": 0,
- "optional": true,
- "example": "0.0003",
- "comment": [
- "The average funding rate of the instrument (over last 8h), expressed in percentage points"
- ]
- },
- {
- "name": "interest_rate",
- "lite_name": "ir",
- "semantic_type": "string",
- "json_type": "string",
- "index": 13,
- "array_depth": 0,
- "optional": true,
- "example": "0.0003",
- "comment": [
- "The interest rate of the underlying, expressed in centibeeps (1/100th of a basis point)"
- ]
- },
- {
- "name": "forward_price",
- "lite_name": "fp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 14,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "[Options] The forward price of the option, expressed in `9` decimals"
- ]
- },
- {
- "name": "buy_volume_24h_b",
- "lite_name": "bv",
- "semantic_type": "string",
- "json_type": "string",
- "index": 15,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The 24 hour taker buy volume of the instrument, expressed in base asset decimal units"
- ]
- },
- {
- "name": "sell_volume_24h_b",
- "lite_name": "sv",
- "semantic_type": "string",
- "json_type": "string",
- "index": 16,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The 24 hour taker sell volume of the instrument, expressed in base asset decimal units"
- ]
- },
- {
- "name": "buy_volume_24h_q",
- "lite_name": "bv1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 17,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The 24 hour taker buy volume of the instrument, expressed in quote asset decimal units"
- ]
- },
- {
- "name": "sell_volume_24h_q",
- "lite_name": "sv1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 18,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The 24 hour taker sell volume of the instrument, expressed in quote asset decimal units"
- ]
- },
- {
- "name": "high_price",
- "lite_name": "hp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 19,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The 24 hour highest traded price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "low_price",
- "lite_name": "lp1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 20,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The 24 hour lowest traded price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "open_price",
- "lite_name": "op",
- "semantic_type": "string",
- "json_type": "string",
- "index": 21,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The 24 hour first traded price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "open_interest",
- "lite_name": "oi",
- "semantic_type": "string",
- "json_type": "string",
- "index": 22,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The open interest in the instrument, expressed in base asset decimal units"
- ]
- },
- {
- "name": "long_short_ratio",
- "lite_name": "ls1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 23,
- "array_depth": 0,
- "optional": true,
- "example": "'0.5'",
- "comment": [
- "The ratio of accounts that are net long vs net short on this instrument"
- ]
- }
- ],
- "comment": [
- "Derived data such as the below, will not be included by default:",
- " - 24 hour volume (`buyVolume + sellVolume`)",
- " - 24 hour taker buy/sell ratio (`buyVolume / sellVolume`)",
- " - 24 hour average trade price (`volumeQ / volumeU`)",
- " - 24 hour average trade volume (`volume / trades`)",
- " - 24 hour percentage change (`24hStatChange / 24hStat`)",
- " - 48 hour statistics (`2 * 24hStat - 24hStatChange`)",
- "",
- "To query for an extended ticker payload, leverage the `greeks` and the `derived` flags.",
- "Ticker extensions are currently under design to offer you more convenience.",
- "These flags are only supported on the `Ticker Snapshot` WS endpoint, and on the `Ticker` API endpoint.",
- ""
- ]
- },
- {
- "name": "ApiTickerResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Ticker",
- "json_type": "Ticker",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The mini ticker matching the request asset"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiTradeRequest",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "500",
- "comment": [
- "The limit to query for. Defaults to 500; Max 1000"
- ]
- }
- ],
- "comment": [
- "Retrieves up to 1000 of the most recent trades in any given instrument. Do not use this to poll for data -- a websocket subscription is much more performant, and useful.",
- "This endpoint offers public trading data, use the Trading APIs instead to query for your personalized trade tape."
- ]
- },
- {
- "name": "Trade",
- "is_root": false,
- "fields": [
- {
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Time at which the event was emitted in unix nanoseconds"
- ]
- },
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "is_taker_buyer",
- "lite_name": "it",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "true",
- "comment": [
- "If taker was the buyer on the trade"
- ]
- },
- {
- "name": "size",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The number of assets being traded, expressed in base asset decimal units"
- ]
- },
- {
- "name": "price",
- "lite_name": "p",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The traded price, expressed in `9` decimals"
- ]
- },
- {
- "name": "mark_price",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The mark price of the instrument at point of trade, expressed in `9` decimals"
- ]
- },
- {
- "name": "index_price",
- "lite_name": "ip",
- "semantic_type": "string",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The index price of the instrument at point of trade, expressed in `9` decimals"
- ]
- },
- {
- "name": "interest_rate",
- "lite_name": "ir",
- "semantic_type": "string",
- "json_type": "string",
- "index": 7,
- "array_depth": 0,
- "optional": false,
- "example": "0.0003",
- "comment": [
- "The interest rate of the underlying at point of trade, expressed in centibeeps (1/100th of a basis point)"
- ]
- },
- {
- "name": "forward_price",
- "lite_name": "fp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 8,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "[Options] The forward price of the option at point of trade, expressed in `9` decimals"
- ]
- },
- {
- "name": "trade_id",
- "lite_name": "ti",
- "semantic_type": "string",
- "json_type": "string",
- "index": 9,
- "array_depth": 0,
- "optional": false,
- "example": "'209358-2'",
- "comment": [
- "A trade identifier, globally unique, and monotonically increasing (not by `1`).",
- "All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.",
- "`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`."
- ]
- },
- {
- "name": "venue",
- "lite_name": "v",
- "semantic_type": "Venue",
- "json_type": "Venue",
- "index": 10,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The venue where the trade occurred"
- ]
- }
- ],
- "comment": [
- "All private RFQs and Private AXEs will be filtered out from the responses"
- ]
- },
- {
- "name": "ApiTradeResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Trade",
- "json_type": "Trade",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The public trades matching the request asset"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiTradeHistoryRequest",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "int64",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
- "comment": [
- "The start time to apply in nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "int64",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
- "comment": [
- "The end time to apply in nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "500",
- "example": "500",
- "comment": [
- "The limit to query for. Defaults to 500; Max 1000"
- ]
- },
- {
- "name": "cursor",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "''",
- "comment": [
- "The cursor to indicate when to start the query from"
- ]
- }
- ],
- "comment": [
- "Perform historical lookup of public trades in any given instrument.",
- "This endpoint offers public trading data, use the Trading APIs instead to query for your personalized trade tape.",
- "Only data from the last three months will be retained.",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "ApiTradeHistoryResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Trade",
- "json_type": "Trade",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The public trades matching the request asset"
- ]
- },
- {
- "name": "next",
- "lite_name": "n",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "'Qw0918='",
- "comment": [
- "The cursor to indicate when to start the next query from"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetInstrumentRequest",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- }
- ],
- "comment": [
- "Fetch a single instrument by supplying the asset or instrument name"
- ]
- },
- {
- "name": "Instrument",
- "is_root": false,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "instrument_hash",
- "lite_name": "ih",
- "semantic_type": "uint256",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'0x030501'",
- "comment": [
- "The asset ID used for instrument signing."
- ]
- },
- {
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC'",
- "comment": [
- "The base currency"
- ]
- },
- {
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'USDT'",
- "comment": [
- "The quote currency"
- ]
- },
- {
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'PERPETUAL'",
- "comment": [
- "The kind of instrument"
- ]
- },
- {
- "name": "venues",
- "lite_name": "v",
- "semantic_type": "Venue",
- "json_type": "Venue",
- "index": 7,
- "array_depth": 1,
- "optional": false,
- "example": "['ORDERBOOK']",
- "comment": [
- "Venues that this instrument can be traded at"
- ]
- },
- {
- "name": "settlement_period",
- "lite_name": "sp1",
- "semantic_type": "InstrumentSettlementPeriod",
- "json_type": "InstrumentSettlementPeriod",
- "index": 8,
- "array_depth": 0,
- "optional": false,
- "example": "'PERPETUAL'",
- "comment": [
- "The settlement period of the instrument"
- ]
- },
- {
- "name": "base_decimals",
- "lite_name": "bd",
- "semantic_type": "int8",
- "json_type": "integer",
- "index": 9,
- "array_depth": 0,
- "optional": false,
- "example": "3",
- "comment": [
- "The smallest denomination of the base asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)"
- ]
- },
- {
- "name": "quote_decimals",
- "lite_name": "qd",
- "semantic_type": "int8",
- "json_type": "integer",
- "index": 10,
- "array_depth": 0,
- "optional": false,
- "example": "3",
- "comment": [
- "The smallest denomination of the quote asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)"
- ]
- },
- {
- "name": "tick_size",
- "lite_name": "ts",
- "semantic_type": "string",
- "json_type": "string",
- "index": 11,
- "array_depth": 0,
- "optional": false,
- "example": "'0.01'",
- "comment": [
- "The size of a single tick, expressed in price decimal units"
- ]
- },
- {
- "name": "min_size",
- "lite_name": "ms",
- "semantic_type": "string",
- "json_type": "string",
- "index": 12,
- "array_depth": 0,
- "optional": false,
- "example": "'0.01'",
- "comment": [
- "The minimum contract size, expressed in base asset decimal units"
- ]
- },
- {
- "name": "create_time",
- "lite_name": "ct",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 14,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Creation time in unix nanoseconds"
- ]
- },
- {
- "name": "max_position_size",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 15,
- "array_depth": 0,
- "optional": false,
- "example": "'100.0'",
- "comment": [
- "The maximum position size, expressed in base asset decimal units"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetInstrumentResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Instrument",
- "json_type": "Instrument",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The instrument matching the request asset"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetFilteredInstrumentsRequest",
- "is_root": true,
- "fields": [
- {
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
- "index": 0,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['PERPETUAL']",
- "comment": [
- "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 1,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['BTC', 'ETH']",
- "comment": [
- "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 2,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['USDT', 'USDC']",
- "comment": [
- "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "is_active",
- "lite_name": "ia",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "false",
- "example": "true",
- "comment": [
- "Request for active instruments only"
- ]
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "500",
- "example": "500",
- "comment": [
- "The limit to query for. Defaults to 500; Max 100000"
- ]
- }
- ],
- "comment": [
- "Fetch a list of instruments based on the filters provided"
- ]
- },
- {
- "name": "ApiGetFilteredInstrumentsResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Instrument",
- "json_type": "Instrument",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The instruments matching the request filter"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiCandlestickRequest",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "interval",
- "lite_name": "i1",
- "semantic_type": "CandlestickInterval",
- "json_type": "CandlestickInterval",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The interval of each candlestick"
- ]
- },
- {
- "name": "type",
- "lite_name": "t",
- "semantic_type": "CandlestickType",
- "json_type": "CandlestickType",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The type of candlestick data to retrieve"
- ]
- },
- {
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
- "comment": [
- "Start time of kline data in unix nanoseconds"
- ]
- },
- {
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
- "comment": [
- "End time of kline data in unix nanoseconds"
- ]
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 5,
- "array_depth": 0,
- "optional": true,
- "default": "500",
- "example": "500",
- "comment": [
- "The limit to query for. Defaults to 500; Max 1000"
- ]
- },
- {
- "name": "cursor",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "''",
- "comment": [
- "The cursor to indicate when to start the query from"
- ]
- }
- ],
- "comment": [
- "Kline/Candlestick bars for an instrument. Klines are uniquely identified by their instrument, type, interval, and open time.",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "Candlestick",
- "is_root": false,
- "fields": [
- {
- "name": "open_time",
- "lite_name": "ot",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Open time of kline bar in unix nanoseconds"
- ]
- },
- {
- "name": "close_time",
- "lite_name": "ct",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Close time of kline bar in unix nanosecond"
- ]
- },
- {
- "name": "open",
- "lite_name": "o",
- "semantic_type": "string",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The open price, expressed in underlying currency resolution units"
- ]
- },
- {
- "name": "close",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The close price, expressed in underlying currency resolution units"
- ]
- },
- {
- "name": "high",
- "lite_name": "h",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The high price, expressed in underlying currency resolution units"
- ]
- },
- {
- "name": "low",
- "lite_name": "l",
- "semantic_type": "string",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The low price, expressed in underlying currency resolution units"
- ]
- },
- {
- "name": "volume_b",
- "lite_name": "vb",
- "semantic_type": "string",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The underlying volume transacted, expressed in base asset decimal units"
- ]
- },
- {
- "name": "volume_q",
- "lite_name": "vq",
- "semantic_type": "string",
- "json_type": "string",
- "index": 7,
- "array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
- "comment": [
- "The quote volume transacted, expressed in quote asset decimal units"
- ]
- },
- {
- "name": "trades",
- "lite_name": "t",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 8,
- "array_depth": 0,
- "optional": false,
- "example": "123456",
- "comment": [
- "The number of trades transacted"
- ]
- },
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 9,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- }
- ],
- "comment": [
- ""
- ]
- },
- {
- "name": "ApiCandlestickResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Candlestick",
- "json_type": "Candlestick",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The candlestick result set for given interval"
- ]
- },
- {
- "name": "next",
- "lite_name": "n",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "'Qw0918='",
- "comment": [
- "The cursor to indicate when to start the next query from"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiFundingRateRequest",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
- "comment": [
- "Start time of funding rate in unix nanoseconds"
- ]
- },
- {
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
- "comment": [
- "End time of funding rate in unix nanoseconds"
- ]
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "500",
- "example": "500",
- "comment": [
- "The limit to query for. Defaults to 500; Max 1000"
- ]
- },
- {
- "name": "cursor",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "''",
- "comment": [
- "The cursor to indicate when to start the query from"
- ]
- }
- ],
- "comment": [
- "Lookup the historical funding rate of a perpetual future.",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "FundingRate",
- "is_root": false,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "funding_rate",
- "lite_name": "fr",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "0.0003",
- "comment": [
- "The funding rate of the instrument, expressed in percentage points"
- ]
- },
- {
- "name": "funding_time",
- "lite_name": "ft",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "The funding timestamp of the funding rate, expressed in unix nanoseconds"
- ]
- },
- {
- "name": "mark_price",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The mark price of the instrument at funding timestamp, expressed in `9` decimals"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiFundingRateResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "FundingRate",
- "json_type": "FundingRate",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The funding rate result set for given interval"
- ]
- },
- {
- "name": "next",
- "lite_name": "n",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "'Qw0918='",
- "comment": [
- "The cursor to indicate when to start the next query from"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiSettlementPriceRequest",
- "is_root": true,
- "fields": [
- {
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC'",
- "comment": [
- "The base currency to select"
- ]
- },
- {
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'USDT'",
- "comment": [
- "The quote currency to select"
- ]
- },
- {
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
- "comment": [
- "Start time of settlement price in unix nanoseconds"
- ]
- },
- {
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
- "comment": [
- "End time of settlement price in unix nanoseconds"
- ]
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "30",
- "example": "20",
- "comment": [
- "The limit to query for. Defaults to 500; Max 1000"
- ]
- },
- {
- "name": "cursor",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "''",
- "comment": [
- "The cursor to indicate when to start the query from"
- ]
- }
- ],
- "comment": [
- "Lookup the historical settlement price of various pairs.",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "APISettlementPrice",
- "is_root": false,
- "fields": [
- {
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC'",
- "comment": [
- "The base currency of the settlement price"
- ]
- },
- {
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'USDT'",
- "comment": [
- "The quote currency of the settlement price"
- ]
- },
- {
- "name": "settlement_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "The settlement timestamp of the settlement price, expressed in unix nanoseconds"
- ]
- },
- {
- "name": "settlement_price",
- "lite_name": "sp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
- "comment": [
- "The settlement price, expressed in `9` decimals"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiSettlementPriceResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "APISettlementPrice",
- "json_type": "APISettlementPrice",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The funding rate result set for given interval"
- ]
- },
- {
- "name": "next",
- "lite_name": "n",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "'Qw0918='",
- "comment": [
- "The cursor to indicate when to start the next query from"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "JSONRPCRequest",
- "is_root": true,
- "fields": [
- {
- "name": "jsonrpc",
- "lite_name": "j",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'2.0'",
- "comment": [
- "The JSON RPC version to use for the request"
- ]
- },
- {
- "name": "method",
- "lite_name": "m",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'subscribe'",
- "comment": [
- "The method to use for the request (eg: `subscribe` / `unsubscribe` / `v1/instrument` )"
- ]
- },
- {
- "name": "params",
- "lite_name": "p",
- "semantic_type": "any",
- "json_type": "object",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The parameters for the request"
- ]
- },
- {
- "name": "id",
- "lite_name": "i",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "123",
- "comment": [
- "Optional Field which is used to match the response by the client.",
- "If not passed, this field will not be returned"
- ]
- }
- ],
- "comment": [
- "All Websocket JSON RPC Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.",
- "If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).",
- "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
- ]
- },
- {
- "name": "Error",
- "is_root": true,
- "fields": [
- {
- "name": "code",
- "lite_name": "c",
- "semantic_type": "uint16",
- "json_type": "integer",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "123",
- "comment": [
- "The error code for the request"
- ]
- },
- {
- "name": "message",
- "lite_name": "m",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'An error occurred'",
- "comment": [
- "The error message for the request"
- ]
- }
- ],
- "comment": [
- "An error response"
- ]
- },
- {
- "name": "JSONRPCResponse",
- "is_root": true,
- "fields": [
- {
- "name": "jsonrpc",
- "lite_name": "j",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'2.0'",
- "comment": [
- "The JSON RPC version to use for the request"
- ]
- },
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "any",
- "json_type": "object",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "null",
- "comment": [
- "The result for the request"
- ]
- },
- {
- "name": "error",
- "lite_name": "e",
- "semantic_type": "Error",
- "json_type": "Error",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "null",
- "comment": [
- "The error for the request"
- ]
- },
- {
- "name": "id",
- "lite_name": "i",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "123",
- "comment": [
- "Optional Field which is used to match the response by the client.",
- "If not passed, this field will not be returned"
- ]
- },
- {
- "name": "method",
- "lite_name": "m",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'subscribe'",
- "comment": [
- "The method used in the request for this response (eg: `subscribe` / `unsubscribe` / `v1/instrument` )"
- ]
- }
- ],
- "comment": [
- "All Websocket JSON RPC Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.",
- "If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response."
- ]
- },
- {
- "name": "WSSubscribeParams",
- "is_root": true,
- "fields": [
- {
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'v1.ticker.d'",
- "comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
- ]
- },
- {
- "name": "selectors",
- "lite_name": "s1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
- "comment": [
- "The list of feeds to subscribe to"
- ]
- },
- {
- "name": "use_global_sequence_number",
- "lite_name": "ug",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "false",
- "example": "true",
- "comment": [
- "Whether to use the global sequence number for the stream"
- ]
- }
- ],
- "comment": [
- "All V1 Websocket Subscription Requests are housed in this wrapper. You may specify a stream and a list of feeds to subscribe to.",
- "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.",
- "Sequence numbers can be either gateway-specific or global:",
- "- **Gateway Unique Sequence Number**: Increments by one per stream, resets to 0 on gateway restart.",
- "- **Global Unique Sequence Number**: A cluster-wide unique number assigned to each cluster payload, does not reset on gateway restarts, and can be used to track and identify message order across streams using `sequence_number` and `prev_sequence_number` in the feed response.",
- "Set `useGlobalSequenceNumber = true` if you need a persistent, unique identifier across all streams or ordering across multiple feeds."
- ]
- },
- {
- "name": "WSSubscribeResult",
- "is_root": true,
- "fields": [
- {
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'v1.ticker.d'",
- "comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
- ]
- },
- {
- "name": "subs",
- "lite_name": "s1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
- "comment": [
- "The list of feeds subscribed to"
- ]
- },
- {
- "name": "unsubs",
- "lite_name": "u",
- "semantic_type": "string",
- "json_type": "string",
- "index": 2,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
- "comment": [
- "The list of feeds unsubscribed from"
- ]
- },
- {
- "name": "num_snapshots",
- "lite_name": "ns",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 3,
- "array_depth": 1,
- "optional": false,
- "example": "10",
- "comment": [
- "The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`"
- ]
- },
- {
- "name": "first_sequence_number",
- "lite_name": "fs",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 4,
- "array_depth": 1,
- "optional": false,
- "example": "872634876",
- "comment": [
- "The first sequence number to expect for each subscribed feed. Returned in same order as `subs`"
- ]
- },
- {
- "name": "latest_sequence_number",
- "lite_name": "ls",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 5,
- "array_depth": 1,
- "optional": false,
- "example": "872634875",
- "comment": [
- "The sequence number of the most recent message in the stream. Next received sequence number must be larger than this one. Returned in same order as `subs`"
- ]
- }
- ],
- "comment": [
- "To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:\u003cul\u003e\u003cli\u003eAll snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas\u003c/li\u003e\u003cli\u003eNum snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots\u003c/li\u003e\u003cli\u003eFirst sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots\u003c/li\u003e\u003cli\u003eSequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect\u003c/li\u003e\u003cli\u003eDuplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.\u003c/li\u003e\u003c/ul\u003e",
- "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
- ]
- },
- {
- "name": "WSUnsubscribeParams",
- "is_root": true,
- "fields": [
- {
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'v1.ticker.d'",
- "comment": [
- "The channel to unsubscribe from (eg: ticker.s / ticker.d)"
- ]
- },
- {
- "name": "selectors",
- "lite_name": "s1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
- "comment": [
- "The list of feeds to unsubscribe from"
- ]
- },
- {
- "name": "use_global_sequence_number",
- "lite_name": "ug",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "false",
- "example": "true",
- "comment": [
- "Whether to use the global sequence number for the stream"
- ]
- }
- ],
- "comment": [
- "All V1 Websocket Unsubscription Requests are housed in this wrapper. You may specify a stream, a list of feeds and whether those feeds use global sequence numbers to unsubscribe from."
- ]
- },
- {
- "name": "WSUnsubscribeResult",
- "is_root": true,
- "fields": [
- {
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'v1.ticker.d'",
- "comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
- ]
- },
- {
- "name": "unsubs",
- "lite_name": "u",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
- "comment": [
- "The list of feeds unsubscribed from"
- ]
- }
- ],
- "comment": [
- "Returns a confirmation of all unsubscribes"
- ]
- },
- {
- "name": "WSSubscribeRequestV1Legacy",
- "is_root": true,
- "fields": [
- {
- "name": "request_id",
- "lite_name": "ri",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 0,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "123",
- "comment": [
- "Optional Field which is used to match the response by the client.",
- "If not passed, this field will not be returned"
- ]
- },
- {
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'v1.ticker.d'",
- "comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
- ]
- },
- {
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "string",
- "json_type": "string",
- "index": 2,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
- "comment": [
- "The list of feeds to subscribe to"
- ]
- },
- {
- "name": "method",
- "lite_name": "m",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'subscribe'",
- "comment": [
- "The method to use for the request (eg: subscribe / unsubscribe)"
- ]
- },
- {
- "name": "is_full",
- "lite_name": "if",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "false",
- "example": "true",
- "comment": [
- "Whether the request is for full data or lite data"
- ]
- }
- ],
- "comment": [
- "All V1 Websocket Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.",
- "If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).",
- "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
- ]
- },
- {
- "name": "WSSubscribeResponseV1Legacy",
- "is_root": true,
- "fields": [
- {
- "name": "request_id",
- "lite_name": "ri",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 0,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "123",
- "comment": [
- "Optional Field which is used to match the response by the client.",
- "If not passed, this field will not be returned"
- ]
- },
- {
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'v1.ticker.d'",
- "comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
- ]
- },
- {
- "name": "subs",
- "lite_name": "s1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 2,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
- "comment": [
- "The list of feeds subscribed to"
- ]
- },
- {
- "name": "unsubs",
- "lite_name": "u",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
- "comment": [
- "The list of feeds unsubscribed from"
- ]
- },
- {
- "name": "num_snapshots",
- "lite_name": "ns",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 4,
- "array_depth": 1,
- "optional": false,
- "example": "10",
- "comment": [
- "The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`"
- ]
- },
- {
- "name": "first_sequence_number",
- "lite_name": "fs",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 5,
- "array_depth": 1,
- "optional": false,
- "example": "872634876",
- "comment": [
- "The first sequence number to expect for each subscribed feed. Returned in same order as `subs`"
- ]
- },
- {
- "name": "latest_sequence_number",
- "lite_name": "ls",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 6,
- "array_depth": 1,
- "optional": false,
- "example": "872634875",
- "comment": [
- "The sequence number of the most recent message in the stream. Next received sequence number must be larger than this one. Returned in same order as `subs`"
- ]
- }
- ],
- "comment": [
- "All V1 Websocket Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.",
- "If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response.",
- "To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:\u003cul\u003e\u003cli\u003eAll snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas\u003c/li\u003e\u003cli\u003eNum snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots\u003c/li\u003e\u003cli\u003eFirst sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots\u003c/li\u003e\u003cli\u003eSequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect\u003c/li\u003e\u003cli\u003eDuplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.\u003c/li\u003e\u003c/ul\u003e",
- "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
- ]
- },
- {
- "name": "WSOrderbookLevelsFeedSelectorV1",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ],
- "selector": "primary"
- },
- {
- "name": "rate",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "500",
- "comment": [
- "The minimal rate at which we publish feeds (in milliseconds)",
- "Delta (50, 100, 500, 1000)",
- "Snapshot (500, 1000)"
- ],
- "selector": "secondary"
- },
- {
- "name": "depth",
- "lite_name": "d",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "'0'",
- "example": "50",
- "comment": [
- "Depth of the order book to be retrieved",
- "Delta(0 - `unlimited`)",
- "Snapshot(10, 50, 100, 500)"
- ],
- "selector": "secondary"
- }
- ],
- "comment": [
- "Subscribes to aggregated orderbook updates for a single instrument. The `book.s` channel offers simpler integration. To experience higher publishing rates, please use the `book.d` channel.",
- "Unlike the `book.d` channel which publishes an initial snapshot, then only streams deltas after, the `book.s` channel publishes full snapshots at each feed.",
- "",
- "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of all levels of the Orderbook.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send levels that have changed in value.\u003c/li\u003e\u003c/ul\u003e",
- "",
- "Subscription Pattern:\u003cul\u003e\u003cli\u003eDelta - `instrument@rate`\u003c/li\u003e\u003cli\u003eSnapshot - `instrument@rate-depth`\u003c/li\u003e\u003c/ul\u003e",
- "",
- "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a level is not updated, level not published\u003c/li\u003e\u003cli\u003eIf a level is updated, {size: '123'}\u003c/li\u003e\u003cli\u003eIf a level is set to zero, {size: '0'}\u003c/li\u003e\u003cli\u003eIncoming levels will be published as soon as price moves\u003c/li\u003e\u003cli\u003eOutgoing levels will be published with `size = 0`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "WSOrderbookLevelsFeedDataV1",
- "is_root": true,
- "fields": [
- {
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'v1.book.s'",
- "comment": [
- "Stream name"
- ]
- },
- {
- "name": "selector",
- "lite_name": "s1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "Primary selector"
- ]
- },
- {
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'872634876'",
- "comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
- ]
- },
- {
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "OrderbookLevels",
- "json_type": "OrderbookLevels",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "An orderbook levels object matching the request filter"
- ]
- },
- {
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'872634875'",
- "comment": [
- "The previous sequence number that determines the message order"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "WSMiniTickerFeedSelectorV1",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ],
- "selector": "primary"
- },
- {
- "name": "rate",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "500",
- "comment": [
- "The minimal rate at which we publish feeds (in milliseconds)",
- "Delta (0 - `raw`, 50, 100, 200, 500, 1000, 5000)",
- "Snapshot (200, 500, 1000, 5000)"
- ],
- "selector": "secondary"
- }
- ],
- "comment": [
- "Subscribes to a mini ticker feed for a single instrument. The `mini.s` channel offers simpler integration. To experience higher publishing rates, please use the `mini.d` channel.",
- "Unlike the `mini.d` channel which publishes an initial snapshot, then only streams deltas after, the `mini.s` channel publishes full snapshots at each feed.",
- "",
- "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of the mini ticker.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send deltas of the mini ticker.\u003c/li\u003e\u003cli\u003eThe server will send a delta if any of the fields in the mini ticker have changed.\u003c/li\u003e\u003c/ul\u003e",
- "",
- "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a field is not updated, {}\u003c/li\u003e\u003cli\u003eIf a field is updated, {field: '123'}\u003c/li\u003e\u003cli\u003eIf a field is set to zero, {field: '0'}\u003c/li\u003e\u003cli\u003eIf a field is set to null, {field: ''}\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "WSMiniTickerFeedDataV1",
- "is_root": true,
- "fields": [
- {
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'v1.mini.s'",
- "comment": [
- "Stream name"
- ]
- },
- {
- "name": "selector",
- "lite_name": "s1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "Primary selector"
- ]
- },
- {
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'872634876'",
- "comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
- ]
- },
- {
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "MiniTicker",
- "json_type": "MiniTicker",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "A mini ticker matching the request filter"
- ]
- },
- {
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'872634875'",
- "comment": [
- "The previous sequence number that determines the message order"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "WSTickerFeedSelectorV1",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ],
- "selector": "primary"
- },
- {
- "name": "rate",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "500",
- "comment": [
- "The minimal rate at which we publish feeds (in milliseconds)",
- "Delta (100, 200, 500, 1000, 5000)",
- "Snapshot (500, 1000, 5000)"
- ],
- "selector": "secondary"
- }
- ],
- "comment": [
- "Subscribes to a ticker feed for a single instrument. The `ticker.s` channel offers simpler integration. To experience higher publishing rates, please use the `ticker.d` channel.",
- "Unlike the `ticker.d` channel which publishes an initial snapshot, then only streams deltas after, the `ticker.s` channel publishes full snapshots at each feed.",
- "",
- "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of the ticker.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send deltas of the ticker.\u003c/li\u003e\u003cli\u003eThe server will send a delta if any of the fields in the ticker have changed.\u003c/li\u003e\u003c/ul\u003e",
- "",
- "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a field is not updated, {}\u003c/li\u003e\u003cli\u003eIf a field is updated, {field: '123'}\u003c/li\u003e\u003cli\u003eIf a field is set to zero, {field: '0'}\u003c/li\u003e\u003cli\u003eIf a field is set to null, {field: ''}\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "WSTickerFeedDataV1",
- "is_root": true,
- "fields": [
- {
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.ticker.s'",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "Stream name"
+ "The sub account ID to request for"
]
},
{
- "name": "selector",
- "lite_name": "s1",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "kind",
+ "lite_name": "k",
+ "semantic_type": "Kind",
+ "json_type": "Kind",
"index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['PERPETUAL']",
"comment": [
- "Primary selector"
+ "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
- "json_type": "string",
+ "name": "base",
+ "lite_name": "b",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'872634876'",
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['BTC', 'ETH']",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "Ticker",
- "json_type": "Ticker",
+ "name": "quote",
+ "lite_name": "q",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 3,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "A ticker matching the request filter"
- ]
- },
- {
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'872634875'",
- "comment": [
- "The previous sequence number that determines the message order"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiTickerFeedDataV1",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Ticker",
- "json_type": "Ticker",
- "index": 0,
- "array_depth": 0,
- "optional": false,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['USDT', 'USDC']",
"comment": [
- "The mini ticker matching the request asset"
+ "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
]
}
],
- "comment": []
- },
- {
- "name": "WSTradeFeedSelectorV1",
- "is_root": true,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ],
- "selector": "primary"
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "500",
- "comment": [
- "The limit to query for. Valid values are (50, 200, 500, 1000). Default is 50"
- ],
- "selector": "secondary"
- }
- ],
"comment": [
- "Subscribes to a stream of Public Trades for an instrument."
+ "Query the positions of a sub account"
]
},
{
- "name": "WSTradeFeedDataV1",
- "is_root": true,
+ "name": "Positions",
+ "is_root": false,
"fields": [
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.trade'",
+ "example": "'1697788800000000000'",
"comment": [
- "Stream name"
+ "Time at which the event was emitted in unix nanoseconds"
]
},
{
- "name": "selector",
- "lite_name": "s1",
- "semantic_type": "string",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "Primary selector"
+ "The sub account ID that participated in the trade"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'872634876'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "The instrument being represented"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "Trade",
- "json_type": "Trade",
+ "name": "size",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 3,
"array_depth": 0,
"optional": false,
+ "example": "'2635000.50'",
"comment": [
- "A public trade matching the request filter"
+ "The size of the position, expressed in base asset decimal units. Negative for short positions"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
+ "name": "notional",
+ "lite_name": "n",
+ "semantic_type": "string",
"json_type": "string",
"index": 4,
"array_depth": 0,
"optional": false,
- "example": "'872634875'",
+ "example": "'2635000.50'",
"comment": [
- "The previous sequence number that determines the message order"
+ "The notional value of the position, negative for short assets, expressed in quote asset decimal units"
]
- }
- ],
- "comment": []
- },
- {
- "name": "WSCandlestickFeedSelectorV1",
- "is_root": true,
- "fields": [
+ },
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "entry_price",
+ "lite_name": "ep",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 5,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'65038.01'",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ],
- "selector": "primary"
+ "The entry price of the position, expressed in `9` decimals",
+ "Whenever increasing the size of a position, the entry price is updated to the new average entry price",
+ "`new_entry_price = (old_entry_price * old_size + trade_price * trade_size) / (old_size + trade_size)`"
+ ]
},
{
- "name": "interval",
- "lite_name": "i1",
- "semantic_type": "CandlestickInterval",
- "json_type": "CandlestickInterval",
- "index": 1,
+ "name": "exit_price",
+ "lite_name": "ep1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 6,
"array_depth": 0,
"optional": false,
+ "example": "'65038.01'",
"comment": [
- "The interval of each candlestick"
- ],
- "selector": "secondary"
- },
- {
- "name": "type",
- "lite_name": "t",
- "semantic_type": "CandlestickType",
- "json_type": "CandlestickType",
- "index": 2,
+ "The exit price of the position, expressed in `9` decimals",
+ "Whenever decreasing the size of a position, the exit price is updated to the new average exit price",
+ "`new_exit_price = (old_exit_price * old_exit_trade_size + trade_price * trade_size) / (old_exit_trade_size + trade_size)`"
+ ]
+ },
+ {
+ "name": "mark_price",
+ "lite_name": "mp",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 7,
"array_depth": 0,
"optional": false,
+ "example": "'65038.01'",
"comment": [
- "The type of candlestick data to retrieve"
- ],
- "selector": "secondary"
- }
- ],
- "comment": [
- "Subscribes to a stream of Kline/Candlestick updates for an instrument. A Kline is uniquely identified by its open time.",
- "A new Kline is published every interval (if it exists). Upon subscription, the server will send the 5 most recent Kline for the requested interval."
- ]
- },
- {
- "name": "WSCandlestickFeedDataV1",
- "is_root": true,
- "fields": [
+ "The mark price of the position, expressed in `9` decimals"
+ ]
+ },
{
- "name": "stream",
- "lite_name": "s",
+ "name": "unrealized_pnl",
+ "lite_name": "up",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 8,
"array_depth": 0,
"optional": false,
- "example": "'v1.candle'",
+ "example": "'135000.50'",
"comment": [
- "Stream name"
+ "The unrealized PnL of the position, expressed in quote asset decimal units",
+ "`unrealized_pnl = (mark_price - entry_price) * size`"
]
},
{
- "name": "selector",
- "lite_name": "s1",
+ "name": "realized_pnl",
+ "lite_name": "rp",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 9,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'-35000.30'",
"comment": [
- "Primary selector"
+ "The realized PnL of the position, expressed in quote asset decimal units",
+ "`realized_pnl = (exit_price - entry_price) * exit_trade_size`"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
+ "name": "total_pnl",
+ "lite_name": "tp",
+ "semantic_type": "string",
"json_type": "string",
- "index": 2,
+ "index": 10,
"array_depth": 0,
"optional": false,
- "example": "'872634876'",
+ "example": "'100000.20'",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "The total PnL of the position, expressed in quote asset decimal units",
+ "`total_pnl = realized_pnl + unrealized_pnl`"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "Candlestick",
- "json_type": "Candlestick",
- "index": 3,
+ "name": "roi",
+ "lite_name": "r",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 11,
"array_depth": 0,
"optional": false,
+ "example": "'10.20'",
"comment": [
- "A candlestick entry matching the request filters"
+ "The ROI of the position, expressed as a percentage",
+ "`roi = (total_pnl / (entry_price * abs(size))) * 100^`"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
+ "name": "quote_index_price",
+ "lite_name": "qi",
+ "semantic_type": "string",
"json_type": "string",
- "index": 4,
+ "index": 12,
"array_depth": 0,
"optional": false,
- "example": "'872634875'",
+ "example": "'1.0000102'",
"comment": [
- "The previous sequence number that determines the message order"
+ "The index price of the quote currency. (reported in `USD`)"
]
- }
- ],
- "comment": []
- },
- {
- "name": "WSUnsubscribeAllParams",
- "is_root": true,
- "fields": [],
- "comment": [
- "All V1 Websocket Unsubscription Request to unsubscribe from all active websocket streams."
- ]
- },
- {
- "name": "StreamReference",
- "is_root": false,
- "fields": [
+ },
{
- "name": "stream",
- "lite_name": "s",
+ "name": "est_liquidation_price",
+ "lite_name": "el",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 13,
"array_depth": 0,
"optional": false,
- "example": "'v1.ticker.d'",
+ "example": "60000.25",
"comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
+ "The estimated liquidation price"
]
},
{
- "name": "selectors",
- "lite_name": "s1",
+ "name": "leverage",
+ "lite_name": "l",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
- "array_depth": 1,
+ "index": 14,
+ "array_depth": 0,
"optional": false,
- "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
+ "example": "'10'",
"comment": [
- "The list of selectors for the stream"
+ "The current leverage value for this position"
]
}
],
"comment": []
},
{
- "name": "WSUnsubscribeAllResult",
+ "name": "ApiPositionsResponse",
"is_root": true,
"fields": [
{
- "name": "stream_reference",
- "lite_name": "sr",
- "semantic_type": "StreamReference",
- "json_type": "StreamReference",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Positions",
+ "json_type": "Positions",
"index": 0,
"array_depth": 1,
"optional": false,
"comment": [
- "The list of stream references unsubscribed from"
+ "The positions matching the request filter"
]
}
],
- "comment": [
- "Returns a list of all rooms the client has unsubscribed from."
- ]
- },
- {
- "name": "WSListStreamsParams",
- "is_root": true,
- "fields": [],
- "comment": [
- "List down all the streams this connection has connected to."
- ]
+ "comment": []
},
{
- "name": "WSListStreamsResult",
+ "name": "ApiFillHistoryRequest",
"is_root": true,
"fields": [
{
- "name": "stream_reference",
- "lite_name": "sr",
- "semantic_type": "StreamReference",
- "json_type": "StreamReference",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
+ "json_type": "string",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The list of stream references the connection is connected to"
+ "The sub account ID to request for"
]
- }
- ],
- "comment": [
- "Returns a list of all rooms the client has subscribed to."
- ]
- },
- {
- "name": "ApiGetAllInstrumentsRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "is_active",
- "lite_name": "ia",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 0,
+ "name": "kind",
+ "lite_name": "k",
+ "semantic_type": "Kind",
+ "json_type": "Kind",
+ "index": 1,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['PERPETUAL']",
+ "comment": [
+ "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
+ ]
+ },
+ {
+ "name": "base",
+ "lite_name": "b",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
+ "index": 2,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['BTC', 'ETH']",
+ "comment": [
+ "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
+ ]
+ },
+ {
+ "name": "quote",
+ "lite_name": "q",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
+ "index": 3,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['USDT', 'USDC']",
+ "comment": [
+ "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
+ ]
+ },
+ {
+ "name": "start_time",
+ "lite_name": "st",
+ "semantic_type": "int64",
+ "json_type": "string",
+ "index": 4,
+ "array_depth": 0,
+ "optional": true,
+ "default": "0",
+ "example": "'1697788800000000000'",
+ "comment": [
+ "The start time to apply in unix nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned"
+ ]
+ },
+ {
+ "name": "end_time",
+ "lite_name": "et",
+ "semantic_type": "int64",
+ "json_type": "string",
+ "index": 5,
+ "array_depth": 0,
+ "optional": true,
+ "default": "now()",
+ "example": "'1697788800000000000'",
+ "comment": [
+ "The end time to apply in unix nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned"
+ ]
+ },
+ {
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 6,
"array_depth": 0,
"optional": true,
- "default": "false",
- "example": "true",
+ "default": "500",
+ "example": "500",
"comment": [
- "Fetch only active instruments"
+ "The limit to query for. Defaults to 500; Max 1000"
]
- }
- ],
- "comment": [
- "Fetch all instruments"
- ]
- },
- {
- "name": "ApiGetAllInstrumentsResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Instrument",
- "json_type": "Instrument",
- "index": 0,
- "array_depth": 1,
- "optional": false,
+ "name": "cursor",
+ "lite_name": "c",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 7,
+ "array_depth": 0,
+ "optional": true,
+ "default": "''",
+ "example": "''",
"comment": [
- "List of instruments"
+ "The cursor to indicate when to start the query from"
]
}
],
- "comment": []
+ "comment": [
+ "Query for all historical fills made by a single account. A single order can be matched multiple times, hence there is no real way to uniquely identify a trade.",
+ "",
+ "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
+ ]
},
{
- "name": "SnapFundingAccountSummary",
- "is_root": true,
+ "name": "Fill",
+ "is_root": false,
"fields": [
{
"name": "event_time",
@@ -8173,112 +2696,133 @@
]
},
{
- "name": "start_interval",
- "lite_name": "si",
- "semantic_type": "timestamp",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The start of the interval in unix nanoseconds"
+ "The sub account ID that participated in the trade"
]
},
{
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "address",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The main account ID of the account to which the summary belongs"
+ "The instrument being represented"
]
},
{
- "name": "total_equity",
- "lite_name": "te",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "is_buyer",
+ "lite_name": "ib",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "'3945034.23'",
+ "example": "true",
"comment": [
- "Total equity of the main account, denominated in USD"
+ "The side that the subaccount took on the trade"
]
},
{
- "name": "spot_balances",
- "lite_name": "sb",
- "semantic_type": "SpotBalance",
- "json_type": "SpotBalance",
+ "name": "is_taker",
+ "lite_name": "it",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 4,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "true",
"comment": [
- "The list of spot assets owned by this main account, and their balances"
+ "The role that the subaccount took on the trade"
]
- }
- ],
- "comment": [
- "The funding account summary, that reports the total equity and spot balances of a funding (main) account"
- ]
- },
- {
- "name": "ApiQueryTradingPerformanceRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
+ "name": "size",
+ "lite_name": "s",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 5,
"array_depth": 0,
- "optional": true,
- "default": "all",
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "optional": false,
+ "example": "'0.30'",
"comment": [
- "Optional: The subaccount ID to filter by"
+ "The number of assets being traded, expressed in base asset decimal units"
]
},
{
- "name": "asset",
- "lite_name": "a",
- "semantic_type": "[]byte",
- "json_type": "unknown",
- "index": 1,
+ "name": "price",
+ "lite_name": "p",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 6,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'65038.01'",
"comment": [
- "The asset to filter by"
+ "The traded price, expressed in `9` decimals"
]
- }
- ],
- "comment": [
- "Request to retrieve the trading volume"
- ]
- },
- {
- "name": "ApiQueryTradingPerformanceResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "trading_volume",
- "lite_name": "tv",
- "semantic_type": "uint64",
+ "name": "mark_price",
+ "lite_name": "mp",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 7,
"array_depth": 0,
"optional": false,
- "example": "'3456.78'",
+ "example": "'65038.01'",
+ "comment": [
+ "The mark price of the instrument at point of trade, expressed in `9` decimals"
+ ]
+ },
+ {
+ "name": "index_price",
+ "lite_name": "ip",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 8,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'65038.01'",
+ "comment": [
+ "The index price of the instrument at point of trade, expressed in `9` decimals"
+ ]
+ },
+ {
+ "name": "interest_rate",
+ "lite_name": "ir",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 9,
+ "array_depth": 0,
+ "optional": false,
+ "example": "0.0003",
+ "comment": [
+ "The interest rate of the underlying at point of trade, expressed in centibeeps (1/100th of a basis point)"
+ ]
+ },
+ {
+ "name": "forward_price",
+ "lite_name": "fp",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 10,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'65038.01'",
"comment": [
- "Trading volume in USDT"
+ "[Options] The forward price of the option at point of trade, expressed in `9` decimals"
]
},
{
@@ -8286,422 +2830,470 @@
"lite_name": "rp",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 11,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'2400.50'",
+ "comment": [
+ "The realized PnL of the trade, expressed in quote asset decimal units (0 if increasing position size)"
+ ]
+ },
+ {
+ "name": "fee",
+ "lite_name": "f",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 12,
"array_depth": 0,
"optional": false,
"example": "'9.75'",
"comment": [
- "Realized PnL in USDT"
+ "The fees paid on the trade, expressed in quote asset decimal unit (negative if maker rebate applied)"
]
- }
- ],
- "comment": [
- "Response to retrieve the trading volume"
- ]
- },
- {
- "name": "OrderLeg",
- "is_root": false,
- "fields": [
+ },
+ {
+ "name": "fee_rate",
+ "lite_name": "fr",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 13,
+ "array_depth": 0,
+ "optional": false,
+ "example": "0.0003",
+ "comment": [
+ "The fee rate paid on the trade"
+ ]
+ },
+ {
+ "name": "trade_id",
+ "lite_name": "ti",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 14,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'209358-2'",
+ "comment": [
+ "A trade identifier, globally unique, and monotonically increasing (not by `1`).",
+ "All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.",
+ "`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`."
+ ]
+ },
+ {
+ "name": "order_id",
+ "lite_name": "oi",
+ "semantic_type": "uint128",
+ "json_type": "string",
+ "index": 15,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'0x10000101000203040506'",
+ "comment": [
+ "An order identifier"
+ ]
+ },
+ {
+ "name": "venue",
+ "lite_name": "v",
+ "semantic_type": "Venue",
+ "json_type": "Venue",
+ "index": 16,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'ORDERBOOK'",
+ "comment": [
+ "The venue where the trade occurred"
+ ]
+ },
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "client_order_id",
+ "lite_name": "co",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 0,
+ "index": 18,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'23042'",
"comment": [
- "The instrument to trade in this leg"
+ "A unique identifier for the active order within a subaccount, specified by the client",
+ "This is used to identify the order in the client's system",
+ "This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer",
+ "This field will not be propagated to the smart contract, and should not be signed by the client",
+ "This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected",
+ "Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]",
+ "To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]",
+ "",
+ "When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId"
]
},
{
- "name": "size",
- "lite_name": "s",
- "semantic_type": "string",
+ "name": "signer",
+ "lite_name": "s1",
+ "semantic_type": "uint256",
"json_type": "string",
- "index": 1,
+ "index": 20,
"array_depth": 0,
"optional": false,
- "example": "'10.5'",
+ "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
"comment": [
- "The total number of assets to trade in this leg, expressed in base asset decimal units."
+ "The address (public key) of the wallet signing the payload"
]
},
{
- "name": "limit_price",
- "lite_name": "lp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 2,
+ "name": "broker",
+ "lite_name": "b",
+ "semantic_type": "BrokerTag",
+ "json_type": "BrokerTag",
+ "index": 21,
"array_depth": 0,
"optional": true,
- "default": "0",
- "example": "'65038.01'",
+ "default": "",
"comment": [
- "The limit price of the order leg, expressed in `9` decimals.",
- "This is the number of quote currency units to pay/receive for this leg.",
- "This should be `null/0` if the order is a market order"
+ "Specifies the broker who brokered the order"
]
},
{
- "name": "is_buying_asset",
- "lite_name": "ib",
+ "name": "is_rpi",
+ "lite_name": "ir1",
"semantic_type": "bool",
"json_type": "boolean",
- "index": 3,
+ "index": 22,
"array_depth": 0,
"optional": false,
- "example": "true",
+ "example": "false",
"comment": [
- "Specifies if the order leg is a buy or sell"
+ "If the trade is a RPI trade"
]
}
],
"comment": []
},
{
- "name": "Signature",
- "is_root": false,
+ "name": "ApiFillHistoryResponse",
+ "is_root": true,
"fields": [
{
- "name": "signer",
- "lite_name": "s",
- "semantic_type": "uint256",
- "json_type": "string",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Fill",
+ "json_type": "Fill",
"index": 0,
- "array_depth": 0,
+ "array_depth": 1,
"optional": false,
- "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
"comment": [
- "The address (public key) of the wallet signing the payload"
+ "The private trades matching the request asset"
]
},
{
- "name": "r",
- "lite_name": "r",
- "semantic_type": "uint256",
+ "name": "next",
+ "lite_name": "n",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8'",
+ "example": "'Qw0918='",
"comment": [
- "Signature R"
+ "The cursor to indicate when to start the query from"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiFundingPaymentHistoryRequest",
+ "is_root": true,
+ "fields": [
{
- "name": "s",
- "lite_name": "s1",
- "semantic_type": "uint256",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 2,
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d'",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "Signature S"
+ "The sub account ID to request for"
]
},
{
- "name": "v",
- "lite_name": "v",
- "semantic_type": "uint8",
- "json_type": "integer",
- "index": 3,
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
+ "index": 1,
"array_depth": 0,
- "optional": false,
- "example": "'28'",
+ "optional": true,
+ "default": "all",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Signature V"
+ "The perpetual instrument to filter for"
]
},
{
- "name": "expiration",
- "lite_name": "e",
- "semantic_type": "timestamp",
+ "name": "start_time",
+ "lite_name": "st",
+ "semantic_type": "int64",
"json_type": "string",
- "index": 4,
+ "index": 2,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "0",
"example": "'1697788800000000000'",
"comment": [
- "Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days"
+ "The start time to apply in unix nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "nonce",
- "lite_name": "n",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 5,
+ "name": "end_time",
+ "lite_name": "et",
+ "semantic_type": "int64",
+ "json_type": "string",
+ "index": 3,
"array_depth": 0,
- "optional": false,
- "example": "'1234567890'",
+ "optional": true,
+ "default": "now()",
+ "example": "'1697788800000000000'",
"comment": [
- "Users can randomly generate this value, used as a signature deconflicting key.",
- "ie. You can send the same exact instruction twice with different nonces.",
- "When the same nonce is used, the same payload will generate the same signature.",
- "Our system will consider the payload a duplicate, and ignore it."
+ "The end time to apply in unix nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned"
]
- }
- ],
- "comment": []
- },
- {
- "name": "TPSLOrderMetadata",
- "is_root": false,
- "fields": [
+ },
{
- "name": "trigger_by",
- "lite_name": "tb",
- "semantic_type": "TriggerBy",
- "json_type": "TriggerBy",
- "index": 0,
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 4,
"array_depth": 0,
- "optional": false,
- "example": "'LAST'",
+ "optional": true,
+ "default": "500",
+ "example": "500",
"comment": [
- "Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order"
+ "The limit to query for. Defaults to 500; Max 1000"
]
},
{
- "name": "trigger_price",
- "lite_name": "tp",
+ "name": "cursor",
+ "lite_name": "c",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 5,
"array_depth": 0,
- "optional": false,
- "example": "'65038.10'",
+ "optional": true,
+ "default": "''",
+ "example": "''",
"comment": [
- "The Trigger Price of the order, expressed in `9` decimals."
+ "The cursor to indicate when to start the query from"
]
}
],
"comment": [
- "Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.",
- "",
- "### Fields:",
- "- **triggerBy**: Defines the price type that activates the order (e.g., index price).",
- "- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.",
+ "Query for all historical funding payments made by a single account.",
"",
- ""
+ "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "TriggerOrderMetadata",
+ "name": "FundingPayment",
"is_root": false,
"fields": [
{
- "name": "trigger_type",
- "lite_name": "tt",
- "semantic_type": "TriggerType",
- "json_type": "TriggerType",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'TAKE_PROFIT'",
+ "example": "'1697788800000000000'",
"comment": [
- "Type of the trigger order. eg: Take Profit, Stop Loss, etc"
+ "Time at which the event was emitted in unix nanoseconds"
]
},
{
- "name": "tpsl",
- "lite_name": "t",
- "semantic_type": "TPSLOrderMetadata",
- "json_type": "TPSLOrderMetadata",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.",
- "",
- ""
+ "The sub account ID that made the funding payment"
]
- }
- ],
- "comment": [
- "Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).",
- "",
- "Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.",
- "",
- ""
- ]
- },
- {
- "name": "OrderMetadata",
- "is_root": false,
- "fields": [
+ },
{
- "name": "client_order_id",
- "lite_name": "co",
- "semantic_type": "uint64",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
- "index": 0,
+ "index": 2,
"array_depth": 0,
"optional": false,
- "example": "'23042'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "A unique identifier for the active order within a subaccount, specified by the client",
- "This is used to identify the order in the client's system",
- "This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer",
- "This field will not be propagated to the smart contract, and should not be signed by the client",
- "This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected",
- "Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]",
- "To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]",
- "",
- "When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId"
+ "The perpetual instrument being funded"
]
},
{
- "name": "create_time",
- "lite_name": "ct",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 1,
+ "name": "currency",
+ "lite_name": "c",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
+ "index": 3,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
+ "optional": false,
+ "example": "'USDT'",
"comment": [
- "[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds"
+ "The currency of the funding payment"
]
},
{
- "name": "trigger",
- "lite_name": "t",
- "semantic_type": "TriggerOrderMetadata",
- "json_type": "TriggerOrderMetadata",
- "index": 2,
+ "name": "amount",
+ "lite_name": "a",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 4,
"array_depth": 0,
- "optional": true,
- "default": "",
+ "optional": false,
+ "example": "'9.75'",
"comment": [
- "Trigger fields are used to support any type of trigger order such as TP/SL"
+ "The amount of the funding payment. Positive if paid, negative if received"
]
},
{
- "name": "broker",
- "lite_name": "b",
- "semantic_type": "BrokerTag",
- "json_type": "BrokerTag",
- "index": 3,
+ "name": "tx_id",
+ "lite_name": "ti",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 5,
"array_depth": 0,
- "optional": true,
- "default": "",
- "example": "'BROKER_CODE'",
+ "optional": false,
+ "example": "'209358'",
"comment": [
- "Specifies the broker who brokered the order"
+ "The transaction ID of the funding payment.",
+ "Funding payments can be triggered by a trade, transfer, or liquidation.",
+ "The `tx_id` will match the corresponding `trade_id` or `tx_id`."
]
}
],
- "comment": [
- "Metadata fields are used to support Backend only operations. These operations are not trustless by nature.",
- "Hence, fields in here are never signed, and is never transmitted to the smart contract."
- ]
+ "comment": []
},
{
- "name": "OrderState",
- "is_root": false,
+ "name": "ApiFundingPaymentHistoryResponse",
+ "is_root": true,
"fields": [
{
- "name": "status",
- "lite_name": "s",
- "semantic_type": "OrderStatus",
- "json_type": "OrderStatus",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "FundingPayment",
+ "json_type": "FundingPayment",
"index": 0,
- "array_depth": 0,
+ "array_depth": 1,
"optional": false,
"comment": [
- "The status of the order"
+ "The funding payments matching the request asset"
]
},
{
- "name": "reject_reason",
- "lite_name": "rr",
- "semantic_type": "OrderRejectReason",
- "json_type": "OrderRejectReason",
+ "name": "next",
+ "lite_name": "n",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'CLIENT_CANCEL'",
+ "example": "'Qw0918='",
"comment": [
- "The reason for rejection or cancellation"
+ "The cursor to indicate when to start the query from"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiSubAccountSummaryRequest",
+ "is_root": true,
+ "fields": [
{
- "name": "book_size",
- "lite_name": "bs",
- "semantic_type": "string",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 2,
- "array_depth": 1,
+ "index": 0,
+ "array_depth": 0,
"optional": false,
- "example": "['10.5']",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs"
+ "The subaccount ID to filter by"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "SpotBalance",
+ "is_root": false,
+ "fields": [
{
- "name": "traded_size",
- "lite_name": "ts",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 1,
+ "name": "currency",
+ "lite_name": "c",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
+ "index": 0,
+ "array_depth": 0,
"optional": false,
- "example": "['1.5']",
+ "example": "'USDT'",
"comment": [
- "The total number of assets traded. Sorted in same order as Order.Legs"
+ "The currency you hold a spot balance in"
]
},
{
- "name": "update_time",
- "lite_name": "ut",
- "semantic_type": "timestamp",
+ "name": "balance",
+ "lite_name": "b",
+ "semantic_type": "string",
"json_type": "string",
- "index": 4,
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'123456.78'",
"comment": [
- "Time at which the order was updated by GRVT, expressed in unix nanoseconds"
+ "This currency's balance in this trading account."
]
},
{
- "name": "avg_fill_price",
- "lite_name": "af",
+ "name": "index_price",
+ "lite_name": "ip",
"semantic_type": "string",
"json_type": "string",
- "index": 5,
- "array_depth": 1,
+ "index": 2,
+ "array_depth": 0,
"optional": false,
- "example": "['60000.4']",
+ "example": "'1.0000102'",
"comment": [
- "The average fill price of the order. Sorted in same order as Order.Legs"
+ "The index price of this currency. (reported in `USD`)"
]
}
],
"comment": []
},
{
- "name": "Order",
+ "name": "SubAccount",
"is_root": false,
"fields": [
{
- "name": "order_id",
- "lite_name": "oi",
- "semantic_type": "uint128",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 0,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'0x1234567890abcdef'",
+ "optional": false,
+ "example": "'1697788800000000000'",
"comment": [
- "[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend"
+ "Time at which the event was emitted in unix nanoseconds"
]
},
{
@@ -8714,182 +3306,172 @@
"optional": false,
"example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The subaccount initiating the order"
+ "The sub account ID this entry refers to"
]
},
{
- "name": "is_market",
- "lite_name": "im",
- "semantic_type": "bool",
- "json_type": "boolean",
+ "name": "margin_type",
+ "lite_name": "mt",
+ "semantic_type": "MarginType",
+ "json_type": "MarginType",
"index": 2,
"array_depth": 0,
- "optional": true,
- "default": "false",
- "example": "false",
+ "optional": false,
+ "example": "'SIMPLE_CROSS_MARGIN'",
"comment": [
- "If the order is a market order",
- "Market Orders do not have a limit price, and are always executed according to the maker order price.",
- "Market Orders must always be taker orders"
+ "The type of margin algorithm this subaccount uses"
]
},
{
- "name": "time_in_force",
- "lite_name": "ti",
- "semantic_type": "TimeInForce",
- "json_type": "TimeInForce",
+ "name": "settle_currency",
+ "lite_name": "sc",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 3,
"array_depth": 0,
"optional": false,
+ "example": "'USDT'",
"comment": [
- "Four supported types of orders: GTT, IOC, AON, FOK:\u003cul\u003e",
- "\u003cli\u003ePARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg\u003c/li\u003e",
- "\u003cli\u003eFULL EXECUTION = AON / FOK - only allows full size execution on all legs\u003c/li\u003e",
- "\u003cli\u003eTAKER ONLY = IOC / FOK - only allows taker orders\u003c/li\u003e",
- "\u003cli\u003eMAKER OR TAKER = GTT / AON - allows maker or taker orders\u003c/li\u003e",
- "\u003c/ul\u003eExchange only supports (GTT, IOC, FOK)",
- "RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)"
+ "The settlement, margin, and reporting currency of this account.",
+ "This subaccount can only open positions quoted in this currency",
+ "",
+ "In the future, when users select a Multi-Currency Margin Type, this will be USD",
+ "All other assets are converted to this currency for the purpose of calculating margin"
]
},
{
- "name": "post_only",
- "lite_name": "po",
- "semantic_type": "bool",
- "json_type": "boolean",
+ "name": "unrealized_pnl",
+ "lite_name": "up",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 4,
"array_depth": 0,
- "optional": true,
- "default": "false",
- "example": "false",
+ "optional": false,
+ "example": "'123456.78'",
"comment": [
- "If True, Order must be a maker order. It has to fill the orderbook instead of match it.",
- "If False, Order can be either a maker or taker order. \u003cb\u003eIn this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.\u003c/b\u003e",
- "",
- "| | Must Fill All | Can Fill Partial |",
- "| - | - | - |",
- "| Must Be Taker | FOK + False | IOC + False |",
- "| Can Be Either | AON + False | GTC + False |",
- "| Must Be Maker | AON + True | GTC + True |",
- ""
+ "The total unrealized PnL of all positions owned by this subaccount, denominated in quote currency decimal units.",
+ "`unrealized_pnl = sum(position.unrealized_pnl * position.quote_index_price) / settle_index_price`"
]
},
{
- "name": "reduce_only",
- "lite_name": "ro",
- "semantic_type": "bool",
- "json_type": "boolean",
+ "name": "total_equity",
+ "lite_name": "te",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 5,
"array_depth": 0,
- "optional": true,
- "default": "false",
- "example": "false",
+ "optional": false,
+ "example": "'123456.78'",
"comment": [
- "If True, Order must reduce the position size, or be cancelled"
+ "The notional value of your account if all positions are closed, excluding trading fees (reported in `settle_currency`).",
+ "`total_equity = sum(spot_balance.balance * spot_balance.index_price) / settle_index_price + unrealized_pnl`"
]
},
{
- "name": "legs",
- "lite_name": "l",
- "semantic_type": "OrderLeg",
- "json_type": "OrderLeg",
+ "name": "initial_margin",
+ "lite_name": "im",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 6,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'123456.78'",
"comment": [
- "The legs present in this order",
- "The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice"
+ "The `total_equity` required to open positions in the account (reported in `settle_currency`).",
+ "Computation is different depending on account's `margin_type`"
]
},
{
- "name": "signature",
- "lite_name": "s",
- "semantic_type": "Signature",
- "json_type": "Signature",
+ "name": "maintenance_margin",
+ "lite_name": "mm",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 7,
"array_depth": 0,
"optional": false,
+ "example": "'123456.78'",
"comment": [
- "The signature approving this order"
+ "The `total_equity` required to avoid liquidation of positions in the account (reported in `settle_currency`).",
+ "Computation is different depending on account's `margin_type`"
]
},
{
- "name": "metadata",
- "lite_name": "m",
- "semantic_type": "OrderMetadata",
- "json_type": "OrderMetadata",
+ "name": "available_balance",
+ "lite_name": "ab",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 8,
"array_depth": 0,
"optional": false,
+ "example": "'123456.78'",
"comment": [
- "Order Metadata, ignored by the smart contract, and unsigned by the client"
+ "The notional value available to transfer out of the trading account into the funding account (reported in `settle_currency`).",
+ "`available_balance = total_equity - initial_margin - min(unrealized_pnl, 0)`"
]
},
{
- "name": "state",
- "lite_name": "s1",
- "semantic_type": "OrderState",
- "json_type": "OrderState",
+ "name": "spot_balances",
+ "lite_name": "sb",
+ "semantic_type": "SpotBalance",
+ "json_type": "SpotBalance",
"index": 9,
- "array_depth": 0,
- "optional": true,
- "default": "''",
+ "array_depth": 1,
+ "optional": false,
"comment": [
- "[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client"
+ "The list of spot assets owned by this sub account, and their balances"
]
- }
- ],
- "comment": [
- "Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.",
- "GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.",
- "This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.",
- "Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.",
- "",
- "All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.",
- "This minimizes the amount of trust users have to offer to GRVT"
- ]
- },
- {
- "name": "ApiCreateOrderRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "order",
- "lite_name": "o",
- "semantic_type": "Order",
- "json_type": "Order",
- "index": 0,
+ "name": "positions",
+ "lite_name": "p",
+ "semantic_type": "Positions",
+ "json_type": "Positions",
+ "index": 10,
+ "array_depth": 1,
+ "optional": false,
+ "comment": [
+ "The list of positions owned by this sub account"
+ ]
+ },
+ {
+ "name": "settle_index_price",
+ "lite_name": "si",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 11,
"array_depth": 0,
"optional": false,
+ "example": "'1.0000102'",
"comment": [
- "The order to create"
+ "The index price of the settle currency. (reported in `USD`)"
]
}
],
- "comment": [
- "Create an order on the orderbook for this trading account."
- ]
+ "comment": []
},
{
- "name": "ApiCreateOrderResponse",
+ "name": "ApiSubAccountSummaryResponse",
"is_root": true,
"fields": [
{
"name": "result",
"lite_name": "r",
- "semantic_type": "Order",
- "json_type": "Order",
+ "semantic_type": "SubAccount",
+ "json_type": "SubAccount",
"index": 0,
"array_depth": 0,
"optional": false,
"comment": [
- "The created order"
+ "The sub account matching the request sub account"
]
}
],
- "comment": []
+ "comment": [
+ "Query for sub-account details, including base currency balance, all derivative positions, margin levels, and P\u0026L."
+ ]
},
{
- "name": "ApiCancelOrderRequest",
+ "name": "ApiSubAccountHistoryRequest",
"is_root": true,
"fields": [
{
@@ -8902,168 +3484,243 @@
"optional": false,
"example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The subaccount ID cancelling the order"
+ "The sub account ID to request for"
]
},
{
- "name": "order_id",
- "lite_name": "oi",
- "semantic_type": "uint128",
+ "name": "start_time",
+ "lite_name": "st",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": true,
"default": "0",
- "example": "'0x1028403'",
+ "example": "'1697788800000000000'",
"comment": [
- "Cancel the order with this `order_id`"
+ "Start time of sub account history in unix nanoseconds"
]
},
{
- "name": "client_order_id",
- "lite_name": "co",
- "semantic_type": "uint64",
+ "name": "end_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": true,
- "default": "0",
- "example": "'23042'",
+ "default": "now()",
+ "example": "'1697788800000000000'",
"comment": [
- "Cancel the order with this `client_order_id`"
+ "End time of sub account history in unix nanoseconds"
]
},
{
- "name": "time_to_live_ms",
- "lite_name": "tt",
- "semantic_type": "uint64",
- "json_type": "string",
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
"index": 3,
"array_depth": 0,
"optional": true,
- "default": "100",
- "example": "'500'",
+ "default": "500",
+ "example": "500",
+ "comment": [
+ "The limit to query for. Defaults to 500; Max 1000"
+ ]
+ },
+ {
+ "name": "cursor",
+ "lite_name": "c",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 4,
+ "array_depth": 0,
+ "optional": true,
+ "default": "''",
+ "example": "''",
+ "comment": [
+ "The cursor to indicate when to start the next query from"
+ ]
+ }
+ ],
+ "comment": [
+ "The request to get the history of a sub account",
+ "SubAccount Summary values are snapshotted once every hour",
+ "No snapshots are taken if the sub account has no activity in the hourly window",
+ "History is preserved only for the last 30 days",
+ "",
+ "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
+ ]
+ },
+ {
+ "name": "ApiSubAccountHistoryResponse",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "SubAccount",
+ "json_type": "SubAccount",
+ "index": 0,
+ "array_depth": 1,
+ "optional": false,
+ "comment": [
+ "The sub account history matching the request sub account"
+ ]
+ },
+ {
+ "name": "next",
+ "lite_name": "n",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'Qw0918='",
+ "comment": [
+ "The cursor to indicate when to start the next query from"
+ ]
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "AggregatedAccountSummary",
+ "is_root": false,
+ "fields": [
+ {
+ "name": "main_account_id",
+ "lite_name": "ma",
+ "semantic_type": "address",
+ "json_type": "string",
+ "index": 0,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
+ "comment": [
+ "The main account ID of the account to which the summary belongs"
+ ]
+ },
+ {
+ "name": "total_equity",
+ "lite_name": "te",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'3945034.23'",
+ "comment": [
+ "Total equity of the main (+ sub) account, denominated in USD"
+ ]
+ },
+ {
+ "name": "spot_balances",
+ "lite_name": "sb",
+ "semantic_type": "SpotBalance",
+ "json_type": "SpotBalance",
+ "index": 2,
+ "array_depth": 1,
+ "optional": false,
"comment": [
- "Specifies the time-to-live (in milliseconds) for this cancellation.",
- "During this period, any order creation with a matching `client_order_id` will be cancelled and not be added to the GRVT matching engine.",
- "This mechanism helps mitigate time-of-flight issues where cancellations might arrive before the corresponding orders.",
- "Hence, cancellation by `order_id` ignores this field as the exchange can only assign `order_id`s to already-processed order creations.",
- "The duration cannot be negative, is rounded down to the nearest 100ms (e.g., `'670'` -\u003e `'600'`, `'30'` -\u003e `'0'`) and capped at 5 seconds (i.e., `'5000'`).",
- "Value of `'0'` or omission results in the default time-to-live value being applied.",
- "If the caller requests multiple successive cancellations for a given order, such that the time-to-live windows overlap, only the first request will be considered.",
- ""
+ "The list of spot assets owned by this main (+ sub) account, and their balances"
]
}
],
- "comment": [
- "Cancel an order on the orderbook for this trading account. Either `order_id` or `client_order_id` must be provided."
- ]
+ "comment": []
},
{
- "name": "ApiCancelOrderResponse",
+ "name": "ApiAggregatedAccountSummaryResponse",
"is_root": true,
"fields": [
{
"name": "result",
"lite_name": "r",
- "semantic_type": "Order",
- "json_type": "Order",
+ "semantic_type": "AggregatedAccountSummary",
+ "json_type": "AggregatedAccountSummary",
"index": 0,
"array_depth": 0,
"optional": false,
"comment": [
- "The cancelled order"
+ "The aggregated account summary"
]
}
],
- "comment": []
+ "comment": [
+ "The aggregated account summary, that reports the total equity and spot balances of a funding (main) account, and its constituent trading (sub) accounts"
+ ]
},
{
- "name": "ApiCancelAllOrdersRequest",
- "is_root": true,
+ "name": "FundingAccountSummary",
+ "is_root": false,
"fields": [
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
+ "name": "main_account_id",
+ "lite_name": "ma",
+ "semantic_type": "address",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
"comment": [
- "The subaccount ID cancelling all orders"
+ "The main account ID of the account to which the summary belongs"
]
},
{
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
+ "name": "total_equity",
+ "lite_name": "te",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 1,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['PERPETUAL']",
+ "array_depth": 0,
+ "optional": false,
+ "example": "'3945034.23'",
"comment": [
- "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be cancelled"
+ "Total equity of the main account, denominated in USD"
]
},
{
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
+ "name": "spot_balances",
+ "lite_name": "sb",
+ "semantic_type": "SpotBalance",
+ "json_type": "SpotBalance",
"index": 2,
"array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['BTC', 'ETH']",
- "comment": [
- "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be cancelled"
- ]
- },
- {
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 3,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['USDT', 'USDC']",
+ "optional": false,
"comment": [
- "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be cancelled"
+ "The list of spot assets owned by this main account, and their balances"
]
}
],
"comment": [
- "Cancel all orders on the orderbook for this trading account. This may not match new orders in flight."
+ "The funding account summary, that reports the total equity and spot balances of a funding (main) account"
]
},
{
- "name": "ApiCancelAllOrdersResponse",
+ "name": "ApiFundingAccountSummaryResponse",
"is_root": true,
"fields": [
{
"name": "result",
"lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "semantic_type": "FundingAccountSummary",
+ "json_type": "FundingAccountSummary",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'52'",
"comment": [
- "The number of orders cancelled"
+ "The funding account summary"
]
}
],
- "comment": []
+ "comment": [
+ "The funding account summary, that reports the total equity and spot balances of a funding (main) account"
+ ]
},
{
- "name": "ApiOpenOrdersRequest",
+ "name": "ApiSetInitialLeverageRequest",
"is_root": true,
"fields": [
{
@@ -9076,77 +3733,64 @@
"optional": false,
"example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The subaccount ID to filter by"
+ "The sub account ID to set the leverage for"
]
},
{
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 1,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['PERPETUAL']",
+ "array_depth": 0,
+ "optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
+ "The instrument to set the leverage for"
]
},
{
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
+ "name": "leverage",
+ "lite_name": "l",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 2,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['BTC', 'ETH']",
- "comment": [
- "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 3,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['USDT', 'USDC']",
+ "array_depth": 0,
+ "optional": false,
+ "example": "'10'",
"comment": [
- "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
+ "The leverage to set for the sub account"
]
}
],
- "comment": []
+ "comment": [
+ "The request to set the initial leverage of a sub account"
+ ]
},
{
- "name": "ApiOpenOrdersResponse",
+ "name": "ApiSetInitialLeverageResponse",
"is_root": true,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Order",
- "json_type": "Order",
+ "name": "success",
+ "lite_name": "s",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'true'",
"comment": [
- "The Open Orders matching the request filter"
+ "Whether the leverage was set successfully"
]
}
],
"comment": [
- "Retrieves all open orders for the account. This may not match new orders in flight."
+ "The response to set the initial leverage of a sub account"
]
},
{
- "name": "ApiOrderHistoryRequest",
+ "name": "ApiGetAllInitialLeverageRequest",
"is_root": true,
"fields": [
{
@@ -9159,1101 +3803,1079 @@
"optional": false,
"example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The subaccount ID to filter by"
+ "The sub account ID to get the leverage for"
+ ]
+ }
+ ],
+ "comment": [
+ "The request to get the initial leverage of a sub account"
+ ]
+ },
+ {
+ "name": "InitialLeverageResult",
+ "is_root": false,
+ "fields": [
+ {
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
+ "index": 0,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'BTC_USDT_Perp'",
+ "comment": [
+ "The instrument to get the leverage for"
]
},
{
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
+ "name": "leverage",
+ "lite_name": "l",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 1,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['PERPETUAL']",
+ "array_depth": 0,
+ "optional": false,
+ "example": "'10'",
"comment": [
- "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
+ "The initial leverage of the sub account"
]
},
{
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
+ "name": "min_leverage",
+ "lite_name": "ml",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 2,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['BTC', 'ETH']",
+ "array_depth": 0,
+ "optional": false,
+ "example": "'10'",
"comment": [
- "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
+ "The min leverage this sub account can set"
]
},
{
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "Currency",
- "json_type": "Currency",
+ "name": "max_leverage",
+ "lite_name": "ml1",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 3,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'50'",
+ "comment": [
+ "The max leverage this sub account can set"
+ ]
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiGetAllInitialLeverageResponse",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "results",
+ "lite_name": "r",
+ "semantic_type": "InitialLeverageResult",
+ "json_type": "InitialLeverageResult",
+ "index": 0,
"array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['USDT', 'USDC']",
+ "optional": false,
"comment": [
- "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
+ "The initial leverage of the sub account"
]
- },
+ }
+ ],
+ "comment": [
+ "The response to get the initial leverage of a sub account"
+ ]
+ },
+ {
+ "name": "ApiOrderbookLevelsRequest",
+ "is_root": true,
+ "fields": [
{
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "int64",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
- "index": 4,
+ "index": 0,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
+ "optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The start time to apply in nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "int64",
- "json_type": "string",
- "index": 5,
+ "name": "depth",
+ "lite_name": "d",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 1,
"array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
+ "optional": false,
+ "example": "50",
"comment": [
- "The end time to apply in nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned"
+ "Depth of the order book to be retrieved (10, 50, 100, 500)"
]
- },
+ }
+ ],
+ "comment": [
+ "Retrieves aggregated price depth for a single instrument, with a maximum depth of 10 levels. Do not use this to poll for data -- a websocket subscription is much more performant, and useful."
+ ]
+ },
+ {
+ "name": "OrderbookLevel",
+ "is_root": false,
+ "fields": [
{
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 6,
+ "name": "price",
+ "lite_name": "p",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 0,
"array_depth": 0,
- "optional": true,
- "default": "500",
- "example": "500",
+ "optional": false,
+ "example": "'65038.01'",
"comment": [
- "The limit to query for. Defaults to 500; Max 1000"
+ "The price of the level, expressed in `9` decimals"
]
},
{
- "name": "cursor",
- "lite_name": "c",
+ "name": "size",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
- "index": 7,
+ "index": 1,
"array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "''",
+ "optional": false,
+ "example": "'3456.78'",
"comment": [
- "The cursor to indicate when to start the query from"
+ "The number of assets offered, expressed in base asset decimal units"
+ ]
+ },
+ {
+ "name": "num_orders",
+ "lite_name": "no",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 2,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'123'",
+ "comment": [
+ "The number of open orders at this level"
]
}
],
- "comment": [
- "Retrieves the order history for the account.",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
- ]
+ "comment": []
},
{
- "name": "ApiOrderHistoryResponse",
- "is_root": true,
+ "name": "OrderbookLevels",
+ "is_root": false,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Order",
- "json_type": "Order",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
+ "json_type": "string",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'1697788800000000000'",
"comment": [
- "The Open Orders matching the request filter"
+ "Time at which the event was emitted in unix nanoseconds"
]
},
{
- "name": "next",
- "lite_name": "n",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'Qw0918='",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The cursor to indicate when to start the query from"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ]
+ },
+ {
+ "name": "bids",
+ "lite_name": "b",
+ "semantic_type": "OrderbookLevel",
+ "json_type": "OrderbookLevel",
+ "index": 2,
+ "array_depth": 1,
+ "optional": false,
+ "comment": [
+ "The list of best bids up till query depth"
+ ]
+ },
+ {
+ "name": "asks",
+ "lite_name": "a",
+ "semantic_type": "OrderbookLevel",
+ "json_type": "OrderbookLevel",
+ "index": 3,
+ "array_depth": 1,
+ "optional": false,
+ "comment": [
+ "The list of best asks up till query depth"
]
}
],
"comment": []
},
{
- "name": "EmptyRequest",
+ "name": "ApiOrderbookLevelsResponse",
"is_root": true,
- "fields": [],
- "comment": [
- "Used for requests that do not require any parameters"
- ]
- },
- {
- "name": "Ack",
- "is_root": false,
"fields": [
{
- "name": "ack",
- "lite_name": "a",
- "semantic_type": "bool",
- "json_type": "boolean",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "OrderbookLevels",
+ "json_type": "OrderbookLevels",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'true'",
"comment": [
- "Gravity has acknowledged that the request has been successfully received and it will process it in the backend"
+ "The orderbook levels objects matching the request asset"
]
}
],
"comment": []
},
{
- "name": "AckResponse",
+ "name": "ApiMiniTickerRequest",
"is_root": true,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Ack",
- "json_type": "Ack",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The Ack Object"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
}
],
"comment": [
- "Used to acknowledge a request has been received and will be processed"
+ "Retrieves a single mini ticker value for a single instrument. Please do not use this to repeatedly poll for data -- a websocket subscription is much more performant, and useful."
]
},
{
- "name": "ApiOrderStateRequest",
- "is_root": true,
+ "name": "MiniTicker",
+ "is_root": false,
"fields": [
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
+ "json_type": "string",
+ "index": 0,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'1697788800000000000'",
+ "comment": [
+ "Time at which the event was emitted in unix nanoseconds"
+ ]
+ },
+ {
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'BTC_USDT_Perp'",
+ "comment": [
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ]
+ },
+ {
+ "name": "mark_price",
+ "lite_name": "mp",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 2,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
+ "comment": [
+ "The mark price of the instrument, expressed in `9` decimals"
+ ]
+ },
+ {
+ "name": "index_price",
+ "lite_name": "ip",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 3,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
+ "comment": [
+ "The index price of the instrument, expressed in `9` decimals"
+ ]
+ },
+ {
+ "name": "last_price",
+ "lite_name": "lp",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 4,
"array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The subaccount ID to filter by"
+ "The last traded price of the instrument (also close price), expressed in `9` decimals"
]
},
{
- "name": "order_id",
- "lite_name": "oi",
- "semantic_type": "uint128",
+ "name": "last_size",
+ "lite_name": "ls",
+ "semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 5,
"array_depth": 0,
"optional": true,
- "default": "0",
- "example": "'0x1028403'",
+ "example": "'123456.78'",
"comment": [
- "Filter for `order_id`"
+ "The number of assets traded in the last trade, expressed in base asset decimal units"
]
},
{
- "name": "client_order_id",
- "lite_name": "co",
- "semantic_type": "uint64",
+ "name": "mid_price",
+ "lite_name": "mp1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 2,
+ "index": 6,
"array_depth": 0,
"optional": true,
- "default": "0",
- "example": "'23042'",
+ "example": "'65038.01'",
"comment": [
- "Filter for `client_order_id`"
+ "The mid price of the instrument, expressed in `9` decimals"
]
- }
- ],
- "comment": [
- "Retrieve the order state for the account. Either `order_id` or `client_order_id` must be provided."
- ]
- },
- {
- "name": "ApiOrderStateResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "state",
- "lite_name": "s",
- "semantic_type": "OrderState",
- "json_type": "OrderState",
- "index": 0,
+ "name": "best_bid_price",
+ "lite_name": "bb",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 7,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The order state for the requested filter"
+ "The best bid price of the instrument, expressed in `9` decimals"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetOrderRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
+ "name": "best_bid_size",
+ "lite_name": "bb1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 8,
"array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The subaccount ID to filter by"
+ "The number of assets offered on the best bid price of the instrument, expressed in base asset decimal units"
]
},
{
- "name": "order_id",
- "lite_name": "oi",
- "semantic_type": "uint128",
+ "name": "best_ask_price",
+ "lite_name": "ba",
+ "semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 9,
"array_depth": 0,
"optional": true,
- "default": "0",
- "example": "'0x1028403'",
+ "example": "'65038.01'",
"comment": [
- "Filter for `order_id`"
+ "The best ask price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "client_order_id",
- "lite_name": "co",
- "semantic_type": "uint64",
+ "name": "best_ask_size",
+ "lite_name": "ba1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 2,
+ "index": 10,
"array_depth": 0,
"optional": true,
- "default": "0",
- "example": "'23042'",
+ "example": "'123456.78'",
"comment": [
- "Filter for `client_order_id`"
+ "The number of assets offered on the best ask price of the instrument, expressed in base asset decimal units"
]
}
],
- "comment": [
- "Retrieve the order for the account. Either `order_id` or `client_order_id` must be provided."
- ]
+ "comment": []
},
{
- "name": "ApiGetOrderResponse",
+ "name": "ApiMiniTickerResponse",
"is_root": true,
"fields": [
{
"name": "result",
"lite_name": "r",
- "semantic_type": "Order",
- "json_type": "Order",
+ "semantic_type": "MiniTicker",
+ "json_type": "MiniTicker",
"index": 0,
"array_depth": 0,
"optional": false,
"comment": [
- "The order object for the requested filter"
+ "The mini ticker matching the request asset"
]
}
],
"comment": []
},
{
- "name": "ApiPreOrderCheckRequest",
+ "name": "ApiTickerRequest",
"is_root": true,
"fields": [
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The subaccount ID of orders to query"
- ]
- },
- {
- "name": "orders",
- "lite_name": "o",
- "semantic_type": "Order",
- "json_type": "Order",
- "index": 1,
- "array_depth": 1,
- "optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The order to do pre-order check"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
}
],
"comment": [
- "Get pre-order check information for a new order"
+ "Retrieves a single ticker value for a single instrument. Please do not use this to repeatedly poll for data -- a websocket subscription is much more performant, and useful."
]
},
{
- "name": "AssetMaxQty",
+ "name": "Ticker",
"is_root": false,
"fields": [
{
- "name": "asset",
- "lite_name": "a",
- "semantic_type": "asset",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 0,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "example": "'1697788800000000000'",
"comment": [
- "The asset associated with the max quantity"
+ "Time at which the event was emitted in unix nanoseconds"
]
},
{
- "name": "max_buy_qty",
- "lite_name": "mb",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": false,
- "example": "100.0",
+ "optional": true,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The maximum buy quantity"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "max_sell_qty",
- "lite_name": "ms",
+ "name": "mark_price",
+ "lite_name": "mp",
"semantic_type": "string",
"json_type": "string",
"index": 2,
"array_depth": 0,
- "optional": false,
- "example": "100.0",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The maximum sell quantity"
+ "The mark price of the instrument, expressed in `9` decimals"
]
- }
- ],
- "comment": []
- },
- {
- "name": "PreOrderCheckResult",
- "is_root": false,
- "fields": [
+ },
{
- "name": "max_qty",
- "lite_name": "mq",
- "semantic_type": "AssetMaxQty",
- "json_type": "AssetMaxQty",
- "index": 0,
- "array_depth": 1,
- "optional": false,
+ "name": "index_price",
+ "lite_name": "ip",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 3,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The maximum quantity for each leg"
+ "The index price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "margin_required",
- "lite_name": "mr",
+ "name": "last_price",
+ "lite_name": "lp",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 4,
"array_depth": 0,
- "optional": false,
- "example": "1000.0",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The margin required for the order (reported in `settle_currency`)"
+ "The last traded price of the instrument (also close price), expressed in `9` decimals"
]
},
{
- "name": "order_valid",
- "lite_name": "ov",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 2,
+ "name": "last_size",
+ "lite_name": "ls",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 5,
"array_depth": 0,
- "optional": false,
- "example": "true",
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "Whether the order is valid"
+ "The number of assets traded in the last trade, expressed in base asset decimal units"
]
},
{
- "name": "reason",
- "lite_name": "r",
+ "name": "mid_price",
+ "lite_name": "mp1",
"semantic_type": "string",
"json_type": "string",
- "index": 3,
+ "index": 6,
"array_depth": 0,
- "optional": false,
- "example": "''",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The reason the order is invalid, if any"
+ "The mid price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "settle_currency",
- "lite_name": "sc",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 4,
+ "name": "best_bid_price",
+ "lite_name": "bb",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 7,
"array_depth": 0,
- "optional": false,
- "example": "'USDT'",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The subAccount settle currency"
+ "The best bid price of the instrument, expressed in `9` decimals"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiPreOrderCheckResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "results",
- "lite_name": "r",
- "semantic_type": "PreOrderCheckResult",
- "json_type": "PreOrderCheckResult",
- "index": 0,
- "array_depth": 1,
- "optional": false,
+ "name": "best_bid_size",
+ "lite_name": "bb1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 8,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "Pre order check for each new order in the request"
+ "The number of assets offered on the best bid price of the instrument, expressed in base asset decimal units"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiPreDepositCheckRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "currency",
- "lite_name": "c",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 0,
+ "name": "best_ask_price",
+ "lite_name": "ba",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 9,
"array_depth": 0,
- "optional": false,
- "example": "'USDT'",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The currency you hold the deposit in"
+ "The best ask price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "bridge",
- "lite_name": "b",
- "semantic_type": "BridgeType",
- "json_type": "BridgeType",
- "index": 1,
+ "name": "best_ask_size",
+ "lite_name": "ba1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 10,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The bridge type to conduct checks for"
+ "The number of assets offered on the best ask price of the instrument, expressed in base asset decimal units"
]
- }
- ],
- "comment": [
- "UI only for bridge deposits through non native bridge. Currently only supports XY Finance bridge account."
- ]
- },
- {
- "name": "ApiPreDepositCheckResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "max_deposit_limit",
- "lite_name": "md",
+ "name": "funding_rate_8h_curr",
+ "lite_name": "fr",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 11,
"array_depth": 0,
- "optional": false,
- "example": "'3945034.23'",
+ "optional": true,
+ "example": "0.0003",
"comment": [
- "Max Deposit Limit reported for the Bridge Account reported in the currency balance"
+ "The current funding rate of the instrument, expressed in percentage points"
]
},
{
- "name": "currency",
- "lite_name": "c",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 1,
+ "name": "funding_rate_8h_avg",
+ "lite_name": "fr1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 12,
"array_depth": 0,
- "optional": false,
- "example": "'USDT'",
+ "optional": true,
+ "example": "0.0003",
"comment": [
- "The currency you hold the deposit in"
+ "The average funding rate of the instrument (over last 8h), expressed in percentage points"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiDedustPositionRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "order",
- "lite_name": "o",
- "semantic_type": "Order",
- "json_type": "Order",
- "index": 0,
+ "name": "interest_rate",
+ "lite_name": "ir",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 13,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "example": "0.0003",
"comment": [
- "The order to create"
+ "The interest rate of the underlying, expressed in centibeeps (1/100th of a basis point)"
]
- }
- ],
- "comment": [
- "Remove dust position (i.e., order quantity smaller than minimum required increment) on an account, by matching the specified order against GRVT directly. Limit price should always be better than mark price."
- ]
- },
- {
- "name": "ApiDedustPositionResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Order",
- "json_type": "Order",
- "index": 0,
+ "name": "forward_price",
+ "lite_name": "fp",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 14,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The created order"
+ "[Options] The forward price of the option, expressed in `9` decimals"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiCreateBulkOrdersRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "orders",
- "lite_name": "o",
- "semantic_type": "Order",
- "json_type": "Order",
- "index": 0,
- "array_depth": 1,
- "optional": false,
+ "name": "buy_volume_24h_b",
+ "lite_name": "bv",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 15,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The orders to create"
+ "The 24 hour taker buy volume of the instrument, expressed in base asset decimal units"
]
- }
- ],
- "comment": [
- "Create multiple orders simultaneously for this trading account.",
- "",
- "This endpoint supports the following order scenarios:",
- "- One-Cancels-Other (OCO) orders combining TP/SL",
- "- One-Sends-Other (OSO) orders",
- "",
- "Usage:",
- "- For OCO (TP/SL pair): Send exactly 2 orders in the same request - one Take Profit and one Stop Loss order",
- "- For OSO: Send exactly one main order and one contingent order (TP and/or SL)"
- ]
- },
- {
- "name": "ApiCreateBulkOrdersResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Order",
- "json_type": "Order",
- "index": 0,
- "array_depth": 1,
- "optional": false,
+ "name": "sell_volume_24h_b",
+ "lite_name": "sv",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 16,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The created orders in same order as requested"
+ "The 24 hour taker sell volume of the instrument, expressed in base asset decimal units"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiCancelOnDisconnectRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
+ "name": "buy_volume_24h_q",
+ "lite_name": "bv1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 17,
"array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The subaccount ID cancelling the orders for"
+ "The 24 hour taker buy volume of the instrument, expressed in quote asset decimal units"
]
},
{
- "name": "countdown_time",
- "lite_name": "ct",
- "semantic_type": "uint64",
+ "name": "sell_volume_24h_q",
+ "lite_name": "sv1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 18,
"array_depth": 0,
"optional": true,
- "default": "1000",
- "example": "300",
+ "example": "'123456.78'",
"comment": [
- "Countdown time in milliseconds (ex. 120000 for 120s).",
- "",
- "0 to disable the timer.",
- "",
- "Does not accept negative values.",
- "",
- "Minimum acceptable value is 1,000.",
- "",
- "Maximum acceptable value is 300,000"
+ "The 24 hour taker sell volume of the instrument, expressed in quote asset decimal units"
]
- }
- ],
- "comment": [
- "Auto-Cancel All Open Orders when the countdown time hits zero.",
- "",
- "Market Maker inputs a countdown time parameter in milliseconds (e.g. 120000 for 120s) rounded down to the smallest second follows the following logic:",
- " - Market Maker initially entered a value between 0 -\u003e 1000, which is rounded to 0: will result in termination of their COD",
- " - Market Maker initially entered a value between 1001 -\u003e 300_000, which is rounded to the nearest second: will result in refresh of their COD",
- " - Market Maker initially entered a value bigger than 300_000, which will result in error (upper bound)",
- "Market Maker will send a heartbeat message by calling the endpoint at specific intervals (ex. every 30 seconds) to the server to refresh the count down.",
- "",
- "If the server does not receive a heartbeat message within the countdown time, it will cancel all open orders for the specified Sub Account ID."
- ]
- },
- {
- "name": "ApiGetOrderGroupRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
+ "name": "high_price",
+ "lite_name": "hp",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 19,
"array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The subaccount ID for which the order groups should be retrieved."
+ "The 24 hour highest traded price of the instrument, expressed in `9` decimals"
]
- }
- ],
- "comment": [
- "Retrieves the grouping of non-cancelled, non-filled client orders for a given subaccount when the grouping exist.",
- "",
- "helping to identify TP/SL pairs or other order relationships within the account."
- ]
- },
- {
- "name": "ClientOrderIDsByGroup",
- "is_root": true,
- "fields": [
+ },
+ {
+ "name": "low_price",
+ "lite_name": "lp1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 20,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
+ "comment": [
+ "The 24 hour lowest traded price of the instrument, expressed in `9` decimals"
+ ]
+ },
{
- "name": "group_id",
- "lite_name": "gi",
- "semantic_type": "uint128",
+ "name": "open_price",
+ "lite_name": "op",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 21,
"array_depth": 0,
- "optional": false,
- "example": "'0x10000101000203040506'",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The group this order belongs to. It can be used to define TP/SL pairs or other order groupings"
+ "The 24 hour first traded price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "client_order_id",
- "lite_name": "co",
- "semantic_type": "uint64",
+ "name": "open_interest",
+ "lite_name": "oi",
+ "semantic_type": "string",
"json_type": "string",
- "index": 1,
- "array_depth": 1,
- "optional": false,
- "example": "'[23042, 54232]'",
+ "index": 22,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "List of client order IDs in the group"
+ "The open interest in the instrument, expressed in base asset decimal units"
]
},
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
+ "name": "long_short_ratio",
+ "lite_name": "ls1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 2,
+ "index": 23,
"array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "optional": true,
+ "example": "'0.5'",
"comment": [
- "The sub account ID that these orders belong to"
+ "The ratio of accounts that are net long vs net short on this instrument"
]
}
],
"comment": [
- "Grouping for the client order id and their associated groups.",
+ "Derived data such as the below, will not be included by default:",
+ " - 24 hour volume (`buyVolume + sellVolume`)",
+ " - 24 hour taker buy/sell ratio (`buyVolume / sellVolume`)",
+ " - 24 hour average trade price (`volumeQ / volumeU`)",
+ " - 24 hour average trade volume (`volume / trades`)",
+ " - 24 hour percentage change (`24hStatChange / 24hStat`)",
+ " - 48 hour statistics (`2 * 24hStat - 24hStatChange`)",
"",
- "This is used to define TP/SL pairs or other order groupings after loading the list of Open Orders."
+ "To query for an extended ticker payload, leverage the `greeks` and the `derived` flags.",
+ "Ticker extensions are currently under design to offer you more convenience.",
+ "These flags are only supported on the `Ticker Snapshot` WS endpoint, and on the `Ticker` API endpoint.",
+ ""
]
},
{
- "name": "ApiGetOrderGroupResponse",
+ "name": "ApiTickerResponse",
"is_root": true,
"fields": [
{
"name": "result",
"lite_name": "r",
- "semantic_type": "ClientOrderIDsByGroup",
- "json_type": "ClientOrderIDsByGroup",
+ "semantic_type": "Ticker",
+ "json_type": "Ticker",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
"comment": [
- "A list of client orders grouped by their associated order group.",
- "Each entry in the list contains a `groupID` and the corresponding `clientOrderID`s",
- "that belong to that group."
+ "The mini ticker matching the request asset"
]
}
],
"comment": []
},
{
- "name": "ApiGetUserEcosystemPointRequest",
+ "name": "ApiTradeRequest",
"is_root": true,
"fields": [
{
- "name": "account_id",
- "lite_name": "ai",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'ACC_1234567890'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The off chain account id"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "calculate_from",
- "lite_name": "cf",
- "semantic_type": "timestamp",
- "json_type": "string",
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Start time of the epoch - phase"
- ]
- },
- {
- "name": "include_user_rank",
- "lite_name": "iu",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'true'",
+ "example": "500",
"comment": [
- "Include user rank in the response"
+ "The limit to query for. Defaults to 500; Max 1000"
]
}
],
- "comment": []
+ "comment": [
+ "Retrieves up to 1000 of the most recent trades in any given instrument. Do not use this to poll for data -- a websocket subscription is much more performant, and useful.",
+ "This endpoint offers public trading data, use the Trading APIs instead to query for your personalized trade tape."
+ ]
},
{
- "name": "EcosystemPoint",
+ "name": "Trade",
"is_root": false,
"fields": [
{
- "name": "account_id",
- "lite_name": "ai",
- "semantic_type": "string",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'ACC_1234567890'",
+ "example": "'1697788800000000000'",
"comment": [
- "The off chain account id"
+ "Time at which the event was emitted in unix nanoseconds"
]
},
{
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "uint256",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The main account id"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "total_point",
- "lite_name": "tp",
- "semantic_type": "uint64",
- "json_type": "string",
+ "name": "is_taker_buyer",
+ "lite_name": "it",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "true",
"comment": [
- "Total ecosystem point"
+ "If taker was the buyer on the trade"
]
},
{
- "name": "direct_invite_count",
- "lite_name": "di",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "size",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "'123456.78'",
"comment": [
- "Direct invite count"
+ "The number of assets being traded, expressed in base asset decimal units"
]
},
{
- "name": "indirect_invite_count",
- "lite_name": "ii",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "price",
+ "lite_name": "p",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 4,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "'65038.01'",
"comment": [
- "Indirect invite count"
+ "The traded price, expressed in `9` decimals"
]
},
{
- "name": "direct_invite_trading_volume",
- "lite_name": "di1",
- "semantic_type": "uint256",
+ "name": "mark_price",
+ "lite_name": "mp",
+ "semantic_type": "string",
"json_type": "string",
"index": 5,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'65038.01'",
"comment": [
- "Direct invite trading volume"
+ "The mark price of the instrument at point of trade, expressed in `9` decimals"
]
},
{
- "name": "indirect_invite_trading_volume",
- "lite_name": "ii1",
- "semantic_type": "uint256",
+ "name": "index_price",
+ "lite_name": "ip",
+ "semantic_type": "string",
"json_type": "string",
"index": 6,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'65038.01'",
"comment": [
- "Indirect invite trading volume"
+ "The index price of the instrument at point of trade, expressed in `9` decimals"
]
},
{
- "name": "calculate_at",
- "lite_name": "ca",
- "semantic_type": "timestamp",
+ "name": "interest_rate",
+ "lite_name": "ir",
+ "semantic_type": "string",
"json_type": "string",
"index": 7,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "0.0003",
"comment": [
- "The time when the ecosystem point is calculated"
+ "The interest rate of the underlying at point of trade, expressed in centibeeps (1/100th of a basis point)"
]
},
{
- "name": "calculate_from",
- "lite_name": "cf",
- "semantic_type": "timestamp",
+ "name": "forward_price",
+ "lite_name": "fp",
+ "semantic_type": "string",
"json_type": "string",
"index": 8,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'65038.01'",
"comment": [
- "Start time of the epoch - phase"
+ "[Options] The forward price of the option at point of trade, expressed in `9` decimals"
]
},
{
- "name": "calculate_to",
- "lite_name": "ct",
- "semantic_type": "timestamp",
+ "name": "trade_id",
+ "lite_name": "ti",
+ "semantic_type": "string",
"json_type": "string",
"index": 9,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'209358-2'",
"comment": [
- "End time of the epoch - phase"
+ "A trade identifier, globally unique, and monotonically increasing (not by `1`).",
+ "All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.",
+ "`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`."
]
},
{
- "name": "rank",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "venue",
+ "lite_name": "v",
+ "semantic_type": "Venue",
+ "json_type": "Venue",
"index": 10,
"array_depth": 0,
"optional": false,
- "example": "'52'",
- "comment": [
- "The rank of the account in the ecosystem"
- ]
- },
- {
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 11,
- "array_depth": 0,
- "optional": false,
- "example": "'1'",
- "comment": [
- "The epoch number of the ecosystem point"
- ]
- },
- {
- "name": "brokered_trading_volume",
- "lite_name": "bt",
- "semantic_type": "uint256",
- "json_type": "string",
- "index": 12,
- "array_depth": 0,
- "optional": false,
- "example": "'10000101000203040506'",
"comment": [
- "Brokered trading volume"
+ "The venue where the trade occurred"
]
},
{
- "name": "brokered_trading_point",
- "lite_name": "bt1",
- "semantic_type": "uint64",
- "json_type": "string",
+ "name": "is_rpi",
+ "lite_name": "ir1",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 13,
"array_depth": 0,
"optional": false,
- "example": "'1000'",
- "comment": [
- "Brokered trading point"
- ]
- },
- {
- "name": "referee_kyc_point",
- "lite_name": "rk",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 14,
- "array_depth": 0,
- "optional": false,
- "example": "'1000'",
+ "example": "false",
"comment": [
- "Referee KYC point"
+ "If the trade is a RPI trade"
]
- },
+ }
+ ],
+ "comment": [
+ "All private RFQs and Private AXEs will be filtered out from the responses"
+ ]
+ },
+ {
+ "name": "ApiTradeResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "referrer_kyc_point",
- "lite_name": "rk1",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 15,
- "array_depth": 0,
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Trade",
+ "json_type": "Trade",
+ "index": 0,
+ "array_depth": 1,
"optional": false,
- "example": "'1000'",
"comment": [
- "Referrer KYC point"
+ "The public trades matching the request asset"
]
}
],
- "comment": [
- ""
- ]
+ "comment": []
},
{
- "name": "ApiGetUserEcosystemPointResponse",
+ "name": "ApiTradeHistoryRequest",
"is_root": true,
"fields": [
{
- "name": "points",
- "lite_name": "p",
- "semantic_type": "EcosystemPoint",
- "json_type": "EcosystemPoint",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
+ "comment": [
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ]
+ },
+ {
+ "name": "start_time",
+ "lite_name": "st",
+ "semantic_type": "int64",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": true,
+ "default": "0",
+ "example": "'1697788800000000000'",
"comment": [
- "The list of ecosystem points"
+ "The start time to apply in nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetEcosystemLeaderboardRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "calculate_from",
- "lite_name": "cf",
- "semantic_type": "timestamp",
+ "name": "end_time",
+ "lite_name": "et",
+ "semantic_type": "int64",
"json_type": "string",
- "index": 0,
+ "index": 2,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "now()",
"example": "'1697788800000000000'",
"comment": [
- "Start time of the epoch - phase"
+ "The end time to apply in nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned"
]
},
{
@@ -10261,674 +4883,705 @@
"lite_name": "l",
"semantic_type": "uint32",
"json_type": "integer",
- "index": 1,
+ "index": 3,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "500",
"example": "500",
"comment": [
- "The number of accounts to return"
+ "The limit to query for. Defaults to 500; Max 1000"
+ ]
+ },
+ {
+ "name": "cursor",
+ "lite_name": "c",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 4,
+ "array_depth": 0,
+ "optional": true,
+ "default": "''",
+ "example": "''",
+ "comment": [
+ "The cursor to indicate when to start the query from"
]
}
],
- "comment": []
+ "comment": [
+ "Perform historical lookup of public trades in any given instrument.",
+ "This endpoint offers public trading data, use the Trading APIs instead to query for your personalized trade tape.",
+ "Only data from the last three months will be retained.",
+ "",
+ "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
+ ]
},
{
- "name": "ApiGetVerifiedEcosystemLeaderboardRequest",
+ "name": "ApiTradeHistoryResponse",
"is_root": true,
"fields": [
{
- "name": "calculate_from",
- "lite_name": "cf",
- "semantic_type": "timestamp",
- "json_type": "string",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Trade",
+ "json_type": "Trade",
"index": 0,
- "array_depth": 0,
+ "array_depth": 1,
"optional": false,
- "example": "'1697788800000000000'",
"comment": [
- "Start time of the epoch"
+ "The public trades matching the request asset"
]
},
{
- "name": "completed_kyc_before",
- "lite_name": "ck",
- "semantic_type": "timestamp",
+ "name": "next",
+ "lite_name": "n",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
+ "optional": true,
+ "default": "''",
+ "example": "'Qw0918='",
"comment": [
- "Completed KYC before this time"
+ "The cursor to indicate when to start the next query from"
]
}
],
"comment": []
},
{
- "name": "ApiGetEcosystemLeaderboardResponse",
+ "name": "ApiGetInstrumentRequest",
"is_root": true,
"fields": [
{
- "name": "points",
- "lite_name": "p",
- "semantic_type": "EcosystemPoint",
- "json_type": "EcosystemPoint",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The list of ecosystem points"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
}
],
- "comment": []
+ "comment": [
+ "Fetch a single instrument by supplying the asset or instrument name"
+ ]
},
{
- "name": "ApiGetEcosystemReferralStatResponse",
- "is_root": true,
+ "name": "Instrument",
+ "is_root": false,
"fields": [
{
- "name": "direct_invite_count",
- "lite_name": "di",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Direct invite count"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "indirect_invite_count",
- "lite_name": "ii",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "instrument_hash",
+ "lite_name": "ih",
+ "semantic_type": "uint256",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "'0x030501'",
"comment": [
- "Indirect invite count"
+ "The asset ID used for instrument signing."
]
},
{
- "name": "direct_invite_trading_volume",
- "lite_name": "di1",
- "semantic_type": "uint256",
- "json_type": "string",
+ "name": "base",
+ "lite_name": "b",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'BTC'",
"comment": [
- "Total volume traded by direct invites multiple by 1e9"
+ "The base currency"
]
},
{
- "name": "indirect_invite_trading_volume",
- "lite_name": "ii1",
- "semantic_type": "uint256",
- "json_type": "string",
+ "name": "quote",
+ "lite_name": "q",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'USDT'",
"comment": [
- "Total volume traded by indirect invites multiple by 1e9"
+ "The quote currency"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiResolveEpochEcosystemMetricResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "epoch_name",
- "lite_name": "en",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
+ "name": "kind",
+ "lite_name": "k",
+ "semantic_type": "Kind",
+ "json_type": "Kind",
+ "index": 4,
"array_depth": 0,
"optional": false,
- "example": "'Phase 1'",
+ "example": "'PERPETUAL'",
"comment": [
- "The name of the epoch"
+ "The kind of instrument"
]
},
{
- "name": "point",
- "lite_name": "p",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
- "array_depth": 0,
+ "name": "venues",
+ "lite_name": "v",
+ "semantic_type": "Venue",
+ "json_type": "Venue",
+ "index": 7,
+ "array_depth": 1,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "['ORDERBOOK']",
"comment": [
- "Ecosystem points up to the most recently calculated time within this epoch"
+ "Venues that this instrument can be traded at"
]
},
{
- "name": "last_calculated_time",
- "lite_name": "lc",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 2,
+ "name": "settlement_period",
+ "lite_name": "sp1",
+ "semantic_type": "InstrumentSettlementPeriod",
+ "json_type": "InstrumentSettlementPeriod",
+ "index": 8,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'PERPETUAL'",
"comment": [
- "The time in unix nanoseconds when the ecosystem points were last calculated"
+ "The settlement period of the instrument"
]
- }
- ],
- "comment": []
- },
- {
- "name": "EcosystemMetric",
- "is_root": true,
- "fields": [
+ },
{
- "name": "direct_invite_count",
- "lite_name": "di",
- "semantic_type": "uint32",
+ "name": "base_decimals",
+ "lite_name": "bd",
+ "semantic_type": "int8",
"json_type": "integer",
- "index": 0,
+ "index": 9,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "3",
"comment": [
- "Direct invite count"
+ "The smallest denomination of the base asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)"
]
},
{
- "name": "indirect_invite_count",
- "lite_name": "ii",
- "semantic_type": "uint32",
+ "name": "quote_decimals",
+ "lite_name": "qd",
+ "semantic_type": "int8",
"json_type": "integer",
- "index": 1,
+ "index": 10,
+ "array_depth": 0,
+ "optional": false,
+ "example": "3",
+ "comment": [
+ "The smallest denomination of the quote asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)"
+ ]
+ },
+ {
+ "name": "tick_size",
+ "lite_name": "ts",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 11,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "'0.01'",
"comment": [
- "Indirect invite count"
+ "The size of a single tick, expressed in price decimal units"
]
},
{
- "name": "direct_invite_trading_volume",
- "lite_name": "di1",
- "semantic_type": "uint256",
+ "name": "min_size",
+ "lite_name": "ms",
+ "semantic_type": "string",
"json_type": "string",
- "index": 2,
+ "index": 12,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'0.01'",
"comment": [
- "Direct invite trading volume"
+ "The minimum contract size, expressed in base asset decimal units"
]
},
{
- "name": "indirect_invite_trading_volume",
- "lite_name": "ii1",
- "semantic_type": "uint256",
+ "name": "create_time",
+ "lite_name": "ct",
+ "semantic_type": "timestamp",
"json_type": "string",
- "index": 3,
+ "index": 14,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'1697788800000000000'",
"comment": [
- "Indirect invite trading volume"
+ "Creation time in unix nanoseconds"
]
},
{
- "name": "total_point",
- "lite_name": "tp",
- "semantic_type": "uint64",
+ "name": "max_position_size",
+ "lite_name": "mp",
+ "semantic_type": "string",
"json_type": "string",
- "index": 4,
+ "index": 15,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'100.0'",
"comment": [
- "Total ecosystem point of this epoch/phase"
+ "The maximum position size, expressed in base asset decimal units"
]
}
],
"comment": []
},
{
- "name": "ApiFindFirstEpochMetricResponse",
+ "name": "ApiGetInstrumentResponse",
"is_root": true,
"fields": [
{
- "name": "phase_zero_metric",
- "lite_name": "pz",
- "semantic_type": "EcosystemMetric",
- "json_type": "EcosystemMetric",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Instrument",
+ "json_type": "Instrument",
"index": 0,
"array_depth": 0,
"optional": false,
"comment": [
- "Phase zero metric"
+ "The instrument matching the request asset"
+ ]
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiGetFilteredInstrumentsRequest",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "kind",
+ "lite_name": "k",
+ "semantic_type": "Kind",
+ "json_type": "Kind",
+ "index": 0,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['PERPETUAL']",
+ "comment": [
+ "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "phase_one_metric",
- "lite_name": "po",
- "semantic_type": "EcosystemMetric",
- "json_type": "EcosystemMetric",
+ "name": "base",
+ "lite_name": "b",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 1,
- "array_depth": 0,
- "optional": false,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['BTC', 'ETH']",
"comment": [
- "Phase one metric"
+ "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "rank",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "quote",
+ "lite_name": "q",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'52'",
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['USDT', 'USDC']",
"comment": [
- "The rank of the account in the ecosystem"
+ "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "total",
- "lite_name": "t",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "is_active",
+ "lite_name": "ia",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 3,
"array_depth": 0,
- "optional": false,
- "example": "52",
+ "optional": true,
+ "default": "false",
+ "example": "true",
"comment": [
- "The total number of accounts in the ecosystem"
+ "Request for active instruments only"
]
},
{
- "name": "total_point",
- "lite_name": "tp",
- "semantic_type": "uint64",
- "json_type": "string",
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
"index": 4,
"array_depth": 0,
- "optional": false,
- "example": "'10000101000203040506'",
+ "optional": true,
+ "default": "500",
+ "example": "500",
"comment": [
- "Total ecosystem point of the first epoch"
+ "The limit to query for. Defaults to 500; Max 100000"
]
- },
+ }
+ ],
+ "comment": [
+ "Fetch a list of instruments based on the filters provided"
+ ]
+ },
+ {
+ "name": "ApiGetFilteredInstrumentsResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "last_calculated_at",
- "lite_name": "lc",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Instrument",
+ "json_type": "Instrument",
+ "index": 0,
+ "array_depth": 1,
"optional": false,
- "example": "'1697788800000000000'",
"comment": [
- "The time when the ecosystem points were last calculated"
+ "The instruments matching the request filter"
]
}
],
"comment": []
},
{
- "name": "ApiFindEcosystemEpochMetricResponse",
+ "name": "ApiCandlestickRequest",
"is_root": true,
"fields": [
{
- "name": "metric",
- "lite_name": "m",
- "semantic_type": "EcosystemMetric",
- "json_type": "EcosystemMetric",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The epoch metric"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "rank",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "interval",
+ "lite_name": "i1",
+ "semantic_type": "CandlestickInterval",
+ "json_type": "CandlestickInterval",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'52'",
"comment": [
- "The rank of the account in the ecosystem"
+ "The interval of each candlestick"
]
},
{
- "name": "total",
+ "name": "type",
"lite_name": "t",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "semantic_type": "CandlestickType",
+ "json_type": "CandlestickType",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "52",
"comment": [
- "The total number of accounts in the ecosystem"
+ "The type of candlestick data to retrieve"
]
},
{
- "name": "last_calculated_at",
- "lite_name": "lc",
+ "name": "start_time",
+ "lite_name": "st",
"semantic_type": "timestamp",
"json_type": "string",
"index": 3,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "0",
"example": "'1697788800000000000'",
"comment": [
- "The time when the ecosystem points were last calculated"
+ "Start time of kline data in unix nanoseconds"
]
},
{
- "name": "total_direct_invite_count",
- "lite_name": "td",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "end_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
+ "json_type": "string",
"index": 4,
"array_depth": 0,
- "optional": false,
- "example": "'52'",
+ "optional": true,
+ "default": "now()",
+ "example": "'1697788800000000000'",
"comment": [
- "Direct invite count without relying on epochs"
+ "End time of kline data in unix nanoseconds"
]
},
{
- "name": "total_indirect_invite_count",
- "lite_name": "ti",
+ "name": "limit",
+ "lite_name": "l",
"semantic_type": "uint32",
"json_type": "integer",
"index": 5,
"array_depth": 0,
- "optional": false,
- "example": "'52'",
+ "optional": true,
+ "default": "500",
+ "example": "500",
+ "comment": [
+ "The limit to query for. Defaults to 500; Max 1000"
+ ]
+ },
+ {
+ "name": "cursor",
+ "lite_name": "c",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 6,
+ "array_depth": 0,
+ "optional": true,
+ "default": "''",
+ "example": "''",
"comment": [
- "Indirect invite count without relying on epochs"
+ "The cursor to indicate when to start the query from"
]
}
],
- "comment": []
+ "comment": [
+ "Kline/Candlestick bars for an instrument. Klines are uniquely identified by their instrument, type, interval, and open time.",
+ "",
+ "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
+ ]
},
{
- "name": "EcosystemLeaderboardUser",
- "is_root": true,
+ "name": "Candlestick",
+ "is_root": false,
"fields": [
{
- "name": "account_id",
- "lite_name": "ai",
- "semantic_type": "string",
+ "name": "open_time",
+ "lite_name": "ot",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'ACC_1234567890'",
+ "example": "'1697788800000000000'",
"comment": [
- "The off chain account id"
+ "Open time of kline bar in unix nanoseconds"
]
},
{
- "name": "rank",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "close_time",
+ "lite_name": "ct",
+ "semantic_type": "timestamp",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "'1697788800000000000'",
"comment": [
- "The rank of the account in the ecosystem"
+ "Close time of kline bar in unix nanosecond"
]
},
{
- "name": "total_point",
- "lite_name": "tp",
- "semantic_type": "uint64",
+ "name": "open",
+ "lite_name": "o",
+ "semantic_type": "string",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'123456.78'",
"comment": [
- "Total ecosystem point"
+ "The open price, expressed in underlying currency resolution units"
]
},
{
- "name": "twitter_username",
- "lite_name": "tu",
+ "name": "close",
+ "lite_name": "c",
"semantic_type": "string",
"json_type": "string",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "'elonmusk'",
+ "example": "'123456.78'",
"comment": [
- "The twitter username of the account"
+ "The close price, expressed in underlying currency resolution units"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiFindEcosystemLeaderboardResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "users",
- "lite_name": "u",
- "semantic_type": "EcosystemLeaderboardUser",
- "json_type": "EcosystemLeaderboardUser",
- "index": 0,
- "array_depth": 1,
+ "name": "high",
+ "lite_name": "h",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 4,
+ "array_depth": 0,
"optional": false,
+ "example": "'123456.78'",
"comment": [
- "The list of ecosystem leaderboard users"
+ "The high price, expressed in underlying currency resolution units"
]
- }
- ],
- "comment": []
- },
- {
- "name": "QueryFindEpochRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "time",
- "lite_name": "t",
- "semantic_type": "timestamp",
+ "name": "low",
+ "lite_name": "l",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 5,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "1714329600000000000",
+ "optional": false,
+ "example": "'123456.78'",
"comment": [
- "The time to query the epoch"
+ "The low price, expressed in underlying currency resolution units"
]
},
{
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "int32",
- "json_type": "integer",
- "index": 1,
+ "name": "volume_b",
+ "lite_name": "vb",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 6,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "1",
+ "optional": false,
+ "example": "'123456.78'",
"comment": [
- "The epoch number"
+ "The underlying volume transacted, expressed in base asset decimal units"
]
- }
- ],
- "comment": [
- "Query epoch by time or epoch number"
- ]
- },
- {
- "name": "Epoch",
- "is_root": false,
- "fields": [
+ },
{
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "int32",
- "json_type": "integer",
- "index": 0,
+ "name": "volume_q",
+ "lite_name": "vq",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 7,
"array_depth": 0,
"optional": false,
+ "example": "'123456.78'",
"comment": [
- "The epoch number"
+ "The quote volume transacted, expressed in quote asset decimal units"
]
},
{
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 1,
+ "name": "trades",
+ "lite_name": "t",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 8,
"array_depth": 0,
"optional": false,
+ "example": "123456",
"comment": [
- "The start time of the epoch"
+ "The number of trades transacted"
]
},
{
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
- "index": 2,
+ "index": 9,
"array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The end time of the epoch"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
}
],
- "comment": []
+ "comment": [
+ ""
+ ]
},
{
- "name": "QueryFindEpochResponse",
+ "name": "ApiCandlestickResponse",
"is_root": true,
"fields": [
{
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "Epoch",
- "json_type": "Epoch",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Candlestick",
+ "json_type": "Candlestick",
"index": 0,
- "array_depth": 0,
+ "array_depth": 1,
"optional": false,
"comment": [
- "The epoch"
+ "The candlestick result set for given interval"
]
- }
- ],
- "comment": []
- },
- {
- "name": "QueryGetListEpochRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 0,
+ "name": "next",
+ "lite_name": "n",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 1,
"array_depth": 0,
"optional": true,
- "default": "0",
- "example": "100",
- "comment": [
- "The limit to query for"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "QueryGetListEpochResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Epoch",
- "json_type": "Epoch",
- "index": 0,
- "array_depth": 1,
- "optional": false,
+ "default": "''",
+ "example": "'Qw0918='",
"comment": [
- "The list of epochs"
+ "The cursor to indicate when to start the next query from"
]
}
],
"comment": []
},
{
- "name": "QueryEpochBadgeRequest",
+ "name": "ApiFundingRateRequest",
"is_root": true,
"fields": [
{
- "name": "account_id",
- "lite_name": "ai",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 0,
"array_depth": 0,
- "optional": true,
- "default": "'all'",
- "example": "'ACC_1234567890'",
+ "optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The off chain account id to get referral stats"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "int32",
- "json_type": "integer",
+ "name": "start_time",
+ "lite_name": "st",
+ "semantic_type": "timestamp",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
"optional": true,
- "default": "'all'",
- "example": "'1'",
+ "default": "0",
+ "example": "'1697788800000000000'",
"comment": [
- "The numerical epoch index"
+ "Start time of funding rate in unix nanoseconds"
]
},
{
- "name": "type",
- "lite_name": "t",
- "semantic_type": "RewardProgramType",
- "json_type": "RewardProgramType",
+ "name": "end_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
+ "json_type": "string",
"index": 2,
"array_depth": 0,
"optional": true,
- "default": "'all'",
- "example": "'trader'",
+ "default": "now()",
+ "example": "'1697788800000000000'",
"comment": [
- "The type of the reward program"
+ "End time of funding rate in unix nanoseconds"
]
},
{
@@ -10939,8 +5592,8 @@
"index": 3,
"array_depth": 0,
"optional": true,
- "default": "'500'",
- "example": "'500'",
+ "default": "500",
+ "example": "500",
"comment": [
"The limit to query for. Defaults to 500; Max 1000"
]
@@ -10953,2250 +5606,2136 @@
"index": 4,
"array_depth": 0,
"optional": true,
- "default": "'all'",
- "example": "'Qw0918='",
+ "default": "''",
+ "example": "''",
"comment": [
"The cursor to indicate when to start the query from"
]
}
],
"comment": [
- "Query list of epoch badges"
+ "Lookup the historical funding rate of a perpetual future.",
+ "",
+ "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "EpochBadge",
+ "name": "FundingRate",
"is_root": false,
"fields": [
{
- "name": "account_id",
- "lite_name": "ai",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'ACC:10001'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The off chain account id"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "address",
+ "name": "funding_rate",
+ "lite_name": "fr",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'$GRVT_ACCOUNT_ID'",
- "comment": [
- "The account ID"
- ]
- },
- {
- "name": "type",
- "lite_name": "t",
- "semantic_type": "RewardProgramType",
- "json_type": "RewardProgramType",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'trader'",
- "comment": [
- "The type of the reward program"
- ]
- },
- {
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "int32",
- "json_type": "integer",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'2'",
+ "example": "0.0003",
"comment": [
- "The epoch number"
+ "The funding rate of the instrument, expressed in percentage points"
]
},
{
- "name": "epoch_start_time",
- "lite_name": "es",
+ "name": "funding_time",
+ "lite_name": "ft",
"semantic_type": "timestamp",
"json_type": "string",
- "index": 4,
+ "index": 2,
"array_depth": 0,
"optional": false,
- "example": "'1726790400000000000'",
+ "example": "'1697788800000000000'",
"comment": [
- "The start time of the epoch"
+ "The funding timestamp of the funding rate, expressed in unix nanoseconds"
]
},
{
- "name": "epoch_end_time",
- "lite_name": "ee",
- "semantic_type": "timestamp",
+ "name": "mark_price",
+ "lite_name": "mp",
+ "semantic_type": "string",
"json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": false,
- "example": "'1726790400000000000'",
- "comment": [
- "The end time of the epoch"
- ]
- },
- {
- "name": "badge",
- "lite_name": "b",
- "semantic_type": "EpochBadgeType",
- "json_type": "EpochBadgeType",
- "index": 6,
+ "index": 3,
"array_depth": 0,
"optional": false,
- "example": "'champion'",
- "comment": [
- "The type of the badge"
- ]
- },
- {
- "name": "distributed_badges",
- "lite_name": "db",
- "semantic_type": "EpochBadgeType",
- "json_type": "EpochBadgeType",
- "index": 7,
- "array_depth": 1,
- "optional": false,
+ "example": "'65038.01'",
"comment": [
- "The distributed badges"
+ "The mark price of the instrument at funding timestamp, expressed in `9` decimals"
]
},
{
- "name": "total_point",
- "lite_name": "tp",
- "semantic_type": "uint64",
+ "name": "funding_rate_8_h_avg",
+ "lite_name": "fr1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 8,
+ "index": 4,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "0.0003",
"comment": [
- "Total point"
+ "The 8h average funding rate of the instrument, expressed in percentage points"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiFundingRateResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "rank",
+ "name": "result",
"lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 9,
- "array_depth": 0,
+ "semantic_type": "FundingRate",
+ "json_type": "FundingRate",
+ "index": 0,
+ "array_depth": 1,
"optional": false,
- "example": "'10000101000203040506'",
"comment": [
- "Rank"
+ "The funding rate result set for given interval"
]
},
{
- "name": "claimed_at",
- "lite_name": "ca",
- "semantic_type": "timestamp",
+ "name": "next",
+ "lite_name": "n",
+ "semantic_type": "string",
"json_type": "string",
- "index": 10,
+ "index": 1,
"array_depth": 0,
- "optional": false,
- "example": "'1726790400000000000'",
+ "optional": true,
+ "default": "''",
+ "example": "'Qw0918='",
"comment": [
- "The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process"
+ "The cursor to indicate when to start the next query from"
]
}
],
"comment": []
},
{
- "name": "QueryEpochBadgeResponse",
+ "name": "JSONRPCRequest",
"is_root": true,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "EpochBadge",
- "json_type": "EpochBadge",
+ "name": "jsonrpc",
+ "lite_name": "j",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'2.0'",
"comment": [
- "The list of epoch badges"
+ "The JSON RPC version to use for the request"
]
},
{
- "name": "next",
- "lite_name": "n",
+ "name": "method",
+ "lite_name": "m",
"semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'Qw0918='",
+ "example": "'subscribe'",
"comment": [
- "The cursor to indicate when to start the query from"
+ "The method to use for the request (eg: `subscribe` / `unsubscribe` / `v1/instrument` )"
+ ]
+ },
+ {
+ "name": "params",
+ "lite_name": "p",
+ "semantic_type": "any",
+ "json_type": "object",
+ "index": 2,
+ "array_depth": 0,
+ "optional": false,
+ "comment": [
+ "The parameters for the request"
+ ]
+ },
+ {
+ "name": "id",
+ "lite_name": "i",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 3,
+ "array_depth": 0,
+ "optional": true,
+ "default": "0",
+ "example": "123",
+ "comment": [
+ "Optional Field which is used to match the response by the client.",
+ "If not passed, this field will not be returned"
]
}
],
- "comment": []
+ "comment": [
+ "All Websocket JSON RPC Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.",
+ "If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).",
+ "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
+ ]
},
{
- "name": "QueryEpochBadgePointDistributionRequest",
+ "name": "Error",
"is_root": true,
"fields": [
{
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "int32",
+ "name": "code",
+ "lite_name": "c",
+ "semantic_type": "uint16",
"json_type": "integer",
"index": 0,
"array_depth": 0,
- "optional": true,
- "default": "'all'",
- "example": "'1'",
+ "optional": false,
+ "example": "123",
"comment": [
- "The numerical epoch index"
+ "The error code for the request"
]
},
{
- "name": "type",
- "lite_name": "t",
- "semantic_type": "RewardProgramType",
- "json_type": "RewardProgramType",
+ "name": "message",
+ "lite_name": "m",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'trader'",
+ "example": "'An error occurred'",
"comment": [
- "The type of the reward program"
+ "The error message for the request"
]
}
],
"comment": [
- "Query list of epoch badges"
+ "An error response"
]
},
{
- "name": "EpochBadgePointDistribution",
- "is_root": false,
+ "name": "JSONRPCResponse",
+ "is_root": true,
"fields": [
{
- "name": "badge",
- "lite_name": "b",
- "semantic_type": "EpochBadgeType",
- "json_type": "EpochBadgeType",
+ "name": "jsonrpc",
+ "lite_name": "j",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'2.0'",
"comment": [
- "The type of the badge"
+ "The JSON RPC version to use for the request"
]
},
{
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "int32",
- "json_type": "integer",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "any",
+ "json_type": "object",
"index": 1,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "null",
"comment": [
- "The epoch number"
+ "The result for the request"
]
},
{
- "name": "type",
- "lite_name": "t",
- "semantic_type": "RewardProgramType",
- "json_type": "RewardProgramType",
+ "name": "error",
+ "lite_name": "e",
+ "semantic_type": "Error",
+ "json_type": "Error",
"index": 2,
"array_depth": 0,
- "optional": false,
- "comment": [
- "The type of the reward program"
- ]
- },
- {
- "name": "min_point",
- "lite_name": "mp",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The minimum point to get the badge"
- ]
- },
- {
- "name": "max_point",
- "lite_name": "mp1",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The maximum point to get the badge"
- ]
- },
- {
- "name": "min_rank",
- "lite_name": "mr",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 5,
- "array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "null",
"comment": [
- "The minimum rank to get the badge"
+ "The error for the request"
]
},
{
- "name": "max_rank",
- "lite_name": "mr1",
+ "name": "id",
+ "lite_name": "i",
"semantic_type": "uint32",
"json_type": "integer",
- "index": 6,
+ "index": 3,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "0",
+ "example": "123",
"comment": [
- "The maximum rank to get the badge"
+ "Optional Field which is used to match the response by the client.",
+ "If not passed, this field will not be returned"
]
},
{
- "name": "total_point",
- "lite_name": "tp",
- "semantic_type": "uint64",
+ "name": "method",
+ "lite_name": "m",
+ "semantic_type": "string",
"json_type": "string",
- "index": 7,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "The total point to get the badge"
- ]
- },
- {
- "name": "count",
- "lite_name": "c",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 8,
+ "index": 4,
"array_depth": 0,
"optional": false,
+ "example": "'subscribe'",
"comment": [
- "The number of users to get the badge"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "QueryEpochBadgePointDistributionResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "EpochBadgePointDistribution",
- "json_type": "EpochBadgePointDistribution",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of epoch badges"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetListEpochBadgeResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "EpochBadge",
- "json_type": "EpochBadge",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of epoch badges"
+ "The method used in the request for this response (eg: `subscribe` / `unsubscribe` / `v1/instrument` )"
]
}
],
- "comment": []
+ "comment": [
+ "All Websocket JSON RPC Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.",
+ "If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response."
+ ]
},
{
- "name": "GetClaimableEcosystemBadgeResponse",
+ "name": "WSSubscribeParams",
"is_root": true,
"fields": [
{
- "name": "badge",
- "lite_name": "b",
- "semantic_type": "EpochBadge",
- "json_type": "EpochBadge",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'v1.ticker.d'",
"comment": [
- "The epoch badge"
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
]
},
{
- "name": "is_claimable",
- "lite_name": "ic",
- "semantic_type": "bool",
- "json_type": "boolean",
+ "name": "selectors",
+ "lite_name": "s1",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 1,
- "array_depth": 0,
+ "array_depth": 1,
"optional": false,
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "Whether the badge is claimable"
+ "The list of feeds to subscribe to"
]
},
{
- "name": "claimable_until",
- "lite_name": "cu",
- "semantic_type": "timestamp",
- "json_type": "string",
+ "name": "use_global_sequence_number",
+ "lite_name": "ug",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 2,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "false",
+ "example": "true",
"comment": [
- "The time when the badge is claimable"
+ "Whether to use the global sequence number for the stream"
]
}
],
- "comment": []
+ "comment": [
+ "All V1 Websocket Subscription Requests are housed in this wrapper. You may specify a stream and a list of feeds to subscribe to.",
+ "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.",
+ "Sequence numbers can be either gateway-specific or global:",
+ "- **Gateway Unique Sequence Number**: Increments by one per stream, resets to 0 on gateway restart.",
+ "- **Global Unique Sequence Number**: A cluster-wide unique number assigned to each cluster payload, does not reset on gateway restarts, and can be used to track and identify message order across streams using `sequence_number` and `prev_sequence_number` in the feed response.",
+ "Set `useGlobalSequenceNumber = true` if you need a persistent, unique identifier across all streams or ordering across multiple feeds."
+ ]
},
{
- "name": "ClaimEcosystemBadgeResponse",
+ "name": "WSSubscribeResult",
"is_root": true,
"fields": [
{
- "name": "badge",
- "lite_name": "b",
- "semantic_type": "EpochBadge",
- "json_type": "EpochBadge",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'v1.ticker.d'",
"comment": [
- "The epoch badge"
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetListFlatReferralRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "referral_id",
- "lite_name": "ri",
+ "name": "subs",
+ "lite_name": "s1",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
- "array_depth": 0,
+ "index": 1,
+ "array_depth": 1,
"optional": false,
- "example": "'ACC_1234567890'",
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "The off chain referrer account id to get all flat referrals"
+ "The list of feeds subscribed to"
]
},
{
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
+ "name": "unsubs",
+ "lite_name": "u",
+ "semantic_type": "string",
"json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
+ "index": 2,
+ "array_depth": 1,
+ "optional": false,
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "Optional. Start time in unix nanoseconds"
+ "The list of feeds unsubscribed from"
]
},
{
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
+ "name": "num_snapshots",
+ "lite_name": "ns",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 3,
+ "array_depth": 1,
+ "optional": false,
+ "example": "10",
+ "comment": [
+ "The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`"
+ ]
+ },
+ {
+ "name": "first_sequence_number",
+ "lite_name": "fs",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
+ "index": 4,
+ "array_depth": 1,
+ "optional": false,
+ "example": "872634876",
"comment": [
- "Optional. End time in unix nanoseconds"
+ "The first sequence number to expect for each subscribed feed. Returned in same order as `subs`"
]
},
{
- "name": "account_id",
- "lite_name": "ai",
- "semantic_type": "string",
+ "name": "latest_sequence_number",
+ "lite_name": "ls",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 3,
- "array_depth": 0,
+ "index": 5,
+ "array_depth": 1,
"optional": false,
- "example": "'ACC_1234567890'",
+ "example": "872634875",
"comment": [
- "The off chain account id to get all user's referrers"
+ "The sequence number of the most recent message in the stream. Next received sequence number must be larger than this one. Returned in same order as `subs`"
]
}
],
"comment": [
- "startTime and endTime are optional parameters. The semantics of these parameters are as follows:\u003cul\u003e"
+ "To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:\u003cul\u003e\u003cli\u003eAll snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas\u003c/li\u003e\u003cli\u003eNum snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots\u003c/li\u003e\u003cli\u003eFirst sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots\u003c/li\u003e\u003cli\u003eSequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect\u003c/li\u003e\u003cli\u003eDuplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.\u003c/li\u003e\u003c/ul\u003e",
+ "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
]
},
{
- "name": "FlatReferral",
- "is_root": false,
+ "name": "WSUnsubscribeParams",
+ "is_root": true,
"fields": [
{
- "name": "account_id",
- "lite_name": "ai",
+ "name": "stream",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'ACC_1234567890'",
+ "example": "'v1.ticker.d'",
"comment": [
- "The off chain account id"
+ "The channel to unsubscribe from (eg: ticker.s / ticker.d)"
]
},
{
- "name": "referrer_id",
- "lite_name": "ri",
+ "name": "selectors",
+ "lite_name": "s1",
"semantic_type": "string",
"json_type": "string",
"index": 1,
- "array_depth": 0,
+ "array_depth": 1,
"optional": false,
- "example": "'ACC_1234567890'",
+ "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
"comment": [
- "The off chain referrer account id"
+ "The list of feeds to unsubscribe from"
]
},
{
- "name": "referrer_level",
- "lite_name": "rl",
- "semantic_type": "uint8",
- "json_type": "integer",
+ "name": "use_global_sequence_number",
+ "lite_name": "ug",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 2,
"array_depth": 0,
- "optional": false,
- "example": "'1'",
- "comment": [
- "The referrer level; 1: direct referrer, 2: indirect referrer"
- ]
- },
- {
- "name": "account_create_time",
- "lite_name": "ac",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
+ "optional": true,
+ "default": "false",
+ "example": "true",
"comment": [
- "The account creation time"
+ "Whether to use the global sequence number for the stream"
]
- },
+ }
+ ],
+ "comment": [
+ "All V1 Websocket Unsubscription Requests are housed in this wrapper. You may specify a stream, a list of feeds and whether those feeds use global sequence numbers to unsubscribe from."
+ ]
+ },
+ {
+ "name": "WSUnsubscribeResult",
+ "is_root": true,
+ "fields": [
{
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "uint256",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
"json_type": "string",
- "index": 4,
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'v1.ticker.d'",
"comment": [
- "The main account id"
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
]
},
{
- "name": "referrer_main_account_id",
- "lite_name": "rm",
- "semantic_type": "uint256",
+ "name": "unsubs",
+ "lite_name": "u",
+ "semantic_type": "string",
"json_type": "string",
- "index": 5,
- "array_depth": 0,
+ "index": 1,
+ "array_depth": 1,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "The referrer main account id"
+ "The list of feeds unsubscribed from"
]
- },
+ }
+ ],
+ "comment": [
+ "Returns a confirmation of all unsubscribes"
+ ]
+ },
+ {
+ "name": "WSSubscribeRequestV1Legacy",
+ "is_root": true,
+ "fields": [
{
- "name": "is_business",
- "lite_name": "ib",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 6,
+ "name": "request_id",
+ "lite_name": "ri",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 0,
"array_depth": 0,
- "optional": false,
- "example": "true",
+ "optional": true,
+ "default": "0",
+ "example": "123",
"comment": [
- "The account is a business account or not"
+ "Optional Field which is used to match the response by the client.",
+ "If not passed, this field will not be returned"
]
},
{
- "name": "is_kyc_completed",
- "lite_name": "ik",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 7,
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "true",
+ "example": "'v1.ticker.d'",
"comment": [
- "The account is KYC verified or not"
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
]
},
{
- "name": "kyc_completed_at",
- "lite_name": "kc",
- "semantic_type": "timestamp",
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "string",
"json_type": "string",
- "index": 8,
- "array_depth": 0,
+ "index": 2,
+ "array_depth": 1,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
"comment": [
- "The KYC completed time"
+ "The list of feeds to subscribe to"
]
},
{
- "name": "kyc_type",
- "lite_name": "kt",
+ "name": "method",
+ "lite_name": "m",
"semantic_type": "string",
"json_type": "string",
- "index": 9,
+ "index": 3,
"array_depth": 0,
"optional": false,
- "example": "'individual'",
+ "example": "'subscribe'",
"comment": [
- "The KYC type, can be 'individual' or 'business'"
+ "The method to use for the request (eg: subscribe / unsubscribe)"
]
},
{
- "name": "kyc_first_completed_at",
- "lite_name": "kf",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 10,
+ "name": "is_full",
+ "lite_name": "if",
+ "semantic_type": "bool",
+ "json_type": "boolean",
+ "index": 4,
"array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
+ "optional": true,
+ "default": "false",
+ "example": "true",
"comment": [
- "The first KYC completed time"
+ "Whether the request is for full data or lite data"
]
}
],
"comment": [
- ""
+ "All V1 Websocket Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.",
+ "If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).",
+ "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
]
},
{
- "name": "ApiGetListFlatReferralResponse",
+ "name": "WSSubscribeResponseV1Legacy",
"is_root": true,
"fields": [
{
- "name": "flat_referrals",
- "lite_name": "fr",
- "semantic_type": "FlatReferral",
- "json_type": "FlatReferral",
+ "name": "request_id",
+ "lite_name": "ri",
+ "semantic_type": "uint32",
+ "json_type": "integer",
"index": 0,
- "array_depth": 1,
- "optional": false,
+ "array_depth": 0,
+ "optional": true,
+ "default": "0",
+ "example": "123",
"comment": [
- "The list of flat referrals"
+ "Optional Field which is used to match the response by the client.",
+ "If not passed, this field will not be returned"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiQueryFlatReferralStatRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "account_id",
- "lite_name": "ai",
+ "name": "stream",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "'ACC_1234567890'",
+ "example": "'v1.ticker.d'",
"comment": [
- "The off chain account id to get referral stats"
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
]
- }
- ],
- "comment": [
- "Query flat referral stats"
- ]
- },
- {
- "name": "ApiQueryFlatReferralStatResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "direct_invite_count",
- "lite_name": "di",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 0,
- "array_depth": 0,
+ "name": "subs",
+ "lite_name": "s1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 2,
+ "array_depth": 1,
"optional": false,
- "example": "'52'",
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "Direct invite count"
+ "The list of feeds subscribed to"
]
},
{
- "name": "indirect_invite_count",
- "lite_name": "ii",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
- "array_depth": 0,
+ "name": "unsubs",
+ "lite_name": "u",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 3,
+ "array_depth": 1,
"optional": false,
- "example": "'52'",
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "Indirect invite count"
+ "The list of feeds unsubscribed from"
]
- }
- ],
- "comment": []
- },
- {
- "name": "LPSnapshot",
- "is_root": true,
- "fields": [
+ },
{
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "uint256",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
+ "name": "num_snapshots",
+ "lite_name": "ns",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 4,
+ "array_depth": 1,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "10",
"comment": [
- "The main account id"
+ "The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`"
]
},
{
- "name": "lp_asset",
- "lite_name": "la",
+ "name": "first_sequence_number",
+ "lite_name": "fs",
"semantic_type": "uint64",
"json_type": "string",
- "index": 1,
- "array_depth": 0,
+ "index": 5,
+ "array_depth": 1,
"optional": false,
- "example": "'10000'",
+ "example": "872634876",
"comment": [
- "The LP Asset"
+ "The first sequence number to expect for each subscribed feed. Returned in same order as `subs`"
]
},
{
- "name": "underlying_multiplier",
- "lite_name": "um",
+ "name": "latest_sequence_number",
+ "lite_name": "ls",
"semantic_type": "uint64",
"json_type": "string",
- "index": 2,
- "array_depth": 0,
+ "index": 6,
+ "array_depth": 1,
"optional": false,
- "example": "'52'",
+ "example": "872634875",
"comment": [
- "Underlying multiplier"
+ "The sequence number of the most recent message in the stream. Next received sequence number must be larger than this one. Returned in same order as `subs`"
]
- },
+ }
+ ],
+ "comment": [
+ "All V1 Websocket Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.",
+ "If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response.",
+ "To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:\u003cul\u003e\u003cli\u003eAll snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas\u003c/li\u003e\u003cli\u003eNum snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots\u003c/li\u003e\u003cli\u003eFirst sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots\u003c/li\u003e\u003cli\u003eSequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect\u003c/li\u003e\u003cli\u003eDuplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.\u003c/li\u003e\u003c/ul\u003e",
+ "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
+ ]
+ },
+ {
+ "name": "WSOrderbookLevelsFeedSelectorV1",
+ "is_root": true,
+ "fields": [
{
- "name": "maker_trading_volume",
- "lite_name": "mt",
- "semantic_type": "uint256",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
- "index": 3,
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Maker trading volume"
- ]
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ],
+ "selector": "primary"
},
{
- "name": "bid_fast_market_multiplier",
- "lite_name": "bf",
+ "name": "rate",
+ "lite_name": "r",
"semantic_type": "uint32",
"json_type": "integer",
- "index": 4,
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "500",
"comment": [
- "Fast market multiplier"
- ]
+ "The minimal rate at which we publish feeds (in milliseconds)",
+ "Delta (50, 100, 500, 1000)",
+ "Snapshot (500, 1000)"
+ ],
+ "selector": "secondary"
},
{
- "name": "ask_fast_market_multiplier",
- "lite_name": "af",
+ "name": "depth",
+ "lite_name": "d",
"semantic_type": "uint32",
"json_type": "integer",
- "index": 5,
- "array_depth": 0,
- "optional": false,
- "example": "'52'",
- "comment": [
- "Fast market multiplier"
- ]
- },
- {
- "name": "liquidity_score",
- "lite_name": "ls",
- "semantic_type": "uint256",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": false,
- "example": "'10000101000203040506'",
- "comment": [
- "Liquidity score"
- ]
- },
- {
- "name": "calculate_at",
- "lite_name": "ca",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 7,
+ "index": 2,
"array_depth": 0,
- "optional": false,
- "example": "'1726790400000000000'",
+ "optional": true,
+ "default": "'0'",
+ "example": "50",
"comment": [
- "The time when the snapshot was calculated"
- ]
+ "Depth of the order book to be retrieved",
+ "Delta(0 - `unlimited`)",
+ "Snapshot(10, 50, 100, 500)"
+ ],
+ "selector": "secondary"
}
],
- "comment": []
+ "comment": [
+ "Subscribes to aggregated orderbook updates for a single instrument. The `book.s` channel offers simpler integration. To experience higher publishing rates, please use the `book.d` channel.",
+ "Unlike the `book.d` channel which publishes an initial snapshot, then only streams deltas after, the `book.s` channel publishes full snapshots at each feed.",
+ "",
+ "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of all levels of the Orderbook.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send levels that have changed in value.\u003c/li\u003e\u003c/ul\u003e",
+ "",
+ "Subscription Pattern:\u003cul\u003e\u003cli\u003eDelta - `instrument@rate`\u003c/li\u003e\u003cli\u003eSnapshot - `instrument@rate-depth`\u003c/li\u003e\u003c/ul\u003e",
+ "",
+ "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a level is not updated, level not published\u003c/li\u003e\u003cli\u003eIf a level is updated, {size: '123'}\u003c/li\u003e\u003cli\u003eIf a level is set to zero, {size: '0'}\u003c/li\u003e\u003cli\u003eIncoming levels will be published as soon as price moves\u003c/li\u003e\u003cli\u003eOutgoing levels will be published with `size = 0`\u003c/li\u003e\u003c/ul\u003e"
+ ]
},
{
- "name": "ApproximateLPSnapshot",
+ "name": "WSOrderbookLevelsFeedDataV1",
"is_root": true,
"fields": [
{
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "uint256",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'v1.book.s'",
"comment": [
- "The main account id"
+ "Stream name"
]
},
{
- "name": "underlying_multiplier",
- "lite_name": "um",
- "semantic_type": "uint64",
+ "name": "selector",
+ "lite_name": "s1",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Underlying multiplier"
+ "Primary selector"
]
},
{
- "name": "market_share_multiplier",
- "lite_name": "ms",
+ "name": "sequence_number",
+ "lite_name": "sn",
"semantic_type": "uint64",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'872634876'",
"comment": [
- "Market share multiplier"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "bid_fast_market_multiplier",
- "lite_name": "bf",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "OrderbookLevels",
+ "json_type": "OrderbookLevels",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "'52'",
- "comment": [
- "Fast market multiplier"
- ]
- },
- {
- "name": "ask_fast_market_multiplier",
- "lite_name": "af",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "example": "'52'",
- "comment": [
- "Fast market multiplier"
- ]
- },
- {
- "name": "liquidity_score",
- "lite_name": "ls",
- "semantic_type": "uint256",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": false,
- "example": "'10000101000203040506'",
"comment": [
- "Liquidity score"
+ "An orderbook levels object matching the request filter"
]
},
{
- "name": "calculate_at",
- "lite_name": "ca",
- "semantic_type": "timestamp",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 6,
+ "index": 4,
"array_depth": 0,
"optional": false,
- "example": "'1726790400000000000'",
+ "example": "'872634875'",
"comment": [
- "The time when the snapshot was calculated"
+ "The previous sequence number that determines the message order"
]
}
],
"comment": []
},
{
- "name": "LPPoint",
+ "name": "WSMiniTickerFeedSelectorV1",
"is_root": true,
"fields": [
{
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "uint256",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
- "comment": [
- "The main account id"
- ]
- },
- {
- "name": "liquidity_score",
- "lite_name": "ls",
- "semantic_type": "uint256",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'10000101000203040506'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Liquidity score"
- ]
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ],
+ "selector": "primary"
},
{
- "name": "rank",
+ "name": "rate",
"lite_name": "r",
"semantic_type": "uint32",
"json_type": "integer",
- "index": 2,
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "500",
"comment": [
- "The rank of user in the LP leaderboard"
- ]
+ "The minimal rate at which we publish feeds (in milliseconds)",
+ "Delta (0 - `raw`, 50, 100, 200, 500, 1000, 5000)",
+ "Snapshot (200, 500, 1000, 5000)"
+ ],
+ "selector": "secondary"
}
],
- "comment": []
+ "comment": [
+ "Subscribes to a mini ticker feed for a single instrument. The `mini.s` channel offers simpler integration. To experience higher publishing rates, please use the `mini.d` channel.",
+ "Unlike the `mini.d` channel which publishes an initial snapshot, then only streams deltas after, the `mini.s` channel publishes full snapshots at each feed.",
+ "",
+ "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of the mini ticker.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send deltas of the mini ticker.\u003c/li\u003e\u003cli\u003eThe server will send a delta if any of the fields in the mini ticker have changed.\u003c/li\u003e\u003c/ul\u003e",
+ "",
+ "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a field is not updated, {}\u003c/li\u003e\u003cli\u003eIf a field is updated, {field: '123'}\u003c/li\u003e\u003cli\u003eIf a field is set to zero, {field: '0'}\u003c/li\u003e\u003cli\u003eIf a field is set to null, {field: ''}\u003c/li\u003e\u003c/ul\u003e"
+ ]
},
{
- "name": "ApproximateLPPoint",
+ "name": "WSMiniTickerFeedDataV1",
"is_root": true,
"fields": [
{
- "name": "off_chain_account_id",
- "lite_name": "oc",
+ "name": "stream",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'ACC:123456'",
+ "example": "'v1.mini.s'",
"comment": [
- "The off chain account id"
+ "Stream name"
]
},
{
- "name": "liquidity_score",
- "lite_name": "ls",
- "semantic_type": "uint256",
+ "name": "selector",
+ "lite_name": "s1",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Liquidity score"
+ "Primary selector"
]
},
{
- "name": "rank",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
+ "json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "'872634876'",
"comment": [
- "The rank of user in the LP leaderboard"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
- }
- ],
- "comment": []
- },
- {
- "name": "QueryGetLatestLPSnapshotResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "snapshot",
- "lite_name": "s",
- "semantic_type": "LPSnapshot",
- "json_type": "LPSnapshot",
- "index": 0,
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "MiniTicker",
+ "json_type": "MiniTicker",
+ "index": 3,
"array_depth": 0,
"optional": false,
"comment": [
- "The latest LP snapshot"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetLatestLPSnapshotRequest",
- "is_root": true,
- "fields": [
- {
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
- "index": 0,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'PERPETUAL'",
- "comment": [
- "The kind filter to apply"
+ "A mini ticker matching the request filter"
]
},
{
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'BTC'",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 4,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'872634875'",
"comment": [
- "The base filter to apply"
+ "The previous sequence number that determines the message order"
]
}
],
"comment": []
},
{
- "name": "ApiGetLatestLPSnapshotResponse",
+ "name": "WSTickerFeedSelectorV1",
"is_root": true,
"fields": [
{
- "name": "snapshot",
- "lite_name": "s",
- "semantic_type": "ApproximateLPSnapshot",
- "json_type": "ApproximateLPSnapshot",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The latest LP snapshot"
- ]
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ],
+ "selector": "primary"
+ },
+ {
+ "name": "rate",
+ "lite_name": "r",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 1,
+ "array_depth": 0,
+ "optional": false,
+ "example": "500",
+ "comment": [
+ "The minimal rate at which we publish feeds (in milliseconds)",
+ "Delta (100, 200, 500, 1000, 5000)",
+ "Snapshot (500, 1000, 5000)"
+ ],
+ "selector": "secondary"
}
],
- "comment": []
+ "comment": [
+ "Subscribes to a ticker feed for a single instrument. The `ticker.s` channel offers simpler integration. To experience higher publishing rates, please use the `ticker.d` channel.",
+ "Unlike the `ticker.d` channel which publishes an initial snapshot, then only streams deltas after, the `ticker.s` channel publishes full snapshots at each feed.",
+ "",
+ "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of the ticker.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send deltas of the ticker.\u003c/li\u003e\u003cli\u003eThe server will send a delta if any of the fields in the ticker have changed.\u003c/li\u003e\u003c/ul\u003e",
+ "",
+ "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a field is not updated, {}\u003c/li\u003e\u003cli\u003eIf a field is updated, {field: '123'}\u003c/li\u003e\u003cli\u003eIf a field is set to zero, {field: '0'}\u003c/li\u003e\u003cli\u003eIf a field is set to null, {field: ''}\u003c/li\u003e\u003c/ul\u003e"
+ ]
},
{
- "name": "ApiGetLPLeaderboardRequest",
+ "name": "WSTickerFeedDataV1",
"is_root": true,
"fields": [
{
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "int32",
- "json_type": "integer",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "1",
+ "optional": false,
+ "example": "'v1.ticker.s'",
"comment": [
- "The epoch to filter"
+ "Stream name"
]
},
{
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "selector",
+ "lite_name": "s1",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "100",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The number of accounts to return"
+ "Primary selector"
]
},
{
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
+ "json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'PERPETUAL'",
+ "example": "'872634876'",
"comment": [
- "The kind filter to apply"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "Ticker",
+ "json_type": "Ticker",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "'BTC'",
"comment": [
- "The base filter to apply"
+ "A ticker matching the request filter"
+ ]
+ },
+ {
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 4,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'872634875'",
+ "comment": [
+ "The previous sequence number that determines the message order"
]
}
],
"comment": []
},
{
- "name": "ApiGetLPLeaderboardResponse",
+ "name": "WSTradeFeedSelectorV1",
"is_root": true,
"fields": [
{
- "name": "points",
- "lite_name": "p",
- "semantic_type": "ApproximateLPPoint",
- "json_type": "ApproximateLPPoint",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The list of LP points"
- ]
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ],
+ "selector": "primary"
+ },
+ {
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 1,
+ "array_depth": 0,
+ "optional": false,
+ "example": "500",
+ "comment": [
+ "The limit to query for. Valid values are (50, 200, 500, 1000). Default is 50"
+ ],
+ "selector": "secondary"
}
],
- "comment": []
+ "comment": [
+ "Subscribes to a stream of Public Trades for an instrument."
+ ]
},
{
- "name": "ApiGetLPPointRequest",
+ "name": "WSTradeFeedDataV1",
"is_root": true,
"fields": [
{
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "int32",
- "json_type": "integer",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "1",
+ "optional": false,
+ "example": "'v1.trade'",
"comment": [
- "The epoch to filter"
+ "Stream name"
]
},
{
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
+ "name": "selector",
+ "lite_name": "s1",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'PERPETUAL'",
+ "optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Optional. The kind filter to apply"
+ "Primary selector"
]
},
{
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
+ "json_type": "string",
"index": 2,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'BTC'",
+ "optional": false,
+ "example": "'872634876'",
"comment": [
- "Optional. The base filter to apply"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetLPPointResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "point",
- "lite_name": "p",
- "semantic_type": "LPPoint",
- "json_type": "LPPoint",
- "index": 0,
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "Trade",
+ "json_type": "Trade",
+ "index": 3,
"array_depth": 0,
"optional": false,
"comment": [
- "LP points of user"
+ "A public trade matching the request filter"
]
},
{
- "name": "maker_count",
- "lite_name": "mc",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 4,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "'872634875'",
"comment": [
- "The number of maker"
+ "The previous sequence number that determines the message order"
]
}
],
"comment": []
},
{
- "name": "ApiGetLPInfoRequest",
+ "name": "WSCandlestickFeedSelectorV1",
"is_root": true,
"fields": [
{
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'PERPETUAL'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The kind filter to apply"
- ]
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ],
+ "selector": "primary"
},
{
- "name": "base",
- "lite_name": "b",
- "semantic_type": "Currency",
- "json_type": "Currency",
+ "name": "interval",
+ "lite_name": "i1",
+ "semantic_type": "CandlestickInterval",
+ "json_type": "CandlestickInterval",
"index": 1,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'BTC'",
+ "optional": false,
"comment": [
- "The base filter to apply"
- ]
+ "The interval of each candlestick"
+ ],
+ "selector": "secondary"
+ },
+ {
+ "name": "type",
+ "lite_name": "t",
+ "semantic_type": "CandlestickType",
+ "json_type": "CandlestickType",
+ "index": 2,
+ "array_depth": 0,
+ "optional": false,
+ "comment": [
+ "The type of candlestick data to retrieve"
+ ],
+ "selector": "secondary"
}
],
- "comment": []
+ "comment": [
+ "Subscribes to a stream of Kline/Candlestick updates for an instrument. A Kline is uniquely identified by its open time.",
+ "A new Kline is published every interval (if it exists). Upon subscription, the server will send the 5 most recent Kline for the requested interval."
+ ]
},
{
- "name": "ApiGetLPInfoResponse",
+ "name": "WSCandlestickFeedDataV1",
"is_root": true,
"fields": [
{
- "name": "is_lp_maker",
- "lite_name": "il",
- "semantic_type": "bool",
- "json_type": "boolean",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "true",
+ "example": "'v1.candle'",
"comment": [
- "Is LP maker"
+ "Stream name"
]
},
{
- "name": "spread_score_value_multiplier",
- "lite_name": "ss",
- "semantic_type": "uint64",
+ "name": "selector",
+ "lite_name": "s1",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'1000000000'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The spread score value multiplier"
+ "Primary selector"
]
},
{
- "name": "depth_score_value_multiplier",
- "lite_name": "ds",
+ "name": "sequence_number",
+ "lite_name": "sn",
"semantic_type": "uint64",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'1000000000'",
+ "example": "'872634876'",
"comment": [
- "The depth score value multiplier"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "market_share_value_multiplier",
- "lite_name": "ms",
- "semantic_type": "uint64",
- "json_type": "string",
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "Candlestick",
+ "json_type": "Candlestick",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "'1000000000'",
"comment": [
- "The market share value multiplier"
+ "A candlestick entry matching the request filters"
]
},
{
- "name": "underlying_multiplier",
- "lite_name": "um",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
"semantic_type": "uint64",
"json_type": "string",
"index": 4,
"array_depth": 0,
"optional": false,
- "example": "'52'",
- "comment": [
- "Underlying multiplier"
- ]
- },
- {
- "name": "market_share_multiplier",
- "lite_name": "ms1",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": false,
- "example": "'1000000000'",
- "comment": [
- "The market share multiplier, equal to the maker trading volume in the past 2 hours"
- ]
- },
- {
- "name": "ask_fast_market_multiplier",
- "lite_name": "af",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 6,
- "array_depth": 0,
- "optional": false,
- "example": "'100'",
- "comment": [
- "Ask fast market multiplier"
- ]
- },
- {
- "name": "bid_fast_market_multiplier",
- "lite_name": "bf",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 7,
- "array_depth": 0,
- "optional": false,
- "example": "'100'",
+ "example": "'872634875'",
"comment": [
- "Bid fast market multiplier"
+ "The previous sequence number that determines the message order"
]
}
],
"comment": []
},
{
- "name": "RewardEpochInfo",
+ "name": "WSUnsubscribeAllParams",
+ "is_root": true,
+ "fields": [],
+ "comment": [
+ "All V1 Websocket Unsubscription Request to unsubscribe from all active websocket streams."
+ ]
+ },
+ {
+ "name": "StreamReference",
"is_root": false,
"fields": [
{
- "name": "epoch",
- "lite_name": "e",
- "semantic_type": "int32",
- "json_type": "integer",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'2'",
+ "example": "'v1.ticker.d'",
"comment": [
- "The epoch number"
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
]
},
{
- "name": "epoch_start_time",
- "lite_name": "es",
- "semantic_type": "timestamp",
+ "name": "selectors",
+ "lite_name": "s1",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'1726790400000000000'",
- "comment": [
- "The start time of the epoch"
- ]
- },
- {
- "name": "epoch_end_time",
- "lite_name": "ee",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'1726790400000000000'",
- "comment": [
- "The end time of the epoch"
- ]
- },
- {
- "name": "status",
- "lite_name": "s",
- "semantic_type": "RewardEpochStatus",
- "json_type": "RewardEpochStatus",
- "index": 3,
- "array_depth": 0,
+ "array_depth": 1,
"optional": false,
+ "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
"comment": [
- "The status of the epoch"
+ "The list of selectors for the stream"
]
}
],
"comment": []
},
{
- "name": "ApiGetListRewardEpochResponse",
+ "name": "WSUnsubscribeAllResult",
"is_root": true,
"fields": [
{
- "name": "ecosystem_epochs",
- "lite_name": "ee",
- "semantic_type": "RewardEpochInfo",
- "json_type": "RewardEpochInfo",
+ "name": "stream_reference",
+ "lite_name": "sr",
+ "semantic_type": "StreamReference",
+ "json_type": "StreamReference",
"index": 0,
"array_depth": 1,
"optional": false,
"comment": [
- "The list of epoch for ecosystem reward"
+ "The list of stream references unsubscribed from"
]
- },
+ }
+ ],
+ "comment": [
+ "Returns a list of all rooms the client has unsubscribed from."
+ ]
+ },
+ {
+ "name": "WSListStreamsParams",
+ "is_root": true,
+ "fields": [],
+ "comment": [
+ "List down all the streams this connection has connected to."
+ ]
+ },
+ {
+ "name": "WSListStreamsResult",
+ "is_root": true,
+ "fields": [
{
- "name": "trading_epochs",
- "lite_name": "te",
- "semantic_type": "RewardEpochInfo",
- "json_type": "RewardEpochInfo",
- "index": 1,
+ "name": "stream_reference",
+ "lite_name": "sr",
+ "semantic_type": "StreamReference",
+ "json_type": "StreamReference",
+ "index": 0,
"array_depth": 1,
"optional": false,
"comment": [
- "The list of epoch for trader reward and lp reward"
+ "The list of stream references the connection is connected to"
]
}
],
- "comment": []
+ "comment": [
+ "Returns a list of all rooms the client has subscribed to."
+ ]
},
{
- "name": "ApiSubAccountTradeAggregationRequest",
+ "name": "ApiGetAllInstrumentsRequest",
"is_root": true,
"fields": [
{
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "int32",
- "json_type": "integer",
+ "name": "is_active",
+ "lite_name": "ia",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 0,
"array_depth": 0,
- "optional": false,
- "example": "100",
- "comment": [
- "Optional. The limit of the number of results to return"
- ]
- },
- {
- "name": "interval",
- "lite_name": "i",
- "semantic_type": "SubAccountTradeInterval",
- "json_type": "SubAccountTradeInterval",
- "index": 1,
- "array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "false",
+ "example": "true",
"comment": [
- "The interval of each sub account trade"
+ "Fetch only active instruments"
]
- },
+ }
+ ],
+ "comment": [
+ "Fetch all instruments"
+ ]
+ },
+ {
+ "name": "ApiGetAllInstrumentsResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "sub_account_i_ds",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 2,
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Instrument",
+ "json_type": "Instrument",
+ "index": 0,
"array_depth": 1,
"optional": false,
- "example": "['2376', '5821']",
"comment": [
- "The list of sub account ids to query"
+ "List of instruments"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "OrderLeg",
+ "is_root": false,
+ "fields": [
{
- "name": "start_interval",
- "lite_name": "si",
- "semantic_type": "timestamp",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
- "index": 3,
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Optional. The starting time in unix nanoseconds of a specific interval to query"
- ]
- },
- {
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Optional. Start time in unix nanoseconds"
+ "The instrument to trade in this leg"
]
},
{
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
+ "name": "size",
+ "lite_name": "s",
+ "semantic_type": "string",
"json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
- "comment": [
- "Optional. End time in unix nanoseconds"
- ]
- },
- {
- "name": "is_maker",
- "lite_name": "im",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 6,
- "array_depth": 0,
- "optional": false,
- "example": "true",
- "comment": [
- "Filter on the maker of the trade"
- ]
- },
- {
- "name": "is_taker",
- "lite_name": "it",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 7,
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "true",
+ "example": "'10.5'",
"comment": [
- "Filter on the taker of the trade"
+ "The total number of assets to trade in this leg, expressed in base asset decimal units."
]
},
{
- "name": "cursor",
- "lite_name": "c",
+ "name": "limit_price",
+ "lite_name": "lp",
"semantic_type": "string",
"json_type": "string",
- "index": 8,
+ "index": 2,
"array_depth": 0,
"optional": true,
- "default": "",
- "example": "''",
+ "default": "0",
+ "example": "'65038.01'",
"comment": [
- "The cursor to indicate when to start the next query from"
+ "The limit price of the order leg, expressed in `9` decimals.",
+ "This is the number of quote currency units to pay/receive for this leg.",
+ "This should be `null/0` if the order is a market order"
]
},
{
- "name": "group_by_signer",
- "lite_name": "gb",
+ "name": "is_buying_asset",
+ "lite_name": "ib",
"semantic_type": "bool",
"json_type": "boolean",
- "index": 9,
+ "index": 3,
"array_depth": 0,
"optional": false,
"example": "true",
"comment": [
- "Whether to group trades by signer per sub account"
+ "Specifies if the order leg is a buy or sell"
]
}
],
- "comment": [
- "startTime are optional parameters. The semantics of these parameters are as follows:\u003cul\u003e"
- ]
+ "comment": []
},
{
- "name": "SubAccountTradeAggregation",
+ "name": "Signature",
"is_root": false,
"fields": [
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
+ "name": "signer",
+ "lite_name": "s",
+ "semantic_type": "uint256",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
"comment": [
- "The sub account id"
+ "The address (public key) of the wallet signing the payload"
]
},
{
- "name": "total_fee",
- "lite_name": "tf",
- "semantic_type": "int64",
+ "name": "r",
+ "lite_name": "r",
+ "semantic_type": "uint256",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8'",
"comment": [
- "Total fee paid"
+ "Signature R"
]
},
{
- "name": "total_trade_volume",
- "lite_name": "tt",
+ "name": "s",
+ "lite_name": "s1",
"semantic_type": "uint256",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d'",
"comment": [
- "Total volume traded"
+ "Signature S"
]
},
{
- "name": "num_traded",
- "lite_name": "nt",
- "semantic_type": "uint64",
- "json_type": "string",
+ "name": "v",
+ "lite_name": "v",
+ "semantic_type": "uint8",
+ "json_type": "integer",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "100",
+ "example": "'28'",
"comment": [
- "Number of trades"
+ "Signature V"
]
},
{
- "name": "positive_fee",
- "lite_name": "pf",
- "semantic_type": "int64",
+ "name": "expiration",
+ "lite_name": "e",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 4,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'1697788800000000000'",
"comment": [
- "Total positive fee paid by user"
+ "Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days"
]
},
{
- "name": "signer",
- "lite_name": "s",
- "semantic_type": "address",
- "json_type": "string",
+ "name": "nonce",
+ "lite_name": "n",
+ "semantic_type": "uint32",
+ "json_type": "integer",
"index": 5,
"array_depth": 0,
"optional": false,
+ "example": "'1234567890'",
"comment": [
- "The signer of the trade"
- ]
- },
- {
- "name": "realized_pnl",
- "lite_name": "rp",
- "semantic_type": "int64",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": false,
- "example": "'10000101000203040506'",
- "comment": [
- "Realized PnL"
+ "Users can randomly generate this value, used as a signature deconflicting key.",
+ "ie. You can send the same exact instruction twice with different nonces.",
+ "When the same nonce is used, the same payload will generate the same signature.",
+ "Our system will consider the payload a duplicate, and ignore it."
]
}
],
- "comment": [
- "Similar to sub-account trade, but not divided by individual assets."
- ]
+ "comment": []
},
{
- "name": "ApiSubAccountTradeAggregationResponse",
- "is_root": true,
+ "name": "TPSLOrderMetadata",
+ "is_root": false,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "SubAccountTradeAggregation",
- "json_type": "SubAccountTradeAggregation",
+ "name": "trigger_by",
+ "lite_name": "tb",
+ "semantic_type": "TriggerBy",
+ "json_type": "TriggerBy",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'LAST'",
"comment": [
- "The sub account trade aggregation result set for given interval"
+ "Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order"
]
},
{
- "name": "next",
- "lite_name": "n",
+ "name": "trigger_price",
+ "lite_name": "tp",
"semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "'Qw0918='",
+ "optional": false,
+ "example": "'65038.10'",
"comment": [
- "The cursor to indicate when to start the next query from"
+ "The Trigger Price of the order, expressed in `9` decimals."
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetTraderStatResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "total_fee",
- "lite_name": "tf",
- "semantic_type": "int64",
- "json_type": "string",
- "index": 0,
+ "name": "close_position",
+ "lite_name": "cp",
+ "semantic_type": "bool",
+ "json_type": "boolean",
+ "index": 2,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "false",
"comment": [
- "Total fee paid"
+ "If True, the order will close the position when the trigger price is reached"
]
}
],
- "comment": []
+ "comment": [
+ "Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.",
+ "",
+ "### Fields:",
+ "- **triggerBy**: Defines the price type that activates the order (e.g., index price).",
+ "- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.",
+ "",
+ ""
+ ]
},
{
- "name": "TraderMetric",
- "is_root": true,
+ "name": "TriggerOrderMetadata",
+ "is_root": false,
"fields": [
{
- "name": "total_fee",
- "lite_name": "tf",
- "semantic_type": "int64",
- "json_type": "string",
+ "name": "trigger_type",
+ "lite_name": "tt",
+ "semantic_type": "TriggerType",
+ "json_type": "TriggerType",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'TAKE_PROFIT'",
"comment": [
- "Total fee paid"
+ "Type of the trigger order. eg: Take Profit, Stop Loss, etc"
]
},
{
- "name": "total_point",
- "lite_name": "tp",
- "semantic_type": "float64",
- "json_type": "number",
+ "name": "tpsl",
+ "lite_name": "t",
+ "semantic_type": "TPSLOrderMetadata",
+ "json_type": "TPSLOrderMetadata",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'10000000.5'",
"comment": [
- "Total trader point of this epoch/phase"
+ "Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.",
+ "",
+ ""
]
}
],
- "comment": []
+ "comment": [
+ "Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).",
+ "",
+ "Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.",
+ "",
+ ""
+ ]
},
{
- "name": "ApiFindTraderEpochMetricResponse",
- "is_root": true,
+ "name": "OrderMetadata",
+ "is_root": false,
"fields": [
{
- "name": "metric",
- "lite_name": "m",
- "semantic_type": "TraderMetric",
- "json_type": "TraderMetric",
+ "name": "client_order_id",
+ "lite_name": "co",
+ "semantic_type": "uint64",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'23042'",
"comment": [
- "Phase zero metric"
+ "A unique identifier for the active order within a subaccount, specified by the client",
+ "This is used to identify the order in the client's system",
+ "This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer",
+ "This field will not be propagated to the smart contract, and should not be signed by the client",
+ "This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected",
+ "Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]",
+ "To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]",
+ "",
+ "When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId"
]
},
{
- "name": "rank",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "create_time",
+ "lite_name": "ct",
+ "semantic_type": "timestamp",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": false,
- "example": "'52'",
+ "optional": true,
+ "default": "0",
+ "example": "'1697788800000000000'",
"comment": [
- "The rank of the account in the trader"
+ "[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds"
]
},
{
- "name": "total",
+ "name": "trigger",
"lite_name": "t",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "semantic_type": "TriggerOrderMetadata",
+ "json_type": "TriggerOrderMetadata",
"index": 2,
"array_depth": 0,
- "optional": false,
- "example": "52",
+ "optional": true,
+ "default": "",
"comment": [
- "The total number of accounts in the trader"
+ "Trigger fields are used to support any type of trigger order such as TP/SL"
]
},
{
- "name": "last_calculated_at",
- "lite_name": "lc",
- "semantic_type": "timestamp",
- "json_type": "string",
+ "name": "broker",
+ "lite_name": "b",
+ "semantic_type": "BrokerTag",
+ "json_type": "BrokerTag",
"index": 3,
"array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
+ "optional": true,
+ "default": "",
+ "example": "'BROKER_CODE'",
"comment": [
- "The time when the trader points were last calculated"
+ "Specifies the broker who brokered the order"
]
}
],
- "comment": []
+ "comment": [
+ "Metadata fields are used to support Backend only operations. These operations are not trustless by nature.",
+ "Hence, fields in here are never signed, and is never transmitted to the smart contract."
+ ]
},
{
- "name": "TraderLeaderboardUser",
- "is_root": true,
+ "name": "OrderState",
+ "is_root": false,
"fields": [
{
- "name": "account_id",
- "lite_name": "ai",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "status",
+ "lite_name": "s",
+ "semantic_type": "OrderStatus",
+ "json_type": "OrderStatus",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'ACC_1234567890'",
"comment": [
- "The off chain account id"
+ "The status of the order"
]
},
{
- "name": "rank",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "reject_reason",
+ "lite_name": "rr",
+ "semantic_type": "OrderRejectReason",
+ "json_type": "OrderRejectReason",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'52'",
+ "example": "'CLIENT_CANCEL'",
+ "comment": [
+ "The reason for rejection or cancellation"
+ ]
+ },
+ {
+ "name": "book_size",
+ "lite_name": "bs",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 2,
+ "array_depth": 1,
+ "optional": false,
+ "example": "['10.5']",
+ "comment": [
+ "The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs"
+ ]
+ },
+ {
+ "name": "traded_size",
+ "lite_name": "ts",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 3,
+ "array_depth": 1,
+ "optional": false,
+ "example": "['1.5']",
"comment": [
- "The rank of the account in the Trader"
+ "The total number of assets traded. Sorted in same order as Order.Legs"
]
},
{
- "name": "total_point",
- "lite_name": "tp",
- "semantic_type": "float64",
- "json_type": "number",
- "index": 2,
+ "name": "update_time",
+ "lite_name": "ut",
+ "semantic_type": "timestamp",
+ "json_type": "string",
+ "index": 4,
"array_depth": 0,
"optional": false,
- "example": "'10000000.5'",
+ "example": "'1697788800000000000'",
"comment": [
- "Total Trader point"
+ "Time at which the order was updated by GRVT, expressed in unix nanoseconds"
]
},
{
- "name": "twitter_username",
- "lite_name": "tu",
+ "name": "avg_fill_price",
+ "lite_name": "af",
"semantic_type": "string",
"json_type": "string",
- "index": 3,
- "array_depth": 0,
+ "index": 5,
+ "array_depth": 1,
"optional": false,
- "example": "'elonmusk'",
+ "example": "['60000.4']",
"comment": [
- "The twitter username of the account"
+ "The average fill price of the order. Sorted in same order as Order.Legs"
]
}
],
"comment": []
},
{
- "name": "ApiFindTraderLeaderboardResponse",
- "is_root": true,
+ "name": "Order",
+ "is_root": false,
"fields": [
{
- "name": "users",
- "lite_name": "u",
- "semantic_type": "TraderLeaderboardUser",
- "json_type": "TraderLeaderboardUser",
+ "name": "order_id",
+ "lite_name": "oi",
+ "semantic_type": "uint128",
+ "json_type": "string",
"index": 0,
- "array_depth": 1,
- "optional": false,
+ "array_depth": 0,
+ "optional": true,
+ "default": "0",
+ "example": "'0x1234567890abcdef'",
"comment": [
- "The list of trader leaderboard users"
+ "[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend"
]
- }
- ],
- "comment": []
- },
- {
- "name": "WSOrderFeedSelectorV1",
- "is_root": true,
- "fields": [
+ },
{
"name": "sub_account_id",
"lite_name": "sa",
"semantic_type": "uint64",
"json_type": "string",
- "index": 0,
+ "index": 1,
"array_depth": 0,
"optional": false,
"example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The subaccount ID to filter by"
- ],
- "selector": "primary"
+ "The subaccount initiating the order"
+ ]
},
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 1,
+ "name": "is_market",
+ "lite_name": "im",
+ "semantic_type": "bool",
+ "json_type": "boolean",
+ "index": 2,
"array_depth": 0,
"optional": true,
- "default": "'all'",
- "example": "'BTC_USDT_Perp'",
+ "default": "false",
+ "example": "false",
"comment": [
- "The instrument filter to apply."
- ],
- "selector": "primary"
- }
- ],
- "comment": [
- "Subscribes to a feed of order updates pertaining to orders made by your account.",
- "Each Order can be uniquely identified by its `order_id` or `client_order_id`.",
- "To subscribe to all orders, specify an empty `instrument` (eg. `2345123`).",
- "Otherwise, specify the `instrument` to only receive orders for that instrument (eg. `2345123-BTC_USDT_Perp`)."
- ]
- },
- {
- "name": "WSOrderFeedDataV1",
- "is_root": true,
- "fields": [
+ "If the order is a market order",
+ "Market Orders do not have a limit price, and are always executed according to the maker order price.",
+ "Market Orders must always be taker orders"
+ ]
+ },
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
+ "name": "time_in_force",
+ "lite_name": "ti",
+ "semantic_type": "TimeInForce",
+ "json_type": "TimeInForce",
+ "index": 3,
"array_depth": 0,
"optional": false,
- "example": "'v1.order'",
"comment": [
- "Stream name"
+ "Four supported types of orders: GTT, IOC, AON, FOK:\u003cul\u003e",
+ "\u003cli\u003ePARTIAL EXECUTION = GTT / IOC - allows partial size execution on each leg\u003c/li\u003e",
+ "\u003cli\u003eFULL EXECUTION = AON / FOK - only allows full size execution on all legs\u003c/li\u003e",
+ "\u003cli\u003eTAKER ONLY = IOC / FOK - only allows taker orders\u003c/li\u003e",
+ "\u003cli\u003eMAKER OR TAKER = GTT / AON - allows maker or taker orders\u003c/li\u003e",
+ "\u003c/ul\u003eExchange only supports (GTT, IOC, FOK)",
+ "RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)"
]
},
{
- "name": "selector",
- "lite_name": "s1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
+ "name": "post_only",
+ "lite_name": "po",
+ "semantic_type": "bool",
+ "json_type": "boolean",
+ "index": 4,
"array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "optional": true,
+ "default": "false",
+ "example": "false",
"comment": [
- "Primary selector"
+ "If True, Order must be a maker order. It has to fill the orderbook instead of match it.",
+ "If False, Order can be either a maker or taker order. \u003cb\u003eIn this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.\u003c/b\u003e",
+ "",
+ "| | Must Fill All | Can Fill Partial |",
+ "| - | - | - |",
+ "| Must Be Taker | FOK + False | IOC + False |",
+ "| Can Be Either | AON + False | GTC + False |",
+ "| Must Be Maker | AON + True | GTC + True |",
+ ""
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 2,
+ "name": "reduce_only",
+ "lite_name": "ro",
+ "semantic_type": "bool",
+ "json_type": "boolean",
+ "index": 5,
"array_depth": 0,
- "optional": false,
- "example": "'872634876'",
+ "optional": true,
+ "default": "false",
+ "example": "false",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "If True, Order must reduce the position size, or be cancelled"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "Order",
- "json_type": "Order",
- "index": 3,
- "array_depth": 0,
+ "name": "legs",
+ "lite_name": "l",
+ "semantic_type": "OrderLeg",
+ "json_type": "OrderLeg",
+ "index": 6,
+ "array_depth": 1,
"optional": false,
"comment": [
- "The order object being created or updated"
+ "The legs present in this order",
+ "The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 4,
+ "name": "signature",
+ "lite_name": "s",
+ "semantic_type": "Signature",
+ "json_type": "Signature",
+ "index": 7,
"array_depth": 0,
"optional": false,
- "example": "'872634875'",
"comment": [
- "The previous sequence number that determines the message order"
+ "The signature approving this order"
]
- }
- ],
- "comment": []
- },
- {
- "name": "WSOrderStateFeedSelectorV1",
- "is_root": true,
- "fields": [
+ },
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
+ "name": "metadata",
+ "lite_name": "m",
+ "semantic_type": "OrderMetadata",
+ "json_type": "OrderMetadata",
+ "index": 8,
"array_depth": 0,
"optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The subaccount ID to filter by"
- ],
- "selector": "primary"
+ "Order Metadata, ignored by the smart contract, and unsigned by the client"
+ ]
},
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 1,
+ "name": "state",
+ "lite_name": "s1",
+ "semantic_type": "OrderState",
+ "json_type": "OrderState",
+ "index": 9,
"array_depth": 0,
"optional": true,
- "default": "'all'",
- "example": "'BTC_USDT_Perp'",
+ "default": "''",
"comment": [
- "The instrument filter to apply."
- ],
- "selector": "primary"
+ "[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client"
+ ]
}
],
"comment": [
- "Subscribes to a feed of order updates pertaining to orders made by your account.",
- "Unlike the Order Stream, this only streams state updates, drastically improving throughput, and latency.",
- "Each Order can be uniquely identified by its `order_id` or `client_order_id`.",
- "To subscribe to all orders, specify an empty `instrument` (eg. `2345123`).",
- "Otherwise, specify the `instrument` to only receive orders for that instrument (eg. `2345123-BTC_USDT_Perp`)."
+ "Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.",
+ "GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.",
+ "This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.",
+ "Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.",
+ "",
+ "All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.",
+ "This minimizes the amount of trust users have to offer to GRVT"
]
},
{
- "name": "OrderStateFeed",
- "is_root": false,
- "fields": [
- {
- "name": "order_id",
- "lite_name": "oi",
- "semantic_type": "uint128",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'10000101000203040506'",
- "comment": [
- "A unique 128-bit identifier for the order, deterministically generated within the GRVT backend"
- ]
- },
+ "name": "ApiCreateOrderRequest",
+ "is_root": true,
+ "fields": [
{
- "name": "client_order_id",
- "lite_name": "co",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 1,
+ "name": "order",
+ "lite_name": "o",
+ "semantic_type": "Order",
+ "json_type": "Order",
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'23042'",
"comment": [
- "A unique identifier for the active order within a subaccount, specified by the client"
+ "The order to create"
]
- },
+ }
+ ],
+ "comment": [
+ "Create an order on the orderbook for this trading account."
+ ]
+ },
+ {
+ "name": "ApiCreateOrderResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "order_state",
- "lite_name": "os",
- "semantic_type": "OrderState",
- "json_type": "OrderState",
- "index": 2,
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Order",
+ "json_type": "Order",
+ "index": 0,
"array_depth": 0,
"optional": false,
"comment": [
- "The order state object being created or updated"
+ "The created order"
]
}
],
"comment": []
},
{
- "name": "WSOrderStateFeedDataV1",
+ "name": "ApiCancelOrderRequest",
"is_root": true,
"fields": [
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.state'",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "Stream name"
+ "The subaccount ID cancelling the order"
]
},
{
- "name": "selector",
- "lite_name": "s1",
- "semantic_type": "string",
+ "name": "order_id",
+ "lite_name": "oi",
+ "semantic_type": "uint128",
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "optional": true,
+ "default": "0",
+ "example": "'0x1028403'",
"comment": [
- "Primary selector"
+ "Cancel the order with this `order_id`"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
+ "name": "client_order_id",
+ "lite_name": "co",
"semantic_type": "uint64",
"json_type": "string",
"index": 2,
"array_depth": 0,
- "optional": false,
- "example": "'872634876'",
- "comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
- ]
- },
- {
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "OrderStateFeed",
- "json_type": "OrderStateFeed",
- "index": 3,
- "array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "0",
+ "example": "'23042'",
"comment": [
- "The Order State Feed"
+ "Cancel the order with this `client_order_id`"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
+ "name": "time_to_live_ms",
+ "lite_name": "tt",
"semantic_type": "uint64",
"json_type": "string",
- "index": 4,
+ "index": 3,
"array_depth": 0,
- "optional": false,
- "example": "'872634875'",
+ "optional": true,
+ "default": "100",
+ "example": "'500'",
"comment": [
- "The previous sequence number that determines the message order"
+ "Specifies the time-to-live (in milliseconds) for this cancellation.",
+ "During this period, any order creation with a matching `client_order_id` will be cancelled and not be added to the GRVT matching engine.",
+ "This mechanism helps mitigate time-of-flight issues where cancellations might arrive before the corresponding orders.",
+ "Hence, cancellation by `order_id` ignores this field as the exchange can only assign `order_id`s to already-processed order creations.",
+ "The duration cannot be negative, is rounded down to the nearest 100ms (e.g., `'670'` -\u003e `'600'`, `'30'` -\u003e `'0'`) and capped at 5 seconds (i.e., `'5000'`).",
+ "Value of `'0'` or omission results in the default time-to-live value being applied.",
+ "If the caller requests multiple successive cancellations for a given order, such that the time-to-live windows overlap, only the first request will be considered.",
+ ""
]
}
],
- "comment": []
+ "comment": [
+ "Cancel an order on the orderbook for this trading account. Either `order_id` or `client_order_id` must be provided."
+ ]
},
{
- "name": "WSPositionsFeedSelectorV1",
+ "name": "ApiCancelAllOrdersRequest",
"is_root": true,
"fields": [
{
@@ -13209,111 +7748,141 @@
"optional": false,
"example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The subaccount ID to filter by"
- ],
- "selector": "primary"
+ "The subaccount ID cancelling all orders"
+ ]
},
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
+ "name": "kind",
+ "lite_name": "k",
+ "semantic_type": "Kind",
+ "json_type": "Kind",
"index": 1,
- "array_depth": 0,
+ "array_depth": 1,
"optional": true,
- "default": "'all'",
- "example": "'BTC_USDT_Perp'",
+ "default": "all",
+ "example": "['PERPETUAL']",
"comment": [
- "The instrument filter to apply."
- ],
- "selector": "primary"
+ "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be cancelled"
+ ]
+ },
+ {
+ "name": "base",
+ "lite_name": "b",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
+ "index": 2,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['BTC', 'ETH']",
+ "comment": [
+ "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be cancelled"
+ ]
+ },
+ {
+ "name": "quote",
+ "lite_name": "q",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
+ "index": 3,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['USDT', 'USDC']",
+ "comment": [
+ "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be cancelled"
+ ]
}
],
"comment": [
- "Subscribes to a feed of position updates.",
- "Updates get published when a trade is executed, and when leverage configurations are changed for instruments with ongoing positions.",
- "To subscribe to all positions, specify an empty `instrument` (eg. `2345123`).",
- "Otherwise, specify the `instrument` to only receive positions for that instrument (eg. `2345123-BTC_USDT_Perp`)."
+ "Cancel all orders on the orderbook for this trading account. This may not match new orders in flight."
]
},
{
- "name": "WSPositionsFeedDataV1",
+ "name": "ApiOpenOrdersRequest",
"is_root": true,
"fields": [
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.position'",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "Stream name"
+ "The subaccount ID to filter by"
]
},
{
- "name": "selector",
- "lite_name": "s1",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "kind",
+ "lite_name": "k",
+ "semantic_type": "Kind",
+ "json_type": "Kind",
"index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['PERPETUAL']",
"comment": [
- "Primary selector"
+ "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
- "json_type": "string",
+ "name": "base",
+ "lite_name": "b",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 2,
- "array_depth": 0,
- "optional": false,
- "example": "'872634876'",
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['BTC', 'ETH']",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "Positions",
- "json_type": "Positions",
+ "name": "quote",
+ "lite_name": "q",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 3,
- "array_depth": 0,
- "optional": false,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['USDT', 'USDC']",
"comment": [
- "A Position being created or updated matching the request filter"
+ "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
]
- },
- {
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiOpenOrdersResponse",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Order",
+ "json_type": "Order",
+ "index": 0,
+ "array_depth": 1,
"optional": false,
- "example": "'872634875'",
"comment": [
- "The previous sequence number that determines the message order"
+ "The Open Orders matching the request filter"
]
}
],
- "comment": []
+ "comment": [
+ "Retrieves all open orders for the account. This may not match new orders in flight."
+ ]
},
{
- "name": "WSFillFeedSelectorV1",
+ "name": "ApiOrderHistoryRequest",
"is_root": true,
"fields": [
{
@@ -13326,297 +7895,359 @@
"optional": false,
"example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The sub account ID to request for"
- ],
- "selector": "primary"
+ "The subaccount ID to filter by"
+ ]
},
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
+ "name": "kind",
+ "lite_name": "k",
+ "semantic_type": "Kind",
+ "json_type": "Kind",
"index": 1,
- "array_depth": 0,
+ "array_depth": 1,
"optional": true,
- "default": "'all'",
- "example": "'BTC_USDT_Perp'",
+ "default": "all",
+ "example": "['PERPETUAL']",
"comment": [
- "The instrument filter to apply."
- ],
- "selector": "primary"
- }
- ],
- "comment": [
- "Subscribes to a feed of private trade updates. This happens when a trade is executed.",
- "To subscribe to all private trades, specify an empty `instrument` (eg. `2345123`).",
- "Otherwise, specify the `instrument` to only receive private trades for that instrument (eg. `2345123-BTC_USDT_Perp`)."
- ]
- },
- {
- "name": "WSFillFeedDataV1",
- "is_root": true,
- "fields": [
+ "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
+ ]
+ },
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'v1.fill'",
+ "name": "base",
+ "lite_name": "b",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
+ "index": 2,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['BTC', 'ETH']",
"comment": [
- "The websocket channel to which the response is sent"
+ "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "selector",
- "lite_name": "s1",
- "semantic_type": "string",
+ "name": "quote",
+ "lite_name": "q",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
+ "index": 3,
+ "array_depth": 1,
+ "optional": true,
+ "default": "all",
+ "example": "['USDT', 'USDC']",
+ "comment": [
+ "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
+ ]
+ },
+ {
+ "name": "start_time",
+ "lite_name": "st",
+ "semantic_type": "int64",
"json_type": "string",
- "index": 1,
+ "index": 4,
"array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "optional": true,
+ "default": "0",
+ "example": "'1697788800000000000'",
"comment": [
- "Primary selector"
+ "The start time to apply in nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
+ "name": "end_time",
+ "lite_name": "et",
+ "semantic_type": "int64",
"json_type": "string",
- "index": 2,
+ "index": 5,
"array_depth": 0,
- "optional": false,
- "example": "'872634876'",
+ "optional": true,
+ "default": "now()",
+ "example": "'1697788800000000000'",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "The end time to apply in nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "Fill",
- "json_type": "Fill",
- "index": 3,
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 6,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "500",
+ "example": "500",
"comment": [
- "A private trade matching the request filter"
+ "The limit to query for. Defaults to 500; Max 1000"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
+ "name": "cursor",
+ "lite_name": "c",
+ "semantic_type": "string",
"json_type": "string",
- "index": 4,
+ "index": 7,
"array_depth": 0,
- "optional": false,
- "example": "'872634875'",
+ "optional": true,
+ "default": "''",
+ "example": "''",
"comment": [
- "The previous sequence number that determines the message order"
+ "The cursor to indicate when to start the query from"
]
}
],
- "comment": []
+ "comment": [
+ "Retrieves the order history for the account.",
+ "",
+ "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
+ ]
},
{
- "name": "WSTransferFeedSelectorV1",
+ "name": "ApiOrderHistoryResponse",
"is_root": true,
"fields": [
{
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "address",
- "json_type": "string",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Order",
+ "json_type": "Order",
"index": 0,
- "array_depth": 0,
+ "array_depth": 1,
"optional": false,
- "example": "'$GRVT_MAIN_ACCOUNT_ID'",
"comment": [
- "The main account ID to request for"
- ],
- "selector": "primary"
+ "The Open Orders matching the request filter"
+ ]
},
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
+ "name": "next",
+ "lite_name": "n",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": true,
- "default": "'0'",
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "optional": false,
+ "example": "'Qw0918='",
"comment": [
- "The sub account ID to request for"
- ],
- "selector": "primary"
+ "The cursor to indicate when to start the query from"
+ ]
}
],
+ "comment": []
+ },
+ {
+ "name": "EmptyRequest",
+ "is_root": true,
+ "fields": [],
"comment": [
- "Subscribes to a feed of transfers. This will execute when there is any transfer to or from the selected account.",
- "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`).",
- "To subscribe to a sub account, specify the main account and the sub account dash separated (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a-1920109784202388`)."
+ "Used for requests that do not require any parameters"
]
},
{
- "name": "TransferHistory",
- "is_root": true,
+ "name": "Ack",
+ "is_root": false,
"fields": [
{
- "name": "tx_id",
- "lite_name": "ti",
- "semantic_type": "uint64",
- "json_type": "string",
+ "name": "ack",
+ "lite_name": "a",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'1028403'",
+ "example": "'true'",
"comment": [
- "The transaction ID of the transfer"
+ "Gravity has acknowledged that the request has been successfully received and it will process it in the backend"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "AckResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "from_account_id",
- "lite_name": "fa",
- "semantic_type": "address",
- "json_type": "string",
- "index": 1,
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Ack",
+ "json_type": "Ack",
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
"comment": [
- "The account to transfer from"
+ "The Ack Object"
]
- },
- {
- "name": "from_sub_account_id",
- "lite_name": "fs",
+ }
+ ],
+ "comment": [
+ "Used to acknowledge a request has been received and will be processed"
+ ]
+ },
+ {
+ "name": "ApiGetOrderRequest",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "sub_account_id",
+ "lite_name": "sa",
"semantic_type": "uint64",
"json_type": "string",
- "index": 2,
+ "index": 0,
"array_depth": 0,
"optional": false,
"example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The subaccount to transfer from (0 if transferring from main account)"
+ "The subaccount ID to filter by"
]
},
{
- "name": "to_account_id",
- "lite_name": "ta",
- "semantic_type": "address",
+ "name": "order_id",
+ "lite_name": "oi",
+ "semantic_type": "uint128",
"json_type": "string",
- "index": 3,
+ "index": 1,
"array_depth": 0,
- "optional": false,
- "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
+ "optional": true,
+ "default": "0",
+ "example": "'0x1028403'",
"comment": [
- "The account to deposit into"
+ "Filter for `order_id`"
]
},
{
- "name": "to_sub_account_id",
- "lite_name": "ts",
+ "name": "client_order_id",
+ "lite_name": "co",
"semantic_type": "uint64",
"json_type": "string",
- "index": 4,
+ "index": 2,
"array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "optional": true,
+ "default": "0",
+ "example": "'23042'",
"comment": [
- "The subaccount to transfer to (0 if transferring to main account)"
+ "Filter for `client_order_id`"
]
- },
+ }
+ ],
+ "comment": [
+ "Retrieve the order for the account. Either `order_id` or `client_order_id` must be provided."
+ ]
+ },
+ {
+ "name": "ApiGetOrderResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "currency",
- "lite_name": "c",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 5,
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Order",
+ "json_type": "Order",
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'USDT'",
"comment": [
- "The token currency to transfer"
+ "The order object for the requested filter"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiCancelOnDisconnectRequest",
+ "is_root": true,
+ "fields": [
{
- "name": "num_tokens",
- "lite_name": "nt",
- "semantic_type": "string",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": false,
- "example": "'1500.0'",
- "comment": [
- "The number of tokens to transfer"
- ]
- },
- {
- "name": "signature",
- "lite_name": "s",
- "semantic_type": "Signature",
- "json_type": "Signature",
- "index": 7,
+ "index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The signature of the transfer"
+ "The subaccount ID cancelling the orders for"
]
},
{
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
+ "name": "countdown_time",
+ "lite_name": "ct",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 8,
+ "index": 1,
"array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
+ "optional": true,
+ "default": "1000",
+ "example": "300",
"comment": [
- "The timestamp of the transfer in unix nanoseconds"
+ "Countdown time in milliseconds (ex. 120000 for 120s).",
+ "",
+ "0 to disable the timer.",
+ "",
+ "Does not accept negative values.",
+ "",
+ "Minimum acceptable value is 1,000.",
+ "",
+ "Maximum acceptable value is 300,000"
]
- },
+ }
+ ],
+ "comment": [
+ "Auto-Cancel All Open Orders when the countdown time hits zero.",
+ "",
+ "Market Maker inputs a countdown time parameter in milliseconds (e.g. 120000 for 120s) rounded down to the smallest second follows the following logic:",
+ " - Market Maker initially entered a value between 0 -\u003e 1000, which is rounded to 0: will result in termination of their COD",
+ " - Market Maker initially entered a value between 1001 -\u003e 300_000, which is rounded to the nearest second: will result in refresh of their COD",
+ " - Market Maker initially entered a value bigger than 300_000, which will result in error (upper bound)",
+ "Market Maker will send a heartbeat message by calling the endpoint at specific intervals (ex. every 30 seconds) to the server to refresh the count down.",
+ "",
+ "If the server does not receive a heartbeat message within the countdown time, it will cancel all open orders for the specified Sub Account ID."
+ ]
+ },
+ {
+ "name": "WSOrderFeedSelectorV1",
+ "is_root": true,
+ "fields": [
{
- "name": "transfer_type",
- "lite_name": "tt",
- "semantic_type": "TransferType",
- "json_type": "TransferType",
- "index": 9,
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The type of transfer"
- ]
+ "The subaccount ID to filter by"
+ ],
+ "selector": "primary"
},
{
- "name": "transfer_metadata",
- "lite_name": "tm",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
- "index": 10,
+ "index": 1,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "'all'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The metadata of the transfer"
- ]
+ "The instrument filter to apply."
+ ],
+ "selector": "primary"
}
],
- "comment": []
+ "comment": [
+ "Subscribes to a feed of order updates pertaining to orders made by your account.",
+ "Each Order can be uniquely identified by its `order_id` or `client_order_id`.",
+ "To subscribe to all orders, specify an empty `instrument` (eg. `2345123`).",
+ "Otherwise, specify the `instrument` to only receive orders for that instrument (eg. `2345123-BTC_USDT_Perp`)."
+ ]
},
{
- "name": "WSTransferFeedDataV1",
+ "name": "WSOrderFeedDataV1",
"is_root": true,
"fields": [
{
@@ -13627,9 +8258,9 @@
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.transfer'",
+ "example": "'v1.order'",
"comment": [
- "The websocket channel to which the response is sent"
+ "Stream name"
]
},
{
@@ -13666,13 +8297,13 @@
{
"name": "feed",
"lite_name": "f",
- "semantic_type": "TransferHistory",
- "json_type": "TransferHistory",
+ "semantic_type": "Order",
+ "json_type": "Order",
"index": 3,
"array_depth": 0,
"optional": false,
"comment": [
- "The transfer history matching the requested filters"
+ "The order object being created or updated"
]
},
{
@@ -13689,95 +8320,97 @@
]
}
],
- "comment": [
- "Subscribes to a feed of transfer updates."
- ]
+ "comment": []
},
{
- "name": "WSDepositFeedSelectorV1",
+ "name": "WSOrderStateFeedSelectorV1",
"is_root": true,
"fields": [
{
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "address",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'$GRVT_MAIN_ACCOUNT_ID'",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The main account ID to request for"
+ "The subaccount ID to filter by"
+ ],
+ "selector": "primary"
+ },
+ {
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": true,
+ "default": "'all'",
+ "example": "'BTC_USDT_Perp'",
+ "comment": [
+ "The instrument filter to apply."
],
"selector": "primary"
}
],
"comment": [
- "Subscribes to a feed of deposits. This will execute when there is any deposit to selected account.",
- "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`)."
+ "Subscribes to a feed of order updates pertaining to orders made by your account.",
+ "Unlike the Order Stream, this only streams state updates, drastically improving throughput, and latency.",
+ "Each Order can be uniquely identified by its `order_id` or `client_order_id`.",
+ "To subscribe to all orders, specify an empty `instrument` (eg. `2345123`).",
+ "Otherwise, specify the `instrument` to only receive orders for that instrument (eg. `2345123-BTC_USDT_Perp`)."
]
},
{
- "name": "Deposit",
+ "name": "OrderStateFeed",
"is_root": false,
"fields": [
{
- "name": "tx_hash",
- "lite_name": "th",
- "semantic_type": "uint256",
+ "name": "order_id",
+ "lite_name": "oi",
+ "semantic_type": "uint128",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'0x1234567890123456789012345678901234567890123456789012345678901234'",
- "comment": [
- "The hash of the bridgemint event producing the deposit"
- ]
- },
- {
- "name": "to_account_id",
- "lite_name": "ta",
- "semantic_type": "address",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
+ "example": "'10000101000203040506'",
"comment": [
- "The account to deposit into"
+ "A unique 128-bit identifier for the order, deterministically generated within the GRVT backend"
]
- },
- {
- "name": "currency",
- "lite_name": "c",
- "semantic_type": "Currency",
- "json_type": "Currency",
- "index": 2,
+ },
+ {
+ "name": "client_order_id",
+ "lite_name": "co",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "'USDT'",
+ "example": "'23042'",
"comment": [
- "The token currency to deposit"
+ "A unique identifier for the active order within a subaccount, specified by the client"
]
},
{
- "name": "num_tokens",
- "lite_name": "nt",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
+ "name": "order_state",
+ "lite_name": "os",
+ "semantic_type": "OrderState",
+ "json_type": "OrderState",
+ "index": 2,
"array_depth": 0,
"optional": false,
- "example": "'10.50'",
"comment": [
- "The number of tokens to deposit"
+ "The order state object being created or updated"
]
}
],
"comment": []
},
{
- "name": "WSDepositFeedDataV1",
+ "name": "WSOrderStateFeedDataV1",
"is_root": true,
"fields": [
{
@@ -13788,9 +8421,9 @@
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.deposit'",
+ "example": "'v1.state'",
"comment": [
- "The websocket channel to which the response is sent"
+ "Stream name"
]
},
{
@@ -13827,13 +8460,13 @@
{
"name": "feed",
"lite_name": "f",
- "semantic_type": "Deposit",
- "json_type": "Deposit",
+ "semantic_type": "OrderStateFeed",
+ "json_type": "OrderStateFeed",
"index": 3,
"array_depth": 0,
"optional": false,
"comment": [
- "The Deposit object"
+ "The Order State Feed"
]
},
{
@@ -13850,107 +8483,167 @@
]
}
],
- "comment": [
- "Subscribes to a feed of deposit updates."
- ]
+ "comment": []
},
{
- "name": "WSWithdrawalFeedSelectorV1",
+ "name": "WSPositionsFeedSelectorV1",
"is_root": true,
"fields": [
{
- "name": "main_account_id",
- "lite_name": "ma",
- "semantic_type": "address",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'$GRVT_MAIN_ACCOUNT_ID'",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "The main account ID to request for"
+ "The subaccount ID to filter by"
+ ],
+ "selector": "primary"
+ },
+ {
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": true,
+ "default": "'all'",
+ "example": "'BTC_USDT_Perp'",
+ "comment": [
+ "The instrument filter to apply."
],
"selector": "primary"
}
],
"comment": [
- "Subscribes to a feed of withdrawals. This will execute when there is any withdrawal from the selected account.",
- "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`)."
+ "Subscribes to a feed of position updates.",
+ "Updates get published when a trade is executed, and when leverage configurations are changed for instruments with ongoing positions.",
+ "To subscribe to all positions, specify an empty `instrument` (eg. `2345123`).",
+ "Otherwise, specify the `instrument` to only receive positions for that instrument (eg. `2345123-BTC_USDT_Perp`)."
]
},
{
- "name": "Withdrawal",
- "is_root": false,
+ "name": "WSPositionsFeedDataV1",
+ "is_root": true,
"fields": [
{
- "name": "from_account_id",
- "lite_name": "fa",
- "semantic_type": "address",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
+ "example": "'v1.position'",
"comment": [
- "The subaccount to withdraw from"
+ "Stream name"
]
},
{
- "name": "to_eth_address",
- "lite_name": "te",
- "semantic_type": "address",
+ "name": "selector",
+ "lite_name": "s1",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The ethereum address to withdraw to"
+ "Primary selector"
]
},
{
- "name": "currency",
- "lite_name": "c",
- "semantic_type": "Currency",
- "json_type": "Currency",
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
+ "json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'USDT'",
+ "example": "'872634876'",
"comment": [
- "The token currency to withdraw"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "num_tokens",
- "lite_name": "nt",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "Positions",
+ "json_type": "Positions",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "'10.50'",
"comment": [
- "The number of tokens to withdraw"
+ "A Position being created or updated matching the request filter"
]
},
{
- "name": "signature",
- "lite_name": "s",
- "semantic_type": "Signature",
- "json_type": "Signature",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
+ "json_type": "string",
"index": 4,
"array_depth": 0,
"optional": false,
+ "example": "'872634875'",
"comment": [
- "The signature of the withdrawal"
+ "The previous sequence number that determines the message order"
]
}
],
"comment": []
},
{
- "name": "WSWithdrawalFeedDataV1",
+ "name": "WSFillFeedSelectorV1",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 0,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "comment": [
+ "The sub account ID to request for"
+ ],
+ "selector": "primary"
+ },
+ {
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": true,
+ "default": "'all'",
+ "example": "'BTC_USDT_Perp'",
+ "comment": [
+ "The instrument filter to apply."
+ ],
+ "selector": "primary"
+ }
+ ],
+ "comment": [
+ "Subscribes to a feed of private trade updates. This happens when a trade is executed.",
+ "To subscribe to all private trades, specify an empty `instrument` (eg. `2345123`).",
+ "Otherwise, specify the `instrument` to only receive private trades for that instrument (eg. `2345123-BTC_USDT_Perp`)."
+ ]
+ },
+ {
+ "name": "WSFillFeedDataV1",
"is_root": true,
"fields": [
{
@@ -13961,7 +8654,7 @@
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.withdrawal'",
+ "example": "'v1.fill'",
"comment": [
"The websocket channel to which the response is sent"
]
@@ -14000,13 +8693,13 @@
{
"name": "feed",
"lite_name": "f",
- "semantic_type": "Withdrawal",
- "json_type": "Withdrawal",
+ "semantic_type": "Fill",
+ "json_type": "Fill",
"index": 3,
"array_depth": 0,
"optional": false,
"comment": [
- "The Withdrawal object"
+ "A private trade matching the request filter"
]
},
{
@@ -14023,224 +8716,197 @@
]
}
],
+ "comment": []
+ },
+ {
+ "name": "WSTransferFeedSelectorV1",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "main_account_id",
+ "lite_name": "ma",
+ "semantic_type": "address",
+ "json_type": "string",
+ "index": 0,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'$GRVT_MAIN_ACCOUNT_ID'",
+ "comment": [
+ "The main account ID to request for"
+ ],
+ "selector": "primary"
+ },
+ {
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": true,
+ "default": "'0'",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "comment": [
+ "The sub account ID to request for"
+ ],
+ "selector": "primary"
+ }
+ ],
"comment": [
- "Subscribes to a feed of withdrawal updates."
+ "Subscribes to a feed of transfers. This will execute when there is any transfer to or from the selected account.",
+ "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`).",
+ "To subscribe to a sub account, specify the main account and the sub account dash separated (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a-1920109784202388`)."
]
},
{
- "name": "CancelStatusFeed",
+ "name": "TransferHistory",
"is_root": false,
"fields": [
{
- "name": "sub_account_id",
- "lite_name": "sa",
+ "name": "tx_id",
+ "lite_name": "ti",
"semantic_type": "uint64",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "example": "'1028403'",
"comment": [
- "The subaccount ID that requested the cancellation"
+ "The transaction ID of the transfer"
]
},
{
- "name": "client_order_id",
- "lite_name": "co",
- "semantic_type": "uint64",
+ "name": "from_account_id",
+ "lite_name": "fa",
+ "semantic_type": "address",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'23042'",
+ "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
"comment": [
- "A unique identifier for the active order within a subaccount, specified by the client"
+ "The account to transfer from"
]
},
{
- "name": "order_id",
- "lite_name": "oi",
- "semantic_type": "uint128",
+ "name": "from_sub_account_id",
+ "lite_name": "fs",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'10000101000203040506'",
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "A unique 128-bit identifier for the order, deterministically generated within the GRVT backend"
+ "The subaccount to transfer from (0 if transferring from main account)"
]
},
{
- "name": "reason",
- "lite_name": "r",
- "semantic_type": "OrderRejectReason",
- "json_type": "OrderRejectReason",
+ "name": "to_account_id",
+ "lite_name": "ta",
+ "semantic_type": "address",
+ "json_type": "string",
"index": 3,
"array_depth": 0,
"optional": false,
+ "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
"comment": [
- "The user-provided reason for cancelling the order"
+ "The account to deposit into"
]
},
{
- "name": "update_time",
- "lite_name": "ut",
- "semantic_type": "timestamp",
+ "name": "to_sub_account_id",
+ "lite_name": "ts",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 4,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
+ "optional": false,
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "[Filled by GRVT Backend] Time at which the cancellation status was updated by GRVT in unix nanoseconds"
+ "The subaccount to transfer to (0 if transferring to main account)"
]
},
{
- "name": "cancel_status",
- "lite_name": "cs",
- "semantic_type": "CancelStatus",
- "json_type": "CancelStatus",
+ "name": "currency",
+ "lite_name": "c",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 5,
"array_depth": 0,
"optional": false,
+ "example": "'USDT'",
"comment": [
- "Status of the cancellation attempt"
+ "The token currency to transfer"
]
- }
- ],
- "comment": []
- },
- {
- "name": "WSCancelFeedDataV1",
- "is_root": true,
- "fields": [
+ },
{
- "name": "stream",
- "lite_name": "s",
+ "name": "num_tokens",
+ "lite_name": "nt",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 6,
"array_depth": 0,
"optional": false,
- "example": "'v1.cancel'",
+ "example": "'1500.0'",
"comment": [
- "Stream name"
+ "The number of tokens to transfer"
]
},
{
- "name": "selector",
- "lite_name": "s1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
+ "name": "signature",
+ "lite_name": "s",
+ "semantic_type": "Signature",
+ "json_type": "Signature",
+ "index": 7,
"array_depth": 0,
"optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "Primary selector"
+ "The signature of the transfer"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
"json_type": "string",
- "index": 2,
+ "index": 8,
"array_depth": 0,
"optional": false,
- "example": "'872634876'",
+ "example": "'1697788800000000000'",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "The timestamp of the transfer in unix nanoseconds"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "CancelStatusFeed",
- "json_type": "CancelStatusFeed",
- "index": 3,
+ "name": "transfer_type",
+ "lite_name": "tt",
+ "semantic_type": "TransferType",
+ "json_type": "TransferType",
+ "index": 9,
"array_depth": 0,
"optional": false,
"comment": [
- "Data relating to the status of the cancellation attempt"
+ "The type of transfer"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
+ "name": "transfer_metadata",
+ "lite_name": "tm",
+ "semantic_type": "string",
"json_type": "string",
- "index": 4,
+ "index": 10,
"array_depth": 0,
"optional": false,
- "example": "'872634875'",
"comment": [
- "The previous sequence number that determines the message order"
+ "The metadata of the transfer"
]
}
],
"comment": []
},
{
- "name": "WSCancelFeedSelectorV1",
- "is_root": true,
- "fields": [
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The subaccount ID to filter by"
- ],
- "selector": "primary"
- }
- ],
- "comment": [
- "Subscribes to a feed of time-to-live expiry events for order cancellations requested by a given subaccount.",
- "**This stream presently only provides expiry updates for cancel-order requests set with a valid TTL value**.",
- "Successful order cancellations will reflect as updates published to the [order-state stream](https://api-docs.grvt.io/trading_streams/#order-state).",
- "_A future release will expand the functionality of this stream to provide more general status updates on order cancellation requests._",
- "Each Order can be uniquely identified by its `client_order_id`.",
- ""
- ]
- },
- {
- "name": "WSOrderGroupFeedSelectorV1",
- "is_root": true,
- "fields": [
- {
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
- "comment": [
- "The subaccount ID to filter by"
- ],
- "selector": "primary"
- }
- ],
- "comment": [
- "Subscribes to a feed of order group to get updated when a new group is created for the subAccount specified.",
- ""
- ]
- },
- {
- "name": "WSOrderGroupFeedDataV1",
+ "name": "WSTransferFeedDataV1",
"is_root": true,
"fields": [
{
@@ -14251,9 +8917,9 @@
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.group'",
+ "example": "'v1.transfer'",
"comment": [
- "Stream name"
+ "The websocket channel to which the response is sent"
]
},
{
@@ -14264,7 +8930,7 @@
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'$GRVT_SUB_ACCOUNT_ID'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
"Primary selector"
]
@@ -14290,13 +8956,13 @@
{
"name": "feed",
"lite_name": "f",
- "semantic_type": "ClientOrderIDsByGroup",
- "json_type": "ClientOrderIDsByGroup",
+ "semantic_type": "TransferHistory",
+ "json_type": "TransferHistory",
"index": 3,
"array_depth": 0,
"optional": false,
"comment": [
- "The order object being created or updated"
+ "The transfer history matching the requested filters"
]
},
{
@@ -14313,10 +8979,12 @@
]
}
],
- "comment": []
+ "comment": [
+ "Subscribes to a feed of transfer updates."
+ ]
},
{
- "name": "ApiDropClientWsRequest",
+ "name": "WSDepositFeedSelectorV1",
"is_root": true,
"fields": [
{
@@ -14327,584 +8995,514 @@
"index": 0,
"array_depth": 0,
"optional": false,
- "comment": []
- }
- ],
- "comment": []
- },
- {
- "name": "ApiDropClientWsResponse",
- "is_root": true,
- "fields": [
- {
- "name": "num_dropped",
- "lite_name": "nd",
- "semantic_type": "int32",
- "json_type": "integer",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "comment": []
- }
- ],
- "comment": []
- },
- {
- "name": "MarginTierResponse",
- "is_root": true,
- "fields": [
- {
- "name": "lower_bound",
- "lite_name": "lb",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "comment": []
- },
- {
- "name": "rate",
- "lite_name": "r",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "comment": []
- }
- ],
- "comment": []
- },
- {
- "name": "AssetMarginTierResponse",
- "is_root": true,
- "fields": [
- {
- "name": "asset",
- "lite_name": "a",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "comment": []
- },
- {
- "name": "tiers",
- "lite_name": "t",
- "semantic_type": "MarginTierResponse",
- "json_type": "MarginTierResponse",
- "index": 1,
- "array_depth": 1,
- "optional": false,
- "comment": []
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetMarginTiersResponse",
- "is_root": true,
- "fields": [
- {
- "name": "results",
- "lite_name": "r",
- "semantic_type": "AssetMarginTierResponse",
- "json_type": "AssetMarginTierResponse",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": []
+ "example": "'$GRVT_MAIN_ACCOUNT_ID'",
+ "comment": [
+ "The main account ID to request for"
+ ],
+ "selector": "primary"
}
],
- "comment": []
+ "comment": [
+ "Subscribes to a feed of deposits. This will execute when there is any deposit to selected account.",
+ "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`)."
+ ]
},
{
- "name": "SessionInformation",
- "is_root": true,
+ "name": "Deposit",
+ "is_root": false,
"fields": [
{
- "name": "country_code",
- "lite_name": "cc",
- "semantic_type": "string",
+ "name": "tx_hash",
+ "lite_name": "th",
+ "semantic_type": "uint256",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'0x1234567890123456789012345678901234567890123456789012345678901234'",
"comment": [
- "country code of user based on IP address"
+ "The hash of the bridgemint event producing the deposit"
]
},
{
- "name": "client_session_id",
- "lite_name": "cs",
- "semantic_type": "string",
+ "name": "to_account_id",
+ "lite_name": "ta",
+ "semantic_type": "address",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
+ "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
"comment": [
- "unique identity of the session generated from client"
+ "The account to deposit into"
]
},
{
- "name": "device_screen_size",
- "lite_name": "ds",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "currency",
+ "lite_name": "c",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 2,
"array_depth": 0,
"optional": false,
+ "example": "'USDT'",
"comment": [
- "screen size"
+ "The token currency to deposit"
]
},
{
- "name": "device_os",
- "lite_name": "do",
+ "name": "num_tokens",
+ "lite_name": "nt",
"semantic_type": "string",
"json_type": "string",
"index": 3,
"array_depth": 0,
"optional": false,
+ "example": "'10.50'",
"comment": [
- "OS of user's device"
- ]
- },
- {
- "name": "device_os_version",
- "lite_name": "do1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": false,
- "comment": [
- "OS version of user's device"
+ "The number of tokens to deposit"
]
}
],
"comment": []
},
{
- "name": "UserVaultCategoryEventPayLoad",
+ "name": "WSDepositFeedDataV1",
"is_root": true,
"fields": [
{
- "name": "category_id",
- "lite_name": "ci",
+ "name": "stream",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'v1.deposit'",
"comment": [
- "category ID of event"
+ "The websocket channel to which the response is sent"
]
},
{
- "name": "vault_id",
- "lite_name": "vi",
+ "name": "selector",
+ "lite_name": "s1",
"semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "vault ID"
+ "Primary selector"
]
},
{
- "name": "action",
- "lite_name": "a",
- "semantic_type": "string",
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
+ "example": "'872634876'",
"comment": [
- "action of event. search/filter/invest..."
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "num_bumps",
- "lite_name": "nb",
- "semantic_type": "int64",
- "json_type": "string",
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "Deposit",
+ "json_type": "Deposit",
"index": 3,
"array_depth": 0,
"optional": false,
"comment": [
- "number of bumps in this event. default 1"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiUserCategoryAffinityScoreRequest",
- "is_root": true,
- "fields": [
- {
- "name": "account_id",
- "lite_name": "ai",
- "semantic_type": "string",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'ACC_1234567890'",
- "comment": [
- "The off chain account id"
+ "The Deposit object"
]
},
{
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 1,
+ "index": 4,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'872634875'",
"comment": [
- "The start time of query. Can leave empty to query from the beginning"
+ "The previous sequence number that determines the message order"
]
- },
+ }
+ ],
+ "comment": [
+ "Subscribes to a feed of deposit updates."
+ ]
+ },
+ {
+ "name": "WSWithdrawalFeedSelectorV1",
+ "is_root": true,
+ "fields": [
{
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
+ "name": "main_account_id",
+ "lite_name": "ma",
+ "semantic_type": "address",
"json_type": "string",
- "index": 2,
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'$GRVT_MAIN_ACCOUNT_ID'",
"comment": [
- "The end time of query. Can leave empty to query until now"
- ]
+ "The main account ID to request for"
+ ],
+ "selector": "primary"
}
],
- "comment": []
+ "comment": [
+ "Subscribes to a feed of withdrawals. This will execute when there is any withdrawal from the selected account.",
+ "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`)."
+ ]
},
{
- "name": "UserCategoryAffinityScore",
+ "name": "Withdrawal",
"is_root": false,
"fields": [
{
- "name": "account_id",
- "lite_name": "ai",
- "semantic_type": "string",
+ "name": "from_account_id",
+ "lite_name": "fa",
+ "semantic_type": "address",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'ACC_1234567890'",
+ "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
"comment": [
- "The off chain account id"
+ "The subaccount to withdraw from"
]
},
{
- "name": "category_id",
- "lite_name": "ci",
- "semantic_type": "string",
+ "name": "to_eth_address",
+ "lite_name": "te",
+ "semantic_type": "address",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
+ "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'",
"comment": [
- "target category"
+ "The ethereum address to withdraw to"
]
},
{
- "name": "affinity_score",
- "lite_name": "as",
- "semantic_type": "float64",
- "json_type": "number",
+ "name": "currency",
+ "lite_name": "c",
+ "semantic_type": "Currency",
+ "json_type": "Currency",
"index": 2,
"array_depth": 0,
"optional": false,
+ "example": "'USDT'",
"comment": [
- "affinity score"
- ]
- }
- ],
- "comment": [
- ""
- ]
- },
- {
- "name": "ApiUserCategoryAffinityScoreResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "UserCategoryAffinityScore",
- "json_type": "UserCategoryAffinityScore",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The list of categoryAffinities score"
+ "The token currency to withdraw"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiCategoryAffinityScoreRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
+ "name": "num_tokens",
+ "lite_name": "nt",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 3,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'10.50'",
"comment": [
- "The start time of query. Can leave empty to query from the beginning"
+ "The number of tokens to withdraw"
]
},
{
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 1,
+ "name": "signature",
+ "lite_name": "s",
+ "semantic_type": "Signature",
+ "json_type": "Signature",
+ "index": 4,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "The end time of query. Can leave empty to query until now"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiCategoryAffinityScoreResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "UserCategoryAffinityScore",
- "json_type": "UserCategoryAffinityScore",
- "index": 0,
- "array_depth": 1,
- "optional": false,
"comment": [
- "The list of categoryAffinities score"
+ "The signature of the withdrawal"
]
}
],
"comment": []
},
{
- "name": "UserTrackingEvent",
+ "name": "WSWithdrawalFeedDataV1",
"is_root": true,
"fields": [
{
- "name": "event_id",
- "lite_name": "ei",
+ "name": "stream",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'v1.withdrawal'",
"comment": [
- "uuid for event"
+ "The websocket channel to which the response is sent"
]
},
{
- "name": "tracking_version",
- "lite_name": "tv",
- "semantic_type": "int32",
- "json_type": "integer",
+ "name": "selector",
+ "lite_name": "s1",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "version of tracking"
+ "Primary selector"
]
},
{
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'872634876'",
"comment": [
- "timestamp of event"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "event_type",
- "lite_name": "et1",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "Withdrawal",
+ "json_type": "Withdrawal",
"index": 3,
"array_depth": 0,
"optional": false,
"comment": [
- "event type"
+ "The Withdrawal object"
]
},
{
- "name": "event_sub_type",
- "lite_name": "es",
- "semantic_type": "string",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 4,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'872634875'",
+ "comment": [
+ "The previous sequence number that determines the message order"
+ ]
+ }
+ ],
+ "comment": [
+ "Subscribes to a feed of withdrawal updates."
+ ]
+ },
+ {
+ "name": "CancelStatusFeed",
+ "is_root": false,
+ "fields": [
+ {
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 4,
+ "index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "event sub type"
+ "The subaccount ID that requested the cancellation"
]
},
{
- "name": "client_session_id",
- "lite_name": "cs",
- "semantic_type": "string",
+ "name": "client_order_id",
+ "lite_name": "co",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 5,
+ "index": 1,
"array_depth": 0,
"optional": false,
+ "example": "'23042'",
"comment": [
- "unique identity of the session generated from client"
+ "A unique identifier for the active order within a subaccount, specified by the client"
]
},
{
- "name": "device_os",
- "lite_name": "do",
- "semantic_type": "string",
+ "name": "order_id",
+ "lite_name": "oi",
+ "semantic_type": "uint128",
"json_type": "string",
- "index": 6,
+ "index": 2,
"array_depth": 0,
"optional": false,
+ "example": "'10000101000203040506'",
"comment": [
- "OS of user's device"
+ "A unique 128-bit identifier for the order, deterministically generated within the GRVT backend"
]
},
{
- "name": "device_os_version",
- "lite_name": "do1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 7,
+ "name": "reason",
+ "lite_name": "r",
+ "semantic_type": "OrderRejectReason",
+ "json_type": "OrderRejectReason",
+ "index": 3,
"array_depth": 0,
"optional": false,
"comment": [
- "OS version of user's device"
+ "The user-provided reason for cancelling the order"
]
},
{
- "name": "sub_account_id",
- "lite_name": "sa",
- "semantic_type": "string",
+ "name": "update_time",
+ "lite_name": "ut",
+ "semantic_type": "timestamp",
"json_type": "string",
- "index": 8,
+ "index": 4,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "0",
+ "example": "'1697788800000000000'",
"comment": [
- "sub account id"
+ "[Filled by GRVT Backend] Time at which the cancellation status was updated by GRVT in unix nanoseconds"
]
},
{
- "name": "trading_address",
- "lite_name": "ta",
- "semantic_type": "string",
- "json_type": "string",
- "index": 9,
+ "name": "cancel_status",
+ "lite_name": "cs",
+ "semantic_type": "CancelStatus",
+ "json_type": "CancelStatus",
+ "index": 5,
"array_depth": 0,
"optional": false,
"comment": [
- "trading session key"
+ "Status of the cancellation attempt"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "WSCancelFeedDataV1",
+ "is_root": true,
+ "fields": [
{
- "name": "screen_size",
- "lite_name": "ss",
+ "name": "stream",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
- "index": 10,
+ "index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'v1.cancel'",
"comment": [
- "screen size"
+ "Stream name"
]
},
{
- "name": "event_data",
- "lite_name": "ed",
+ "name": "selector",
+ "lite_name": "s1",
"semantic_type": "string",
"json_type": "string",
- "index": 11,
+ "index": 1,
"array_depth": 0,
"optional": false,
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "event data"
+ "Primary selector"
]
},
{
- "name": "user_id",
- "lite_name": "ui",
- "semantic_type": "string",
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 12,
+ "index": 2,
"array_depth": 0,
"optional": false,
+ "example": "'872634876'",
"comment": [
- "user id"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "account_id",
- "lite_name": "ai",
- "semantic_type": "string",
- "json_type": "string",
- "index": 13,
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "CancelStatusFeed",
+ "json_type": "CancelStatusFeed",
+ "index": 3,
"array_depth": 0,
"optional": false,
"comment": [
- "account id"
+ "Data relating to the status of the cancellation attempt"
]
},
{
- "name": "auth_session_hash",
- "lite_name": "as",
- "semantic_type": "string",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 14,
+ "index": 4,
"array_depth": 0,
"optional": false,
+ "example": "'872634875'",
"comment": [
- "auth session hash of the authenticated session on backend"
+ "The previous sequence number that determines the message order"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "WSCancelFeedSelectorV1",
+ "is_root": true,
+ "fields": [
{
- "name": "country_code",
- "lite_name": "cc",
- "semantic_type": "string",
+ "name": "sub_account_id",
+ "lite_name": "sa",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 15,
+ "index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'$GRVT_SUB_ACCOUNT_ID'",
"comment": [
- "country code of user based on IP address"
- ]
+ "The subaccount ID to filter by"
+ ],
+ "selector": "primary"
}
],
"comment": [
- "event of user"
+ "Subscribes to a feed of time-to-live expiry events for order cancellations requested by a given subaccount.",
+ "**This stream presently only provides expiry updates for cancel-order requests set with a valid TTL value**.",
+ "Successful order cancellations will reflect as updates published to the [order-state stream](https://api-docs.grvt.io/trading_streams/#order-state).",
+ "_A future release will expand the functionality of this stream to provide more general status updates on order cancellation requests._",
+ "Each Order can be uniquely identified by its `client_order_id`.",
+ ""
]
},
{
@@ -15118,6 +9716,60 @@
""
]
},
+ {
+ "name": "ApiTransferAck",
+ "is_root": false,
+ "fields": [
+ {
+ "name": "ack",
+ "lite_name": "a",
+ "semantic_type": "bool",
+ "json_type": "boolean",
+ "index": 0,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'true'",
+ "comment": [
+ "Gravity has acknowledged that the transfer has been successfully processed. If true, a `tx_id` will be returned. If false, an error will be returned."
+ ]
+ },
+ {
+ "name": "tx_id",
+ "lite_name": "ti",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'1028403'",
+ "comment": [
+ "The transaction ID of the transfer. This is only returned if the transfer is successful."
+ ]
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiTransferResponse",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "ApiTransferAck",
+ "json_type": "ApiTransferAck",
+ "index": 0,
+ "array_depth": 0,
+ "optional": false,
+ "comment": [
+ "The Transfer response object"
+ ]
+ }
+ ],
+ "comment": [
+ "Used to acknowledge a transfer request outcome"
+ ]
+ },
{
"name": "ApiDepositHistoryRequest",
"is_root": true,
@@ -15596,7 +10248,7 @@
},
{
"name": "WithdrawalHistory",
- "is_root": true,
+ "is_root": false,
"fields": [
{
"name": "tx_id",
@@ -15735,6 +10387,13 @@
"comment": [
"XY Bridge type"
]
+ },
+ {
+ "name": "RHINO",
+ "value": 2,
+ "comment": [
+ "Rhino Bridge type"
+ ]
}
],
"comment": []
@@ -16653,6 +11312,20 @@
"comment": [
"the OCO counter part order was triggered"
]
+ },
+ {
+ "name": "REDUCE_ONLY_LIMIT",
+ "value": 31,
+ "comment": [
+ "the remaining order size was cancelled because it exceeded current position size"
+ ]
+ },
+ {
+ "name": "CLIENT_REPLACE",
+ "value": 32,
+ "comment": [
+ "the order was replaced by a client replace request"
+ ]
}
],
"comment": []
@@ -16810,6 +11483,13 @@
"comment": [
"FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it"
]
+ },
+ {
+ "name": "RETAIL_PRICE_IMPROVEMENT",
+ "value": 5,
+ "comment": [
+ "RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users."
+ ]
}
],
"comment": [
@@ -16820,6 +11500,42 @@
""
]
},
+ {
+ "name": "TimeInterval",
+ "values": [
+ {
+ "name": "INTERVAL_1_D",
+ "value": 1,
+ "comment": [
+ "1 day"
+ ]
+ },
+ {
+ "name": "INTERVAL_7_D",
+ "value": 2,
+ "comment": [
+ "7 days"
+ ]
+ },
+ {
+ "name": "INTERVAL_30_D",
+ "value": 3,
+ "comment": [
+ "30 days"
+ ]
+ },
+ {
+ "name": "INTERVAL_90_D",
+ "value": 4,
+ "comment": [
+ "90 days"
+ ]
+ }
+ ],
+ "comment": [
+ "Time interval can be used as a filter in metric/portfolio management APIs"
+ ]
+ },
{
"name": "TransferType",
"values": [
@@ -16843,6 +11559,20 @@
"comment": [
"Fast Arb Withdrawal Metadata type"
]
+ },
+ {
+ "name": "NON_NATIVE_BRIDGE_DEPOSIT",
+ "value": 4,
+ "comment": [
+ "Transfer type for non native bridging deposit"
+ ]
+ },
+ {
+ "name": "NON_NATIVE_BRIDGE_WITHDRAWAL",
+ "value": 5,
+ "comment": [
+ "Transfer type for non native bridging withdrawal"
+ ]
}
],
"comment": []
@@ -16913,6 +11643,26 @@
""
]
},
+ {
+ "name": "VaultType",
+ "values": [
+ {
+ "name": "PRIME",
+ "value": 1,
+ "comment": [
+ "Prime vault"
+ ]
+ },
+ {
+ "name": "LAUNCH_PAD",
+ "value": 2,
+ "comment": [
+ "Launchpad vault"
+ ]
+ }
+ ],
+ "comment": []
+ },
{
"name": "Venue",
"values": [