From 98c0f829fcda70c79944c257198dee778cc661e7 Mon Sep 17 00:00:00 2001 From: thangnguyen-19 Date: Wed, 9 Apr 2025 17:12:00 +0700 Subject: [PATCH 1/4] [RFC] Update API docs and specs --- .../schemas/api_cancel_order_response.md | 2 +- .../schemas/api_create_bulk_orders_request.md | 2 +- .../api_create_bulk_orders_response.md | 2 +- .../schemas/api_create_order_request.md | 2 +- .../schemas/api_create_order_response.md | 2 +- .../schemas/api_deposit_history_request.md | 1 + .../schemas/api_drop_client_ws_request.md | 4 + .../schemas/api_drop_client_ws_response.md | 4 + .../api_get_ecosystem_leaderboard_response.md | 3 + .../api_get_list_flat_referral_response.md | 1 + .../schemas/api_get_margin_tiers_response.md | 14 + .../apidocs/schemas/api_get_order_response.md | 2 +- .../api_get_user_ecosystem_point_response.md | 3 + .../schemas/api_open_orders_response.md | 2 +- .../schemas/api_order_history_response.md | 2 +- .../schemas/api_pre_order_check_request.md | 2 +- .../api_query_trading_performance_request.md | 7 + .../api_query_trading_performance_response.md | 7 + ...i_sub_account_trade_aggregation_request.md | 1 + ..._sub_account_trade_aggregation_response.md | 1 + .../schemas/api_transfer_history_request.md | 1 + .../schemas/api_withdrawal_history_request.md | 1 + .../schemas/asset_margin_tier_response.md | 10 + artifacts/apidocs/schemas/ecosystem_point.md | 3 + artifacts/apidocs/schemas/flat_referral.md | 1 + .../apidocs/schemas/margin_tier_response.md | 5 + artifacts/apidocs/schemas/order.md | 2 +- artifacts/apidocs/schemas/order_metadata.md | 2 +- .../schemas/snap_funding_account_summary.md | 39 + .../schemas/sub_account_trade_aggregation.md | 1 + .../schemas/sub_account_trade_interval.md | 1 + .../apidocs/schemas/ws_cancel_feed_data_v1.md | 2 +- .../schemas/ws_candlestick_feed_data_v1.md | 2 +- .../schemas/ws_deposit_feed_data_v1.md | 2 +- .../apidocs/schemas/ws_fill_feed_data_v1.md | 2 +- .../schemas/ws_mini_ticker_feed_data_v1.md | 2 +- .../apidocs/schemas/ws_order_feed_data_v1.md | 4 +- .../schemas/ws_order_group_feed_data_v1.md | 2 +- .../schemas/ws_order_state_feed_data_v1.md | 2 +- .../ws_orderbook_levels_feed_data_v1.md | 2 +- .../schemas/ws_positions_feed_data_v1.md | 2 +- .../apidocs/schemas/ws_subscribe_params.md | 2 +- .../apidocs/schemas/ws_ticker_feed_data_v1.md | 2 +- .../apidocs/schemas/ws_trade_feed_data_v1.md | 2 +- .../schemas/ws_transfer_feed_data_v1.md | 2 +- .../apidocs/schemas/ws_unsubscribe_params.md | 2 +- .../schemas/ws_withdrawal_feed_data_v1.md | 2 +- artifacts/apidocs/trading_api.md | 10395 +++++++++------- artifacts/apidocs/trading_streams.md | 12 +- artifacts/pysdk/grvt_raw_async.py | 26 + artifacts/pysdk/grvt_raw_sync.py | 26 + artifacts/pysdk/grvt_raw_types.py | 237 +- src/codegen/apispec.json | 605 +- 53 files changed, 6667 insertions(+), 4798 deletions(-) create mode 100644 artifacts/apidocs/schemas/api_drop_client_ws_request.md create mode 100644 artifacts/apidocs/schemas/api_drop_client_ws_response.md create mode 100644 artifacts/apidocs/schemas/api_get_margin_tiers_response.md create mode 100644 artifacts/apidocs/schemas/api_query_trading_performance_request.md create mode 100644 artifacts/apidocs/schemas/api_query_trading_performance_response.md create mode 100644 artifacts/apidocs/schemas/asset_margin_tier_response.md create mode 100644 artifacts/apidocs/schemas/margin_tier_response.md create mode 100644 artifacts/apidocs/schemas/snap_funding_account_summary.md diff --git a/artifacts/apidocs/schemas/api_cancel_order_response.md b/artifacts/apidocs/schemas/api_cancel_order_response.md index 907c62b..5de6e3e 100644 --- a/artifacts/apidocs/schemas/api_cancel_order_response.md +++ b/artifacts/apidocs/schemas/api_cancel_order_response.md @@ -53,7 +53,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/api_create_bulk_orders_request.md b/artifacts/apidocs/schemas/api_create_bulk_orders_request.md index 27c45a7..b0068e9 100644 --- a/artifacts/apidocs/schemas/api_create_bulk_orders_request.md +++ b/artifacts/apidocs/schemas/api_create_bulk_orders_request.md @@ -55,7 +55,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/api_create_bulk_orders_response.md b/artifacts/apidocs/schemas/api_create_bulk_orders_response.md index 92826a1..64b7666 100644 --- a/artifacts/apidocs/schemas/api_create_bulk_orders_response.md +++ b/artifacts/apidocs/schemas/api_create_bulk_orders_response.md @@ -53,7 +53,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/api_create_order_request.md b/artifacts/apidocs/schemas/api_create_order_request.md index d64700e..b31f672 100644 --- a/artifacts/apidocs/schemas/api_create_order_request.md +++ b/artifacts/apidocs/schemas/api_create_order_request.md @@ -55,7 +55,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/api_create_order_response.md b/artifacts/apidocs/schemas/api_create_order_response.md index cf3ecf8..77d22fe 100644 --- a/artifacts/apidocs/schemas/api_create_order_response.md +++ b/artifacts/apidocs/schemas/api_create_order_response.md @@ -53,7 +53,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/api_deposit_history_request.md b/artifacts/apidocs/schemas/api_deposit_history_request.md index 8dd39d9..1027e1c 100644 --- a/artifacts/apidocs/schemas/api_deposit_history_request.md +++ b/artifacts/apidocs/schemas/api_deposit_history_request.md @@ -8,6 +8,7 @@ |end_time
`et` |string|False
`now()`|The end time to query for in unix nanoseconds| |limit
`l` |integer|False
`500`|The limit to query for. Defaults to 500; Max 1000| |cursor
`c1` |string|False
`''`|The cursor to indicate when to start the next query from| + |main_account_id
`ma` |string|False
``|Main account ID being queried. By default, applies the requestor's main account ID.| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/api_drop_client_ws_request.md b/artifacts/apidocs/schemas/api_drop_client_ws_request.md new file mode 100644 index 0000000..4fdfe35 --- /dev/null +++ b/artifacts/apidocs/schemas/api_drop_client_ws_request.md @@ -0,0 +1,4 @@ +!!! info "[ApiDropClientWsRequest](/../../schemas/api_drop_client_ws_request)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |main_account_id
`ma` |string|True|| diff --git a/artifacts/apidocs/schemas/api_drop_client_ws_response.md b/artifacts/apidocs/schemas/api_drop_client_ws_response.md new file mode 100644 index 0000000..8e7b4b5 --- /dev/null +++ b/artifacts/apidocs/schemas/api_drop_client_ws_response.md @@ -0,0 +1,4 @@ +!!! info "[ApiDropClientWsResponse](/../../schemas/api_drop_client_ws_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |num_dropped
`nd` |integer|True|| diff --git a/artifacts/apidocs/schemas/api_get_ecosystem_leaderboard_response.md b/artifacts/apidocs/schemas/api_get_ecosystem_leaderboard_response.md index 670d5f9..32f12c8 100644 --- a/artifacts/apidocs/schemas/api_get_ecosystem_leaderboard_response.md +++ b/artifacts/apidocs/schemas/api_get_ecosystem_leaderboard_response.md @@ -20,3 +20,6 @@ |rank
`r` |integer|True|The rank of the account in the ecosystem| |epoch
`e` |integer|True|The epoch number of the ecosystem point| |brokered_trading_volume
`bt` |string|True|Brokered trading volume| + |brokered_trading_point
`bt1` |string|True|Brokered trading point| + |referee_kyc_point
`rk` |string|True|Referee KYC point| + |referrer_kyc_point
`rk1` |string|True|Referrer KYC point| diff --git a/artifacts/apidocs/schemas/api_get_list_flat_referral_response.md b/artifacts/apidocs/schemas/api_get_list_flat_referral_response.md index 01d3d78..a8a914d 100644 --- a/artifacts/apidocs/schemas/api_get_list_flat_referral_response.md +++ b/artifacts/apidocs/schemas/api_get_list_flat_referral_response.md @@ -17,3 +17,4 @@ |is_kyc_completed
`ik` |boolean|True|The account is KYC verified or not| |kyc_completed_at
`kc` |string|True|The KYC completed time| |kyc_type
`kt` |string|True|The KYC type, can be 'individual' or 'business'| + |kyc_first_completed_at
`kf` |string|True|The first KYC completed time| diff --git a/artifacts/apidocs/schemas/api_get_margin_tiers_response.md b/artifacts/apidocs/schemas/api_get_margin_tiers_response.md new file mode 100644 index 0000000..636c01e --- /dev/null +++ b/artifacts/apidocs/schemas/api_get_margin_tiers_response.md @@ -0,0 +1,14 @@ +!!! info "[ApiGetMarginTiersResponse](/../../schemas/api_get_margin_tiers_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |results
`r` |[AssetMarginTierResponse]|True|| + ??? info "[AssetMarginTierResponse](/../../schemas/asset_margin_tier_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |asset
`a` |string|True|| + |tiers
`t` |[MarginTierResponse]|True|| + ??? info "[MarginTierResponse](/../../schemas/margin_tier_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |lower_bound
`lb` |string|True|| + |rate
`r` |string|True|| diff --git a/artifacts/apidocs/schemas/api_get_order_response.md b/artifacts/apidocs/schemas/api_get_order_response.md index 1b2a078..8a2f97b 100644 --- a/artifacts/apidocs/schemas/api_get_order_response.md +++ b/artifacts/apidocs/schemas/api_get_order_response.md @@ -53,7 +53,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/api_get_user_ecosystem_point_response.md b/artifacts/apidocs/schemas/api_get_user_ecosystem_point_response.md index 7261f56..69dc27e 100644 --- a/artifacts/apidocs/schemas/api_get_user_ecosystem_point_response.md +++ b/artifacts/apidocs/schemas/api_get_user_ecosystem_point_response.md @@ -20,3 +20,6 @@ |rank
`r` |integer|True|The rank of the account in the ecosystem| |epoch
`e` |integer|True|The epoch number of the ecosystem point| |brokered_trading_volume
`bt` |string|True|Brokered trading volume| + |brokered_trading_point
`bt1` |string|True|Brokered trading point| + |referee_kyc_point
`rk` |string|True|Referee KYC point| + |referrer_kyc_point
`rk1` |string|True|Referrer KYC point| diff --git a/artifacts/apidocs/schemas/api_open_orders_response.md b/artifacts/apidocs/schemas/api_open_orders_response.md index 6c6e5e0..4655df8 100644 --- a/artifacts/apidocs/schemas/api_open_orders_response.md +++ b/artifacts/apidocs/schemas/api_open_orders_response.md @@ -55,7 +55,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/api_order_history_response.md b/artifacts/apidocs/schemas/api_order_history_response.md index 261e27f..10f951d 100644 --- a/artifacts/apidocs/schemas/api_order_history_response.md +++ b/artifacts/apidocs/schemas/api_order_history_response.md @@ -54,7 +54,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/api_pre_order_check_request.md b/artifacts/apidocs/schemas/api_pre_order_check_request.md index e7bf320..48c8e75 100644 --- a/artifacts/apidocs/schemas/api_pre_order_check_request.md +++ b/artifacts/apidocs/schemas/api_pre_order_check_request.md @@ -56,7 +56,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/api_query_trading_performance_request.md b/artifacts/apidocs/schemas/api_query_trading_performance_request.md new file mode 100644 index 0000000..33a192f --- /dev/null +++ b/artifacts/apidocs/schemas/api_query_trading_performance_request.md @@ -0,0 +1,7 @@ +!!! info "[ApiQueryTradingPerformanceRequest](/../../schemas/api_query_trading_performance_request)" + Request to retrieve the trading volume
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|False
`all`|Optional: The subaccount ID to filter by| + |asset
`a` |unknown|True|The asset to filter by| diff --git a/artifacts/apidocs/schemas/api_query_trading_performance_response.md b/artifacts/apidocs/schemas/api_query_trading_performance_response.md new file mode 100644 index 0000000..7facd67 --- /dev/null +++ b/artifacts/apidocs/schemas/api_query_trading_performance_response.md @@ -0,0 +1,7 @@ +!!! info "[ApiQueryTradingPerformanceResponse](/../../schemas/api_query_trading_performance_response)" + Response to retrieve the trading volume
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trading_volume
`tv` |string|True|Trading volume in USDT| + |realized_pnl
`rp` |string|True|Realized PnL in USDT| diff --git a/artifacts/apidocs/schemas/api_sub_account_trade_aggregation_request.md b/artifacts/apidocs/schemas/api_sub_account_trade_aggregation_request.md index 5067d4d..e627924 100644 --- a/artifacts/apidocs/schemas/api_sub_account_trade_aggregation_request.md +++ b/artifacts/apidocs/schemas/api_sub_account_trade_aggregation_request.md @@ -19,3 +19,4 @@ |`SAT_1_MO` = 1|1 month| |`SAT_1_D` = 2|1 day| |`SAT_1_H` = 3|1 hour| + |`SAT_4_H` = 4|4 hour| diff --git a/artifacts/apidocs/schemas/api_sub_account_trade_aggregation_response.md b/artifacts/apidocs/schemas/api_sub_account_trade_aggregation_response.md index bcf19f4..afda476 100644 --- a/artifacts/apidocs/schemas/api_sub_account_trade_aggregation_response.md +++ b/artifacts/apidocs/schemas/api_sub_account_trade_aggregation_response.md @@ -14,3 +14,4 @@ |num_traded
`nt` |string|True|Number of trades| |positive_fee
`pf` |string|True|Total positive fee paid by user| |signer
`s` |string|True|The signer of the trade| + |realized_pnl
`rp` |string|True|Realized PnL| diff --git a/artifacts/apidocs/schemas/api_transfer_history_request.md b/artifacts/apidocs/schemas/api_transfer_history_request.md index c1fc682..e11db27 100644 --- a/artifacts/apidocs/schemas/api_transfer_history_request.md +++ b/artifacts/apidocs/schemas/api_transfer_history_request.md @@ -9,6 +9,7 @@ |limit
`l` |integer|False
`500`|The limit to query for. Defaults to 500; Max 1000| |cursor
`c1` |string|False
`''`|The cursor to indicate when to start the next query from| |tx_id
`ti` |string|False
`0`|The transaction ID to query for| + |main_account_id
`ma` |string|False
``|Main account ID being queried. By default, applies the requestor's main account ID.| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/api_withdrawal_history_request.md b/artifacts/apidocs/schemas/api_withdrawal_history_request.md index 30005f0..286991f 100644 --- a/artifacts/apidocs/schemas/api_withdrawal_history_request.md +++ b/artifacts/apidocs/schemas/api_withdrawal_history_request.md @@ -8,6 +8,7 @@ |end_time
`et` |string|False
`now()`|The end time to query for in unix nanoseconds| |limit
`l` |integer|False
`500`|The limit to query for. Defaults to 500; Max 1000| |cursor
`c1` |string|False
`''`|The cursor to indicate when to start the next query from| + |main_account_id
`ma` |string|False
``|Main account ID being queried. By default, applies the requestor's main account ID.| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/asset_margin_tier_response.md b/artifacts/apidocs/schemas/asset_margin_tier_response.md new file mode 100644 index 0000000..beb4d88 --- /dev/null +++ b/artifacts/apidocs/schemas/asset_margin_tier_response.md @@ -0,0 +1,10 @@ +!!! info "[AssetMarginTierResponse](/../../schemas/asset_margin_tier_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |asset
`a` |string|True|| + |tiers
`t` |[MarginTierResponse]|True|| + ??? info "[MarginTierResponse](/../../schemas/margin_tier_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |lower_bound
`lb` |string|True|| + |rate
`r` |string|True|| diff --git a/artifacts/apidocs/schemas/ecosystem_point.md b/artifacts/apidocs/schemas/ecosystem_point.md index f8573eb..318f5f9 100644 --- a/artifacts/apidocs/schemas/ecosystem_point.md +++ b/artifacts/apidocs/schemas/ecosystem_point.md @@ -16,3 +16,6 @@ |rank
`r` |integer|True|The rank of the account in the ecosystem| |epoch
`e` |integer|True|The epoch number of the ecosystem point| |brokered_trading_volume
`bt` |string|True|Brokered trading volume| + |brokered_trading_point
`bt1` |string|True|Brokered trading point| + |referee_kyc_point
`rk` |string|True|Referee KYC point| + |referrer_kyc_point
`rk1` |string|True|Referrer KYC point| diff --git a/artifacts/apidocs/schemas/flat_referral.md b/artifacts/apidocs/schemas/flat_referral.md index 9e17431..e6fde20 100644 --- a/artifacts/apidocs/schemas/flat_referral.md +++ b/artifacts/apidocs/schemas/flat_referral.md @@ -13,3 +13,4 @@ |is_kyc_completed
`ik` |boolean|True|The account is KYC verified or not| |kyc_completed_at
`kc` |string|True|The KYC completed time| |kyc_type
`kt` |string|True|The KYC type, can be 'individual' or 'business'| + |kyc_first_completed_at
`kf` |string|True|The first KYC completed time| diff --git a/artifacts/apidocs/schemas/margin_tier_response.md b/artifacts/apidocs/schemas/margin_tier_response.md new file mode 100644 index 0000000..faceaa7 --- /dev/null +++ b/artifacts/apidocs/schemas/margin_tier_response.md @@ -0,0 +1,5 @@ +!!! info "[MarginTierResponse](/../../schemas/margin_tier_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |lower_bound
`lb` |string|True|| + |rate
`r` |string|True|| diff --git a/artifacts/apidocs/schemas/order.md b/artifacts/apidocs/schemas/order.md index 96b59e0..a6d43b2 100644 --- a/artifacts/apidocs/schemas/order.md +++ b/artifacts/apidocs/schemas/order.md @@ -49,7 +49,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/order_metadata.md b/artifacts/apidocs/schemas/order_metadata.md index fa834f5..571cd2c 100644 --- a/artifacts/apidocs/schemas/order_metadata.md +++ b/artifacts/apidocs/schemas/order_metadata.md @@ -5,7 +5,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/snap_funding_account_summary.md b/artifacts/apidocs/schemas/snap_funding_account_summary.md new file mode 100644 index 0000000..c684457 --- /dev/null +++ b/artifacts/apidocs/schemas/snap_funding_account_summary.md @@ -0,0 +1,39 @@ +!!! info "[SnapFundingAccountSummary](/../../schemas/snap_funding_account_summary)" + The funding account summary, that reports the total equity and spot balances of a funding (main) account
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |event_time
`et` |string|True|Time at which the event was emitted in unix nanoseconds| + |main_account_id
`ma` |string|True|The main account ID of the account to which the summary belongs| + |total_equity
`te` |string|True|Total equity of the main account, denominated in USD| + |spot_balances
`sb` |[SpotBalance]|True|The list of spot assets owned by this main account, and their balances| + ??? info "[SpotBalance](/../../schemas/spot_balance)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |currency
`c` |Currency|True|The currency you hold a spot balance in| + |balance
`b` |string|True|This currency's balance in this trading account.| + |index_price
`ip` |string|True|The index price of this currency. (reported in `USD`)| + ??? info "[Currency](/../../schemas/currency)" + The list of Currencies that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`USD` = 1|the USD fiat currency| + |`USDC` = 2|the USDC token| + |`USDT` = 3|the USDT token| + |`ETH` = 4|the ETH token| + |`BTC` = 5|the BTC token| + |`SOL` = 6|the SOL token| + |`ARB` = 7|the ARB token| + |`BNB` = 8|the BNB token| + |`ZK` = 9|the ZK token| + |`POL` = 10|the POL token| + |`OP` = 11|the OP token| + |`ATOM` = 12|the ATOM token| + |`KPEPE` = 13|the 1000PEPE token| + |`TON` = 14|the TON token| + |`XRP` = 15|the XRP token| + |`TRUMP` = 20|the TRUMP token| + |`SUI` = 21|the SUI token| + |`FARTCOIN` = 28|the FARTCOIN token| + |`BERA` = 35|the BERA token| diff --git a/artifacts/apidocs/schemas/sub_account_trade_aggregation.md b/artifacts/apidocs/schemas/sub_account_trade_aggregation.md index e6ab414..1658d88 100644 --- a/artifacts/apidocs/schemas/sub_account_trade_aggregation.md +++ b/artifacts/apidocs/schemas/sub_account_trade_aggregation.md @@ -9,3 +9,4 @@ |num_traded
`nt` |string|True|Number of trades| |positive_fee
`pf` |string|True|Total positive fee paid by user| |signer
`s` |string|True|The signer of the trade| + |realized_pnl
`rp` |string|True|Realized PnL| diff --git a/artifacts/apidocs/schemas/sub_account_trade_interval.md b/artifacts/apidocs/schemas/sub_account_trade_interval.md index da2a639..7765cb7 100644 --- a/artifacts/apidocs/schemas/sub_account_trade_interval.md +++ b/artifacts/apidocs/schemas/sub_account_trade_interval.md @@ -4,3 +4,4 @@ |`SAT_1_MO` = 1|1 month| |`SAT_1_D` = 2|1 day| |`SAT_1_H` = 3|1 hour| + |`SAT_4_H` = 4|4 hour| diff --git a/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md b/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md index fb5a7d4..2924a18 100644 --- a/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|Stream name| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |CancelStatusFeed|True|Data relating to the status of the cancellation attempt| ??? info "[CancelStatusFeed](/../../schemas/cancel_status_feed)" |Name
`Lite`|Type|Required
`Default`| Description | diff --git a/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md b/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md index 253e439..72d1fd2 100644 --- a/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|Stream name| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |Candlestick|True|A candlestick entry matching the request filters| ??? info "[Candlestick](/../../schemas/candlestick)"
diff --git a/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md b/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md index 6217458..5c36103 100644 --- a/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md @@ -5,7 +5,7 @@ |-|-|-|-| |stream
`s` |string|True|The websocket channel to which the response is sent| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |Deposit|True|The Deposit object| ??? info "[Deposit](/../../schemas/deposit)" |Name
`Lite`|Type|Required
`Default`| Description | diff --git a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md index 69e7b68..d78ab8c 100644 --- a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|The websocket channel to which the response is sent| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |Fill|True|A private trade matching the request filter| ??? info "[Fill](/../../schemas/fill)" |Name
`Lite`|Type|Required
`Default`| Description | diff --git a/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md b/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md index b04fa9c..5aae76f 100644 --- a/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|Stream name| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |MiniTicker|True|A mini ticker matching the request filter| ??? info "[MiniTicker](/../../schemas/mini_ticker)" |Name
`Lite`|Type|Required
`Default`| Description | diff --git a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md index 758591d..60a656b 100644 --- a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|Stream name| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |Order|True|The order object being created or updated| ??? info "[Order](/../../schemas/order)" 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
@@ -56,7 +56,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| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| - |trigger
`t` |TriggerOrderMetadata|True|Trigger fields are used to support any type of trigger order such as TP/SL| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" 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.


diff --git a/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md index 447a395..469e03f 100644 --- a/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|Stream name| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |ClientOrderIDsByGroup|True|The order object being created or updated| ??? info "[ClientOrderIDsByGroup](/../../schemas/client_order_i_ds_by_group)" 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.
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 c2165cf..e371c6c 100644 --- a/artifacts/apidocs/schemas/ws_order_state_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_state_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|Stream name| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |OrderStateFeed|True|The Order State Feed| ??? info "[OrderStateFeed](/../../schemas/order_state_feed)" |Name
`Lite`|Type|Required
`Default`| Description | diff --git a/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md b/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md index 74587a0..e37a0ed 100644 --- a/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|Stream name| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |OrderbookLevels|True|An orderbook levels object matching the request filter| ??? info "[OrderbookLevels](/../../schemas/orderbook_levels)" |Name
`Lite`|Type|Required
`Default`| Description | diff --git a/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md b/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md index a090b94..c4cbcda 100644 --- a/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|Stream name| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |Positions|True|A Position being created or updated matching the request filter| ??? info "[Positions](/../../schemas/positions)" |Name
`Lite`|Type|Required
`Default`| Description | diff --git a/artifacts/apidocs/schemas/ws_subscribe_params.md b/artifacts/apidocs/schemas/ws_subscribe_params.md index 7c9c059..896bfaa 100644 --- a/artifacts/apidocs/schemas/ws_subscribe_params.md +++ b/artifacts/apidocs/schemas/ws_subscribe_params.md @@ -1,5 +1,5 @@ !!! info "[WSSubscribeParams](/../../schemas/ws_subscribe_params)" - 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.
+ 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
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md b/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md index b821c89..e9dacdc 100644 --- a/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|Stream name| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |Ticker|True|A ticker matching the request filter| ??? info "[Ticker](/../../schemas/ticker)" 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.

diff --git a/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md b/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md index a2e0ce6..8328e51 100644 --- a/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md @@ -3,7 +3,7 @@ |-|-|-|-| |stream
`s` |string|True|Stream name| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |Trade|True|A public trade matching the request filter| ??? info "[Trade](/../../schemas/trade)" All private RFQs and Private AXEs will be filtered out from the responses
diff --git a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md index b1f56f0..2553e8c 100644 --- a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md @@ -5,7 +5,7 @@ |-|-|-|-| |stream
`s` |string|True|The websocket channel to which the response is sent| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |TransferHistory|True|The transfer history matching the requested filters| ??? info "[TransferHistory](/../../schemas/transfer_history)" |Name
`Lite`|Type|Required
`Default`| Description | diff --git a/artifacts/apidocs/schemas/ws_unsubscribe_params.md b/artifacts/apidocs/schemas/ws_unsubscribe_params.md index 7fcaa6b..5914171 100644 --- a/artifacts/apidocs/schemas/ws_unsubscribe_params.md +++ b/artifacts/apidocs/schemas/ws_unsubscribe_params.md @@ -1,5 +1,5 @@ !!! info "[WSUnsubscribeParams](/../../schemas/ws_unsubscribe_params)" - All V1 Websocket Unsubscription Requests are housed in this wrapper. You may specify a stream, and a list of feeds to unsubscribe from.
+ 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
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md b/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md index 373591c..4161a8a 100644 --- a/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md @@ -5,7 +5,7 @@ |-|-|-|-| |stream
`s` |string|True|The websocket channel to which the response is sent| |selector
`s1` |string|True|Primary selector| - |sequence_number
`sn` |string|True|A running sequence number that determines global message order within the specific stream| + |sequence_number
`sn` |string|True|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`.| |feed
`f` |Withdrawal|True|The Withdrawal object| ??? info "[Withdrawal](/../../schemas/withdrawal)" |Name
`Lite`|Type|Required
`Default`| Description | diff --git a/artifacts/apidocs/trading_api.md b/artifacts/apidocs/trading_api.md index bcaf21c..b0d59dd 100644 --- a/artifacts/apidocs/trading_api.md +++ b/artifacts/apidocs/trading_api.md @@ -1,194 +1,48 @@ # Trading APIs All requests should be made using the `POST` HTTP method. -## Order -### Create Order +## Admin +### Drop Client ``` -FULL ENDPOINT: full/v1/create_order -LITE ENDPOINT: lite/v1/create_order +FULL ENDPOINT: full/v1/drop_client_ws +LITE ENDPOINT: lite/v1/drop_client_ws ``` === "Request"
- -8<- "docs/schemas/api_create_order_request.md" + -8<- "docs/schemas/api_drop_client_ws_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "order": { - "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - } - } + "main_account_id": null } ``` **Lite Request** ``` { .json .copy } { - "o": { - "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - } - } + "ma": null } ```
=== "Response"
- -8<- "docs/schemas/api_create_order_response.md" + -8<- "docs/schemas/api_drop_client_ws_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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - } + "num_dropped": null } ``` **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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - } + "nd": null } ```
@@ -201,51 +55,8 @@ LITE ENDPOINT: lite/v1/create_order |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|
!!! failure @@ -274,43 +85,11 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/create_order' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/drop_client_ws' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "order": { - "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - } - } + "main_account_id": null } ' ``` @@ -322,41 +101,9 @@ LITE ENDPOINT: lite/v1/create_order -x ' { "jsonrpc": "2.0", - "method": "v1/create_order", + "method": "v1/drop_client_ws", "params": { - "order": { - "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - } - } + "main_account_id": null }, "id": 123 } @@ -366,43 +113,11 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/create_order' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/drop_client_ws' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "o": { - "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - } - } + "ma": null } ' ``` @@ -414,41 +129,9 @@ LITE ENDPOINT: lite/v1/create_order -x ' { "j": "2.0", - "m": "v1/create_order", + "m": "v1/drop_client_ws", "p": { - "o": { - "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - } - } + "ma": null }, "i": 123 } @@ -459,43 +142,11 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/create_order' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/drop_client_ws' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "order": { - "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - } - } + "main_account_id": null } ' ``` @@ -507,41 +158,9 @@ LITE ENDPOINT: lite/v1/create_order -x ' { "jsonrpc": "2.0", - "method": "v1/create_order", + "method": "v1/drop_client_ws", "params": { - "order": { - "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - } - } + "main_account_id": null }, "id": 123 } @@ -551,43 +170,11 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/create_order' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/drop_client_ws' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "o": { - "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - } - } + "ma": null } ' ``` @@ -599,41 +186,9 @@ LITE ENDPOINT: lite/v1/create_order -x ' { "j": "2.0", - "m": "v1/create_order", + "m": "v1/drop_client_ws", "p": { - "o": { - "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - } - } + "ma": null }, "i": 123 } @@ -644,43 +199,11 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/create_order' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/drop_client_ws' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "order": { - "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - } - } + "main_account_id": null } ' ``` @@ -692,41 +215,9 @@ LITE ENDPOINT: lite/v1/create_order -x ' { "jsonrpc": "2.0", - "method": "v1/create_order", + "method": "v1/drop_client_ws", "params": { - "order": { - "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - } - } + "main_account_id": null }, "id": 123 } @@ -736,43 +227,11 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/create_order' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/drop_client_ws' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "o": { - "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - } - } + "ma": null } ' ``` @@ -784,41 +243,9 @@ LITE ENDPOINT: lite/v1/create_order -x ' { "j": "2.0", - "m": "v1/create_order", + "m": "v1/drop_client_ws", "p": { - "o": { - "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - } - } + "ma": null }, "i": 123 } @@ -829,43 +256,11 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/create_order' \ + curl --location 'https://trades.grvt.io/full/v1/drop_client_ws' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "order": { - "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - } - } + "main_account_id": null } ' ``` @@ -877,41 +272,9 @@ LITE ENDPOINT: lite/v1/create_order -x ' { "jsonrpc": "2.0", - "method": "v1/create_order", + "method": "v1/drop_client_ws", "params": { - "order": { - "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - } - } + "main_account_id": null }, "id": 123 } @@ -921,43 +284,11 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/create_order' \ + curl --location 'https://trades.grvt.io/lite/v1/drop_client_ws' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "o": { - "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - } - } + "ma": null } ' ``` @@ -969,41 +300,9 @@ LITE ENDPOINT: lite/v1/create_order -x ' { "j": "2.0", - "m": "v1/create_order", + "m": "v1/drop_client_ws", "p": { - "o": { - "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - } - } + "ma": null }, "i": 123 } @@ -1011,40 +310,99 @@ LITE ENDPOINT: lite/v1/create_order ```

-### Cancel Order +## Order +### Create Order ``` -FULL ENDPOINT: full/v1/cancel_order -LITE ENDPOINT: lite/v1/cancel_order +FULL ENDPOINT: full/v1/create_order +LITE ENDPOINT: lite/v1/create_order ``` === "Request"
- -8<- "docs/schemas/api_cancel_order_request.md" + -8<- "docs/schemas/api_create_order_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "order": { + "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" + } + } } ``` **Lite Request** ``` { .json .copy } { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "o": { + "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" + } + } } ```
=== "Response"
- -8<- "docs/schemas/ack_response.md" + -8<- "docs/schemas/api_create_order_response.md"
!!! success @@ -1052,15 +410,93 @@ LITE ENDPOINT: lite/v1/cancel_order ``` { .json .copy } { "result": { - "ack": "true" - } - } - ``` - **Lite Response** - ``` { .json .copy } + "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": { - "a": "true" + "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"] + } } } ``` @@ -1074,11 +510,51 @@ LITE ENDPOINT: lite/v1/cancel_order |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| - |2300|400|Order cancel time-to-live settings currently disabled.| - |2301|400|Order cancel time-to-live exceeds maximum allowed value.| - |3021|400|Either order ID or client order ID must be supplied| + |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|
!!! failure @@ -1107,14 +583,43 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_order' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "order": { + "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" + } + } } ' ``` @@ -1126,12 +631,41 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_order", + "method": "v1/create_order", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "order": { + "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" + } + } }, "id": 123 } @@ -1141,14 +675,43 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_order' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "o": { + "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" + } + } } ' ``` @@ -1160,30 +723,88 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "j": "2.0", - "m": "v1/cancel_order", + "m": "v1/create_order", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" - }, - "i": 123 - } - ' -w 360 - ``` -
- === "STAGING" -
- !!! example "REST Full" - ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_order' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "o": { + "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" + } + } + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/create_order' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "order": { + "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" + } + } } ' ``` @@ -1195,12 +816,41 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_order", + "method": "v1/create_order", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "order": { + "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" + } + } }, "id": 123 } @@ -1210,14 +860,43 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_order' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "o": { + "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" + } + } } ' ``` @@ -1229,12 +908,41 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "j": "2.0", - "m": "v1/cancel_order", + "m": "v1/create_order", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "o": { + "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" + } + } }, "i": 123 } @@ -1245,14 +953,43 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_order' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "order": { + "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" + } + } } ' ``` @@ -1264,12 +1001,41 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_order", + "method": "v1/create_order", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "order": { + "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" + } + } }, "id": 123 } @@ -1279,14 +1045,43 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_order' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "o": { + "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" + } + } } ' ``` @@ -1298,12 +1093,41 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "j": "2.0", - "m": "v1/cancel_order", + "m": "v1/create_order", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "o": { + "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" + } + } }, "i": 123 } @@ -1314,14 +1138,43 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/cancel_order' \ + curl --location 'https://trades.grvt.io/full/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "order": { + "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" + } + } } ' ``` @@ -1333,12 +1186,41 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_order", + "method": "v1/create_order", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "order": { + "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" + } + } }, "id": 123 } @@ -1348,14 +1230,43 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/cancel_order' \ + curl --location 'https://trades.grvt.io/lite/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "o": { + "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" + } + } } ' ``` @@ -1367,12 +1278,41 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "j": "2.0", - "m": "v1/cancel_order", + "m": "v1/create_order", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "o": { + "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" + } + } }, "i": 123 } @@ -1380,15 +1320,15 @@ LITE ENDPOINT: lite/v1/cancel_order ```

-### Cancel All Orders +### Cancel Order ``` -FULL ENDPOINT: full/v1/cancel_all_orders -LITE ENDPOINT: lite/v1/cancel_all_orders +FULL ENDPOINT: full/v1/cancel_order +LITE ENDPOINT: lite/v1/cancel_order ``` === "Request"
- -8<- "docs/schemas/api_cancel_all_orders_request.md" + -8<- "docs/schemas/api_cancel_order_request.md"
!!! question "Query" @@ -1396,18 +1336,18 @@ LITE ENDPOINT: lite/v1/cancel_all_orders ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" } ``` **Lite Request** ``` { .json .copy } { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042", + "tt": "500" } ```
@@ -1445,6 +1385,9 @@ LITE ENDPOINT: lite/v1/cancel_all_orders |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| + |2300|400|Order cancel time-to-live settings currently disabled.| + |2301|400|Order cancel time-to-live exceeds maximum allowed value.| + |3021|400|Either order ID or client order ID must be supplied|
!!! failure @@ -1473,14 +1416,14 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_all_orders' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" } ' ``` @@ -1492,12 +1435,12 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_all_orders", + "method": "v1/cancel_order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" }, "id": 123 } @@ -1507,14 +1450,14 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_all_orders' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_order' \ --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"] + "oi": "0x1028403", + "co": "23042", + "tt": "500" } ' ``` @@ -1526,12 +1469,12 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "j": "2.0", - "m": "v1/cancel_all_orders", + "m": "v1/cancel_order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042", + "tt": "500" }, "i": 123 } @@ -1542,14 +1485,14 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_all_orders' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" } ' ``` @@ -1561,12 +1504,12 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_all_orders", + "method": "v1/cancel_order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" }, "id": 123 } @@ -1576,14 +1519,14 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_all_orders' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_order' \ --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"] + "oi": "0x1028403", + "co": "23042", + "tt": "500" } ' ``` @@ -1595,12 +1538,12 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "j": "2.0", - "m": "v1/cancel_all_orders", + "m": "v1/cancel_order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042", + "tt": "500" }, "i": 123 } @@ -1611,14 +1554,14 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_all_orders' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" } ' ``` @@ -1630,12 +1573,12 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_all_orders", + "method": "v1/cancel_order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" }, "id": 123 } @@ -1645,14 +1588,14 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_all_orders' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_order' \ --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"] + "oi": "0x1028403", + "co": "23042", + "tt": "500" } ' ``` @@ -1664,12 +1607,12 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "j": "2.0", - "m": "v1/cancel_all_orders", + "m": "v1/cancel_order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042", + "tt": "500" }, "i": 123 } @@ -1680,14 +1623,14 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/cancel_all_orders' \ + curl --location 'https://trades.grvt.io/full/v1/cancel_order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" } ' ``` @@ -1699,12 +1642,12 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_all_orders", + "method": "v1/cancel_order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" }, "id": 123 } @@ -1714,14 +1657,14 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/cancel_all_orders' \ + curl --location 'https://trades.grvt.io/lite/v1/cancel_order' \ --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"] + "oi": "0x1028403", + "co": "23042", + "tt": "500" } ' ``` @@ -1733,12 +1676,12 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "j": "2.0", - "m": "v1/cancel_all_orders", + "m": "v1/cancel_order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042", + "tt": "500" }, "i": 123 } @@ -1746,15 +1689,15 @@ LITE ENDPOINT: lite/v1/cancel_all_orders ```

-### Get Order +### Cancel All Orders ``` -FULL ENDPOINT: full/v1/order -LITE ENDPOINT: lite/v1/order +FULL ENDPOINT: full/v1/cancel_all_orders +LITE ENDPOINT: lite/v1/cancel_all_orders ``` === "Request"
- -8<- "docs/schemas/api_get_order_request.md" + -8<- "docs/schemas/api_cancel_all_orders_request.md"
!!! question "Query" @@ -1762,22 +1705,24 @@ LITE ENDPOINT: lite/v1/order ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ``` **Lite Request** ``` { .json .copy } { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ```
=== "Response"
- -8<- "docs/schemas/api_get_order_response.md" + -8<- "docs/schemas/ack_response.md"
!!! success @@ -1785,46 +1730,7 @@ LITE ENDPOINT: lite/v1/order ``` { .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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } + "ack": "true" } } ``` @@ -1832,46 +1738,7 @@ LITE ENDPOINT: lite/v1/order ``` { .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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } + "a": "true" } } ``` @@ -1887,8 +1754,6 @@ LITE ENDPOINT: lite/v1/order |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| - |3021|400|Either order ID or client order ID must be supplied|
!!! failure @@ -1917,13 +1782,14 @@ LITE ENDPOINT: lite/v1/order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/order' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -1935,11 +1801,12 @@ LITE ENDPOINT: lite/v1/order -x ' { "jsonrpc": "2.0", - "method": "v1/order", + "method": "v1/cancel_all_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -1949,13 +1816,14 @@ LITE ENDPOINT: lite/v1/order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/order' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -1967,11 +1835,12 @@ LITE ENDPOINT: lite/v1/order -x ' { "j": "2.0", - "m": "v1/order", + "m": "v1/cancel_all_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -1982,13 +1851,14 @@ LITE ENDPOINT: lite/v1/order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/order' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -2000,11 +1870,12 @@ LITE ENDPOINT: lite/v1/order -x ' { "jsonrpc": "2.0", - "method": "v1/order", + "method": "v1/cancel_all_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -2014,14 +1885,15 @@ LITE ENDPOINT: lite/v1/order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/order' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" - } + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] + } ' ``` !!! example "JSONRPC Lite" @@ -2032,11 +1904,12 @@ LITE ENDPOINT: lite/v1/order -x ' { "j": "2.0", - "m": "v1/order", + "m": "v1/cancel_all_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -2047,13 +1920,14 @@ LITE ENDPOINT: lite/v1/order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/order' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -2065,11 +1939,12 @@ LITE ENDPOINT: lite/v1/order -x ' { "jsonrpc": "2.0", - "method": "v1/order", + "method": "v1/cancel_all_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -2079,13 +1954,14 @@ LITE ENDPOINT: lite/v1/order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/order' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -2097,11 +1973,12 @@ LITE ENDPOINT: lite/v1/order -x ' { "j": "2.0", - "m": "v1/order", + "m": "v1/cancel_all_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -2112,13 +1989,14 @@ LITE ENDPOINT: lite/v1/order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/order' \ + curl --location 'https://trades.grvt.io/full/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -2130,11 +2008,12 @@ LITE ENDPOINT: lite/v1/order -x ' { "jsonrpc": "2.0", - "method": "v1/order", + "method": "v1/cancel_all_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -2144,13 +2023,14 @@ LITE ENDPOINT: lite/v1/order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/order' \ + curl --location 'https://trades.grvt.io/lite/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -2162,11 +2042,12 @@ LITE ENDPOINT: lite/v1/order -x ' { "j": "2.0", - "m": "v1/order", + "m": "v1/cancel_all_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -2174,15 +2055,15 @@ LITE ENDPOINT: lite/v1/order ```

-### Open Orders +### Get Order ``` -FULL ENDPOINT: full/v1/open_orders -LITE ENDPOINT: lite/v1/open_orders +FULL ENDPOINT: full/v1/order +LITE ENDPOINT: lite/v1/order ``` === "Request"
- -8<- "docs/schemas/api_open_orders_request.md" + -8<- "docs/schemas/api_get_order_request.md"
!!! question "Query" @@ -2190,31 +2071,29 @@ LITE ENDPOINT: lite/v1/open_orders ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042" } ``` **Lite Request** ``` { .json .copy } { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042" } ```
=== "Response"
- -8<- "docs/schemas/api_open_orders_response.md" + -8<- "docs/schemas/api_get_order_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": [{ + "result": { "order_id": "0x1234567890abcdef", "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "is_market": false, @@ -2239,13 +2118,13 @@ LITE ENDPOINT: lite/v1/open_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": "UNSPECIFIED", + "trigger_type": TAKE_PROFIT, "tpsl": { - "trigger_by": "UNSPECIFIED", + "trigger_by": LAST, "trigger_price": "65038.10" } }, - "broker": "UNSPECIFIED" + "broker": "BROKER_CODE" }, "state": { "status": "PENDING", @@ -2255,13 +2134,13 @@ LITE ENDPOINT: lite/v1/open_orders "update_time": "1697788800000000000", "avg_fill_price": ["60000.4"] } - }] + } } ``` **Lite Response** ``` { .json .copy } { - "r": [{ + "r": { "oi": "0x1234567890abcdef", "sa": "'$GRVT_SUB_ACCOUNT_ID'", "im": false, @@ -2286,13 +2165,13 @@ LITE ENDPOINT: lite/v1/open_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": "UNSPECIFIED", + "tt": TAKE_PROFIT, "t": { - "tb": "UNSPECIFIED", + "tb": LAST, "tp": "65038.10" } }, - "b": "UNSPECIFIED" + "b": "BROKER_CODE" }, "s1": { "s": "PENDING", @@ -2302,7 +2181,7 @@ LITE ENDPOINT: lite/v1/open_orders "ut": "1697788800000000000", "af": ["60000.4"] } - }] + } } ```
@@ -2314,9 +2193,11 @@ LITE ENDPOINT: lite/v1/open_orders |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| - |1003|400|Request could not be processed due to malformed syntax| + |1004|404|Data Not Found| + |3021|400|Either order ID or client order ID must be supplied|
!!! failure @@ -2345,14 +2226,13 @@ LITE ENDPOINT: lite/v1/open_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/open_orders' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042" } ' ``` @@ -2364,12 +2244,11 @@ LITE ENDPOINT: lite/v1/open_orders -x ' { "jsonrpc": "2.0", - "method": "v1/open_orders", + "method": "v1/order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042" }, "id": 123 } @@ -2379,14 +2258,13 @@ LITE ENDPOINT: lite/v1/open_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/open_orders' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/order' \ --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"] + "oi": "0x1028403", + "co": "23042" } ' ``` @@ -2398,12 +2276,11 @@ LITE ENDPOINT: lite/v1/open_orders -x ' { "j": "2.0", - "m": "v1/open_orders", + "m": "v1/order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042" }, "i": 123 } @@ -2414,14 +2291,13 @@ LITE ENDPOINT: lite/v1/open_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/open_orders' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042" } ' ``` @@ -2433,12 +2309,11 @@ LITE ENDPOINT: lite/v1/open_orders -x ' { "jsonrpc": "2.0", - "method": "v1/open_orders", + "method": "v1/order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042" }, "id": 123 } @@ -2448,14 +2323,13 @@ LITE ENDPOINT: lite/v1/open_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/open_orders' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/order' \ --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"] + "oi": "0x1028403", + "co": "23042" } ' ``` @@ -2467,12 +2341,11 @@ LITE ENDPOINT: lite/v1/open_orders -x ' { "j": "2.0", - "m": "v1/open_orders", + "m": "v1/order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042" }, "i": 123 } @@ -2483,14 +2356,13 @@ LITE ENDPOINT: lite/v1/open_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/open_orders' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042" } ' ``` @@ -2502,12 +2374,11 @@ LITE ENDPOINT: lite/v1/open_orders -x ' { "jsonrpc": "2.0", - "method": "v1/open_orders", + "method": "v1/order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042" }, "id": 123 } @@ -2517,14 +2388,13 @@ LITE ENDPOINT: lite/v1/open_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/open_orders' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/order' \ --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"] + "oi": "0x1028403", + "co": "23042" } ' ``` @@ -2536,12 +2406,11 @@ LITE ENDPOINT: lite/v1/open_orders -x ' { "j": "2.0", - "m": "v1/open_orders", + "m": "v1/order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042" }, "i": 123 } @@ -2552,14 +2421,13 @@ LITE ENDPOINT: lite/v1/open_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/open_orders' \ + curl --location 'https://trades.grvt.io/full/v1/order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042" } ' ``` @@ -2571,12 +2439,11 @@ LITE ENDPOINT: lite/v1/open_orders -x ' { "jsonrpc": "2.0", - "method": "v1/open_orders", + "method": "v1/order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042" }, "id": 123 } @@ -2586,14 +2453,13 @@ LITE ENDPOINT: lite/v1/open_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/open_orders' \ + curl --location 'https://trades.grvt.io/lite/v1/order' \ --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"] + "oi": "0x1028403", + "co": "23042" } ' ``` @@ -2605,12 +2471,11 @@ LITE ENDPOINT: lite/v1/open_orders -x ' { "j": "2.0", - "m": "v1/open_orders", + "m": "v1/order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042" }, "i": 123 } @@ -2618,15 +2483,15 @@ LITE ENDPOINT: lite/v1/open_orders ```

-### Order History +### Open Orders ``` -FULL ENDPOINT: full/v1/order_history -LITE ENDPOINT: lite/v1/order_history +FULL ENDPOINT: full/v1/open_orders +LITE ENDPOINT: lite/v1/open_orders ``` === "Request"
- -8<- "docs/schemas/api_order_history_request.md" + -8<- "docs/schemas/api_open_orders_request.md"
!!! question "Query" @@ -2636,11 +2501,7 @@ LITE ENDPOINT: lite/v1/order_history "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "kind": ["PERPETUAL"], "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "quote": ["USDT", "USDC"] } ``` **Lite Request** @@ -2649,17 +2510,13 @@ LITE ENDPOINT: lite/v1/order_history "sa": "'$GRVT_SUB_ACCOUNT_ID'", "k": ["PERPETUAL"], "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "q": ["USDT", "USDC"] } ```
=== "Response"
- -8<- "docs/schemas/api_order_history_response.md" + -8<- "docs/schemas/api_open_orders_response.md"
!!! success @@ -2691,13 +2548,13 @@ LITE ENDPOINT: lite/v1/order_history "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": "UNSPECIFIED", + "trigger_type": TAKE_PROFIT, "tpsl": { - "trigger_by": "UNSPECIFIED", + "trigger_by": LAST, "trigger_price": "65038.10" } }, - "broker": "UNSPECIFIED" + "broker": "BROKER_CODE" }, "state": { "status": "PENDING", @@ -2707,8 +2564,7 @@ LITE ENDPOINT: lite/v1/order_history "update_time": "1697788800000000000", "avg_fill_price": ["60000.4"] } - }], - "next": "Qw0918=" + }] } ``` **Lite Response** @@ -2739,13 +2595,13 @@ LITE ENDPOINT: lite/v1/order_history "co": "23042", "ct": "1697788800000000000", "t": { - "tt": "UNSPECIFIED", + "tt": TAKE_PROFIT, "t": { - "tb": "UNSPECIFIED", + "tb": LAST, "tp": "65038.10" } }, - "b": "UNSPECIFIED" + "b": "BROKER_CODE" }, "s1": { "s": "PENDING", @@ -2755,8 +2611,7 @@ LITE ENDPOINT: lite/v1/order_history "ut": "1697788800000000000", "af": ["60000.4"] } - }], - "n": "Qw0918=" + }] } ```
@@ -2768,9 +2623,9 @@ LITE ENDPOINT: lite/v1/order_history |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| + |1003|400|Request could not be processed due to malformed syntax|
!!! failure @@ -2799,18 +2654,14 @@ LITE ENDPOINT: lite/v1/order_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/order_history' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/open_orders' \ --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": "" + "quote": ["USDT", "USDC"] } ' ``` @@ -2822,16 +2673,12 @@ LITE ENDPOINT: lite/v1/order_history -x ' { "jsonrpc": "2.0", - "method": "v1/order_history", + "method": "v1/open_orders", "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": "" + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -2841,18 +2688,14 @@ LITE ENDPOINT: lite/v1/order_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/order_history' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/open_orders' \ --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": "" + "q": ["USDT", "USDC"] } ' ``` @@ -2864,16 +2707,12 @@ LITE ENDPOINT: lite/v1/order_history -x ' { "j": "2.0", - "m": "v1/order_history", + "m": "v1/open_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "k": ["PERPETUAL"], "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "q": ["USDT", "USDC"] }, "i": 123 } @@ -2884,18 +2723,14 @@ LITE ENDPOINT: lite/v1/order_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/order_history' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/open_orders' \ --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": "" + "quote": ["USDT", "USDC"] } ' ``` @@ -2907,16 +2742,12 @@ LITE ENDPOINT: lite/v1/order_history -x ' { "jsonrpc": "2.0", - "method": "v1/order_history", + "method": "v1/open_orders", "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": "" + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -2926,18 +2757,14 @@ LITE ENDPOINT: lite/v1/order_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/order_history' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/open_orders' \ --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": "" + "q": ["USDT", "USDC"] } ' ``` @@ -2949,16 +2776,12 @@ LITE ENDPOINT: lite/v1/order_history -x ' { "j": "2.0", - "m": "v1/order_history", + "m": "v1/open_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "k": ["PERPETUAL"], "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "q": ["USDT", "USDC"] }, "i": 123 } @@ -2969,18 +2792,14 @@ LITE ENDPOINT: lite/v1/order_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/order_history' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/open_orders' \ --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": "" + "quote": ["USDT", "USDC"] } ' ``` @@ -2992,16 +2811,12 @@ LITE ENDPOINT: lite/v1/order_history -x ' { "jsonrpc": "2.0", - "method": "v1/order_history", + "method": "v1/open_orders", "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": "" + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -3011,18 +2826,14 @@ LITE ENDPOINT: lite/v1/order_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/order_history' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/open_orders' \ --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": "" + "q": ["USDT", "USDC"] } ' ``` @@ -3034,16 +2845,12 @@ LITE ENDPOINT: lite/v1/order_history -x ' { "j": "2.0", - "m": "v1/order_history", + "m": "v1/open_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "k": ["PERPETUAL"], "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "q": ["USDT", "USDC"] }, "i": 123 } @@ -3054,18 +2861,14 @@ LITE ENDPOINT: lite/v1/order_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/order_history' \ + curl --location 'https://trades.grvt.io/full/v1/open_orders' \ --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": "" + "quote": ["USDT", "USDC"] } ' ``` @@ -3077,16 +2880,12 @@ LITE ENDPOINT: lite/v1/order_history -x ' { "jsonrpc": "2.0", - "method": "v1/order_history", + "method": "v1/open_orders", "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": "" + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -3096,18 +2895,14 @@ LITE ENDPOINT: lite/v1/order_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/order_history' \ + curl --location 'https://trades.grvt.io/lite/v1/open_orders' \ --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": "" + "q": ["USDT", "USDC"] } ' ``` @@ -3119,16 +2914,12 @@ LITE ENDPOINT: lite/v1/order_history -x ' { "j": "2.0", - "m": "v1/order_history", + "m": "v1/open_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "k": ["PERPETUAL"], "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "q": ["USDT", "USDC"] }, "i": 123 } @@ -3136,15 +2927,15 @@ LITE ENDPOINT: lite/v1/order_history ```

-### Pre Order Check +### Order History ``` -FULL ENDPOINT: full/v1/pre_order_check -LITE ENDPOINT: lite/v1/pre_order_check +FULL ENDPOINT: full/v1/order_history +LITE ENDPOINT: lite/v1/order_history ``` === "Request"
- -8<- "docs/schemas/api_pre_order_check_request.md" + -8<- "docs/schemas/api_order_history_request.md"
!!! question "Query" @@ -3152,7 +2943,39 @@ LITE ENDPOINT: lite/v1/pre_order_check ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "orders": [{ + "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_order_history_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": [{ "order_id": "0x1234567890abcdef", "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "is_market": false, @@ -3177,13 +3000,13 @@ LITE ENDPOINT: lite/v1/pre_order_check "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": "UNSPECIFIED", + "trigger_type": TAKE_PROFIT, "tpsl": { - "trigger_by": "UNSPECIFIED", + "trigger_by": LAST, "trigger_price": "65038.10" } }, - "broker": "UNSPECIFIED" + "broker": "BROKER_CODE" }, "state": { "status": "PENDING", @@ -3193,14 +3016,14 @@ LITE ENDPOINT: lite/v1/pre_order_check "update_time": "1697788800000000000", "avg_fill_price": ["60000.4"] } - }] + }], + "next": "Qw0918=" } ``` - **Lite Request** + **Lite Response** ``` { .json .copy } { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "o": [{ + "r": [{ "oi": "0x1234567890abcdef", "sa": "'$GRVT_SUB_ACCOUNT_ID'", "im": false, @@ -3225,13 +3048,13 @@ LITE ENDPOINT: lite/v1/pre_order_check "co": "23042", "ct": "1697788800000000000", "t": { - "tt": "UNSPECIFIED", + "tt": TAKE_PROFIT, "t": { - "tb": "UNSPECIFIED", + "tb": LAST, "tp": "65038.10" } }, - "b": "UNSPECIFIED" + "b": "BROKER_CODE" }, "s1": { "s": "PENDING", @@ -3241,46 +3064,8 @@ LITE ENDPOINT: lite/v1/pre_order_check "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" - }] + }], + "n": "Qw0918=" } ```
@@ -3295,9 +3080,6 @@ LITE ENDPOINT: lite/v1/pre_order_check |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 @@ -3326,53 +3108,18 @@ LITE ENDPOINT: lite/v1/pre_order_check
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/pre_order_check' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/order_history' \ --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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -3384,51 +3131,16 @@ LITE ENDPOINT: lite/v1/pre_order_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_order_check", + "method": "v1/order_history", "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -3438,53 +3150,18 @@ LITE ENDPOINT: lite/v1/pre_order_check
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/pre_order_check' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/order_history' \ --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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -3496,51 +3173,16 @@ LITE ENDPOINT: lite/v1/pre_order_check -x ' { "j": "2.0", - "m": "v1/pre_order_check", + "m": "v1/order_history", "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -3551,53 +3193,18 @@ LITE ENDPOINT: lite/v1/pre_order_check
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/pre_order_check' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/order_history' \ --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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -3609,51 +3216,16 @@ LITE ENDPOINT: lite/v1/pre_order_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_order_check", + "method": "v1/order_history", "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -3663,53 +3235,18 @@ LITE ENDPOINT: lite/v1/pre_order_check
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/pre_order_check' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/order_history' \ --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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -3721,51 +3258,16 @@ LITE ENDPOINT: lite/v1/pre_order_check -x ' { "j": "2.0", - "m": "v1/pre_order_check", + "m": "v1/order_history", "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -3776,53 +3278,18 @@ LITE ENDPOINT: lite/v1/pre_order_check
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/pre_order_check' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/order_history' \ --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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -3834,51 +3301,16 @@ LITE ENDPOINT: lite/v1/pre_order_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_order_check", + "method": "v1/order_history", "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -3888,53 +3320,18 @@ LITE ENDPOINT: lite/v1/pre_order_check
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/pre_order_check' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/order_history' \ --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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -3946,51 +3343,16 @@ LITE ENDPOINT: lite/v1/pre_order_check -x ' { "j": "2.0", - "m": "v1/pre_order_check", + "m": "v1/order_history", "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -4001,53 +3363,18 @@ LITE ENDPOINT: lite/v1/pre_order_check
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/pre_order_check' \ + curl --location 'https://trades.grvt.io/full/v1/order_history' \ --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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -4059,51 +3386,16 @@ LITE ENDPOINT: lite/v1/pre_order_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_order_check", + "method": "v1/order_history", "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -4113,53 +3405,18 @@ LITE ENDPOINT: lite/v1/pre_order_check
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/pre_order_check' \ + curl --location 'https://trades.grvt.io/lite/v1/order_history' \ --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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -4171,51 +3428,16 @@ LITE ENDPOINT: lite/v1/pre_order_check -x ' { "j": "2.0", - "m": "v1/pre_order_check", + "m": "v1/order_history", "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -4223,15 +3445,15 @@ LITE ENDPOINT: lite/v1/pre_order_check ```

-### Cancel On Disconnect +### Pre Order Check ``` -FULL ENDPOINT: full/v1/cancel_on_disconnect -LITE ENDPOINT: lite/v1/cancel_on_disconnect +FULL ENDPOINT: full/v1/pre_order_check +LITE ENDPOINT: lite/v1/pre_order_check ``` === "Request"
- -8<- "docs/schemas/api_cancel_on_disconnect_request.md" + -8<- "docs/schemas/api_pre_order_check_request.md"
!!! question "Query" @@ -4239,37 +3461,135 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "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'", - "ct": 300 + "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/ack_response.md" + -8<- "docs/schemas/api_pre_order_check_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": { - "ack": "true" - } + "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": { - "a": "true" - } + "r": [{ + "mq": [{ + "a": null, + "mb": 100.0, + "ms": 100.0 + }], + "mr": 1000.0, + "ov": true, + "r": "", + "sc": "USDT" + }] } ```
@@ -4284,7 +3604,9 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect |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| + |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 @@ -4313,12 +3635,53 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_on_disconnect' \ + 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'", - "countdown_time": 300 + "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"] + } + }] } ' ``` @@ -4330,10 +3693,51 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_on_disconnect", + "method": "v1/pre_order_check", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "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 } @@ -4343,12 +3747,53 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_on_disconnect' \ + 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'", - "ct": 300 + "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"] + } + }] } ' ``` @@ -4360,10 +3805,51 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "j": "2.0", - "m": "v1/cancel_on_disconnect", + "m": "v1/pre_order_check", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 + "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 } @@ -4374,27 +3860,109 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_on_disconnect' \ + 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'", - "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", + "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'", - "countdown_time": 300 + "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 } @@ -4404,12 +3972,53 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_on_disconnect' \ + 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'", - "ct": 300 + "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"] + } + }] } ' ``` @@ -4421,10 +4030,51 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "j": "2.0", - "m": "v1/cancel_on_disconnect", + "m": "v1/pre_order_check", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 + "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 } @@ -4435,12 +4085,53 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_on_disconnect' \ + 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'", - "countdown_time": 300 + "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"] + } + }] } ' ``` @@ -4452,56 +4143,220 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_on_disconnect", + "method": "v1/pre_order_check", "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 - ``` + "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/cancel_on_disconnect' \ + 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'", - "countdown_time": 300 + "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"] + } + }] } ' ``` @@ -4513,10 +4368,51 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_on_disconnect", + "method": "v1/pre_order_check", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "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 } @@ -4526,239 +4422,2041 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/cancel_on_disconnect' \ + 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'", - "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": { + "o": [{ + "oi": "0x1234567890abcdef", "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 - }, - "i": 123 - } + "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 ```

-### Create Bulk Orders +### Cancel On Disconnect ``` -FULL ENDPOINT: full/v1/create_bulk_orders -LITE ENDPOINT: lite/v1/create_bulk_orders +FULL ENDPOINT: full/v1/cancel_on_disconnect +LITE ENDPOINT: lite/v1/cancel_on_disconnect ``` === "Request"
- -8<- "docs/schemas/api_create_bulk_orders_request.md" + -8<- "docs/schemas/api_cancel_on_disconnect_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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "countdown_time": 300 } ``` **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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "ct": 300 } ```
=== "Response"
- -8<- "docs/schemas/api_create_bulk_orders_response.md" + -8<- "docs/schemas/ack_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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "result": { + "ack": "true" + } } ``` **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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "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=" } ```
@@ -4771,55 +6469,8 @@ LITE ENDPOINT: lite/v1/create_bulk_orders |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 @@ -4848,52 +6499,18 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/create_bulk_orders' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/fill_history' \ --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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -4905,50 +6522,16 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "jsonrpc": "2.0", - "method": "v1/create_bulk_orders", + "method": "v1/fill_history", "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "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 } @@ -4958,52 +6541,18 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/create_bulk_orders' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/fill_history' \ --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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -5015,50 +6564,16 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "j": "2.0", - "m": "v1/create_bulk_orders", + "m": "v1/fill_history", "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -5068,53 +6583,19 @@ LITE ENDPOINT: lite/v1/create_bulk_orders === "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + ``` { .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": "" } ' ``` @@ -5126,50 +6607,16 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "jsonrpc": "2.0", - "method": "v1/create_bulk_orders", + "method": "v1/fill_history", "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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "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 } @@ -5179,52 +6626,18 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/create_bulk_orders' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/fill_history' \ --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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -5236,50 +6649,16 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "j": "2.0", - "m": "v1/create_bulk_orders", + "m": "v1/fill_history", "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -5290,107 +6669,39 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/create_bulk_orders' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/fill_history' \ --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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "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/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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + 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 } @@ -5400,52 +6711,18 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/create_bulk_orders' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/fill_history' \ --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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -5457,50 +6734,16 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "j": "2.0", - "m": "v1/create_bulk_orders", + "m": "v1/fill_history", "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -5511,52 +6754,18 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/create_bulk_orders' \ + curl --location 'https://trades.grvt.io/full/v1/fill_history' \ --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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "state": { - "status": "PENDING", - "reject_reason": "CLIENT_CANCEL", - "book_size": ["10.5"], - "traded_size": ["1.5"], - "update_time": "1697788800000000000", - "avg_fill_price": ["60000.4"] - } - }] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -5568,105 +6777,37 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -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": "UNSPECIFIED", - "tpsl": { - "trigger_by": "UNSPECIFIED", - "trigger_price": "65038.10" - } - }, - "broker": "UNSPECIFIED" - }, - "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "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": "" } ' ``` @@ -5678,50 +6819,16 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "j": "2.0", - "m": "v1/create_bulk_orders", + "m": "v1/fill_history", "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": "UNSPECIFIED", - "t": { - "tb": "UNSPECIFIED", - "tp": "65038.10" - } - }, - "b": "UNSPECIFIED" - }, - "s1": { - "s": "PENDING", - "rr": "CLIENT_CANCEL", - "bs": ["10.5"], - "ts": ["1.5"], - "ut": "1697788800000000000", - "af": ["60000.4"] - } - }] + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -5729,34 +6836,40 @@ LITE ENDPOINT: lite/v1/create_bulk_orders ```

-### Get Order Group +### Positions ``` -FULL ENDPOINT: full/v1/order_group -LITE ENDPOINT: lite/v1/order_group +FULL ENDPOINT: full/v1/positions +LITE ENDPOINT: lite/v1/positions ``` === "Request"
- -8<- "docs/schemas/api_get_order_group_request.md" + -8<- "docs/schemas/api_positions_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ``` **Lite Request** ``` { .json .copy } { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ```
=== "Response"
- -8<- "docs/schemas/api_get_order_group_response.md" + -8<- "docs/schemas/api_positions_response.md"
!!! success @@ -5764,9 +6877,20 @@ LITE ENDPOINT: lite/v1/order_group ``` { .json .copy } { "result": [{ - "group_id": "0x10000101000203040506", - "client_order_id": ["[23042, 54232]"], - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "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 }] } ``` @@ -5774,9 +6898,20 @@ LITE ENDPOINT: lite/v1/order_group ``` { .json .copy } { "r": [{ - "gi": "0x10000101000203040506", - "co": ["[23042, 54232]"], - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "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 }] } ``` @@ -5792,9 +6927,6 @@ LITE ENDPOINT: lite/v1/order_group |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 @@ -5823,11 +6955,14 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/order_group' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/positions' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -5839,9 +6974,12 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "jsonrpc": "2.0", - "method": "v1/order_group", + "method": "v1/positions", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -5851,11 +6989,14 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/order_group' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/positions' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -5867,9 +7008,12 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "j": "2.0", - "m": "v1/order_group", + "m": "v1/positions", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -5880,11 +7024,14 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/order_group' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/positions' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -5896,9 +7043,12 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "jsonrpc": "2.0", - "method": "v1/order_group", + "method": "v1/positions", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -5908,11 +7058,14 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/order_group' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/positions' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -5924,9 +7077,12 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "j": "2.0", - "m": "v1/order_group", + "m": "v1/positions", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -5937,11 +7093,14 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/order_group' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/positions' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -5953,9 +7112,12 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "jsonrpc": "2.0", - "method": "v1/order_group", + "method": "v1/positions", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -5965,11 +7127,14 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/order_group' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/positions' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -5981,9 +7146,12 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "j": "2.0", - "m": "v1/order_group", + "m": "v1/positions", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -5994,11 +7162,14 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/order_group' \ + curl --location 'https://trades.grvt.io/full/v1/positions' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -6010,9 +7181,12 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "jsonrpc": "2.0", - "method": "v1/order_group", + "method": "v1/positions", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -6022,11 +7196,14 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/order_group' \ + curl --location 'https://trades.grvt.io/lite/v1/positions' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -6038,9 +7215,12 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "j": "2.0", - "m": "v1/order_group", + "m": "v1/positions", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -6048,16 +7228,15 @@ LITE ENDPOINT: lite/v1/order_group ```

-## Execution -### Fill History +### Funding Payment History ``` -FULL ENDPOINT: full/v1/fill_history -LITE ENDPOINT: lite/v1/fill_history +FULL ENDPOINT: full/v1/funding_payment_history +LITE ENDPOINT: lite/v1/funding_payment_history ``` === "Request"
- -8<- "docs/schemas/api_fill_history_request.md" + -8<- "docs/schemas/api_funding_payment_history_request.md"
!!! question "Query" @@ -6065,9 +7244,7 @@ LITE ENDPOINT: lite/v1/fill_history ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], + "instrument": "BTC_USDT_Perp", "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, @@ -6078,9 +7255,7 @@ LITE ENDPOINT: lite/v1/fill_history ``` { .json .copy } { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], + "i": "BTC_USDT_Perp", "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, @@ -6090,7 +7265,7 @@ LITE ENDPOINT: lite/v1/fill_history
=== "Response"
- -8<- "docs/schemas/api_fill_history_response.md" + -8<- "docs/schemas/api_funding_payment_history_response.md"
!!! success @@ -6101,23 +7276,9 @@ LITE ENDPOINT: lite/v1/fill_history "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" + "currency": "USDT", + "amount": "9.75", + "tx_id": "209358" }], "next": "Qw0918=" } @@ -6129,23 +7290,9 @@ LITE ENDPOINT: lite/v1/fill_history "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" + "c": "USDT", + "a": "9.75", + "ti": "209358" }], "n": "Qw0918=" } @@ -6190,14 +7337,12 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/fill_history' \ + 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 '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], + "instrument": "BTC_USDT_Perp", "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, @@ -6213,12 +7358,10 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/funding_payment_history", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], + "instrument": "BTC_USDT_Perp", "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, @@ -6232,14 +7375,12 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/fill_history' \ + 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 '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], + "i": "BTC_USDT_Perp", "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, @@ -6255,12 +7396,10 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/funding_payment_history", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], + "i": "BTC_USDT_Perp", "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, @@ -6275,14 +7414,12 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/fill_history' \ + 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 '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], + "instrument": "BTC_USDT_Perp", "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, @@ -6298,12 +7435,10 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/funding_payment_history", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], + "instrument": "BTC_USDT_Perp", "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, @@ -6317,14 +7452,12 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/fill_history' \ + 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 '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], + "i": "BTC_USDT_Perp", "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, @@ -6340,12 +7473,10 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/funding_payment_history", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], + "i": "BTC_USDT_Perp", "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, @@ -6360,14 +7491,12 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/fill_history' \ + 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 '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], + "instrument": "BTC_USDT_Perp", "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, @@ -6383,12 +7512,10 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/funding_payment_history", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], + "instrument": "BTC_USDT_Perp", "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, @@ -6402,14 +7529,12 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/fill_history' \ + 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 '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], + "i": "BTC_USDT_Perp", "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, @@ -6425,12 +7550,10 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/funding_payment_history", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], + "i": "BTC_USDT_Perp", "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, @@ -6445,14 +7568,12 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/fill_history' \ + curl --location 'https://trades.grvt.io/full/v1/funding_payment_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"], + "instrument": "BTC_USDT_Perp", "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, @@ -6468,12 +7589,10 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/funding_payment_history", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], + "instrument": "BTC_USDT_Perp", "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, @@ -6487,14 +7606,12 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/fill_history' \ + curl --location 'https://trades.grvt.io/lite/v1/funding_payment_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"], + "i": "BTC_USDT_Perp", "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, @@ -6510,12 +7627,10 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/funding_payment_history", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], + "i": "BTC_USDT_Perp", "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, @@ -6527,40 +7642,45 @@ LITE ENDPOINT: lite/v1/fill_history ```

-### Positions +## Transfer +### Deposit History ``` -FULL ENDPOINT: full/v1/positions -LITE ENDPOINT: lite/v1/positions +FULL ENDPOINT: full/v1/deposit_history +LITE ENDPOINT: lite/v1/deposit_history ``` === "Request"
- -8<- "docs/schemas/api_positions_request.md" + -8<- "docs/schemas/api_deposit_history_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "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'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ma": null } ```
=== "Response"
- -8<- "docs/schemas/api_positions_response.md" + -8<- "docs/schemas/api_deposit_history_response.md"
!!! success @@ -6568,42 +7688,32 @@ LITE ENDPOINT: lite/v1/positions ``` { .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 - }] + "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=" } ``` **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 - }] + "l1": "0x10000101000203040506", + "l2": "0x10000101000203040506", + "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "it": "1697788800000000000", + "ct": "1697788800000000000", + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0" + }], + "n": "Qw0918=" } ```
@@ -6646,14 +7756,16 @@ 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/deposit_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"] + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "main_account_id": null } ' ``` @@ -6665,12 +7777,14 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/deposit_history", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "main_account_id": null }, "id": 123 } @@ -6680,14 +7794,16 @@ 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/deposit_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"] + --data '{ + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ma": null } ' ``` @@ -6699,12 +7815,14 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/deposit_history", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ma": null }, "i": 123 } @@ -6715,14 +7833,16 @@ 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/deposit_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"] + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "main_account_id": null } ' ``` @@ -6734,12 +7854,14 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/deposit_history", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "main_account_id": null }, "id": 123 } @@ -6749,14 +7871,16 @@ 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/deposit_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"] + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ma": null } ' ``` @@ -6768,12 +7892,14 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/deposit_history", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ma": null }, "i": 123 } @@ -6784,14 +7910,16 @@ 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/deposit_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"] + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "main_account_id": null } ' ``` @@ -6803,12 +7931,14 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/deposit_history", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "main_account_id": null }, "id": 123 } @@ -6818,14 +7948,16 @@ 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/deposit_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"] + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ma": null } ' ``` @@ -6837,12 +7969,14 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/deposit_history", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ma": null }, "i": 123 } @@ -6853,14 +7987,16 @@ 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/deposit_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"] + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "main_account_id": null } ' ``` @@ -6872,12 +8008,14 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/deposit_history", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "main_account_id": null }, "id": 123 } @@ -6887,14 +8025,16 @@ 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/deposit_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"] + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ma": null } ' ``` @@ -6906,12 +8046,14 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/deposit_history", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ma": null }, "i": 123 } @@ -6919,73 +8061,81 @@ LITE ENDPOINT: lite/v1/positions ```

-### Funding Payment History +### Transfer ``` -FULL ENDPOINT: full/v1/funding_payment_history -LITE ENDPOINT: lite/v1/funding_payment_history +FULL ENDPOINT: full/v1/transfer +LITE ENDPOINT: lite/v1/transfer ``` === "Request"
- -8<- "docs/schemas/api_funding_payment_history_request.md" + -8<- "docs/schemas/api_transfer_request.md"
!!! 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": "" + "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"} } ``` **Lite Request** ``` { .json .copy } { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"} } ```
=== "Response"
- -8<- "docs/schemas/api_funding_payment_history_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", - "currency": "USDT", - "amount": "9.75", - "tx_id": "209358" - }], - "next": "Qw0918=" + "result": { + "ack": "true" + } } ``` **Lite Response** ``` { .json .copy } { - "r": [{ - "et": "1697788800000000000", - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "c": "USDT", - "a": "9.75", - "ti": "209358" - }], - "n": "Qw0918=" + "r": { + "a": "true" + } } ```
@@ -7000,6 +8150,12 @@ LITE ENDPOINT: lite/v1/funding_payment_history |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 @@ -7028,16 +8184,26 @@ 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/transfer' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"} } ' ``` @@ -7049,14 +8215,24 @@ LITE ENDPOINT: lite/v1/funding_payment_history -x ' { "jsonrpc": "2.0", - "method": "v1/funding_payment_history", + "method": "v1/transfer", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"} }, "id": 123 } @@ -7066,16 +8242,26 @@ 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/transfer' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"} } ' ``` @@ -7087,14 +8273,24 @@ LITE ENDPOINT: lite/v1/funding_payment_history -x ' { "j": "2.0", - "m": "v1/funding_payment_history", + "m": "v1/transfer", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"} }, "i": 123 } @@ -7105,16 +8301,26 @@ 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/transfer' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"} } ' ``` @@ -7126,14 +8332,24 @@ LITE ENDPOINT: lite/v1/funding_payment_history -x ' { "jsonrpc": "2.0", - "method": "v1/funding_payment_history", + "method": "v1/transfer", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"} }, "id": 123 } @@ -7143,16 +8359,26 @@ 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/transfer' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"} } ' ``` @@ -7164,14 +8390,24 @@ LITE ENDPOINT: lite/v1/funding_payment_history -x ' { "j": "2.0", - "m": "v1/funding_payment_history", + "m": "v1/transfer", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"} }, "i": 123 } @@ -7182,16 +8418,26 @@ 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/transfer' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"} } ' ``` @@ -7203,14 +8449,24 @@ LITE ENDPOINT: lite/v1/funding_payment_history -x ' { "jsonrpc": "2.0", - "method": "v1/funding_payment_history", + "method": "v1/transfer", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"} }, "id": 123 } @@ -7220,16 +8476,26 @@ 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/transfer' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"} } ' ``` @@ -7241,14 +8507,24 @@ LITE ENDPOINT: lite/v1/funding_payment_history -x ' { "j": "2.0", - "m": "v1/funding_payment_history", + "m": "v1/transfer", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"} }, "i": 123 } @@ -7259,16 +8535,26 @@ 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/transfer' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"} } ' ``` @@ -7280,14 +8566,24 @@ LITE ENDPOINT: lite/v1/funding_payment_history -x ' { "jsonrpc": "2.0", - "method": "v1/funding_payment_history", + "method": "v1/transfer", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"} }, "id": 123 } @@ -7297,16 +8593,26 @@ 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/transfer' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"} } ' ``` @@ -7318,14 +8624,24 @@ LITE ENDPOINT: lite/v1/funding_payment_history -x ' { "j": "2.0", - "m": "v1/funding_payment_history", + "m": "v1/transfer", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"} }, "i": 123 } @@ -7333,16 +8649,15 @@ LITE ENDPOINT: lite/v1/funding_payment_history ```

-## Transfer -### Deposit History +### Transfer History ``` -FULL ENDPOINT: full/v1/deposit_history -LITE ENDPOINT: lite/v1/deposit_history +FULL ENDPOINT: full/v1/transfer_history +LITE ENDPOINT: lite/v1/transfer_history ``` === "Request"
- -8<- "docs/schemas/api_deposit_history_request.md" + -8<- "docs/schemas/api_transfer_history_request.md"
!!! question "Query" @@ -7353,7 +8668,9 @@ LITE ENDPOINT: lite/v1/deposit_history "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, - "cursor": "" + "cursor": "", + "tx_id": "1028403", + "main_account_id": null } ``` **Lite Request** @@ -7363,13 +8680,15 @@ LITE ENDPOINT: lite/v1/deposit_history "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, - "c1": "" + "c1": "", + "ti": "1028403", + "ma": null } ```
=== "Response"
- -8<- "docs/schemas/api_deposit_history_response.md" + -8<- "docs/schemas/api_transfer_history_response.md"
!!! success @@ -7377,14 +8696,24 @@ LITE ENDPOINT: lite/v1/deposit_history ``` { .json .copy } { "result": [{ - "l_1_hash": "0x10000101000203040506", - "l_2_hash": "0x10000101000203040506", + "tx_id": "1028403", + "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", - "initiated_time": "1697788800000000000", - "confirmed_time": "1697788800000000000", - "from_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0" + "signature": { + "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "expiration": "1697788800000000000", + "nonce": 1234567890 + }, + "event_time": "1697788800000000000", + "transfer_type": "STANDARD", + "transfer_metadata": null }], "next": "Qw0918=" } @@ -7393,14 +8722,24 @@ LITE ENDPOINT: lite/v1/deposit_history ``` { .json .copy } { "r": [{ - "l1": "0x10000101000203040506", - "l2": "0x10000101000203040506", + "ti": "1028403", + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "fs": "'$GRVT_SUB_ACCOUNT_ID'", "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "ts": "'$GRVT_SUB_ACCOUNT_ID'", "c": "USDT", "nt": "1500.0", - "it": "1697788800000000000", - "ct": "1697788800000000000", - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0" + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + }, + "et": "1697788800000000000", + "tt": "STANDARD", + "tm": null }], "n": "Qw0918=" } @@ -7445,7 +8784,7 @@ 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/transfer_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -7453,7 +8792,9 @@ LITE ENDPOINT: lite/v1/deposit_history "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, - "cursor": "" + "cursor": "", + "tx_id": "1028403", + "main_account_id": null } ' ``` @@ -7465,13 +8806,15 @@ LITE ENDPOINT: lite/v1/deposit_history -x ' { "jsonrpc": "2.0", - "method": "v1/deposit_history", + "method": "v1/transfer_history", "params": { "currency": ["USDT", "USDC"], "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, - "cursor": "" + "cursor": "", + "tx_id": "1028403", + "main_account_id": null }, "id": 123 } @@ -7481,7 +8824,7 @@ 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/transfer_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -7489,7 +8832,9 @@ LITE ENDPOINT: lite/v1/deposit_history "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, - "c1": "" + "c1": "", + "ti": "1028403", + "ma": null } ' ``` @@ -7501,13 +8846,15 @@ LITE ENDPOINT: lite/v1/deposit_history -x ' { "j": "2.0", - "m": "v1/deposit_history", + "m": "v1/transfer_history", "p": { "c": ["USDT", "USDC"], "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, - "c1": "" + "c1": "", + "ti": "1028403", + "ma": null }, "i": 123 } @@ -7518,7 +8865,7 @@ 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/transfer_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -7526,7 +8873,9 @@ LITE ENDPOINT: lite/v1/deposit_history "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, - "cursor": "" + "cursor": "", + "tx_id": "1028403", + "main_account_id": null } ' ``` @@ -7538,13 +8887,15 @@ LITE ENDPOINT: lite/v1/deposit_history -x ' { "jsonrpc": "2.0", - "method": "v1/deposit_history", + "method": "v1/transfer_history", "params": { "currency": ["USDT", "USDC"], "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, - "cursor": "" + "cursor": "", + "tx_id": "1028403", + "main_account_id": null }, "id": 123 } @@ -7554,7 +8905,7 @@ 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/transfer_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -7562,7 +8913,9 @@ LITE ENDPOINT: lite/v1/deposit_history "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, - "c1": "" + "c1": "", + "ti": "1028403", + "ma": null } ' ``` @@ -7574,13 +8927,15 @@ LITE ENDPOINT: lite/v1/deposit_history -x ' { "j": "2.0", - "m": "v1/deposit_history", + "m": "v1/transfer_history", "p": { "c": ["USDT", "USDC"], "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, - "c1": "" + "c1": "", + "ti": "1028403", + "ma": null }, "i": 123 } @@ -7591,7 +8946,7 @@ 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/transfer_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -7599,7 +8954,9 @@ LITE ENDPOINT: lite/v1/deposit_history "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, - "cursor": "" + "cursor": "", + "tx_id": "1028403", + "main_account_id": null } ' ``` @@ -7611,13 +8968,15 @@ LITE ENDPOINT: lite/v1/deposit_history -x ' { "jsonrpc": "2.0", - "method": "v1/deposit_history", + "method": "v1/transfer_history", "params": { "currency": ["USDT", "USDC"], "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, - "cursor": "" + "cursor": "", + "tx_id": "1028403", + "main_account_id": null }, "id": 123 } @@ -7627,7 +8986,7 @@ 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/transfer_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -7635,7 +8994,9 @@ LITE ENDPOINT: lite/v1/deposit_history "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, - "c1": "" + "c1": "", + "ti": "1028403", + "ma": null } ' ``` @@ -7647,13 +9008,15 @@ LITE ENDPOINT: lite/v1/deposit_history -x ' { "j": "2.0", - "m": "v1/deposit_history", + "m": "v1/transfer_history", "p": { "c": ["USDT", "USDC"], "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, - "c1": "" + "c1": "", + "ti": "1028403", + "ma": null }, "i": 123 } @@ -7664,7 +9027,7 @@ 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/transfer_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -7672,7 +9035,9 @@ LITE ENDPOINT: lite/v1/deposit_history "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, - "cursor": "" + "cursor": "", + "tx_id": "1028403", + "main_account_id": null } ' ``` @@ -7684,13 +9049,15 @@ LITE ENDPOINT: lite/v1/deposit_history -x ' { "jsonrpc": "2.0", - "method": "v1/deposit_history", + "method": "v1/transfer_history", "params": { "currency": ["USDT", "USDC"], "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, - "cursor": "" + "cursor": "", + "tx_id": "1028403", + "main_account_id": null }, "id": 123 } @@ -7700,7 +9067,7 @@ 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/transfer_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -7708,7 +9075,9 @@ LITE ENDPOINT: lite/v1/deposit_history "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, - "c1": "" + "c1": "", + "ti": "1028403", + "ma": null } ' ``` @@ -7720,13 +9089,15 @@ LITE ENDPOINT: lite/v1/deposit_history -x ' { "j": "2.0", - "m": "v1/deposit_history", + "m": "v1/transfer_history", "p": { "c": ["USDT", "USDC"], "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, - "c1": "" + "c1": "", + "ti": "1028403", + "ma": null }, "i": 123 } @@ -7734,15 +9105,15 @@ LITE ENDPOINT: lite/v1/deposit_history ```

-### Transfer +### Withdrawal ``` -FULL ENDPOINT: full/v1/transfer -LITE ENDPOINT: lite/v1/transfer +FULL ENDPOINT: full/v1/withdrawal +LITE ENDPOINT: lite/v1/withdrawal ``` === "Request"
- -8<- "docs/schemas/api_transfer_request.md" + -8<- "docs/schemas/api_withdrawal_request.md"
!!! question "Query" @@ -7750,9 +9121,7 @@ LITE ENDPOINT: lite/v1/transfer ``` { .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'", + "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "1500.0", "signature": { @@ -7762,18 +9131,14 @@ LITE ENDPOINT: lite/v1/transfer "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", - "fs": "'$GRVT_SUB_ACCOUNT_ID'", - "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "ts": "'$GRVT_SUB_ACCOUNT_ID'", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "1500.0", "s": { @@ -7783,9 +9148,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, - "tt": "STANDARD", - "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } } ```
@@ -7820,15 +9183,10 @@ LITE ENDPOINT: lite/v1/transfer |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| - |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.| + |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.|
!!! failure @@ -7857,14 +9215,12 @@ 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/withdrawal' \ --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'", + "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "1500.0", "signature": { @@ -7874,9 +9230,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, - "transfer_type": "STANDARD", - "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } } ' ``` @@ -7888,12 +9242,10 @@ LITE ENDPOINT: lite/v1/transfer -x ' { "jsonrpc": "2.0", - "method": "v1/transfer", + "method": "v1/withdrawal", "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'", + "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "1500.0", "signature": { @@ -7903,9 +9255,7 @@ LITE ENDPOINT: lite/v1/transfer "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 } @@ -7915,14 +9265,12 @@ 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/withdrawal' \ --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'", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "1500.0", "s": { @@ -7932,9 +9280,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, - "tt": "STANDARD", - "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } } ' ``` @@ -7946,12 +9292,10 @@ LITE ENDPOINT: lite/v1/transfer -x ' { "j": "2.0", - "m": "v1/transfer", + "m": "v1/withdrawal", "p": { "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "fs": "'$GRVT_SUB_ACCOUNT_ID'", - "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "ts": "'$GRVT_SUB_ACCOUNT_ID'", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "1500.0", "s": { @@ -7961,9 +9305,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, - "tt": "STANDARD", - "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } }, "i": 123 } @@ -7974,14 +9316,12 @@ 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/withdrawal' \ --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'", + "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "1500.0", "signature": { @@ -7991,9 +9331,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, - "transfer_type": "STANDARD", - "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } } ' ``` @@ -8005,12 +9343,10 @@ LITE ENDPOINT: lite/v1/transfer -x ' { "jsonrpc": "2.0", - "method": "v1/transfer", + "method": "v1/withdrawal", "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'", + "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "1500.0", "signature": { @@ -8020,9 +9356,7 @@ LITE ENDPOINT: lite/v1/transfer "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 } @@ -8032,14 +9366,12 @@ 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/withdrawal' \ --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'", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "1500.0", "s": { @@ -8049,9 +9381,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, - "tt": "STANDARD", - "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } } ' ``` @@ -8063,12 +9393,10 @@ LITE ENDPOINT: lite/v1/transfer -x ' { "j": "2.0", - "m": "v1/transfer", + "m": "v1/withdrawal", "p": { "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "fs": "'$GRVT_SUB_ACCOUNT_ID'", - "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "ts": "'$GRVT_SUB_ACCOUNT_ID'", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "1500.0", "s": { @@ -8078,9 +9406,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, - "tt": "STANDARD", - "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } }, "i": 123 } @@ -8091,14 +9417,12 @@ 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/withdrawal' \ --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'", + "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "1500.0", "signature": { @@ -8108,9 +9432,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, - "transfer_type": "STANDARD", - "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } } ' ``` @@ -8122,12 +9444,10 @@ LITE ENDPOINT: lite/v1/transfer -x ' { "jsonrpc": "2.0", - "method": "v1/transfer", + "method": "v1/withdrawal", "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'", + "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "1500.0", "signature": { @@ -8137,9 +9457,7 @@ LITE ENDPOINT: lite/v1/transfer "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 } @@ -8149,14 +9467,12 @@ 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/withdrawal' \ --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'", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "1500.0", "s": { @@ -8166,9 +9482,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, - "tt": "STANDARD", - "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } } ' ``` @@ -8180,12 +9494,10 @@ LITE ENDPOINT: lite/v1/transfer -x ' { "j": "2.0", - "m": "v1/transfer", + "m": "v1/withdrawal", "p": { "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "fs": "'$GRVT_SUB_ACCOUNT_ID'", - "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "ts": "'$GRVT_SUB_ACCOUNT_ID'", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "1500.0", "s": { @@ -8195,9 +9507,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, - "tt": "STANDARD", - "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } }, "i": 123 } @@ -8208,14 +9518,12 @@ 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/withdrawal' \ --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'", + "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "1500.0", "signature": { @@ -8225,9 +9533,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, - "transfer_type": "STANDARD", - "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } } ' ``` @@ -8239,12 +9545,10 @@ LITE ENDPOINT: lite/v1/transfer -x ' { "jsonrpc": "2.0", - "method": "v1/transfer", + "method": "v1/withdrawal", "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'", + "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "1500.0", "signature": { @@ -8254,9 +9558,7 @@ LITE ENDPOINT: lite/v1/transfer "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 } @@ -8266,14 +9568,12 @@ 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/withdrawal' \ --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'", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "1500.0", "s": { @@ -8283,9 +9583,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, - "tt": "STANDARD", - "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } } ' ``` @@ -8297,12 +9595,10 @@ LITE ENDPOINT: lite/v1/transfer -x ' { "j": "2.0", - "m": "v1/transfer", + "m": "v1/withdrawal", "p": { "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "fs": "'$GRVT_SUB_ACCOUNT_ID'", - "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "ts": "'$GRVT_SUB_ACCOUNT_ID'", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "1500.0", "s": { @@ -8312,9 +9608,7 @@ LITE ENDPOINT: lite/v1/transfer "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, - "tt": "STANDARD", - "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + } }, "i": 123 } @@ -8322,15 +9616,15 @@ LITE ENDPOINT: lite/v1/transfer ```

-### Transfer History +### Withdrawal History ``` -FULL ENDPOINT: full/v1/transfer_history -LITE ENDPOINT: lite/v1/transfer_history +FULL ENDPOINT: full/v1/withdrawal_history +LITE ENDPOINT: lite/v1/withdrawal_history ``` === "Request"
- -8<- "docs/schemas/api_transfer_history_request.md" + -8<- "docs/schemas/api_withdrawal_history_request.md"
!!! question "Query" @@ -8342,7 +9636,7 @@ LITE ENDPOINT: lite/v1/transfer_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403" + "main_account_id": null } ``` **Lite Request** @@ -8353,13 +9647,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_withdrawal_history_response.md"
!!! success @@ -8369,9 +9663,7 @@ LITE ENDPOINT: lite/v1/transfer_history "result": [{ "tx_id": "1028403", "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "to_eth_address": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "1500.0", "signature": { @@ -8382,9 +9674,7 @@ LITE ENDPOINT: lite/v1/transfer_history "expiration": "1697788800000000000", "nonce": 1234567890 }, - "event_time": "1697788800000000000", - "transfer_type": "STANDARD", - "transfer_metadata": null + "event_time": "1697788800000000000" }], "next": "Qw0918=" } @@ -8395,9 +9685,7 @@ LITE ENDPOINT: lite/v1/transfer_history "r": [{ "ti": "1028403", "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "fs": "'$GRVT_SUB_ACCOUNT_ID'", - "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "ts": "'$GRVT_SUB_ACCOUNT_ID'", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "1500.0", "s": { @@ -8408,9 +9696,7 @@ LITE ENDPOINT: lite/v1/transfer_history "e": "1697788800000000000", "n": 1234567890 }, - "et": "1697788800000000000", - "tt": "STANDARD", - "tm": null + "et": "1697788800000000000" }], "n": "Qw0918=" } @@ -8455,7 +9741,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/withdrawal_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8464,7 +9750,7 @@ LITE ENDPOINT: lite/v1/transfer_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403" + "main_account_id": null } ' ``` @@ -8476,14 +9762,14 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "jsonrpc": "2.0", - "method": "v1/transfer_history", + "method": "v1/withdrawal_history", "params": { "currency": ["USDT", "USDC"], "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403" + "main_account_id": null }, "id": 123 } @@ -8493,7 +9779,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/withdrawal_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8502,7 +9788,7 @@ LITE ENDPOINT: lite/v1/transfer_history "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403" + "ma": null } ' ``` @@ -8514,14 +9800,14 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "j": "2.0", - "m": "v1/transfer_history", + "m": "v1/withdrawal_history", "p": { "c": ["USDT", "USDC"], "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403" + "ma": null }, "i": 123 } @@ -8532,7 +9818,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/withdrawal_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8541,7 +9827,7 @@ LITE ENDPOINT: lite/v1/transfer_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403" + "main_account_id": null } ' ``` @@ -8553,14 +9839,14 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "jsonrpc": "2.0", - "method": "v1/transfer_history", + "method": "v1/withdrawal_history", "params": { "currency": ["USDT", "USDC"], "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403" + "main_account_id": null }, "id": 123 } @@ -8570,7 +9856,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/withdrawal_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8579,7 +9865,7 @@ LITE ENDPOINT: lite/v1/transfer_history "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403" + "ma": null } ' ``` @@ -8591,14 +9877,14 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "j": "2.0", - "m": "v1/transfer_history", + "m": "v1/withdrawal_history", "p": { "c": ["USDT", "USDC"], "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403" + "ma": null }, "i": 123 } @@ -8609,7 +9895,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/withdrawal_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8618,7 +9904,7 @@ LITE ENDPOINT: lite/v1/transfer_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403" + "main_account_id": null } ' ``` @@ -8630,14 +9916,14 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "jsonrpc": "2.0", - "method": "v1/transfer_history", + "method": "v1/withdrawal_history", "params": { "currency": ["USDT", "USDC"], "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403" + "main_account_id": null }, "id": 123 } @@ -8647,7 +9933,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/withdrawal_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8656,7 +9942,7 @@ LITE ENDPOINT: lite/v1/transfer_history "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403" + "ma": null } ' ``` @@ -8668,14 +9954,14 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "j": "2.0", - "m": "v1/transfer_history", + "m": "v1/withdrawal_history", "p": { "c": ["USDT", "USDC"], "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403" + "ma": null }, "i": 123 } @@ -8686,7 +9972,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/withdrawal_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8695,7 +9981,7 @@ LITE ENDPOINT: lite/v1/transfer_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403" + "main_account_id": null } ' ``` @@ -8707,14 +9993,14 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "jsonrpc": "2.0", - "method": "v1/transfer_history", + "method": "v1/withdrawal_history", "params": { "currency": ["USDT", "USDC"], "start_time": "1697788800000000000", "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403" + "main_account_id": null }, "id": 123 } @@ -8724,7 +10010,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/withdrawal_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8733,7 +10019,7 @@ LITE ENDPOINT: lite/v1/transfer_history "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403" + "ma": null } ' ``` @@ -8745,14 +10031,14 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "j": "2.0", - "m": "v1/transfer_history", + "m": "v1/withdrawal_history", "p": { "c": ["USDT", "USDC"], "st": "1697788800000000000", "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403" + "ma": null }, "i": 123 } @@ -8760,73 +10046,52 @@ LITE ENDPOINT: lite/v1/transfer_history ```

-### Withdrawal +## PreDepositCheck +### Pre Deposit Check ``` -FULL ENDPOINT: full/v1/withdrawal -LITE ENDPOINT: lite/v1/withdrawal +FULL ENDPOINT: full/v1/pre_deposit_check +LITE ENDPOINT: lite/v1/pre_deposit_check ``` === "Request"
- -8<- "docs/schemas/api_withdrawal_request.md" + -8<- "docs/schemas/api_pre_deposit_check_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "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 - } + "bridge": "XY" } ``` **Lite Request** ``` { .json .copy } { - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "b": "XY" } ```
=== "Response"
- -8<- "docs/schemas/ack_response.md" + -8<- "docs/schemas/api_pre_deposit_check_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": { - "ack": "true" - } + "max_deposit_limit": "3945034.23", + "currency": "USDT" } ``` **Lite Response** ``` { .json .copy } { - "r": { - "a": "true" - } + "md": "3945034.23", + "c": "USDT" } ```
@@ -8835,13 +10100,11 @@ LITE ENDPOINT: lite/v1/withdrawal !!! 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 @@ -8849,18 +10112,18 @@ LITE ENDPOINT: lite/v1/withdrawal ``` { .json .copy } { "request_id":1, - "code":1000, - "message":"You need to authenticate prior to using this functionality", - "status":401 + "code":1002, + "message":"Internal Server Error", + "status":500 } ``` **Lite Error Response** ``` { .json .copy } { "ri":1, - "c":1000, - "m":"You need to authenticate prior to using this functionality", - "s":401 + "c":1002, + "m":"Internal Server Error", + "s":500 } ```
@@ -8870,22 +10133,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "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 - } + "bridge": "XY" } ' ``` @@ -8897,20 +10150,10 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal", + "method": "v1/pre_deposit_check", "params": { - "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 - } + "bridge": "XY" }, "id": 123 } @@ -8920,22 +10163,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "b": "XY" } ' ``` @@ -8947,20 +10180,10 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "j": "2.0", - "m": "v1/withdrawal", + "m": "v1/pre_deposit_check", "p": { - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "b": "XY" }, "i": 123 } @@ -8971,22 +10194,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "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 - } + "bridge": "XY" } ' ``` @@ -8998,20 +10211,10 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal", + "method": "v1/pre_deposit_check", "params": { - "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 - } + "bridge": "XY" }, "id": 123 } @@ -9021,22 +10224,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "b": "XY" } ' ``` @@ -9048,20 +10241,10 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "j": "2.0", - "m": "v1/withdrawal", + "m": "v1/pre_deposit_check", "p": { - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "b": "XY" }, "i": 123 } @@ -9072,22 +10255,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "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 - } + "bridge": "XY" } ' ``` @@ -9099,20 +10272,10 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal", + "method": "v1/pre_deposit_check", "params": { - "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 - } + "bridge": "XY" }, "id": 123 } @@ -9122,22 +10285,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "b": "XY" } ' ``` @@ -9149,20 +10302,10 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "j": "2.0", - "m": "v1/withdrawal", + "m": "v1/pre_deposit_check", "p": { - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "b": "XY" }, "i": 123 } @@ -9173,22 +10316,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "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 - } + "bridge": "XY" } ' ``` @@ -9200,20 +10333,10 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal", + "method": "v1/pre_deposit_check", "params": { - "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 - } + "bridge": "XY" }, "id": 123 } @@ -9223,47 +10346,27 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "b": "XY" } ' ``` !!! 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/withdrawal", - "p": { - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "v1/pre_deposit_check", + "p": { + "c": "USDT", + "b": "XY" }, "i": 123 } @@ -9271,87 +10374,112 @@ LITE ENDPOINT: lite/v1/withdrawal ```

-### Withdrawal History +## Account +### Sub Account Summary ``` -FULL ENDPOINT: full/v1/withdrawal_history -LITE ENDPOINT: lite/v1/withdrawal_history +FULL ENDPOINT: full/v1/account_summary +LITE ENDPOINT: lite/v1/account_summary ``` === "Request"
- -8<- "docs/schemas/api_withdrawal_history_request.md" + -8<- "docs/schemas/api_sub_account_summary_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ``` **Lite Request** ``` { .json .copy } { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ```
=== "Response"
- -8<- "docs/schemas/api_withdrawal_history_response.md" + -8<- "docs/schemas/api_sub_account_summary_response.md"
!!! success **Full Response** ``` { .json .copy } { - "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=" + "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 + }], + "settle_index_price": "1.0000102" + } } ``` **Lite Response** ``` { .json .copy } { - "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=" + "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 + }], + "si": "1.0000102" + } } ```
@@ -9394,15 +10522,11 @@ 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/account_summary' \ --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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9414,13 +10538,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal_history", + "method": "v1/account_summary", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -9430,15 +10550,11 @@ 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/account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9450,13 +10566,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "j": "2.0", - "m": "v1/withdrawal_history", + "m": "v1/account_summary", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -9467,15 +10579,11 @@ 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/account_summary' \ --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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9487,13 +10595,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal_history", + "method": "v1/account_summary", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -9503,15 +10607,11 @@ 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/account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9523,13 +10623,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "j": "2.0", - "m": "v1/withdrawal_history", + "m": "v1/account_summary", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -9540,15 +10636,11 @@ 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/account_summary' \ --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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9560,13 +10652,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal_history", + "method": "v1/account_summary", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -9576,15 +10664,11 @@ 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/account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9596,13 +10680,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "j": "2.0", - "m": "v1/withdrawal_history", + "m": "v1/account_summary", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -9613,15 +10693,11 @@ 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/account_summary' \ --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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9633,13 +10709,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal_history", + "method": "v1/account_summary", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -9649,15 +10721,11 @@ 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/account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9669,13 +10737,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "j": "2.0", - "m": "v1/withdrawal_history", + "m": "v1/account_summary", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -9683,52 +10747,121 @@ LITE ENDPOINT: lite/v1/withdrawal_history ```

-## PreDepositCheck -### Pre Deposit Check +### Sub Account History ``` -FULL ENDPOINT: full/v1/pre_deposit_check -LITE ENDPOINT: lite/v1/pre_deposit_check +FULL ENDPOINT: full/v1/account_history +LITE ENDPOINT: lite/v1/account_history ``` === "Request"
- -8<- "docs/schemas/api_pre_deposit_check_request.md" + -8<- "docs/schemas/api_sub_account_history_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ``` **Lite Request** ``` { .json .copy } { - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ```
=== "Response"
- -8<- "docs/schemas/api_pre_deposit_check_response.md" + -8<- "docs/schemas/api_sub_account_history_response.md"
!!! success **Full Response** ``` { .json .copy } { - "max_deposit_limit": "3945034.23", - "currency": "USDT" + "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 + }], + "settle_index_price": "1.0000102" + }], + "next": "Qw0918=" } ``` **Lite Response** ``` { .json .copy } { - "md": "3945034.23", - "c": "USDT" + "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 + }], + "si": "1.0000102" + }], + "n": "Qw0918=" } ```
@@ -9737,10 +10870,11 @@ 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|
@@ -9749,18 +10883,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 } ```
@@ -9770,12 +10904,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -9787,10 +10924,13 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_deposit_check", + "method": "v1/account_history", "params": { - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -9800,12 +10940,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -9817,10 +10960,13 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "j": "2.0", - "m": "v1/pre_deposit_check", + "m": "v1/account_history", "p": { - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -9831,12 +10977,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -9848,10 +10997,13 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_deposit_check", + "method": "v1/account_history", "params": { - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -9861,12 +11013,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -9878,10 +11033,13 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "j": "2.0", - "m": "v1/pre_deposit_check", + "m": "v1/account_history", "p": { - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -9892,12 +11050,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -9909,10 +11070,13 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_deposit_check", + "method": "v1/account_history", "params": { - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -9922,12 +11086,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -9939,10 +11106,13 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "j": "2.0", - "m": "v1/pre_deposit_check", + "m": "v1/account_history", "p": { - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -9953,12 +11123,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -9970,10 +11143,13 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_deposit_check", + "method": "v1/account_history", "params": { - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -9983,12 +11159,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -10000,10 +11179,13 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "j": "2.0", - "m": "v1/pre_deposit_check", + "m": "v1/account_history", "p": { - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -10011,35 +11193,32 @@ LITE ENDPOINT: lite/v1/pre_deposit_check ```

-## Account -### Sub Account Summary +### Aggregated Account Summary ``` -FULL ENDPOINT: full/v1/account_summary -LITE ENDPOINT: lite/v1/account_summary +FULL ENDPOINT: full/v1/aggregated_account_summary +LITE ENDPOINT: lite/v1/aggregated_account_summary ``` === "Request"
- -8<- "docs/schemas/api_sub_account_summary_request.md" + -8<- "docs/schemas/empty_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_sub_account_summary_response.md" + -8<- "docs/schemas/api_aggregated_account_summary_response.md"
!!! success @@ -10047,37 +11226,13 @@ LITE ENDPOINT: lite/v1/account_summary ``` { .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", + "main_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "total_equity": "3945034.23", "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 - }], - "settle_index_price": "1.0000102" + }] } } ``` @@ -10085,37 +11240,13 @@ LITE ENDPOINT: lite/v1/account_summary ``` { .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", + "ma": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "3945034.23", "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 - }], - "si": "1.0000102" + }] } } ``` @@ -10125,8 +11256,6 @@ LITE ENDPOINT: lite/v1/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| @@ -10138,18 +11267,18 @@ LITE ENDPOINT: lite/v1/account_summary ``` { .json .copy } { "request_id":1, - "code":1000, - "message":"You need to authenticate prior to using this functionality", - "status":401 + "code":1002, + "message":"Internal Server Error", + "status":500 } ``` **Lite Error Response** ``` { .json .copy } { "ri":1, - "c":1000, - "m":"You need to authenticate prior to using this functionality", - "s":401 + "c":1002, + "m":"Internal Server Error", + "s":500 } ```
@@ -10159,11 +11288,10 @@ 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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -10175,9 +11303,8 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/account_summary", + "method": "v1/aggregated_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -10187,11 +11314,10 @@ 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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -10203,9 +11329,8 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "j": "2.0", - "m": "v1/account_summary", + "m": "v1/aggregated_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -10216,11 +11341,10 @@ 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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -10232,9 +11356,8 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/account_summary", + "method": "v1/aggregated_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -10244,11 +11367,10 @@ 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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -10260,9 +11382,8 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "j": "2.0", - "m": "v1/account_summary", + "m": "v1/aggregated_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -10273,11 +11394,10 @@ 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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -10289,9 +11409,8 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/account_summary", + "method": "v1/aggregated_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -10301,11 +11420,10 @@ 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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -10317,9 +11435,8 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "j": "2.0", - "m": "v1/account_summary", + "m": "v1/aggregated_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -10330,11 +11447,10 @@ 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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -10346,9 +11462,8 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/account_summary", + "method": "v1/aggregated_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -10358,11 +11473,10 @@ 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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -10374,9 +11488,8 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "j": "2.0", - "m": "v1/account_summary", + "m": "v1/aggregated_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -10384,121 +11497,61 @@ LITE ENDPOINT: lite/v1/account_summary ```

-### Sub Account History +### Funding Account Summary ``` -FULL ENDPOINT: full/v1/account_history -LITE ENDPOINT: lite/v1/account_history +FULL ENDPOINT: full/v1/funding_account_summary +LITE ENDPOINT: lite/v1/funding_account_summary ``` === "Request"
- -8<- "docs/schemas/api_sub_account_history_request.md" + -8<- "docs/schemas/empty_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_sub_account_history_response.md" + -8<- "docs/schemas/api_funding_account_summary_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", + "result": { + "main_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "total_equity": "3945034.23", "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 - }], - "settle_index_price": "1.0000102" - }], - "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", + "r": { + "ma": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "3945034.23", "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 - }], - "si": "1.0000102" - }], - "n": "Qw0918=" + }] + } } ```
@@ -10507,8 +11560,6 @@ LITE ENDPOINT: lite/v1/account_history !!! 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| @@ -10520,18 +11571,18 @@ LITE ENDPOINT: lite/v1/account_history ``` { .json .copy } { "request_id":1, - "code":1000, - "message":"You need to authenticate prior to using this functionality", - "status":401 + "code":1002, + "message":"Internal Server Error", + "status":500 } ``` **Lite Error Response** ``` { .json .copy } { "ri":1, - "c":1000, - "m":"You need to authenticate prior to using this functionality", - "s":401 + "c":1002, + "m":"Internal Server Error", + "s":500 } ```
@@ -10541,15 +11592,10 @@ 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/funding_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": "" } ' ``` @@ -10561,13 +11607,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/funding_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" }, "id": 123 } @@ -10577,15 +11618,10 @@ 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/funding_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": "" + --data '{ } ' ``` @@ -10597,13 +11633,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/funding_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" }, "i": 123 } @@ -10614,15 +11645,10 @@ 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/funding_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": "" } ' ``` @@ -10634,13 +11660,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/funding_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" }, "id": 123 } @@ -10650,15 +11671,10 @@ 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/funding_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": "" } ' ``` @@ -10670,13 +11686,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/funding_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" }, "i": 123 } @@ -10687,15 +11698,10 @@ 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/funding_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": "" } ' ``` @@ -10707,13 +11713,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/funding_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" }, "id": 123 } @@ -10723,15 +11724,10 @@ 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/funding_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": "" } ' ``` @@ -10743,13 +11739,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/funding_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" }, "i": 123 } @@ -10760,15 +11751,10 @@ 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/funding_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": "" } ' ``` @@ -10780,13 +11766,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/funding_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" }, "id": 123 } @@ -10796,15 +11777,10 @@ 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/funding_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": "" } ' ``` @@ -10816,13 +11792,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/funding_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" }, "i": 123 } @@ -10830,10 +11801,11 @@ LITE ENDPOINT: lite/v1/account_history ```

-### Aggregated Account Summary +## SocializedLoss +### Socialized Loss Status ``` -FULL ENDPOINT: full/v1/aggregated_account_summary -LITE ENDPOINT: lite/v1/aggregated_account_summary +FULL ENDPOINT: full/v1/socialized_loss_status +LITE ENDPOINT: lite/v1/socialized_loss_status ``` === "Request" @@ -10855,36 +11827,22 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
=== "Response"
- -8<- "docs/schemas/api_aggregated_account_summary_response.md" + -8<- "docs/schemas/api_socialized_loss_status_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": { - "main_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "total_equity": "3945034.23", - "spot_balances": [{ - "currency": "USDT", - "balance": "123456.78", - "index_price": "1.0000102" - }] - } + "is_active": "false", + "haircut_ratio": "0.34" } ``` **Lite Response** ``` { .json .copy } { - "r": { - "ma": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "3945034.23", - "sb": [{ - "c": "USDT", - "b": "123456.78", - "ip": "1.0000102" - }] - } + "ia": "false", + "hr": "0.34" } ```
@@ -10925,7 +11883,7 @@ 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/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -10940,7 +11898,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/socialized_loss_status", "params": { }, "id": 123 @@ -10951,7 +11909,7 @@ 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/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -10966,7 +11924,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/socialized_loss_status", "p": { }, "i": 123 @@ -10978,7 +11936,7 @@ 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/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -10993,7 +11951,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/socialized_loss_status", "params": { }, "id": 123 @@ -11004,7 +11962,7 @@ 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/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -11019,7 +11977,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/socialized_loss_status", "p": { }, "i": 123 @@ -11031,7 +11989,7 @@ 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/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -11046,7 +12004,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/socialized_loss_status", "params": { }, "id": 123 @@ -11057,7 +12015,7 @@ 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/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -11072,7 +12030,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/socialized_loss_status", "p": { }, "i": 123 @@ -11084,7 +12042,7 @@ 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/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -11099,7 +12057,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/socialized_loss_status", "params": { }, "id": 123 @@ -11110,7 +12068,7 @@ 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/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -11125,7 +12083,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/socialized_loss_status", "p": { }, "i": 123 @@ -11134,61 +12092,58 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary ```

-### Funding Account Summary +## InitialLeverage +### Get All Initial Leverage ``` -FULL ENDPOINT: full/v1/funding_account_summary -LITE ENDPOINT: lite/v1/funding_account_summary +FULL ENDPOINT: full/v1/get_all_initial_leverage +LITE ENDPOINT: lite/v1/get_all_initial_leverage ``` === "Request"
- -8<- "docs/schemas/empty_request.md" + -8<- "docs/schemas/api_get_all_initial_leverage_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_funding_account_summary_response.md" + -8<- "docs/schemas/api_get_all_initial_leverage_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": { - "main_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "total_equity": "3945034.23", - "spot_balances": [{ - "currency": "USDT", - "balance": "123456.78", - "index_price": "1.0000102" - }] - } + "results": [{ + "instrument": "BTC_USDT_Perp", + "leverage": "10", + "min_leverage": "10", + "max_leverage": "50" + }] } ``` **Lite Response** ``` { .json .copy } { - "r": { - "ma": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "3945034.23", - "sb": [{ - "c": "USDT", - "b": "123456.78", - "ip": "1.0000102" - }] - } + "r": [{ + "i": "BTC_USDT_Perp", + "l": "10", + "ml": "10", + "ml1": "50" + }] } ```
@@ -11197,10 +12152,12 @@ LITE ENDPOINT: lite/v1/funding_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| - |1008|401|Your IP has not been whitelisted for access| + |1004|404|Data Not Found|
!!! failure @@ -11208,18 +12165,18 @@ LITE ENDPOINT: lite/v1/funding_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 } ```
@@ -11229,10 +12186,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11244,8 +12202,9 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_account_summary", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11255,10 +12214,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11270,8 +12230,9 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11282,10 +12243,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11297,8 +12259,9 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_account_summary", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11308,10 +12271,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11323,8 +12287,9 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11335,10 +12300,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11350,8 +12316,9 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_account_summary", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11361,10 +12328,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11376,8 +12344,9 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11388,10 +12357,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11403,8 +12373,9 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_account_summary", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11414,10 +12385,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11429,8 +12401,9 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11438,48 +12411,51 @@ LITE ENDPOINT: lite/v1/funding_account_summary ```

-## SocializedLoss -### Socialized Loss Status +### Set Initial Leverage ``` -FULL ENDPOINT: full/v1/socialized_loss_status -LITE ENDPOINT: lite/v1/socialized_loss_status +FULL ENDPOINT: full/v1/set_initial_leverage +LITE ENDPOINT: lite/v1/set_initial_leverage ``` === "Request"
- -8<- "docs/schemas/empty_request.md" + -8<- "docs/schemas/api_set_initial_leverage_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ``` **Lite Request** ``` { .json .copy } { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" } ```
=== "Response"
- -8<- "docs/schemas/api_socialized_loss_status_response.md" + -8<- "docs/schemas/api_set_initial_leverage_response.md"
!!! success **Full Response** ``` { .json .copy } { - "is_active": "false", - "haircut_ratio": "0.34" + "success": "true" } ``` **Lite Response** ``` { .json .copy } { - "ia": "false", - "hr": "0.34" + "s": "true" } ```
@@ -11488,10 +12464,13 @@ LITE ENDPOINT: lite/v1/socialized_loss_status !!! 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| + |2100|400|Invalid initial leverage|
!!! failure @@ -11499,18 +12478,18 @@ LITE ENDPOINT: lite/v1/socialized_loss_status ``` { .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 } ```
@@ -11520,10 +12499,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -11535,8 +12517,11 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/set_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -11546,10 +12531,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -11561,8 +12549,11 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/set_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -11573,10 +12564,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -11588,8 +12582,11 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/set_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -11599,10 +12596,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -11614,8 +12614,11 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/set_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -11626,10 +12629,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -11641,8 +12647,11 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/set_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -11652,10 +12661,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -11667,8 +12679,11 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/set_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -11679,10 +12694,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -11694,8 +12712,11 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/set_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -11705,10 +12726,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -11720,8 +12744,11 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/set_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -11729,35 +12756,33 @@ LITE ENDPOINT: lite/v1/socialized_loss_status ```

-## InitialLeverage -### Get All Initial Leverage +## Margin +### Get Margin Tiers ``` -FULL ENDPOINT: full/v1/get_all_initial_leverage -LITE ENDPOINT: lite/v1/get_all_initial_leverage +FULL ENDPOINT: full/v1/get_margin_tiers +LITE ENDPOINT: lite/v1/get_margin_tiers ``` === "Request"
- -8<- "docs/schemas/api_get_all_initial_leverage_request.md" + -8<- "docs/schemas/empty_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_all_initial_leverage_response.md" + -8<- "docs/schemas/api_get_margin_tiers_response.md"
!!! success @@ -11765,10 +12790,11 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage ``` { .json .copy } { "results": [{ - "instrument": "BTC_USDT_Perp", - "leverage": "10", - "min_leverage": "10", - "max_leverage": "50" + "asset": null, + "tiers": [{ + "lower_bound": null, + "rate": null + }] }] } ``` @@ -11776,10 +12802,11 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage ``` { .json .copy } { "r": [{ - "i": "BTC_USDT_Perp", - "l": "10", - "ml": "10", - "ml1": "50" + "a": null, + "t": [{ + "lb": null, + "r": null + }] }] } ``` @@ -11789,12 +12816,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage !!! 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| - |1004|404|Data Not Found| + |1008|401|Your IP has not been whitelisted for access|
!!! failure @@ -11802,18 +12827,18 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage ``` { .json .copy } { "request_id":1, - "code":1000, - "message":"You need to authenticate prior to using this functionality", - "status":401 + "code":1002, + "message":"Internal Server Error", + "status":500 } ``` **Lite Error Response** ``` { .json .copy } { "ri":1, - "c":1000, - "m":"You need to authenticate prior to using this functionality", - "s":401 + "c":1002, + "m":"Internal Server Error", + "s":500 } ```
@@ -11823,11 +12848,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/get_all_initial_leverage' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/get_margin_tiers' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11839,9 +12863,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/get_margin_tiers", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11851,11 +12874,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/get_all_initial_leverage' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/get_margin_tiers' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11867,9 +12889,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/get_margin_tiers", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11880,11 +12901,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/get_all_initial_leverage' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/get_margin_tiers' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11896,9 +12916,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/get_margin_tiers", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11908,11 +12927,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/get_all_initial_leverage' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/get_margin_tiers' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11924,9 +12942,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/get_margin_tiers", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11937,11 +12954,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/get_all_initial_leverage' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/get_margin_tiers' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11953,9 +12969,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/get_margin_tiers", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11965,11 +12980,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/get_all_initial_leverage' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/get_margin_tiers' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11981,9 +12995,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/get_margin_tiers", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11994,11 +13007,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/get_all_initial_leverage' \ + curl --location 'https://trades.grvt.io/full/v1/get_margin_tiers' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12010,9 +13022,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/get_margin_tiers", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -12022,11 +13033,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/get_all_initial_leverage' \ + curl --location 'https://trades.grvt.io/lite/v1/get_margin_tiers' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12038,9 +13048,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/get_margin_tiers", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -12048,15 +13057,16 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage ```

-### Set Initial Leverage +## Order +### Query Trading Performance ``` -FULL ENDPOINT: full/v1/set_initial_leverage -LITE ENDPOINT: lite/v1/set_initial_leverage +FULL ENDPOINT: full/v1/trading_performance +LITE ENDPOINT: lite/v1/trading_performance ``` === "Request"
- -8<- "docs/schemas/api_set_initial_leverage_request.md" + -8<- "docs/schemas/api_query_trading_performance_request.md"
!!! question "Query" @@ -12064,35 +13074,35 @@ LITE ENDPOINT: lite/v1/set_initial_leverage ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "asset": "BTC_USDT_Perp" } ``` **Lite Request** ``` { .json .copy } { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "a": "BTC_USDT_Perp" } ```
=== "Response"
- -8<- "docs/schemas/api_set_initial_leverage_response.md" + -8<- "docs/schemas/api_query_trading_performance_response.md"
!!! success **Full Response** ``` { .json .copy } { - "success": "true" + "trading_volume": "3456.78", + "realized_pnl": "9.75" } ``` **Lite Response** ``` { .json .copy } { - "s": "true" + "tv": "3456.78", + "rp": "9.75" } ```
@@ -12106,8 +13116,7 @@ LITE ENDPOINT: lite/v1/set_initial_leverage |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| - |1004|404|Data Not Found| - |2100|400|Invalid initial leverage| + |1008|401|Your IP has not been whitelisted for access|
!!! failure @@ -12136,13 +13145,12 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/set_initial_leverage' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/trading_performance' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "asset": "BTC_USDT_Perp" } ' ``` @@ -12154,11 +13162,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/trading_performance", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "asset": "BTC_USDT_Perp" }, "id": 123 } @@ -12168,13 +13175,12 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/set_initial_leverage' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/trading_performance' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "a": "BTC_USDT_Perp" } ' ``` @@ -12186,11 +13192,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/trading_performance", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "a": "BTC_USDT_Perp" }, "i": 123 } @@ -12201,13 +13206,12 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/set_initial_leverage' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/trading_performance' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "asset": "BTC_USDT_Perp" } ' ``` @@ -12219,11 +13223,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/trading_performance", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "asset": "BTC_USDT_Perp" }, "id": 123 } @@ -12233,13 +13236,12 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/set_initial_leverage' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/trading_performance' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "a": "BTC_USDT_Perp" } ' ``` @@ -12251,11 +13253,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/trading_performance", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "a": "BTC_USDT_Perp" }, "i": 123 } @@ -12266,13 +13267,12 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/set_initial_leverage' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/trading_performance' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "asset": "BTC_USDT_Perp" } ' ``` @@ -12284,11 +13284,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/trading_performance", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "asset": "BTC_USDT_Perp" }, "id": 123 } @@ -12298,13 +13297,12 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/set_initial_leverage' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/trading_performance' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "a": "BTC_USDT_Perp" } ' ``` @@ -12316,11 +13314,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/trading_performance", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "a": "BTC_USDT_Perp" }, "i": 123 } @@ -12331,13 +13328,12 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/set_initial_leverage' \ + curl --location 'https://trades.grvt.io/full/v1/trading_performance' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "asset": "BTC_USDT_Perp" } ' ``` @@ -12349,11 +13345,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/trading_performance", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "asset": "BTC_USDT_Perp" }, "id": 123 } @@ -12363,13 +13358,12 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/set_initial_leverage' \ + curl --location 'https://trades.grvt.io/lite/v1/trading_performance' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "a": "BTC_USDT_Perp" } ' ``` @@ -12381,11 +13375,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/trading_performance", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "a": "BTC_USDT_Perp" }, "i": 123 } diff --git a/artifacts/apidocs/trading_streams.md b/artifacts/apidocs/trading_streams.md index 3e596f7..1971003 100644 --- a/artifacts/apidocs/trading_streams.md +++ b/artifacts/apidocs/trading_streams.md @@ -133,13 +133,13 @@ STREAM: v1.order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": "UNSPECIFIED", + "trigger_type": TAKE_PROFIT, "tpsl": { - "trigger_by": "UNSPECIFIED", + "trigger_by": LAST, "trigger_price": "65038.10" } }, - "broker": "UNSPECIFIED" + "broker": "BROKER_CODE" }, "state": { "status": "PENDING", @@ -183,13 +183,13 @@ STREAM: v1.order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": "UNSPECIFIED", + "tt": TAKE_PROFIT, "t": { - "tb": "UNSPECIFIED", + "tb": LAST, "tp": "65038.10" } }, - "b": "UNSPECIFIED" + "b": "BROKER_CODE" }, "s1": { "s": "PENDING", diff --git a/artifacts/pysdk/grvt_raw_async.py b/artifacts/pysdk/grvt_raw_async.py index c9e3194..c9b143a 100644 --- a/artifacts/pysdk/grvt_raw_async.py +++ b/artifacts/pysdk/grvt_raw_async.py @@ -96,6 +96,14 @@ 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: @@ -329,3 +337,21 @@ 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 60b090d..7d078f3 100644 --- a/artifacts/pysdk/grvt_raw_sync.py +++ b/artifacts/pysdk/grvt_raw_sync.py @@ -94,6 +94,14 @@ 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: @@ -315,3 +323,21 @@ 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 7e12c08..a04c9a6 100644 --- a/artifacts/pysdk/grvt_raw_types.py +++ b/artifacts/pysdk/grvt_raw_types.py @@ -323,6 +323,8 @@ class SubAccountTradeInterval(Enum): SAT_1_D = "SAT_1_D" # 1 hour SAT_1_H = "SAT_1_H" + # 4 hour + SAT_4_H = "SAT_4_H" class TimeInForce(Enum): @@ -1303,8 +1305,12 @@ class JSONRPCResponse: @dataclass class WSSubscribeParams: """ - All V1 Websocket Subscription Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to. + 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. """ # The channel to subscribe to (eg: ticker.s / ticker.d) @@ -1440,11 +1446,18 @@ class WSOrderbookLevelsFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 # An orderbook levels object matching the request filter feed: OrderbookLevels - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -1475,11 +1488,18 @@ class WSMiniTickerFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 # A mini ticker matching the request filter feed: MiniTicker - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -1510,11 +1530,18 @@ class WSTickerFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 # A ticker matching the request filter feed: Ticker - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -1538,11 +1565,18 @@ class WSTradeFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 # A public trade matching the request filter feed: Trade - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -1567,11 +1601,18 @@ class WSCandlestickFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 # A candlestick entry matching the request filters feed: Candlestick - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -1617,6 +1658,34 @@ class ApiGetAllInstrumentsResponse: result: list[Instrument] +@dataclass +class SnapFundingAccountSummary: + # Time at which the event was emitted in unix nanoseconds + event_time: 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 @@ -1711,10 +1780,10 @@ class OrderMetadata: When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId """ client_order_id: str - # Trigger fields are used to support any type of trigger order such as TP/SL - trigger: TriggerOrderMetadata # [Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds create_time: str | None = None + # Trigger fields are used to support any type of trigger order such as TP/SL + trigger: TriggerOrderMetadata | None = None # Specifies the broker who brokered the order broker: BrokerTag | None = None @@ -2149,6 +2218,12 @@ class EcosystemPoint: 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 @@ -2441,6 +2516,8 @@ class FlatReferral: 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 @@ -2663,6 +2740,8 @@ class SubAccountTradeAggregation: positive_fee: str # The signer of the trade signer: str + # Realized PnL + realized_pnl: str @dataclass @@ -2738,11 +2817,18 @@ class WSOrderFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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: Order - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -2778,11 +2864,18 @@ class WSOrderStateFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 State Feed feed: OrderStateFeed - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -2806,11 +2899,18 @@ class WSPositionsFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 # A Position being created or updated matching the request filter feed: Positions - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -2834,11 +2934,18 @@ class WSFillFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 # A private trade matching the request filter feed: Fill - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -2888,11 +2995,18 @@ class WSTransferFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 transfer history matching the requested filters feed: TransferHistory - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -2925,11 +3039,18 @@ class WSDepositFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 Deposit object feed: Deposit - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -2964,11 +3085,18 @@ class WSWithdrawalFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 Withdrawal object feed: Withdrawal - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -2994,11 +3122,18 @@ class WSCancelFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 # Data relating to the status of the cancellation attempt feed: CancelStatusFeed - # The previous sequence number that determines global message order within the specific stream + # The previous sequence number that determines the message order prev_sequence_number: str @@ -3034,14 +3169,48 @@ class WSOrderGroupFeedDataV1: stream: str # Primary selector selector: str - # A running sequence number that determines global message order within the specific stream + """ + 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 global message order within the specific stream + # 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 ApiWithdrawalRequest: """ @@ -3119,6 +3288,8 @@ class ApiDepositHistoryRequest: limit: int | None = None # The cursor to indicate when to start the next query from cursor: str | None = None + # Main account ID being queried. By default, applies the requestor's main account ID. + main_account_id: str | None = None @dataclass @@ -3170,6 +3341,8 @@ class ApiTransferHistoryRequest: cursor: str | None = None # The transaction ID to query for tx_id: str | None = None + # Main account ID being queried. By default, applies the requestor's main account ID. + main_account_id: str | None = None @dataclass @@ -3199,6 +3372,8 @@ class ApiWithdrawalHistoryRequest: limit: int | None = None # The cursor to indicate when to start the next query from cursor: str | None = None + # Main account ID being queried. By default, applies the requestor's main account ID. + main_account_id: str | None = None @dataclass diff --git a/src/codegen/apispec.json b/src/codegen/apispec.json index 29232cf..4c9dacb 100644 --- a/src/codegen/apispec.json +++ b/src/codegen/apispec.json @@ -701,6 +701,47 @@ } ], "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", @@ -2512,6 +2553,78 @@ "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": [ @@ -6895,8 +7008,12 @@ } ], "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." + "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." ] }, { @@ -7033,7 +7150,7 @@ } ], "comment": [ - "All V1 Websocket Unsubscription Requests are housed in this wrapper. You may specify a stream, and a list of feeds to unsubscribe from." + "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." ] }, { @@ -7358,7 +7475,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -7383,7 +7505,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -7473,7 +7595,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -7498,7 +7625,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -7588,7 +7715,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -7613,7 +7745,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -7715,7 +7847,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -7740,7 +7877,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -7836,7 +7973,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -7861,7 +8003,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -8000,6 +8142,137 @@ ], "comment": [] }, + { + "name": "SnapFundingAccountSummary", + "is_root": true, + "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": "main_account_id", + "lite_name": "ma", + "semantic_type": "address", + "json_type": "string", + "index": 1, + "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": 2, + "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": 3, + "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": "ApiQueryTradingPerformanceRequest", + "is_root": true, + "fields": [ + { + "name": "sub_account_id", + "lite_name": "sa", + "semantic_type": "uint64", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": true, + "default": "all", + "example": "'$GRVT_SUB_ACCOUNT_ID'", + "comment": [ + "Optional: The subaccount ID to filter by" + ] + }, + { + "name": "asset", + "lite_name": "a", + "semantic_type": "[]byte", + "json_type": "unknown", + "index": 1, + "array_depth": 0, + "optional": false, + "example": "'BTC_USDT_Perp'", + "comment": [ + "The asset to filter by" + ] + } + ], + "comment": [ + "Request to retrieve the trading volume" + ] + }, + { + "name": "ApiQueryTradingPerformanceResponse", + "is_root": true, + "fields": [ + { + "name": "trading_volume", + "lite_name": "tv", + "semantic_type": "uint64", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": false, + "example": "'3456.78'", + "comment": [ + "Trading volume in USDT" + ] + }, + { + "name": "realized_pnl", + "lite_name": "rp", + "semantic_type": "string", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": false, + "example": "'9.75'", + "comment": [ + "Realized PnL in USDT" + ] + } + ], + "comment": [ + "Response to retrieve the trading volume" + ] + }, { "name": "OrderLeg", "is_root": false, @@ -8162,6 +8435,7 @@ "index": 0, "array_depth": 0, "optional": false, + "example": "LAST", "comment": [ "Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order" ] @@ -8202,6 +8476,7 @@ "index": 0, "array_depth": 0, "optional": false, + "example": "TAKE_PROFIT", "comment": [ "Type of the trigger order. eg: Take Profit, Stop Loss, etc" ] @@ -8275,7 +8550,8 @@ "json_type": "TriggerOrderMetadata", "index": 2, "array_depth": 0, - "optional": false, + "optional": true, + "default": "", "comment": [ "Trigger fields are used to support any type of trigger order such as TP/SL" ] @@ -8289,6 +8565,7 @@ "array_depth": 0, "optional": true, "default": "", + "example": "'BROKER_CODE'", "comment": [ "Specifies the broker who brokered the order" ] @@ -9872,6 +10149,45 @@ "comment": [ "Brokered trading volume" ] + }, + { + "name": "brokered_trading_point", + "lite_name": "bt1", + "semantic_type": "uint64", + "json_type": "string", + "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'", + "comment": [ + "Referee KYC point" + ] + }, + { + "name": "referrer_kyc_point", + "lite_name": "rk1", + "semantic_type": "uint64", + "json_type": "string", + "index": 15, + "array_depth": 0, + "optional": false, + "example": "'1000'", + "comment": [ + "Referrer KYC point" + ] } ], "comment": [ @@ -11250,6 +11566,19 @@ "comment": [ "The KYC type, can be 'individual' or 'business'" ] + }, + { + "name": "kyc_first_completed_at", + "lite_name": "kf", + "semantic_type": "timestamp", + "json_type": "string", + "index": 10, + "array_depth": 0, + "optional": false, + "example": "'1697788800000000000'", + "comment": [ + "The first KYC completed time" + ] } ], "comment": [ @@ -12319,6 +12648,19 @@ "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" + ] } ], "comment": [ @@ -12628,7 +12970,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -12653,7 +13000,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -12786,7 +13133,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -12811,7 +13163,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -12897,7 +13249,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -12922,7 +13279,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -13008,7 +13365,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -13033,7 +13395,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -13266,7 +13628,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -13291,7 +13658,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -13422,7 +13789,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -13447,7 +13819,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -13590,7 +13962,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -13615,7 +13992,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -13747,7 +14124,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -13772,7 +14154,7 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], @@ -13870,7 +14252,12 @@ "optional": false, "example": "'872634876'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "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`." ] }, { @@ -13895,12 +14282,117 @@ "optional": false, "example": "'872634875'", "comment": [ - "The previous sequence number that determines global message order within the specific stream" + "The previous sequence number that determines the message order" ] } ], "comment": [] }, + { + "name": "ApiDropClientWsRequest", + "is_root": true, + "fields": [ + { + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "address", + "json_type": "string", + "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": [] + } + ], + "comment": [] + }, { "name": "ApiWithdrawalRequest", "is_root": true, @@ -14184,6 +14676,20 @@ "comment": [ "The cursor to indicate when to start the next query from" ] + }, + { + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "address", + "json_type": "string", + "index": 5, + "array_depth": 0, + "optional": true, + "default": "", + "example": "", + "comment": [ + "Main account ID being queried. By default, applies the requestor's main account ID." + ] } ], "comment": [ @@ -14423,6 +14929,20 @@ "comment": [ "The transaction ID to query for" ] + }, + { + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "address", + "json_type": "string", + "index": 6, + "array_depth": 0, + "optional": true, + "default": "", + "example": "", + "comment": [ + "Main account ID being queried. By default, applies the requestor's main account ID." + ] } ], "comment": [ @@ -14537,6 +15057,20 @@ "comment": [ "The cursor to indicate when to start the next query from" ] + }, + { + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "address", + "json_type": "string", + "index": 5, + "array_depth": 0, + "optional": true, + "default": "", + "example": "", + "comment": [ + "Main account ID being queried. By default, applies the requestor's main account ID." + ] } ], "comment": [ @@ -15721,6 +16255,13 @@ "comment": [ "1 hour" ] + }, + { + "name": "SAT_4_H", + "value": 4, + "comment": [ + "4 hour" + ] } ], "comment": [] From 1e2e203190fd7235b68591750bc6f0fbc9234150 Mon Sep 17 00:00:00 2001 From: thangnguyen-19 Date: Wed, 9 Apr 2025 17:17:00 +0700 Subject: [PATCH 2/4] [RFC] Update API docs and specs --- artifacts/apidocs/market_data_streams.md | 504 +- .../schemas/aggregated_account_summary.md | 7 + ...api_aggregated_account_summary_response.md | 7 + .../schemas/api_cancel_all_orders_request.md | 14 + .../schemas/api_deposit_history_request.md | 7 + .../schemas/api_deposit_history_response.md | 7 + .../schemas/api_fill_history_request.md | 14 + .../api_funding_account_summary_response.md | 7 + .../api_funding_payment_history_response.md | 7 + .../api_get_all_instruments_response.md | 14 + .../api_get_filtered_instruments_request.md | 14 + .../api_get_filtered_instruments_response.md | 14 + .../schemas/api_get_instrument_response.md | 14 + .../api_get_latest_lp_snapshot_request.md | 7 + .../schemas/api_get_lp_info_request.md | 7 + .../schemas/api_get_lp_leaderboard_request.md | 7 + .../schemas/api_get_lp_point_request.md | 7 + .../api_latest_snap_sub_accounts_response.md | 14 + ...ist_aggregated_account_summary_response.md | 7 + .../schemas/api_open_orders_request.md | 14 + .../schemas/api_order_history_request.md | 14 + .../apidocs/schemas/api_positions_request.md | 14 + .../schemas/api_pre_deposit_check_request.md | 7 + .../schemas/api_pre_deposit_check_response.md | 7 + .../schemas/api_pre_order_check_response.md | 7 + .../apidocs/schemas/api_settlement_price.md | 14 + .../schemas/api_settlement_price_request.md | 14 + .../schemas/api_settlement_price_response.md | 14 + .../api_sub_account_history_response.md | 14 + .../api_sub_account_summary_response.md | 14 + .../schemas/api_transfer_history_request.md | 7 + .../schemas/api_transfer_history_response.md | 7 + .../apidocs/schemas/api_transfer_request.md | 7 + .../schemas/api_withdrawal_history_request.md | 7 + .../api_withdrawal_history_response.md | 7 + .../apidocs/schemas/api_withdrawal_request.md | 7 + artifacts/apidocs/schemas/currency.md | 7 + artifacts/apidocs/schemas/deposit.md | 7 + artifacts/apidocs/schemas/deposit_history.md | 7 + .../schemas/funding_account_summary.md | 7 + artifacts/apidocs/schemas/funding_payment.md | 7 + artifacts/apidocs/schemas/instrument.md | 14 + .../apidocs/schemas/pre_order_check_result.md | 7 + .../schemas/snap_funding_account_summary.md | 7 + artifacts/apidocs/schemas/spot_balance.md | 7 + artifacts/apidocs/schemas/sub_account.md | 14 + artifacts/apidocs/schemas/transfer_history.md | 7 + artifacts/apidocs/schemas/withdrawal.md | 7 + .../apidocs/schemas/withdrawal_history.md | 7 + .../apidocs/schemas/ws_cancel_feed_data_v1.md | 1 + .../schemas/ws_candlestick_feed_data_v1.md | 1 + .../schemas/ws_deposit_feed_data_v1.md | 8 + .../apidocs/schemas/ws_fill_feed_data_v1.md | 1 + .../schemas/ws_mini_ticker_feed_data_v1.md | 1 + .../apidocs/schemas/ws_order_feed_data_v1.md | 1 + .../schemas/ws_order_group_feed_data_v1.md | 1 + .../schemas/ws_order_state_feed_data_v1.md | 1 + .../ws_orderbook_levels_feed_data_v1.md | 1 + .../schemas/ws_positions_feed_data_v1.md | 1 + .../apidocs/schemas/ws_subscribe_params.md | 1 + .../ws_subscribe_response_v1_legacy.md | 1 + .../apidocs/schemas/ws_subscribe_result.md | 1 + .../apidocs/schemas/ws_ticker_feed_data_v1.md | 1 + .../apidocs/schemas/ws_trade_feed_data_v1.md | 1 + .../schemas/ws_transfer_feed_data_v1.md | 8 + .../apidocs/schemas/ws_unsubscribe_params.md | 1 + .../schemas/ws_withdrawal_feed_data_v1.md | 8 + artifacts/apidocs/trading_api.md | 9271 ++++++++--------- artifacts/apidocs/trading_streams.md | 567 +- src/codegen/apidocs/apidocs.py | 16 +- 70 files changed, 5378 insertions(+), 5474 deletions(-) diff --git a/artifacts/apidocs/market_data_streams.md b/artifacts/apidocs/market_data_streams.md index 463c4dc..8f44fc7 100644 --- a/artifacts/apidocs/market_data_streams.md +++ b/artifacts/apidocs/market_data_streams.md @@ -28,7 +28,8 @@ STREAM: v1.mini.s "method": "subscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -42,7 +43,8 @@ STREAM: v1.mini.s "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -56,7 +58,8 @@ STREAM: v1.mini.s "method": "unsubscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -120,7 +123,8 @@ STREAM: v1.mini.s "best_bid_size": "123456.78", "best_ask_price": "65038.01", "best_ask_size": "123456.78" - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -141,7 +145,8 @@ STREAM: v1.mini.s "bb1": "123456.78", "ba": "65038.01", "ba1": "123456.78" - } + }, + "ps": "872634875" } ```
@@ -206,7 +211,8 @@ STREAM: v1.mini.s "method": "subscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -221,7 +227,8 @@ STREAM: v1.mini.s "method": "unsubscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -251,7 +258,8 @@ STREAM: v1.mini.s "m": "subscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -266,7 +274,8 @@ STREAM: v1.mini.s "m": "unsubscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -297,7 +306,8 @@ STREAM: v1.mini.s "method": "subscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -312,7 +322,8 @@ STREAM: v1.mini.s "method": "unsubscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -342,7 +353,8 @@ STREAM: v1.mini.s "m": "subscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -357,7 +369,8 @@ STREAM: v1.mini.s "m": "unsubscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -388,7 +401,8 @@ STREAM: v1.mini.s "method": "subscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -403,7 +417,8 @@ STREAM: v1.mini.s "method": "unsubscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -433,7 +448,8 @@ STREAM: v1.mini.s "m": "subscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -448,7 +464,8 @@ STREAM: v1.mini.s "m": "unsubscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -479,7 +496,8 @@ STREAM: v1.mini.s "method": "subscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -494,7 +512,8 @@ STREAM: v1.mini.s "method": "unsubscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -524,7 +543,8 @@ STREAM: v1.mini.s "m": "subscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -539,7 +559,8 @@ STREAM: v1.mini.s "m": "unsubscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -587,7 +608,8 @@ STREAM: v1.mini.d "method": "subscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -601,7 +623,8 @@ STREAM: v1.mini.d "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -615,7 +638,8 @@ STREAM: v1.mini.d "method": "unsubscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -679,7 +703,8 @@ STREAM: v1.mini.d "best_bid_size": "123456.78", "best_ask_price": "65038.01", "best_ask_size": "123456.78" - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -700,7 +725,8 @@ STREAM: v1.mini.d "bb1": "123456.78", "ba": "65038.01", "ba1": "123456.78" - } + }, + "ps": "872634875" } ```
@@ -765,7 +791,8 @@ STREAM: v1.mini.d "method": "subscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -780,7 +807,8 @@ STREAM: v1.mini.d "method": "unsubscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -810,7 +838,8 @@ STREAM: v1.mini.d "m": "subscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -825,7 +854,8 @@ STREAM: v1.mini.d "m": "unsubscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -856,7 +886,8 @@ STREAM: v1.mini.d "method": "subscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -871,7 +902,8 @@ STREAM: v1.mini.d "method": "unsubscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -901,7 +933,8 @@ STREAM: v1.mini.d "m": "subscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -916,7 +949,8 @@ STREAM: v1.mini.d "m": "unsubscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -947,7 +981,8 @@ STREAM: v1.mini.d "method": "subscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -962,7 +997,8 @@ STREAM: v1.mini.d "method": "unsubscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -992,7 +1028,8 @@ STREAM: v1.mini.d "m": "subscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1007,7 +1044,8 @@ STREAM: v1.mini.d "m": "unsubscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1038,7 +1076,8 @@ STREAM: v1.mini.d "method": "subscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1053,7 +1092,8 @@ STREAM: v1.mini.d "method": "unsubscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1083,7 +1123,8 @@ STREAM: v1.mini.d "m": "subscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1098,7 +1139,8 @@ STREAM: v1.mini.d "m": "unsubscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1146,7 +1188,8 @@ STREAM: v1.ticker.s "method": "subscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1160,7 +1203,8 @@ STREAM: v1.ticker.s "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -1174,7 +1218,8 @@ STREAM: v1.ticker.s "method": "unsubscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1251,7 +1296,8 @@ STREAM: v1.ticker.s "open_price": "65038.01", "open_interest": "123456.78", "long_short_ratio": "0.5" - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -1285,7 +1331,8 @@ STREAM: v1.ticker.s "op": "65038.01", "oi": "123456.78", "ls1": "0.5" - } + }, + "ps": "872634875" } ```
@@ -1350,7 +1397,8 @@ STREAM: v1.ticker.s "method": "subscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1365,7 +1413,8 @@ STREAM: v1.ticker.s "method": "unsubscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1395,7 +1444,8 @@ STREAM: v1.ticker.s "m": "subscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1410,7 +1460,8 @@ STREAM: v1.ticker.s "m": "unsubscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1441,7 +1492,8 @@ STREAM: v1.ticker.s "method": "subscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1456,7 +1508,8 @@ STREAM: v1.ticker.s "method": "unsubscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1486,7 +1539,8 @@ STREAM: v1.ticker.s "m": "subscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1501,7 +1555,8 @@ STREAM: v1.ticker.s "m": "unsubscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1532,7 +1587,8 @@ STREAM: v1.ticker.s "method": "subscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1547,7 +1603,8 @@ STREAM: v1.ticker.s "method": "unsubscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1577,7 +1634,8 @@ STREAM: v1.ticker.s "m": "subscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1592,7 +1650,8 @@ STREAM: v1.ticker.s "m": "unsubscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1623,7 +1682,8 @@ STREAM: v1.ticker.s "method": "subscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1638,7 +1698,8 @@ STREAM: v1.ticker.s "method": "unsubscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1668,7 +1729,8 @@ STREAM: v1.ticker.s "m": "subscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1683,7 +1745,8 @@ STREAM: v1.ticker.s "m": "unsubscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1731,7 +1794,8 @@ STREAM: v1.ticker.d "method": "subscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1745,7 +1809,8 @@ STREAM: v1.ticker.d "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -1759,7 +1824,8 @@ STREAM: v1.ticker.d "method": "unsubscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1836,7 +1902,8 @@ STREAM: v1.ticker.d "open_price": "65038.01", "open_interest": "123456.78", "long_short_ratio": "0.5" - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -1870,7 +1937,8 @@ STREAM: v1.ticker.d "op": "65038.01", "oi": "123456.78", "ls1": "0.5" - } + }, + "ps": "872634875" } ```
@@ -1935,7 +2003,8 @@ STREAM: v1.ticker.d "method": "subscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1950,7 +2019,8 @@ STREAM: v1.ticker.d "method": "unsubscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -1980,7 +2050,8 @@ STREAM: v1.ticker.d "m": "subscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -1995,7 +2066,8 @@ STREAM: v1.ticker.d "m": "unsubscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -2026,7 +2098,8 @@ STREAM: v1.ticker.d "method": "subscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -2041,7 +2114,8 @@ STREAM: v1.ticker.d "method": "unsubscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -2071,7 +2145,8 @@ STREAM: v1.ticker.d "m": "subscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -2086,7 +2161,8 @@ STREAM: v1.ticker.d "m": "unsubscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -2117,7 +2193,8 @@ STREAM: v1.ticker.d "method": "subscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -2132,7 +2209,8 @@ STREAM: v1.ticker.d "method": "unsubscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -2162,7 +2240,8 @@ STREAM: v1.ticker.d "m": "subscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -2177,7 +2256,8 @@ STREAM: v1.ticker.d "m": "unsubscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -2208,7 +2288,8 @@ STREAM: v1.ticker.d "method": "subscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -2223,7 +2304,8 @@ STREAM: v1.ticker.d "method": "unsubscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -2253,7 +2335,8 @@ STREAM: v1.ticker.d "m": "subscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -2268,7 +2351,8 @@ STREAM: v1.ticker.d "m": "unsubscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -2317,7 +2401,8 @@ STREAM: v1.book.s "method": "subscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"] + "selectors": ["BTC_USDT_Perp@500-50"], + "use_global_sequence_number": true }, "id": 123 } @@ -2331,7 +2416,8 @@ STREAM: v1.book.s "subs": ["BTC_USDT_Perp@500-50"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -2345,7 +2431,8 @@ STREAM: v1.book.s "method": "unsubscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"] + "selectors": ["BTC_USDT_Perp@500-50"], + "use_global_sequence_number": true }, "id": 123 } @@ -2410,7 +2497,8 @@ STREAM: v1.book.s "size": "3456.78", "num_orders": 123 }] - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -2432,7 +2520,8 @@ STREAM: v1.book.s "s": "3456.78", "no": 123 }] - } + }, + "ps": "872634875" } ```
@@ -2498,7 +2587,8 @@ STREAM: v1.book.s "method": "subscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"] + "selectors": ["BTC_USDT_Perp@500-50"], + "use_global_sequence_number": true }, "id": 123 } @@ -2513,7 +2603,8 @@ STREAM: v1.book.s "method": "unsubscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"] + "selectors": ["BTC_USDT_Perp@500-50"], + "use_global_sequence_number": true }, "id": 123 } @@ -2543,7 +2634,8 @@ STREAM: v1.book.s "m": "subscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"] + "s1": ["BTC_USDT_Perp@500-50"], + "ug": true }, "i": 123 } @@ -2558,7 +2650,8 @@ STREAM: v1.book.s "m": "unsubscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"] + "s1": ["BTC_USDT_Perp@500-50"], + "ug": true }, "i": 123 } @@ -2589,7 +2682,8 @@ STREAM: v1.book.s "method": "subscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"] + "selectors": ["BTC_USDT_Perp@500-50"], + "use_global_sequence_number": true }, "id": 123 } @@ -2604,7 +2698,8 @@ STREAM: v1.book.s "method": "unsubscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"] + "selectors": ["BTC_USDT_Perp@500-50"], + "use_global_sequence_number": true }, "id": 123 } @@ -2634,7 +2729,8 @@ STREAM: v1.book.s "m": "subscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"] + "s1": ["BTC_USDT_Perp@500-50"], + "ug": true }, "i": 123 } @@ -2649,7 +2745,8 @@ STREAM: v1.book.s "m": "unsubscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"] + "s1": ["BTC_USDT_Perp@500-50"], + "ug": true }, "i": 123 } @@ -2680,7 +2777,8 @@ STREAM: v1.book.s "method": "subscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"] + "selectors": ["BTC_USDT_Perp@500-50"], + "use_global_sequence_number": true }, "id": 123 } @@ -2695,7 +2793,8 @@ STREAM: v1.book.s "method": "unsubscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"] + "selectors": ["BTC_USDT_Perp@500-50"], + "use_global_sequence_number": true }, "id": 123 } @@ -2725,7 +2824,8 @@ STREAM: v1.book.s "m": "subscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"] + "s1": ["BTC_USDT_Perp@500-50"], + "ug": true }, "i": 123 } @@ -2740,7 +2840,8 @@ STREAM: v1.book.s "m": "unsubscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"] + "s1": ["BTC_USDT_Perp@500-50"], + "ug": true }, "i": 123 } @@ -2771,7 +2872,8 @@ STREAM: v1.book.s "method": "subscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"] + "selectors": ["BTC_USDT_Perp@500-50"], + "use_global_sequence_number": true }, "id": 123 } @@ -2786,7 +2888,8 @@ STREAM: v1.book.s "method": "unsubscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"] + "selectors": ["BTC_USDT_Perp@500-50"], + "use_global_sequence_number": true }, "id": 123 } @@ -2816,7 +2919,8 @@ STREAM: v1.book.s "m": "subscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"] + "s1": ["BTC_USDT_Perp@500-50"], + "ug": true }, "i": 123 } @@ -2831,7 +2935,8 @@ STREAM: v1.book.s "m": "unsubscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"] + "s1": ["BTC_USDT_Perp@500-50"], + "ug": true }, "i": 123 } @@ -2879,7 +2984,8 @@ STREAM: v1.book.d "method": "subscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -2893,7 +2999,8 @@ STREAM: v1.book.d "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -2907,7 +3014,8 @@ STREAM: v1.book.d "method": "unsubscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -2972,7 +3080,8 @@ STREAM: v1.book.d "size": "3456.78", "num_orders": 123 }] - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -2994,7 +3103,8 @@ STREAM: v1.book.d "s": "3456.78", "no": 123 }] - } + }, + "ps": "872634875" } ```
@@ -3059,7 +3169,8 @@ STREAM: v1.book.d "method": "subscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3074,7 +3185,8 @@ STREAM: v1.book.d "method": "unsubscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3104,7 +3216,8 @@ STREAM: v1.book.d "m": "subscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3119,7 +3232,8 @@ STREAM: v1.book.d "m": "unsubscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3150,7 +3264,8 @@ STREAM: v1.book.d "method": "subscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3165,7 +3280,8 @@ STREAM: v1.book.d "method": "unsubscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3195,7 +3311,8 @@ STREAM: v1.book.d "m": "subscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3210,7 +3327,8 @@ STREAM: v1.book.d "m": "unsubscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3241,7 +3359,8 @@ STREAM: v1.book.d "method": "subscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3256,7 +3375,8 @@ STREAM: v1.book.d "method": "unsubscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3286,7 +3406,8 @@ STREAM: v1.book.d "m": "subscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3301,7 +3422,8 @@ STREAM: v1.book.d "m": "unsubscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3332,7 +3454,8 @@ STREAM: v1.book.d "method": "subscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3347,7 +3470,8 @@ STREAM: v1.book.d "method": "unsubscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3377,7 +3501,8 @@ STREAM: v1.book.d "m": "subscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3392,7 +3517,8 @@ STREAM: v1.book.d "m": "unsubscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3441,7 +3567,8 @@ STREAM: v1.trade "method": "subscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3455,7 +3582,8 @@ STREAM: v1.trade "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -3469,7 +3597,8 @@ STREAM: v1.trade "method": "unsubscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3533,7 +3662,8 @@ STREAM: v1.trade "forward_price": "65038.01", "trade_id": "209358-2", "venue": "ORDERBOOK" - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -3554,7 +3684,8 @@ STREAM: v1.trade "fp": "65038.01", "ti": "209358-2", "v": "ORDERBOOK" - } + }, + "ps": "872634875" } ```
@@ -3619,7 +3750,8 @@ STREAM: v1.trade "method": "subscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3634,7 +3766,8 @@ STREAM: v1.trade "method": "unsubscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3664,7 +3797,8 @@ STREAM: v1.trade "m": "subscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3679,7 +3813,8 @@ STREAM: v1.trade "m": "unsubscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3710,7 +3845,8 @@ STREAM: v1.trade "method": "subscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3725,7 +3861,8 @@ STREAM: v1.trade "method": "unsubscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3755,7 +3892,8 @@ STREAM: v1.trade "m": "subscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3770,7 +3908,8 @@ STREAM: v1.trade "m": "unsubscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3801,7 +3940,8 @@ STREAM: v1.trade "method": "subscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3816,7 +3956,8 @@ STREAM: v1.trade "method": "unsubscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3846,7 +3987,8 @@ STREAM: v1.trade "m": "subscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3861,7 +4003,8 @@ STREAM: v1.trade "m": "unsubscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3892,7 +4035,8 @@ STREAM: v1.trade "method": "subscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3907,7 +4051,8 @@ STREAM: v1.trade "method": "unsubscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"] + "selectors": ["BTC_USDT_Perp@500"], + "use_global_sequence_number": true }, "id": 123 } @@ -3937,7 +4082,8 @@ STREAM: v1.trade "m": "subscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -3952,7 +4098,8 @@ STREAM: v1.trade "m": "unsubscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"] + "s1": ["BTC_USDT_Perp@500"], + "ug": true }, "i": 123 } @@ -4001,7 +4148,8 @@ STREAM: v1.candle "method": "subscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "use_global_sequence_number": true }, "id": 123 } @@ -4015,7 +4163,8 @@ STREAM: v1.candle "subs": ["BTC_USDT_Perp@CI_1_M-TRADE"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -4029,7 +4178,8 @@ STREAM: v1.candle "method": "unsubscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "use_global_sequence_number": true }, "id": 123 } @@ -4092,7 +4242,8 @@ STREAM: v1.candle "volume_q": "123456.78", "trades": 123456, "instrument": "BTC_USDT_Perp" - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -4112,7 +4263,8 @@ STREAM: v1.candle "vq": "123456.78", "t": 123456, "i": "BTC_USDT_Perp" - } + }, + "ps": "872634875" } ```
@@ -4177,7 +4329,8 @@ STREAM: v1.candle "method": "subscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "use_global_sequence_number": true }, "id": 123 } @@ -4192,7 +4345,8 @@ STREAM: v1.candle "method": "unsubscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "use_global_sequence_number": true }, "id": 123 } @@ -4222,7 +4376,8 @@ STREAM: v1.candle "m": "subscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "ug": true }, "i": 123 } @@ -4237,7 +4392,8 @@ STREAM: v1.candle "m": "unsubscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "ug": true }, "i": 123 } @@ -4268,7 +4424,8 @@ STREAM: v1.candle "method": "subscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "use_global_sequence_number": true }, "id": 123 } @@ -4283,7 +4440,8 @@ STREAM: v1.candle "method": "unsubscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "use_global_sequence_number": true }, "id": 123 } @@ -4313,7 +4471,8 @@ STREAM: v1.candle "m": "subscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "ug": true }, "i": 123 } @@ -4328,7 +4487,8 @@ STREAM: v1.candle "m": "unsubscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "ug": true }, "i": 123 } @@ -4359,7 +4519,8 @@ STREAM: v1.candle "method": "subscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "use_global_sequence_number": true }, "id": 123 } @@ -4374,7 +4535,8 @@ STREAM: v1.candle "method": "unsubscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "use_global_sequence_number": true }, "id": 123 } @@ -4404,7 +4566,8 @@ STREAM: v1.candle "m": "subscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "ug": true }, "i": 123 } @@ -4419,7 +4582,8 @@ STREAM: v1.candle "m": "unsubscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "ug": true }, "i": 123 } @@ -4450,7 +4614,8 @@ STREAM: v1.candle "method": "subscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "use_global_sequence_number": true }, "id": 123 } @@ -4465,7 +4630,8 @@ STREAM: v1.candle "method": "unsubscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "use_global_sequence_number": true }, "id": 123 } @@ -4495,7 +4661,8 @@ STREAM: v1.candle "m": "subscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "ug": true }, "i": 123 } @@ -4510,7 +4677,8 @@ STREAM: v1.candle "m": "unsubscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "ug": true }, "i": 123 } diff --git a/artifacts/apidocs/schemas/aggregated_account_summary.md b/artifacts/apidocs/schemas/aggregated_account_summary.md index 91f4a10..e2a1f5c 100644 --- a/artifacts/apidocs/schemas/aggregated_account_summary.md +++ b/artifacts/apidocs/schemas/aggregated_account_summary.md @@ -32,5 +32,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md b/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md index dbe4d6d..11d8c3d 100644 --- a/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md +++ b/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md @@ -38,5 +38,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_cancel_all_orders_request.md b/artifacts/apidocs/schemas/api_cancel_all_orders_request.md index 7792003..34a70e6 100644 --- a/artifacts/apidocs/schemas/api_cancel_all_orders_request.md +++ b/artifacts/apidocs/schemas/api_cancel_all_orders_request.md @@ -38,8 +38,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -62,5 +69,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_deposit_history_request.md b/artifacts/apidocs/schemas/api_deposit_history_request.md index 1027e1c..0758a4d 100644 --- a/artifacts/apidocs/schemas/api_deposit_history_request.md +++ b/artifacts/apidocs/schemas/api_deposit_history_request.md @@ -31,5 +31,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_deposit_history_response.md b/artifacts/apidocs/schemas/api_deposit_history_response.md index b1e6a7e..0073f5a 100644 --- a/artifacts/apidocs/schemas/api_deposit_history_response.md +++ b/artifacts/apidocs/schemas/api_deposit_history_response.md @@ -36,5 +36,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_fill_history_request.md b/artifacts/apidocs/schemas/api_fill_history_request.md index bfb6b4e..57ebd43 100644 --- a/artifacts/apidocs/schemas/api_fill_history_request.md +++ b/artifacts/apidocs/schemas/api_fill_history_request.md @@ -42,8 +42,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -66,5 +73,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_funding_account_summary_response.md b/artifacts/apidocs/schemas/api_funding_account_summary_response.md index 6fff816..8ec97c1 100644 --- a/artifacts/apidocs/schemas/api_funding_account_summary_response.md +++ b/artifacts/apidocs/schemas/api_funding_account_summary_response.md @@ -40,5 +40,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_funding_payment_history_response.md b/artifacts/apidocs/schemas/api_funding_payment_history_response.md index 00b1fa8..aba3976 100644 --- a/artifacts/apidocs/schemas/api_funding_payment_history_response.md +++ b/artifacts/apidocs/schemas/api_funding_payment_history_response.md @@ -34,5 +34,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_get_all_instruments_response.md b/artifacts/apidocs/schemas/api_get_all_instruments_response.md index 194a032..78cb95f 100644 --- a/artifacts/apidocs/schemas/api_get_all_instruments_response.md +++ b/artifacts/apidocs/schemas/api_get_all_instruments_response.md @@ -40,8 +40,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -64,8 +71,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Kind](/../../schemas/kind)" The list of asset kinds that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/api_get_filtered_instruments_request.md b/artifacts/apidocs/schemas/api_get_filtered_instruments_request.md index 91afdfb..bc108c7 100644 --- a/artifacts/apidocs/schemas/api_get_filtered_instruments_request.md +++ b/artifacts/apidocs/schemas/api_get_filtered_instruments_request.md @@ -39,8 +39,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -63,5 +70,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_get_filtered_instruments_response.md b/artifacts/apidocs/schemas/api_get_filtered_instruments_response.md index 00eb893..906378d 100644 --- a/artifacts/apidocs/schemas/api_get_filtered_instruments_response.md +++ b/artifacts/apidocs/schemas/api_get_filtered_instruments_response.md @@ -40,8 +40,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -64,8 +71,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Kind](/../../schemas/kind)" The list of asset kinds that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/api_get_instrument_response.md b/artifacts/apidocs/schemas/api_get_instrument_response.md index c345b82..6217afa 100644 --- a/artifacts/apidocs/schemas/api_get_instrument_response.md +++ b/artifacts/apidocs/schemas/api_get_instrument_response.md @@ -40,8 +40,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -64,8 +71,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Kind](/../../schemas/kind)" The list of asset kinds that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/api_get_latest_lp_snapshot_request.md b/artifacts/apidocs/schemas/api_get_latest_lp_snapshot_request.md index d60c753..7862abb 100644 --- a/artifacts/apidocs/schemas/api_get_latest_lp_snapshot_request.md +++ b/artifacts/apidocs/schemas/api_get_latest_lp_snapshot_request.md @@ -34,5 +34,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_get_lp_info_request.md b/artifacts/apidocs/schemas/api_get_lp_info_request.md index 3b014c4..5766137 100644 --- a/artifacts/apidocs/schemas/api_get_lp_info_request.md +++ b/artifacts/apidocs/schemas/api_get_lp_info_request.md @@ -34,5 +34,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_get_lp_leaderboard_request.md b/artifacts/apidocs/schemas/api_get_lp_leaderboard_request.md index a3f1c78..9d59aa7 100644 --- a/artifacts/apidocs/schemas/api_get_lp_leaderboard_request.md +++ b/artifacts/apidocs/schemas/api_get_lp_leaderboard_request.md @@ -36,5 +36,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_get_lp_point_request.md b/artifacts/apidocs/schemas/api_get_lp_point_request.md index 54116b6..03b57d7 100644 --- a/artifacts/apidocs/schemas/api_get_lp_point_request.md +++ b/artifacts/apidocs/schemas/api_get_lp_point_request.md @@ -35,5 +35,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_latest_snap_sub_accounts_response.md b/artifacts/apidocs/schemas/api_latest_snap_sub_accounts_response.md index 735ee64..73f63ea 100644 --- a/artifacts/apidocs/schemas/api_latest_snap_sub_accounts_response.md +++ b/artifacts/apidocs/schemas/api_latest_snap_sub_accounts_response.md @@ -44,8 +44,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[SpotBalance](/../../schemas/spot_balance)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -74,8 +81,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Positions](/../../schemas/positions)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_list_aggregated_account_summary_response.md b/artifacts/apidocs/schemas/api_list_aggregated_account_summary_response.md index f05992f..3b09a9d 100644 --- a/artifacts/apidocs/schemas/api_list_aggregated_account_summary_response.md +++ b/artifacts/apidocs/schemas/api_list_aggregated_account_summary_response.md @@ -42,5 +42,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_open_orders_request.md b/artifacts/apidocs/schemas/api_open_orders_request.md index 0e76b77..282af89 100644 --- a/artifacts/apidocs/schemas/api_open_orders_request.md +++ b/artifacts/apidocs/schemas/api_open_orders_request.md @@ -36,8 +36,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -60,5 +67,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_order_history_request.md b/artifacts/apidocs/schemas/api_order_history_request.md index 8a47eb5..3c38deb 100644 --- a/artifacts/apidocs/schemas/api_order_history_request.md +++ b/artifacts/apidocs/schemas/api_order_history_request.md @@ -42,8 +42,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -66,5 +73,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_positions_request.md b/artifacts/apidocs/schemas/api_positions_request.md index 1aa7fdb..2e20a3a 100644 --- a/artifacts/apidocs/schemas/api_positions_request.md +++ b/artifacts/apidocs/schemas/api_positions_request.md @@ -38,8 +38,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -62,5 +69,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_pre_deposit_check_request.md b/artifacts/apidocs/schemas/api_pre_deposit_check_request.md index 0cb5a85..9b8471a 100644 --- a/artifacts/apidocs/schemas/api_pre_deposit_check_request.md +++ b/artifacts/apidocs/schemas/api_pre_deposit_check_request.md @@ -27,8 +27,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[BridgeType](/../../schemas/bridge_type)" |Value| Description | |-|-| diff --git a/artifacts/apidocs/schemas/api_pre_deposit_check_response.md b/artifacts/apidocs/schemas/api_pre_deposit_check_response.md index 1d679ce..5777522 100644 --- a/artifacts/apidocs/schemas/api_pre_deposit_check_response.md +++ b/artifacts/apidocs/schemas/api_pre_deposit_check_response.md @@ -25,5 +25,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_pre_order_check_response.md b/artifacts/apidocs/schemas/api_pre_order_check_response.md index 5a56900..b4afa37 100644 --- a/artifacts/apidocs/schemas/api_pre_order_check_response.md +++ b/artifacts/apidocs/schemas/api_pre_order_check_response.md @@ -38,5 +38,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_settlement_price.md b/artifacts/apidocs/schemas/api_settlement_price.md index 60e0300..d71e4de 100644 --- a/artifacts/apidocs/schemas/api_settlement_price.md +++ b/artifacts/apidocs/schemas/api_settlement_price.md @@ -27,8 +27,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -51,5 +58,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_settlement_price_request.md b/artifacts/apidocs/schemas/api_settlement_price_request.md index 9be5b8e..22a7633 100644 --- a/artifacts/apidocs/schemas/api_settlement_price_request.md +++ b/artifacts/apidocs/schemas/api_settlement_price_request.md @@ -31,8 +31,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -55,5 +62,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_settlement_price_response.md b/artifacts/apidocs/schemas/api_settlement_price_response.md index 04990a9..f1628b9 100644 --- a/artifacts/apidocs/schemas/api_settlement_price_response.md +++ b/artifacts/apidocs/schemas/api_settlement_price_response.md @@ -32,8 +32,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -56,5 +63,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_sub_account_history_response.md b/artifacts/apidocs/schemas/api_sub_account_history_response.md index 95bad3a..b2bf5c3 100644 --- a/artifacts/apidocs/schemas/api_sub_account_history_response.md +++ b/artifacts/apidocs/schemas/api_sub_account_history_response.md @@ -45,8 +45,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[SpotBalance](/../../schemas/spot_balance)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -75,8 +82,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Positions](/../../schemas/positions)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_sub_account_summary_response.md b/artifacts/apidocs/schemas/api_sub_account_summary_response.md index 042a944..978eda2 100644 --- a/artifacts/apidocs/schemas/api_sub_account_summary_response.md +++ b/artifacts/apidocs/schemas/api_sub_account_summary_response.md @@ -46,8 +46,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[SpotBalance](/../../schemas/spot_balance)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -76,8 +83,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Positions](/../../schemas/positions)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_transfer_history_request.md b/artifacts/apidocs/schemas/api_transfer_history_request.md index e11db27..7e5764d 100644 --- a/artifacts/apidocs/schemas/api_transfer_history_request.md +++ b/artifacts/apidocs/schemas/api_transfer_history_request.md @@ -32,5 +32,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_transfer_history_response.md b/artifacts/apidocs/schemas/api_transfer_history_response.md index 0b2e6c0..cbdac79 100644 --- a/artifacts/apidocs/schemas/api_transfer_history_response.md +++ b/artifacts/apidocs/schemas/api_transfer_history_response.md @@ -39,8 +39,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_transfer_request.md b/artifacts/apidocs/schemas/api_transfer_request.md index 3b125bf..836d0f6 100644 --- a/artifacts/apidocs/schemas/api_transfer_request.md +++ b/artifacts/apidocs/schemas/api_transfer_request.md @@ -34,8 +34,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_withdrawal_history_request.md b/artifacts/apidocs/schemas/api_withdrawal_history_request.md index 286991f..549928f 100644 --- a/artifacts/apidocs/schemas/api_withdrawal_history_request.md +++ b/artifacts/apidocs/schemas/api_withdrawal_history_request.md @@ -31,5 +31,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/api_withdrawal_history_response.md b/artifacts/apidocs/schemas/api_withdrawal_history_response.md index 7d38da5..6376519 100644 --- a/artifacts/apidocs/schemas/api_withdrawal_history_response.md +++ b/artifacts/apidocs/schemas/api_withdrawal_history_response.md @@ -35,8 +35,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_withdrawal_request.md b/artifacts/apidocs/schemas/api_withdrawal_request.md index c79afd1..fe154bf 100644 --- a/artifacts/apidocs/schemas/api_withdrawal_request.md +++ b/artifacts/apidocs/schemas/api_withdrawal_request.md @@ -30,8 +30,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/currency.md b/artifacts/apidocs/schemas/currency.md index 7b268f9..73bd283 100644 --- a/artifacts/apidocs/schemas/currency.md +++ b/artifacts/apidocs/schemas/currency.md @@ -20,5 +20,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/deposit.md b/artifacts/apidocs/schemas/deposit.md index 29d5e17..326521e 100644 --- a/artifacts/apidocs/schemas/deposit.md +++ b/artifacts/apidocs/schemas/deposit.md @@ -27,5 +27,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/deposit_history.md b/artifacts/apidocs/schemas/deposit_history.md index 95b2926..6ecbcdd 100644 --- a/artifacts/apidocs/schemas/deposit_history.md +++ b/artifacts/apidocs/schemas/deposit_history.md @@ -31,5 +31,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/funding_account_summary.md b/artifacts/apidocs/schemas/funding_account_summary.md index 1ba48cc..1060184 100644 --- a/artifacts/apidocs/schemas/funding_account_summary.md +++ b/artifacts/apidocs/schemas/funding_account_summary.md @@ -34,5 +34,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/funding_payment.md b/artifacts/apidocs/schemas/funding_payment.md index 24f9d6c..9f2664b 100644 --- a/artifacts/apidocs/schemas/funding_payment.md +++ b/artifacts/apidocs/schemas/funding_payment.md @@ -29,5 +29,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/instrument.md b/artifacts/apidocs/schemas/instrument.md index 70c3b41..91f7cb0 100644 --- a/artifacts/apidocs/schemas/instrument.md +++ b/artifacts/apidocs/schemas/instrument.md @@ -36,8 +36,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -60,8 +67,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Kind](/../../schemas/kind)" The list of asset kinds that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/pre_order_check_result.md b/artifacts/apidocs/schemas/pre_order_check_result.md index a7185c4..a5c736a 100644 --- a/artifacts/apidocs/schemas/pre_order_check_result.md +++ b/artifacts/apidocs/schemas/pre_order_check_result.md @@ -34,5 +34,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/snap_funding_account_summary.md b/artifacts/apidocs/schemas/snap_funding_account_summary.md index c684457..1cd7568 100644 --- a/artifacts/apidocs/schemas/snap_funding_account_summary.md +++ b/artifacts/apidocs/schemas/snap_funding_account_summary.md @@ -35,5 +35,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/spot_balance.md b/artifacts/apidocs/schemas/spot_balance.md index 4eae88d..4b4c1c6 100644 --- a/artifacts/apidocs/schemas/spot_balance.md +++ b/artifacts/apidocs/schemas/spot_balance.md @@ -26,5 +26,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/sub_account.md b/artifacts/apidocs/schemas/sub_account.md index c947b90..c5c0487 100644 --- a/artifacts/apidocs/schemas/sub_account.md +++ b/artifacts/apidocs/schemas/sub_account.md @@ -40,8 +40,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[SpotBalance](/../../schemas/spot_balance)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -70,8 +77,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Positions](/../../schemas/positions)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/transfer_history.md b/artifacts/apidocs/schemas/transfer_history.md index 55adcbd..fa698b0 100644 --- a/artifacts/apidocs/schemas/transfer_history.md +++ b/artifacts/apidocs/schemas/transfer_history.md @@ -34,8 +34,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/withdrawal.md b/artifacts/apidocs/schemas/withdrawal.md index 1f8271e..8cf5b8e 100644 --- a/artifacts/apidocs/schemas/withdrawal.md +++ b/artifacts/apidocs/schemas/withdrawal.md @@ -28,8 +28,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/withdrawal_history.md b/artifacts/apidocs/schemas/withdrawal_history.md index 9b835e8..bfd2d31 100644 --- a/artifacts/apidocs/schemas/withdrawal_history.md +++ b/artifacts/apidocs/schemas/withdrawal_history.md @@ -30,8 +30,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md b/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md index 2924a18..df91b80 100644 --- a/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |CancelStatusFeed|True|Data relating to the status of the cancellation attempt| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[CancelStatusFeed](/../../schemas/cancel_status_feed)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md b/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md index 72d1fd2..d805ffb 100644 --- a/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Candlestick|True|A candlestick entry matching the request filters| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Candlestick](/../../schemas/candlestick)"
diff --git a/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md b/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md index 5c36103..2b8a828 100644 --- a/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md @@ -7,6 +7,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Deposit|True|The Deposit object| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Deposit](/../../schemas/deposit)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -36,5 +37,12 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md index d78ab8c..186748b 100644 --- a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Fill|True|A private trade matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Fill](/../../schemas/fill)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md b/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md index 5aae76f..810a6ac 100644 --- a/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |MiniTicker|True|A mini ticker matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[MiniTicker](/../../schemas/mini_ticker)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md index 60a656b..2bcba48 100644 --- a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Order|True|The order object being created or updated| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Order](/../../schemas/order)" 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
diff --git a/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md index 469e03f..4f516e7 100644 --- a/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |ClientOrderIDsByGroup|True|The order object being created or updated| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[ClientOrderIDsByGroup](/../../schemas/client_order_i_ds_by_group)" 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.
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..f80df14 100644 --- a/artifacts/apidocs/schemas/ws_order_state_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_state_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |OrderStateFeed|True|The Order State Feed| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[OrderStateFeed](/../../schemas/order_state_feed)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md b/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md index e37a0ed..4538302 100644 --- a/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |OrderbookLevels|True|An orderbook levels object matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[OrderbookLevels](/../../schemas/orderbook_levels)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md b/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md index c4cbcda..ebe54cb 100644 --- a/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Positions|True|A Position being created or updated matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Positions](/../../schemas/positions)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_subscribe_params.md b/artifacts/apidocs/schemas/ws_subscribe_params.md index 896bfaa..f8ccd86 100644 --- a/artifacts/apidocs/schemas/ws_subscribe_params.md +++ b/artifacts/apidocs/schemas/ws_subscribe_params.md @@ -5,3 +5,4 @@ |-|-|-|-| |stream
`s` |string|True|The channel to subscribe to (eg: ticker.s / ticker.d)| |selectors
`s1` |[string]|True|The list of feeds to subscribe to| + |use_global_sequence_number
`ug` |boolean|False
`false`|Whether to use the global sequence number for the stream| diff --git a/artifacts/apidocs/schemas/ws_subscribe_response_v1_legacy.md b/artifacts/apidocs/schemas/ws_subscribe_response_v1_legacy.md index 0ddb8ed..dce4145 100644 --- a/artifacts/apidocs/schemas/ws_subscribe_response_v1_legacy.md +++ b/artifacts/apidocs/schemas/ws_subscribe_response_v1_legacy.md @@ -9,3 +9,4 @@ |unsubs
`u` |[string]|True|The list of feeds unsubscribed from| |num_snapshots
`ns` |[integer]|True|The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`| |first_sequence_number
`fs` |[string]|True|The first sequence number to expect for each subscribed feed. Returned in same order as `subs`| + |latest_sequence_number
`ls` |[string]|True|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`| diff --git a/artifacts/apidocs/schemas/ws_subscribe_result.md b/artifacts/apidocs/schemas/ws_subscribe_result.md index a60e253..084eb60 100644 --- a/artifacts/apidocs/schemas/ws_subscribe_result.md +++ b/artifacts/apidocs/schemas/ws_subscribe_result.md @@ -8,3 +8,4 @@ |unsubs
`u` |[string]|True|The list of feeds unsubscribed from| |num_snapshots
`ns` |[integer]|True|The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`| |first_sequence_number
`fs` |[string]|True|The first sequence number to expect for each subscribed feed. Returned in same order as `subs`| + |latest_sequence_number
`ls` |[string]|True|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`| diff --git a/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md b/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md index e9dacdc..2014bb1 100644 --- a/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Ticker|True|A ticker matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Ticker](/../../schemas/ticker)" 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.

diff --git a/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md b/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md index 8328e51..a69312b 100644 --- a/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md @@ -5,6 +5,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Trade|True|A public trade matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Trade](/../../schemas/trade)" All private RFQs and Private AXEs will be filtered out from the responses
diff --git a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md index 2553e8c..83f466f 100644 --- a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md @@ -7,6 +7,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |TransferHistory|True|The transfer history matching the requested filters| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[TransferHistory](/../../schemas/transfer_history)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -43,8 +44,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_unsubscribe_params.md b/artifacts/apidocs/schemas/ws_unsubscribe_params.md index 5914171..af207e0 100644 --- a/artifacts/apidocs/schemas/ws_unsubscribe_params.md +++ b/artifacts/apidocs/schemas/ws_unsubscribe_params.md @@ -5,3 +5,4 @@ |-|-|-|-| |stream
`s` |string|True|The channel to unsubscribe from (eg: ticker.s / ticker.d)| |selectors
`s1` |[string]|True|The list of feeds to unsubscribe from| + |use_global_sequence_number
`ug` |boolean|False
`false`|Whether to use the global sequence number for the stream| diff --git a/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md b/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md index 4161a8a..77bb4de 100644 --- a/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md @@ -7,6 +7,7 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Withdrawal|True|The Withdrawal object| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Withdrawal](/../../schemas/withdrawal)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -37,8 +38,15 @@ |`XRP` = 15|the XRP token| |`TRUMP` = 20|the TRUMP token| |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/trading_api.md b/artifacts/apidocs/trading_api.md index b0d59dd..01ee1cc 100644 --- a/artifacts/apidocs/trading_api.md +++ b/artifacts/apidocs/trading_api.md @@ -1,48 +1,194 @@ # Trading APIs All requests should be made using the `POST` HTTP method. -## Admin -### Drop Client +## Order +### Create Order ``` -FULL ENDPOINT: full/v1/drop_client_ws -LITE ENDPOINT: lite/v1/drop_client_ws +FULL ENDPOINT: full/v1/create_order +LITE ENDPOINT: lite/v1/create_order ``` === "Request"
- -8<- "docs/schemas/api_drop_client_ws_request.md" + -8<- "docs/schemas/api_create_order_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "main_account_id": null + "order": { + "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" + } + } } ``` **Lite Request** ``` { .json .copy } { - "ma": null + "o": { + "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" + } + } } ```
=== "Response"
- -8<- "docs/schemas/api_drop_client_ws_response.md" + -8<- "docs/schemas/api_create_order_response.md"
!!! success **Full Response** ``` { .json .copy } { - "num_dropped": null + "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 } { - "nd": null + "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"] + } + } } ```
@@ -55,8 +201,51 @@ LITE ENDPOINT: lite/v1/drop_client_ws |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|
!!! failure @@ -85,11 +274,43 @@ LITE ENDPOINT: lite/v1/drop_client_ws
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/drop_client_ws' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "main_account_id": null + "order": { + "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" + } + } } ' ``` @@ -101,66 +322,41 @@ LITE ENDPOINT: lite/v1/drop_client_ws -x ' { "jsonrpc": "2.0", - "method": "v1/drop_client_ws", + "method": "v1/create_order", "params": { - "main_account_id": null - }, - "id": 123 - } - ' -w 360 - ``` -
-
- !!! example "REST Lite" - ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/drop_client_ws' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "ma": null - } - ' - ``` - !!! 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/drop_client_ws", - "p": { - "ma": null - }, - "i": 123 - } - ' -w 360 - ``` -
- === "STAGING" -
- !!! example "REST Full" - ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/drop_client_ws' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "main_account_id": null - } - ' - ``` - !!! 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/drop_client_ws", - "params": { - "main_account_id": null + "order": { + "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" + } + } }, "id": 123 } @@ -170,54 +366,182 @@ LITE ENDPOINT: lite/v1/drop_client_ws
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/drop_client_ws' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "ma": null + "o": { + "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" + } + } } ' ``` !!! example "JSONRPC Lite" ``` { .bash .copy } - wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \ + 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/drop_client_ws", + "m": "v1/create_order", "p": { - "ma": null + "o": { + "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" + } + } }, "i": 123 } ' -w 360 ```
- === "TESTNET" + === "STAGING"
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/drop_client_ws' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "main_account_id": null + "order": { + "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" + } + } } ' ``` !!! example "JSONRPC Full" ``` { .bash .copy } - wscat -c "wss://trades.testnet.grvt.io/ws/full" \ + 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/drop_client_ws", + "method": "v1/create_order", "params": { - "main_account_id": null + "order": { + "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" + } + } }, "id": 123 } @@ -227,54 +551,182 @@ LITE ENDPOINT: lite/v1/drop_client_ws
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/drop_client_ws' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "ma": null + "o": { + "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" + } + } } ' ``` !!! example "JSONRPC Lite" ``` { .bash .copy } - wscat -c "wss://trades.testnet.grvt.io/ws/lite" \ + 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/drop_client_ws", + "m": "v1/create_order", "p": { - "ma": null - }, - "i": 123 - } + "o": { + "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" + } + } + }, + "i": 123 + } ' -w 360 ```
- === "PROD" + === "TESTNET"
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/drop_client_ws' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "main_account_id": null + "order": { + "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" + } + } } ' ``` !!! example "JSONRPC Full" ``` { .bash .copy } - wscat -c "wss://trades.grvt.io/ws/full" \ + 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/drop_client_ws", + "method": "v1/create_order", "params": { - "main_account_id": null + "order": { + "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" + } + } }, "id": 123 } @@ -284,328 +736,122 @@ LITE ENDPOINT: lite/v1/drop_client_ws
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/drop_client_ws' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "ma": null + "o": { + "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" + } + } } ' ``` !!! example "JSONRPC Lite" ``` { .bash .copy } - wscat -c "wss://trades.grvt.io/ws/lite" \ + 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/drop_client_ws", + "m": "v1/create_order", "p": { - "ma": null + "o": { + "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" + } + } }, "i": 123 } ' -w 360 ```
-
-## Order -### Create Order -``` -FULL ENDPOINT: full/v1/create_order -LITE ENDPOINT: lite/v1/create_order -``` - -=== "Request" -
- -8<- "docs/schemas/api_create_order_request.md" -
-
- !!! question "Query" - **Full Request** - ``` { .json .copy } - { - "order": { - "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" - } - } - } - ``` - **Lite Request** - ``` { .json .copy } - { - "o": { - "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" - } - } - } - ``` -
-=== "Response" -
- -8<- "docs/schemas/api_create_order_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| -
-
- !!! 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_order' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "order": { - "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 + === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://trades.grvt.io/full/v1/create_order' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "order": { + "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", @@ -625,7 +871,7 @@ LITE ENDPOINT: lite/v1/create_order ``` !!! example "JSONRPC Full" ``` { .bash .copy } - wscat -c "wss://trades.dev.gravitymarkets.io/ws/full" \ + wscat -c "wss://trades.grvt.io/ws/full" \ -H "Cookie: $GRVT_COOKIE" \ -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ -x ' @@ -675,7 +921,7 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/create_order' \ + curl --location 'https://trades.grvt.io/lite/v1/create_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -717,7 +963,7 @@ LITE ENDPOINT: lite/v1/create_order ``` !!! example "JSONRPC Lite" ``` { .bash .copy } - wscat -c "wss://trades.dev.gravitymarkets.io/ws/lite" \ + wscat -c "wss://trades.grvt.io/ws/lite" \ -H "Cookie: $GRVT_COOKIE" \ -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ -x ' @@ -764,93 +1010,128 @@ LITE ENDPOINT: lite/v1/create_order ' -w 360 ```
- === "STAGING" +
+### Cancel Order +``` +FULL ENDPOINT: full/v1/cancel_order +LITE ENDPOINT: lite/v1/cancel_order +``` + +=== "Request" +
+ -8<- "docs/schemas/api_cancel_order_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" + } + ``` + **Lite Request** + ``` { .json .copy } + { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "oi": "0x1028403", + "co": "23042", + "tt": "500" + } + ``` +
+=== "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| + |2300|400|Order cancel time-to-live settings currently disabled.| + |2301|400|Order cancel time-to-live exceeds maximum allowed value.| + |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.staging.gravitymarkets.io/full/v1/create_order' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "order": { - "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" - } - } + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" } ' ``` !!! example "JSONRPC Full" ``` { .bash .copy } - wscat -c "wss://trades.staging.gravitymarkets.io/ws/full" \ + 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_order", + "method": "v1/cancel_order", "params": { - "order": { - "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" - } - } + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" }, "id": 123 } @@ -860,182 +1141,66 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/create_order' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "o": { - "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" - } - } + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "oi": "0x1028403", + "co": "23042", + "tt": "500" } ' ``` !!! example "JSONRPC Lite" ``` { .bash .copy } - wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \ + 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_order", + "m": "v1/cancel_order", "p": { - "o": { - "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" - } - } + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "oi": "0x1028403", + "co": "23042", + "tt": "500" }, "i": 123 } ' -w 360 ```
- === "TESTNET" + === "STAGING"
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/create_order' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "order": { - "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" - } - } + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" } ' ``` !!! example "JSONRPC Full" ``` { .bash .copy } - wscat -c "wss://trades.testnet.grvt.io/ws/full" \ + 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_order", + "method": "v1/cancel_order", "params": { - "order": { - "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" - } - } + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" }, "id": 123 } @@ -1045,182 +1210,66 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/create_order' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "o": { - "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" - } - } + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "oi": "0x1028403", + "co": "23042", + "tt": "500" } ' ``` !!! example "JSONRPC Lite" ``` { .bash .copy } - wscat -c "wss://trades.testnet.grvt.io/ws/lite" \ + 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_order", + "m": "v1/cancel_order", "p": { - "o": { - "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" - } - } + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "oi": "0x1028403", + "co": "23042", + "tt": "500" }, "i": 123 } ' -w 360 ```
- === "PROD" + === "TESTNET"
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/create_order' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "order": { - "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" - } - } + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" } ' ``` !!! example "JSONRPC Full" ``` { .bash .copy } - wscat -c "wss://trades.grvt.io/ws/full" \ + 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_order", + "method": "v1/cancel_order", "params": { - "order": { - "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" - } - } + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" }, "id": 123 } @@ -1230,43 +1279,83 @@ LITE ENDPOINT: lite/v1/create_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/create_order' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_order' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "o": { - "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" - } - } + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "oi": "0x1028403", + "co": "23042", + "tt": "500" + } + ' + ``` + !!! 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_order", + "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "oi": "0x1028403", + "co": "23042", + "tt": "500" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://trades.grvt.io/full/v1/cancel_order' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" + } + ' + ``` + !!! 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_order", + "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": "500" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://trades.grvt.io/lite/v1/cancel_order' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "oi": "0x1028403", + "co": "23042", + "tt": "500" } ' ``` @@ -1278,41 +1367,12 @@ LITE ENDPOINT: lite/v1/create_order -x ' { "j": "2.0", - "m": "v1/create_order", + "m": "v1/cancel_order", "p": { - "o": { - "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" - } - } + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "oi": "0x1028403", + "co": "23042", + "tt": "500" }, "i": 123 } @@ -1320,15 +1380,15 @@ LITE ENDPOINT: lite/v1/create_order ```

-### Cancel Order +### Cancel All Orders ``` -FULL ENDPOINT: full/v1/cancel_order -LITE ENDPOINT: lite/v1/cancel_order +FULL ENDPOINT: full/v1/cancel_all_orders +LITE ENDPOINT: lite/v1/cancel_all_orders ``` === "Request"
- -8<- "docs/schemas/api_cancel_order_request.md" + -8<- "docs/schemas/api_cancel_all_orders_request.md"
!!! question "Query" @@ -1336,18 +1396,18 @@ LITE ENDPOINT: lite/v1/cancel_order ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ``` **Lite Request** ``` { .json .copy } { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ```
@@ -1385,9 +1445,6 @@ LITE ENDPOINT: lite/v1/cancel_order |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| - |2300|400|Order cancel time-to-live settings currently disabled.| - |2301|400|Order cancel time-to-live exceeds maximum allowed value.| - |3021|400|Either order ID or client order ID must be supplied|
!!! failure @@ -1416,14 +1473,14 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_order' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -1435,12 +1492,12 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_order", + "method": "v1/cancel_all_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -1450,14 +1507,14 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_order' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -1469,12 +1526,12 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "j": "2.0", - "m": "v1/cancel_order", + "m": "v1/cancel_all_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -1485,14 +1542,14 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_order' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -1504,12 +1561,12 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_order", + "method": "v1/cancel_all_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -1519,14 +1576,14 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_order' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -1538,12 +1595,12 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "j": "2.0", - "m": "v1/cancel_order", + "m": "v1/cancel_all_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -1554,14 +1611,14 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_order' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -1573,12 +1630,12 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_order", + "method": "v1/cancel_all_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -1588,14 +1645,14 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_order' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -1607,12 +1664,12 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "j": "2.0", - "m": "v1/cancel_order", + "m": "v1/cancel_all_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -1623,14 +1680,14 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/cancel_order' \ + curl --location 'https://trades.grvt.io/full/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -1642,12 +1699,12 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_order", + "method": "v1/cancel_all_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042", - "time_to_live_ms": "500" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -1657,14 +1714,14 @@ LITE ENDPOINT: lite/v1/cancel_order
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/cancel_order' \ + curl --location 'https://trades.grvt.io/lite/v1/cancel_all_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -1676,12 +1733,12 @@ LITE ENDPOINT: lite/v1/cancel_order -x ' { "j": "2.0", - "m": "v1/cancel_order", + "m": "v1/cancel_all_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042", - "tt": "500" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -1689,15 +1746,15 @@ LITE ENDPOINT: lite/v1/cancel_order ```

-### Cancel All Orders +### Get Order ``` -FULL ENDPOINT: full/v1/cancel_all_orders -LITE ENDPOINT: lite/v1/cancel_all_orders +FULL ENDPOINT: full/v1/order +LITE ENDPOINT: lite/v1/order ``` === "Request"
- -8<- "docs/schemas/api_cancel_all_orders_request.md" + -8<- "docs/schemas/api_get_order_request.md"
!!! question "Query" @@ -1705,24 +1762,22 @@ LITE ENDPOINT: lite/v1/cancel_all_orders ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042" } ``` **Lite Request** ``` { .json .copy } { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042" } ```
=== "Response"
- -8<- "docs/schemas/ack_response.md" + -8<- "docs/schemas/api_get_order_response.md"
!!! success @@ -1730,7 +1785,46 @@ LITE ENDPOINT: lite/v1/cancel_all_orders ``` { .json .copy } { "result": { - "ack": "true" + "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"] + } } } ``` @@ -1738,7 +1832,46 @@ LITE ENDPOINT: lite/v1/cancel_all_orders ``` { .json .copy } { "r": { - "a": "true" + "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"] + } } } ``` @@ -1754,6 +1887,8 @@ LITE ENDPOINT: lite/v1/cancel_all_orders |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| + |3021|400|Either order ID or client order ID must be supplied|
!!! failure @@ -1782,14 +1917,13 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_all_orders' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042" } ' ``` @@ -1801,12 +1935,11 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_all_orders", + "method": "v1/order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042" }, "id": 123 } @@ -1816,14 +1949,13 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_all_orders' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/order' \ --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"] + "oi": "0x1028403", + "co": "23042" } ' ``` @@ -1835,12 +1967,11 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "j": "2.0", - "m": "v1/cancel_all_orders", + "m": "v1/order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042" }, "i": 123 } @@ -1851,14 +1982,13 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_all_orders' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042" } ' ``` @@ -1870,12 +2000,11 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_all_orders", + "method": "v1/order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042" }, "id": 123 } @@ -1885,14 +2014,13 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_all_orders' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/order' \ --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"] + "oi": "0x1028403", + "co": "23042" } ' ``` @@ -1904,12 +2032,11 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "j": "2.0", - "m": "v1/cancel_all_orders", + "m": "v1/order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042" }, "i": 123 } @@ -1920,14 +2047,13 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_all_orders' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042" } ' ``` @@ -1939,12 +2065,11 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_all_orders", + "method": "v1/order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042" }, "id": 123 } @@ -1954,14 +2079,13 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_all_orders' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/order' \ --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"] + "oi": "0x1028403", + "co": "23042" } ' ``` @@ -1973,12 +2097,11 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "j": "2.0", - "m": "v1/cancel_all_orders", + "m": "v1/order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042" }, "i": 123 } @@ -1989,14 +2112,13 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/cancel_all_orders' \ + curl --location 'https://trades.grvt.io/full/v1/order' \ --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"] + "order_id": "0x1028403", + "client_order_id": "23042" } ' ``` @@ -2008,12 +2130,11 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_all_orders", + "method": "v1/order", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "order_id": "0x1028403", + "client_order_id": "23042" }, "id": 123 } @@ -2023,14 +2144,13 @@ LITE ENDPOINT: lite/v1/cancel_all_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/cancel_all_orders' \ + curl --location 'https://trades.grvt.io/lite/v1/order' \ --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"] + "oi": "0x1028403", + "co": "23042" } ' ``` @@ -2042,12 +2162,11 @@ LITE ENDPOINT: lite/v1/cancel_all_orders -x ' { "j": "2.0", - "m": "v1/cancel_all_orders", + "m": "v1/order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "oi": "0x1028403", + "co": "23042" }, "i": 123 } @@ -2055,15 +2174,15 @@ LITE ENDPOINT: lite/v1/cancel_all_orders ```

-### Get Order +### Open Orders ``` -FULL ENDPOINT: full/v1/order -LITE ENDPOINT: lite/v1/order +FULL ENDPOINT: full/v1/open_orders +LITE ENDPOINT: lite/v1/open_orders ``` === "Request"
- -8<- "docs/schemas/api_get_order_request.md" + -8<- "docs/schemas/api_open_orders_request.md"
!!! question "Query" @@ -2071,29 +2190,31 @@ LITE ENDPOINT: lite/v1/order ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" - } + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] + } ``` **Lite Request** ``` { .json .copy } { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ```
=== "Response"
- -8<- "docs/schemas/api_get_order_response.md" + -8<- "docs/schemas/api_open_orders_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": { + "result": [{ "order_id": "0x1234567890abcdef", "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "is_market": false, @@ -2134,13 +2255,13 @@ LITE ENDPOINT: lite/v1/order "update_time": "1697788800000000000", "avg_fill_price": ["60000.4"] } - } + }] } ``` **Lite Response** ``` { .json .copy } { - "r": { + "r": [{ "oi": "0x1234567890abcdef", "sa": "'$GRVT_SUB_ACCOUNT_ID'", "im": false, @@ -2181,7 +2302,7 @@ LITE ENDPOINT: lite/v1/order "ut": "1697788800000000000", "af": ["60000.4"] } - } + }] } ```
@@ -2193,11 +2314,9 @@ LITE ENDPOINT: lite/v1/order |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| - |3021|400|Either order ID or client order ID must be supplied| + |1003|400|Request could not be processed due to malformed syntax|
!!! failure @@ -2226,13 +2345,14 @@ LITE ENDPOINT: lite/v1/order
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/order' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/open_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -2242,1727 +2362,14 @@ LITE ENDPOINT: lite/v1/order -H "Cookie: $GRVT_COOKIE" \ -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ -x ' - { - "jsonrpc": "2.0", - "method": "v1/order", - "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" - }, - "id": 123 - } - ' -w 360 - ``` -
-
- !!! example "REST Lite" - ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/order' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" - } - ' - ``` - !!! 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", - "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" - }, - "i": 123 - } - ' -w 360 - ``` -
- === "STAGING" -
- !!! example "REST Full" - ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/order' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" - } - ' - ``` - !!! 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", - "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" - }, - "id": 123 - } - ' -w 360 - ``` -
-
- !!! example "REST Lite" - ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/order' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" - } - ' - ``` - !!! 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", - "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" - }, - "i": 123 - } - ' -w 360 - ``` -
- === "TESTNET" -
- !!! example "REST Full" - ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/order' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" - } - ' - ``` - !!! 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", - "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" - }, - "id": 123 - } - ' -w 360 - ``` -
-
- !!! example "REST Lite" - ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/order' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" - } - ' - ``` - !!! 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", - "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" - }, - "i": 123 - } - ' -w 360 - ``` -
- === "PROD" -
- !!! example "REST Full" - ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/order' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" - } - ' - ``` - !!! 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", - "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "order_id": "0x1028403", - "client_order_id": "23042" - }, - "id": 123 - } - ' -w 360 - ``` -
-
- !!! example "REST Lite" - ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/order' \ - --header "Cookie: $GRVT_COOKIE" \ - --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ - --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" - } - ' - ``` - !!! 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", - "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "oi": "0x1028403", - "co": "23042" - }, - "i": 123 - } - ' -w 360 - ``` -
-
-### Open Orders -``` -FULL ENDPOINT: full/v1/open_orders -LITE ENDPOINT: lite/v1/open_orders -``` - -=== "Request" -
- -8<- "docs/schemas/api_open_orders_request.md" -
-
- !!! question "Query" - **Full Request** - ``` { .json .copy } - { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] - } - ``` - **Lite Request** - ``` { .json .copy } - { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] - } - ``` -
-=== "Response" -
- -8<- "docs/schemas/api_open_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| - |1006|429|You have surpassed the allocated rate limit for your tier| - |1008|401|Your IP has not been whitelisted for access| - |1003|400|Request could not be processed due to malformed syntax| -
-
- !!! 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/open_orders' \ - --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"] - } - ' - ``` - !!! 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/open_orders", - "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] - }, - "id": 123 - } - ' -w 360 - ``` -
-
- !!! example "REST Lite" - ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/open_orders' \ - --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"] - } - ' - ``` - !!! 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/open_orders", - "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] - }, - "i": 123 - } - ' -w 360 - ``` -
- === "STAGING" -
- !!! example "REST Full" - ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/open_orders' \ - --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"] - } - ' - ``` - !!! 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/open_orders", - "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] - }, - "id": 123 - } - ' -w 360 - ``` -
-
- !!! example "REST Lite" - ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/open_orders' \ - --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"] - } - ' - ``` - !!! 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/open_orders", - "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] - }, - "i": 123 - } - ' -w 360 - ``` -
- === "TESTNET" -
- !!! example "REST Full" - ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/open_orders' \ - --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"] - } - ' - ``` - !!! 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/open_orders", - "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] - }, - "id": 123 - } - ' -w 360 - ``` -
-
- !!! example "REST Lite" - ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/open_orders' \ - --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"] - } - ' - ``` - !!! 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/open_orders", - "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] - }, - "i": 123 - } - ' -w 360 - ``` -
- === "PROD" -
- !!! example "REST Full" - ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/open_orders' \ - --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"] - } - ' - ``` - !!! 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/open_orders", - "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] - }, - "id": 123 - } - ' -w 360 - ``` -
-
- !!! example "REST Lite" - ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/open_orders' \ - --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"] - } - ' - ``` - !!! 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/open_orders", - "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] - }, - "i": 123 - } - ' -w 360 - ``` -
-
-### Order History -``` -FULL ENDPOINT: full/v1/order_history -LITE ENDPOINT: lite/v1/order_history -``` - -=== "Request" -
- -8<- "docs/schemas/api_order_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_order_history_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"] - } - }], - "next": "Qw0918=" - } - ``` - **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"] - } - }], - "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/order_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/order_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/order_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/order_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/order_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/order_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/order_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/order_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/order_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/order_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/order_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/order_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/order_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/order_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/order_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/order_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 - ``` -
-
-### 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"] - } - }] + { + "jsonrpc": "2.0", + "method": "v1/open_orders", + "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -3972,447 +2379,135 @@ LITE ENDPOINT: lite/v1/pre_order_check
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/pre_order_check' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/open_orders' \ --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"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` !!! example "JSONRPC Lite" ``` { .bash .copy } - wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \ + 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", + "m": "v1/open_orders", "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"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } ' -w 360 ```
- === "TESTNET" + === "STAGING"
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/pre_order_check' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/open_orders' \ --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"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` !!! example "JSONRPC Full" ``` { .bash .copy } - wscat -c "wss://trades.testnet.grvt.io/ws/full" \ + 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", + "method": "v1/open_orders", "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"] - } - }] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/open_orders' \ + --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"] } ' ``` !!! example "JSONRPC Lite" ``` { .bash .copy } - wscat -c "wss://trades.testnet.grvt.io/ws/lite" \ + 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", + "m": "v1/open_orders", "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"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } ' -w 360 ```
- === "PROD" + === "TESTNET"
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/pre_order_check' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/open_orders' \ --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"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` !!! example "JSONRPC Full" ``` { .bash .copy } - wscat -c "wss://trades.grvt.io/ws/full" \ + 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", + "method": "v1/open_orders", "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"] - } - }] + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -4422,53 +2517,83 @@ LITE ENDPOINT: lite/v1/pre_order_check
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/pre_order_check' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/open_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "o": [{ - "oi": "0x1234567890abcdef", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] + } + ' + ``` + !!! 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/open_orders", + "p": { "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"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://trades.grvt.io/full/v1/open_orders' \ + --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"] + } + ' + ``` + !!! 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/open_orders", + "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://trades.grvt.io/lite/v1/open_orders' \ + --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"] } ' ``` @@ -4480,51 +2605,12 @@ LITE ENDPOINT: lite/v1/pre_order_check -x ' { "j": "2.0", - "m": "v1/pre_order_check", + "m": "v1/open_orders", "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"] - } - }] + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -4532,15 +2618,15 @@ LITE ENDPOINT: lite/v1/pre_order_check ```

-### Cancel On Disconnect +### Order History ``` -FULL ENDPOINT: full/v1/cancel_on_disconnect -LITE ENDPOINT: lite/v1/cancel_on_disconnect +FULL ENDPOINT: full/v1/order_history +LITE ENDPOINT: lite/v1/order_history ``` === "Request"
- -8<- "docs/schemas/api_cancel_on_disconnect_request.md" + -8<- "docs/schemas/api_order_history_request.md"
!!! question "Query" @@ -4548,37 +2634,129 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "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'", - "ct": 300 + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ```
=== "Response"
- -8<- "docs/schemas/ack_response.md" + -8<- "docs/schemas/api_order_history_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": { - "ack": "true" - } + "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"] + } + }], + "next": "Qw0918=" } ``` **Lite Response** ``` { .json .copy } { - "r": { - "a": "true" - } + "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"] + } + }], + "n": "Qw0918=" } ```
@@ -4593,7 +2771,6 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect |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 @@ -4622,12 +2799,18 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_on_disconnect' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/order_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -4639,10 +2822,16 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_on_disconnect", + "method": "v1/order_history", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -4652,12 +2841,18 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_on_disconnect' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/order_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -4669,10 +2864,16 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "j": "2.0", - "m": "v1/cancel_on_disconnect", + "m": "v1/order_history", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -4683,12 +2884,18 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_on_disconnect' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/order_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -4700,10 +2907,16 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_on_disconnect", + "method": "v1/order_history", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -4713,12 +2926,18 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_on_disconnect' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/order_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -4730,10 +2949,16 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "j": "2.0", - "m": "v1/cancel_on_disconnect", + "m": "v1/order_history", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -4744,12 +2969,18 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_on_disconnect' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/order_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -4761,10 +2992,16 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_on_disconnect", + "method": "v1/order_history", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -4774,12 +3011,18 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_on_disconnect' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/order_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -4791,10 +3034,16 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "j": "2.0", - "m": "v1/cancel_on_disconnect", + "m": "v1/order_history", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -4805,12 +3054,18 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/cancel_on_disconnect' \ + curl --location 'https://trades.grvt.io/full/v1/order_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -4822,10 +3077,16 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "jsonrpc": "2.0", - "method": "v1/cancel_on_disconnect", + "method": "v1/order_history", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "countdown_time": 300 + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -4835,12 +3096,18 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/cancel_on_disconnect' \ + curl --location 'https://trades.grvt.io/lite/v1/order_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -4852,10 +3119,16 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect -x ' { "j": "2.0", - "m": "v1/cancel_on_disconnect", + "m": "v1/order_history", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "ct": 300 + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -4863,21 +3136,22 @@ LITE ENDPOINT: lite/v1/cancel_on_disconnect ```

-### Create Bulk Orders +### Pre Order Check ``` -FULL ENDPOINT: full/v1/create_bulk_orders -LITE ENDPOINT: lite/v1/create_bulk_orders +FULL ENDPOINT: full/v1/pre_order_check +LITE ENDPOINT: lite/v1/pre_order_check ``` === "Request"
- -8<- "docs/schemas/api_create_bulk_orders_request.md" + -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'", @@ -4925,6 +3199,7 @@ LITE ENDPOINT: lite/v1/create_bulk_orders **Lite Request** ``` { .json .copy } { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", "o": [{ "oi": "0x1234567890abcdef", "sa": "'$GRVT_SUB_ACCOUNT_ID'", @@ -4972,163 +3247,57 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
=== "Response"
- -8<- "docs/schemas/api_create_bulk_orders_response.md" + -8<- "docs/schemas/api_pre_order_check_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 + "results": [{ + "max_qty": [{ + "asset": null, + "max_buy_qty": 100.0, + "max_sell_qty": 100.0 }], - "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| + "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| - |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 @@ -5157,10 +3326,11 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/create_bulk_orders' \ + 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'", @@ -5214,8 +3384,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "jsonrpc": "2.0", - "method": "v1/create_bulk_orders", + "method": "v1/pre_order_check", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "orders": [{ "order_id": "0x1234567890abcdef", "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", @@ -5267,10 +3438,11 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/create_bulk_orders' \ + 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'", @@ -5324,8 +3496,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "j": "2.0", - "m": "v1/create_bulk_orders", + "m": "v1/pre_order_check", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", "o": [{ "oi": "0x1234567890abcdef", "sa": "'$GRVT_SUB_ACCOUNT_ID'", @@ -5378,10 +3551,11 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/create_bulk_orders' \ + 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'", @@ -5435,8 +3609,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "jsonrpc": "2.0", - "method": "v1/create_bulk_orders", + "method": "v1/pre_order_check", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "orders": [{ "order_id": "0x1234567890abcdef", "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", @@ -5488,10 +3663,11 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/create_bulk_orders' \ + 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'", @@ -5545,8 +3721,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "j": "2.0", - "m": "v1/create_bulk_orders", + "m": "v1/pre_order_check", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", "o": [{ "oi": "0x1234567890abcdef", "sa": "'$GRVT_SUB_ACCOUNT_ID'", @@ -5599,10 +3776,11 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/create_bulk_orders' \ + 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'", @@ -5656,8 +3834,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "jsonrpc": "2.0", - "method": "v1/create_bulk_orders", + "method": "v1/pre_order_check", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "orders": [{ "order_id": "0x1234567890abcdef", "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", @@ -5709,10 +3888,11 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/create_bulk_orders' \ + 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'", @@ -5766,8 +3946,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "j": "2.0", - "m": "v1/create_bulk_orders", + "m": "v1/pre_order_check", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", "o": [{ "oi": "0x1234567890abcdef", "sa": "'$GRVT_SUB_ACCOUNT_ID'", @@ -5820,10 +4001,11 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/create_bulk_orders' \ + 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'", @@ -5877,8 +4059,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "jsonrpc": "2.0", - "method": "v1/create_bulk_orders", + "method": "v1/pre_order_check", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "orders": [{ "order_id": "0x1234567890abcdef", "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", @@ -5930,10 +4113,11 @@ LITE ENDPOINT: lite/v1/create_bulk_orders
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/create_bulk_orders' \ + 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'", @@ -5987,8 +4171,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders -x ' { "j": "2.0", - "m": "v1/create_bulk_orders", + "m": "v1/pre_order_check", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", "o": [{ "oi": "0x1234567890abcdef", "sa": "'$GRVT_SUB_ACCOUNT_ID'", @@ -6038,55 +4223,53 @@ LITE ENDPOINT: lite/v1/create_bulk_orders ```

-### Get Order Group +### Cancel On Disconnect ``` -FULL ENDPOINT: full/v1/order_group -LITE ENDPOINT: lite/v1/order_group +FULL ENDPOINT: full/v1/cancel_on_disconnect +LITE ENDPOINT: lite/v1/cancel_on_disconnect ``` === "Request"
- -8<- "docs/schemas/api_get_order_group_request.md" + -8<- "docs/schemas/api_cancel_on_disconnect_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "countdown_time": 300 } ``` **Lite Request** ``` { .json .copy } { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "ct": 300 } ```
=== "Response"
- -8<- "docs/schemas/api_get_order_group_response.md" + -8<- "docs/schemas/ack_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": [{ - "group_id": "0x10000101000203040506", - "client_order_id": ["[23042, 54232]"], - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" - }] + "result": { + "ack": "true" + } } ``` **Lite Response** ``` { .json .copy } { - "r": [{ - "gi": "0x10000101000203040506", - "co": ["[23042, 54232]"], - "sa": "'$GRVT_SUB_ACCOUNT_ID'" - }] + "r": { + "a": "true" + } } ```
@@ -6101,9 +4284,7 @@ LITE ENDPOINT: lite/v1/order_group |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| + |6000|400|Countdown time is bigger than 300s supported|
!!! failure @@ -6132,11 +4313,12 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/order_group' \ + 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'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "countdown_time": 300 } ' ``` @@ -6148,9 +4330,10 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "jsonrpc": "2.0", - "method": "v1/order_group", + "method": "v1/cancel_on_disconnect", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "countdown_time": 300 }, "id": 123 } @@ -6160,11 +4343,12 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/order_group' \ + 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'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "ct": 300 } ' ``` @@ -6176,9 +4360,10 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "j": "2.0", - "m": "v1/order_group", + "m": "v1/cancel_on_disconnect", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "ct": 300 }, "i": 123 } @@ -6189,11 +4374,12 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/order_group' \ + 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'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "countdown_time": 300 } ' ``` @@ -6205,9 +4391,10 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "jsonrpc": "2.0", - "method": "v1/order_group", + "method": "v1/cancel_on_disconnect", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "countdown_time": 300 }, "id": 123 } @@ -6217,11 +4404,12 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/order_group' \ + 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'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "ct": 300 } ' ``` @@ -6233,9 +4421,10 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "j": "2.0", - "m": "v1/order_group", + "m": "v1/cancel_on_disconnect", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "ct": 300 }, "i": 123 } @@ -6246,11 +4435,12 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/order_group' \ + 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'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "countdown_time": 300 } ' ``` @@ -6262,9 +4452,10 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "jsonrpc": "2.0", - "method": "v1/order_group", + "method": "v1/cancel_on_disconnect", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "countdown_time": 300 }, "id": 123 } @@ -6274,11 +4465,12 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/order_group' \ + 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'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "ct": 300 } ' ``` @@ -6290,9 +4482,10 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "j": "2.0", - "m": "v1/order_group", + "m": "v1/cancel_on_disconnect", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "ct": 300 }, "i": 123 } @@ -6303,11 +4496,12 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/order_group' \ + 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'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "countdown_time": 300 } ' ``` @@ -6319,9 +4513,10 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "jsonrpc": "2.0", - "method": "v1/order_group", + "method": "v1/cancel_on_disconnect", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "countdown_time": 300 }, "id": 123 } @@ -6331,11 +4526,12 @@ LITE ENDPOINT: lite/v1/order_group
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/order_group' \ + 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'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "ct": 300 } ' ``` @@ -6347,9 +4543,10 @@ LITE ENDPOINT: lite/v1/order_group -x ' { "j": "2.0", - "m": "v1/order_group", + "m": "v1/cancel_on_disconnect", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "ct": 300 }, "i": 123 } @@ -6357,49 +4554,116 @@ LITE ENDPOINT: lite/v1/order_group ```

-## Execution -### Fill History +### Create Bulk Orders ``` -FULL ENDPOINT: full/v1/fill_history -LITE ENDPOINT: lite/v1/fill_history +FULL ENDPOINT: full/v1/create_bulk_orders +LITE ENDPOINT: lite/v1/create_bulk_orders ``` === "Request"
- -8<- "docs/schemas/api_fill_history_request.md" + -8<- "docs/schemas/api_create_bulk_orders_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": "" + "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'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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_fill_history_response.md" + -8<- "docs/schemas/api_create_bulk_orders_response.md"
!!! success @@ -6407,56 +4671,94 @@ LITE ENDPOINT: lite/v1/fill_history ``` { .json .copy } { "result": [{ - "event_time": "1697788800000000000", + "order_id": "0x1234567890abcdef", "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=" + "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": [{ - "et": "1697788800000000000", + "oi": "0x1234567890abcdef", "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=" + "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"] + } + }] } ```
@@ -6469,8 +4771,55 @@ LITE ENDPOINT: lite/v1/fill_history |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 @@ -6499,18 +4848,52 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/fill_history' \ + 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 '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"] + } + }] } ' ``` @@ -6522,16 +4905,50 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/create_bulk_orders", "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": "" + "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 } @@ -6541,18 +4958,52 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/fill_history' \ + 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 '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"] + } + }] } ' ``` @@ -6564,16 +5015,50 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/create_bulk_orders", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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 } @@ -6584,18 +5069,52 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/fill_history' \ + 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 '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"] + } + }] } ' ``` @@ -6607,16 +5126,50 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/create_bulk_orders", "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": "" + "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 } @@ -6626,18 +5179,52 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/fill_history' \ + 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 '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"] + } + }] } ' ``` @@ -6649,16 +5236,50 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/create_bulk_orders", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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 } @@ -6669,18 +5290,52 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/fill_history' \ + 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 '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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"] + } + }] } ' ``` @@ -6692,16 +5347,50 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/create_bulk_orders", "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": "" + "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 } @@ -6711,18 +5400,52 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/fill_history' \ + 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 '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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"] + } + }] } ' ``` @@ -6734,16 +5457,50 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/create_bulk_orders", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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 } @@ -6754,18 +5511,52 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/fill_history' \ + curl --location 'https://trades.grvt.io/full/v1/create_bulk_orders' \ --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": "" + "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"] + } + }] } ' ``` @@ -6777,16 +5568,50 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/create_bulk_orders", "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": "" + "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 } @@ -6796,18 +5621,52 @@ LITE ENDPOINT: lite/v1/fill_history
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/fill_history' \ + curl --location 'https://trades.grvt.io/lite/v1/create_bulk_orders' \ --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": "" + "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"] + } + }] } ' ``` @@ -6819,16 +5678,50 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/create_bulk_orders", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "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 } @@ -6836,40 +5729,34 @@ LITE ENDPOINT: lite/v1/fill_history ```

-### Positions +### Get Order Group ``` -FULL ENDPOINT: full/v1/positions -LITE ENDPOINT: lite/v1/positions +FULL ENDPOINT: full/v1/order_group +LITE ENDPOINT: lite/v1/order_group ``` === "Request"
- -8<- "docs/schemas/api_positions_request.md" + -8<- "docs/schemas/api_get_order_group_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ``` **Lite Request** ``` { .json .copy } { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ```
=== "Response"
- -8<- "docs/schemas/api_positions_response.md" + -8<- "docs/schemas/api_get_order_group_response.md"
!!! success @@ -6877,20 +5764,9 @@ LITE ENDPOINT: lite/v1/positions ``` { .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 + "group_id": "0x10000101000203040506", + "client_order_id": ["[23042, 54232]"], + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }] } ``` @@ -6898,20 +5774,9 @@ LITE ENDPOINT: lite/v1/positions ``` { .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 + "gi": "0x10000101000203040506", + "co": ["[23042, 54232]"], + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }] } ``` @@ -6927,6 +5792,9 @@ 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| + |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 @@ -6955,14 +5823,11 @@ 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/order_group' \ --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"] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -6974,12 +5839,9 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/order_group", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -6989,14 +5851,11 @@ 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/order_group' \ --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"] + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7008,12 +5867,9 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/order_group", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -7024,14 +5880,11 @@ 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/order_group' \ --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"] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7043,12 +5896,9 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/order_group", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -7058,14 +5908,11 @@ 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/order_group' \ --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"] + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7077,12 +5924,9 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/order_group", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -7093,14 +5937,11 @@ 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/order_group' \ --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"] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7112,12 +5953,9 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/order_group", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -7127,14 +5965,11 @@ 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/order_group' \ --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"] + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7146,12 +5981,9 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/order_group", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -7162,14 +5994,11 @@ 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/order_group' \ --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"] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7181,12 +6010,9 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/order_group", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "kind": ["PERPETUAL"], - "base": ["BTC", "ETH"], - "quote": ["USDT", "USDC"] + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -7196,14 +6022,11 @@ 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/order_group' \ --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"] + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7215,12 +6038,9 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/order_group", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"] + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -7228,15 +6048,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" @@ -7244,7 +6065,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, @@ -7255,7 +6078,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, @@ -7265,7 +6090,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 @@ -7276,9 +6101,23 @@ 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" }], "next": "Qw0918=" } @@ -7290,9 +6129,23 @@ 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" }], "n": "Qw0918=" } @@ -7337,12 +6190,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, @@ -7358,10 +6213,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, @@ -7375,12 +6232,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, @@ -7396,10 +6255,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, @@ -7414,12 +6275,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, @@ -7435,10 +6298,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, @@ -7452,12 +6317,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, @@ -7473,10 +6340,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, @@ -7491,12 +6360,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, @@ -7512,10 +6383,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, @@ -7529,12 +6402,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, @@ -7550,10 +6425,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, @@ -7568,12 +6445,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, @@ -7589,10 +6468,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, @@ -7606,12 +6487,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, @@ -7627,10 +6510,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, @@ -7642,45 +6527,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 @@ -7688,32 +6568,42 @@ 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 + }] } ``` **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 + }] } ```
@@ -7756,16 +6646,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"] } ' ``` @@ -7777,14 +6665,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 } @@ -7794,16 +6680,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"] } ' ``` @@ -7815,14 +6699,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 } @@ -7833,16 +6715,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"] } ' ``` @@ -7854,14 +6734,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 } @@ -7871,16 +6749,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"] } ' ``` @@ -7892,14 +6768,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 } @@ -7910,16 +6784,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"] } ' ``` @@ -7931,14 +6803,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 } @@ -7948,16 +6818,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"] } ' ``` @@ -7969,14 +6837,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 } @@ -7987,16 +6853,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"] } ' ``` @@ -8008,14 +6872,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 } @@ -8025,16 +6887,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"] } ' ``` @@ -8046,14 +6906,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 } @@ -8061,81 +6919,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"} + "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=" } ```
@@ -8150,12 +7000,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 @@ -8184,55 +7028,35 @@ 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"} - } - ' - ``` - !!! 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/transfer", - "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": "" + } + ' + ``` + !!! 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/funding_payment_history", + "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -8242,26 +7066,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": "" } ' ``` @@ -8273,24 +7087,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 } @@ -8301,26 +7105,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": "" } ' ``` @@ -8332,24 +7126,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 } @@ -8359,26 +7143,16 @@ 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": "" } ' ``` @@ -8390,24 +7164,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 } @@ -8418,26 +7182,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": "" } ' ``` @@ -8449,24 +7203,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 } @@ -8476,26 +7220,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": "" } ' ``` @@ -8507,24 +7241,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 } @@ -8535,26 +7259,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": "" } ' ``` @@ -8566,24 +7280,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 } @@ -8593,26 +7297,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": "" } ' ``` @@ -8624,24 +7318,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 } @@ -8649,15 +7333,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" @@ -8669,7 +7354,6 @@ LITE ENDPOINT: lite/v1/transfer_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403", "main_account_id": null } ``` @@ -8681,14 +7365,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 @@ -8696,24 +7379,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=" } @@ -8722,24 +7395,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 + "it": "1697788800000000000", + "ct": "1697788800000000000", + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0" }], "n": "Qw0918=" } @@ -8784,7 +7447,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 '{ @@ -8793,7 +7456,6 @@ LITE ENDPOINT: lite/v1/transfer_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403", "main_account_id": null } ' @@ -8806,14 +7468,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 @@ -8824,7 +7485,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 '{ @@ -8833,7 +7494,6 @@ LITE ENDPOINT: lite/v1/transfer_history "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403", "ma": null } ' @@ -8846,14 +7506,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 @@ -8865,7 +7524,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 '{ @@ -8874,7 +7533,6 @@ LITE ENDPOINT: lite/v1/transfer_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403", "main_account_id": null } ' @@ -8887,14 +7545,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 @@ -8905,7 +7562,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 '{ @@ -8914,7 +7571,6 @@ LITE ENDPOINT: lite/v1/transfer_history "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403", "ma": null } ' @@ -8927,14 +7583,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 @@ -8946,7 +7601,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 '{ @@ -8955,7 +7610,6 @@ LITE ENDPOINT: lite/v1/transfer_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403", "main_account_id": null } ' @@ -8968,14 +7622,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 @@ -8986,7 +7639,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 '{ @@ -8995,7 +7648,6 @@ LITE ENDPOINT: lite/v1/transfer_history "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403", "ma": null } ' @@ -9008,14 +7660,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 @@ -9027,7 +7678,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 '{ @@ -9036,7 +7687,6 @@ LITE ENDPOINT: lite/v1/transfer_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", - "tx_id": "1028403", "main_account_id": null } ' @@ -9049,14 +7699,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 @@ -9067,7 +7716,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 '{ @@ -9076,7 +7725,6 @@ LITE ENDPOINT: lite/v1/transfer_history "et": "1697788800000000000", "l": 500, "c1": "", - "ti": "1028403", "ma": null } ' @@ -9089,14 +7737,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 @@ -9105,15 +7752,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" @@ -9121,7 +7768,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": { @@ -9131,14 +7780,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": { @@ -9148,7 +7801,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"} } ```
@@ -9186,7 +7841,12 @@ 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.| + |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 @@ -9215,12 +7875,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": { @@ -9230,7 +7892,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"} } ' ``` @@ -9242,10 +7906,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": { @@ -9255,7 +7921,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 } @@ -9265,12 +7933,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": { @@ -9280,7 +7950,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"} } ' ``` @@ -9292,10 +7964,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": { @@ -9305,7 +7979,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 } @@ -9316,12 +7992,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": { @@ -9331,7 +8009,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"} } ' ``` @@ -9343,10 +8023,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": { @@ -9356,7 +8038,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 } @@ -9366,12 +8050,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": { @@ -9381,7 +8067,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"} } ' ``` @@ -9393,10 +8081,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": { @@ -9406,7 +8096,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 } @@ -9417,12 +8109,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": { @@ -9432,7 +8126,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"} } ' ``` @@ -9444,10 +8140,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": { @@ -9457,7 +8155,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 } @@ -9467,12 +8167,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": { @@ -9482,7 +8184,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"} } ' ``` @@ -9494,10 +8198,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": { @@ -9507,7 +8213,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 } @@ -9518,12 +8226,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": { @@ -9533,7 +8243,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"} } ' ``` @@ -9545,10 +8257,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": { @@ -9558,7 +8272,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 } @@ -9568,12 +8284,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": { @@ -9583,7 +8301,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"} } ' ``` @@ -9595,10 +8315,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": { @@ -9608,7 +8330,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 } @@ -9616,15 +8340,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" @@ -9636,6 +8360,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", + "tx_id": "1028403", "main_account_id": null } ``` @@ -9647,13 +8372,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 @@ -9663,7 +8389,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": { @@ -9674,7 +8402,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=" } @@ -9685,7 +8415,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": { @@ -9696,7 +8428,9 @@ LITE ENDPOINT: lite/v1/withdrawal_history "e": "1697788800000000000", "n": 1234567890 }, - "et": "1697788800000000000" + "et": "1697788800000000000", + "tt": "STANDARD", + "tm": null }], "n": "Qw0918=" } @@ -9741,7 +8475,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 '{ @@ -9750,6 +8484,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", + "tx_id": "1028403", "main_account_id": null } ' @@ -9762,13 +8497,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 @@ -9779,7 +8515,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 '{ @@ -9788,6 +8524,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history "et": "1697788800000000000", "l": 500, "c1": "", + "ti": "1028403", "ma": null } ' @@ -9800,13 +8537,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 @@ -9818,7 +8556,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 '{ @@ -9827,6 +8565,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", + "tx_id": "1028403", "main_account_id": null } ' @@ -9839,13 +8578,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 @@ -9856,7 +8596,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 '{ @@ -9865,6 +8605,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history "et": "1697788800000000000", "l": 500, "c1": "", + "ti": "1028403", "ma": null } ' @@ -9877,13 +8618,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 @@ -9895,7 +8637,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 '{ @@ -9904,6 +8646,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", + "tx_id": "1028403", "main_account_id": null } ' @@ -9916,13 +8659,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 @@ -9933,7 +8677,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 '{ @@ -9942,6 +8686,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history "et": "1697788800000000000", "l": 500, "c1": "", + "ti": "1028403", "ma": null } ' @@ -9954,13 +8699,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 @@ -9972,7 +8718,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 '{ @@ -9981,6 +8727,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history "end_time": "1697788800000000000", "limit": 500, "cursor": "", + "tx_id": "1028403", "main_account_id": null } ' @@ -9993,13 +8740,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 @@ -10010,7 +8758,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 '{ @@ -10019,6 +8767,7 @@ LITE ENDPOINT: lite/v1/withdrawal_history "et": "1697788800000000000", "l": 500, "c1": "", + "ti": "1028403", "ma": null } ' @@ -10031,13 +8780,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 @@ -10046,52 +8796,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" + } } ```
@@ -10100,11 +8871,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 @@ -10112,18 +8885,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 } ```
@@ -10133,12 +8906,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 + } } ' ``` @@ -10150,10 +8933,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 } @@ -10163,12 +8956,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 + } } ' ``` @@ -10180,10 +8983,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 } @@ -10194,12 +9007,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 + } } ' ``` @@ -10211,10 +9034,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 } @@ -10224,12 +9057,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 + } } ' ``` @@ -10241,10 +9084,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 } @@ -10255,12 +9108,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 + } } ' ``` @@ -10272,10 +9135,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 } @@ -10285,12 +9158,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 + } } ' ``` @@ -10302,10 +9185,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 } @@ -10316,12 +9209,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 + } } ' ``` @@ -10333,10 +9236,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 } @@ -10346,12 +9259,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 + } } ' ``` @@ -10363,10 +9286,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 } @@ -10374,112 +9307,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 - }], - "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 - }], - "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=" } ```
@@ -10522,11 +9432,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 } ' ``` @@ -10538,9 +9453,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 } @@ -10550,11 +9470,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 } ' ``` @@ -10566,9 +9491,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 } @@ -10579,11 +9509,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 } ' ``` @@ -10595,9 +9530,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 } @@ -10607,11 +9547,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 } ' ``` @@ -10623,9 +9568,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 } @@ -10636,11 +9586,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 } ' ``` @@ -10652,9 +9607,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 } @@ -10664,11 +9624,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 } ' ``` @@ -10680,9 +9645,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 } @@ -10693,11 +9663,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 } ' ``` @@ -10709,9 +9684,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 } @@ -10721,11 +9701,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 } ' ``` @@ -10737,9 +9722,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 } @@ -10747,121 +9737,52 @@ LITE ENDPOINT: lite/v1/account_summary ```

-### Sub Account History +## PreDepositCheck +### Pre Deposit Check ``` -FULL ENDPOINT: full/v1/account_history -LITE ENDPOINT: lite/v1/account_history +FULL ENDPOINT: full/v1/pre_deposit_check +LITE ENDPOINT: lite/v1/pre_deposit_check ``` === "Request"
- -8<- "docs/schemas/api_sub_account_history_request.md" + -8<- "docs/schemas/api_pre_deposit_check_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "currency": "USDT", + "bridge": "XY" } ``` **Lite Request** ``` { .json .copy } { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "c": "USDT", + "b": "XY" } ```
=== "Response"
- -8<- "docs/schemas/api_sub_account_history_response.md" + -8<- "docs/schemas/api_pre_deposit_check_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 - }], - "settle_index_price": "1.0000102" - }], - "next": "Qw0918=" + "max_deposit_limit": "3945034.23", + "currency": "USDT" } ``` **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 - }], - "si": "1.0000102" - }], - "n": "Qw0918=" + "md": "3945034.23", + "c": "USDT" } ```
@@ -10870,11 +9791,10 @@ LITE ENDPOINT: lite/v1/account_history !!! 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|
@@ -10883,18 +9803,18 @@ LITE ENDPOINT: lite/v1/account_history ``` { .json .copy } { "request_id":1, - "code":1000, - "message":"You need to authenticate prior to using this functionality", - "status":401 + "code":1002, + "message":"Internal Server Error", + "status":500 } ``` **Lite Error Response** ``` { .json .copy } { "ri":1, - "c":1000, - "m":"You need to authenticate prior to using this functionality", - "s":401 + "c":1002, + "m":"Internal Server Error", + "s":500 } ```
@@ -10904,15 +9824,12 @@ 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/pre_deposit_check' \ --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": "" + "currency": "USDT", + "bridge": "XY" } ' ``` @@ -10924,13 +9841,10 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/pre_deposit_check", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "currency": "USDT", + "bridge": "XY" }, "id": 123 } @@ -10940,15 +9854,12 @@ 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/pre_deposit_check' \ --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": "" + "c": "USDT", + "b": "XY" } ' ``` @@ -10960,13 +9871,10 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/pre_deposit_check", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "c": "USDT", + "b": "XY" }, "i": 123 } @@ -10977,15 +9885,12 @@ 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/pre_deposit_check' \ --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": "" + "currency": "USDT", + "bridge": "XY" } ' ``` @@ -10997,13 +9902,10 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/pre_deposit_check", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "currency": "USDT", + "bridge": "XY" }, "id": 123 } @@ -11013,15 +9915,12 @@ 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/pre_deposit_check' \ --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": "" + "c": "USDT", + "b": "XY" } ' ``` @@ -11033,13 +9932,10 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/pre_deposit_check", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "c": "USDT", + "b": "XY" }, "i": 123 } @@ -11050,15 +9946,12 @@ 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/pre_deposit_check' \ --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": "" + "currency": "USDT", + "bridge": "XY" } ' ``` @@ -11070,13 +9963,10 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/pre_deposit_check", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "currency": "USDT", + "bridge": "XY" }, "id": 123 } @@ -11086,15 +9976,12 @@ 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/pre_deposit_check' \ --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": "" + "c": "USDT", + "b": "XY" } ' ``` @@ -11106,13 +9993,10 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/pre_deposit_check", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "c": "USDT", + "b": "XY" }, "i": 123 } @@ -11123,15 +10007,12 @@ 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/pre_deposit_check' \ --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": "" + "currency": "USDT", + "bridge": "XY" } ' ``` @@ -11143,13 +10024,10 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/pre_deposit_check", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "currency": "USDT", + "bridge": "XY" }, "id": 123 } @@ -11159,15 +10037,12 @@ 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/pre_deposit_check' \ --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": "" + "c": "USDT", + "b": "XY" } ' ``` @@ -11179,13 +10054,10 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/pre_deposit_check", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "c": "USDT", + "b": "XY" }, "i": 123 } @@ -11193,32 +10065,35 @@ LITE ENDPOINT: lite/v1/account_history ```

-### Aggregated Account Summary +## Account +### Sub Account Summary ``` -FULL ENDPOINT: full/v1/aggregated_account_summary -LITE ENDPOINT: lite/v1/aggregated_account_summary +FULL ENDPOINT: full/v1/account_summary +LITE ENDPOINT: lite/v1/account_summary ``` === "Request"
- -8<- "docs/schemas/empty_request.md" + -8<- "docs/schemas/api_sub_account_summary_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_aggregated_account_summary_response.md" + -8<- "docs/schemas/api_sub_account_summary_response.md"
!!! success @@ -11226,13 +10101,37 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary ``` { .json .copy } { "result": { - "main_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "total_equity": "3945034.23", + "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 + }], + "settle_index_price": "1.0000102" } } ``` @@ -11240,13 +10139,37 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary ``` { .json .copy } { "r": { - "ma": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "3945034.23", + "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 + }], + "si": "1.0000102" } } ``` @@ -11256,6 +10179,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| @@ -11267,18 +10192,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 } ```
@@ -11288,10 +10213,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11303,8 +10229,9 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/account_summary", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11314,10 +10241,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11329,8 +10257,9 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/account_summary", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11341,10 +10270,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11356,8 +10286,9 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/account_summary", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11367,10 +10298,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11382,8 +10314,9 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/account_summary", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11394,10 +10327,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11409,8 +10343,9 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/account_summary", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11420,10 +10355,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11435,8 +10371,9 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/account_summary", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11447,10 +10384,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11462,8 +10400,9 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/account_summary", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -11473,10 +10412,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -11488,8 +10428,9 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/account_summary", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -11497,61 +10438,121 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary ```

-### Funding Account Summary +### Sub Account History ``` -FULL ENDPOINT: full/v1/funding_account_summary -LITE ENDPOINT: lite/v1/funding_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_funding_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 + }], + "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 + }], + "si": "1.0000102" + }], + "n": "Qw0918=" } ```
@@ -11560,6 +10561,8 @@ LITE ENDPOINT: lite/v1/funding_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| @@ -11571,18 +10574,18 @@ LITE ENDPOINT: lite/v1/funding_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 } ```
@@ -11592,10 +10595,15 @@ 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/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": "" } ' ``` @@ -11607,8 +10615,13 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_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 } @@ -11618,10 +10631,15 @@ 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/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": "" } ' ``` @@ -11633,8 +10651,13 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/account_history", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -11645,10 +10668,15 @@ 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/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": "" } ' ``` @@ -11660,8 +10688,13 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_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 } @@ -11671,10 +10704,15 @@ 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/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": "" } ' ``` @@ -11686,8 +10724,13 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/account_history", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -11698,10 +10741,15 @@ 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/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": "" } ' ``` @@ -11713,8 +10761,13 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_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 } @@ -11724,10 +10777,15 @@ 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/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": "" } ' ``` @@ -11739,8 +10797,13 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/account_history", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -11751,10 +10814,15 @@ 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/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": "" } ' ``` @@ -11766,8 +10834,13 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_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 } @@ -11777,10 +10850,15 @@ 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/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": "" } ' ``` @@ -11792,8 +10870,13 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/account_history", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -11801,11 +10884,10 @@ LITE ENDPOINT: lite/v1/funding_account_summary ```

-## SocializedLoss -### Socialized Loss Status +### Aggregated Account Summary ``` -FULL ENDPOINT: full/v1/socialized_loss_status -LITE ENDPOINT: lite/v1/socialized_loss_status +FULL ENDPOINT: full/v1/aggregated_account_summary +LITE ENDPOINT: lite/v1/aggregated_account_summary ``` === "Request" @@ -11827,22 +10909,36 @@ LITE ENDPOINT: lite/v1/socialized_loss_status
=== "Response"
- -8<- "docs/schemas/api_socialized_loss_status_response.md" + -8<- "docs/schemas/api_aggregated_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" + }] + } } ```
@@ -11883,7 +10979,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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -11898,7 +10994,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/aggregated_account_summary", "params": { }, "id": 123 @@ -11909,7 +11005,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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -11924,7 +11020,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/aggregated_account_summary", "p": { }, "i": 123 @@ -11936,7 +11032,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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -11951,7 +11047,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/aggregated_account_summary", "params": { }, "id": 123 @@ -11962,7 +11058,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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -11977,7 +11073,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/aggregated_account_summary", "p": { }, "i": 123 @@ -11989,7 +11085,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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -12004,7 +11100,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/aggregated_account_summary", "params": { }, "id": 123 @@ -12015,7 +11111,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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -12030,7 +11126,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/aggregated_account_summary", "p": { }, "i": 123 @@ -12042,7 +11138,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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -12057,7 +11153,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/aggregated_account_summary", "params": { }, "id": 123 @@ -12068,7 +11164,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/aggregated_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -12083,7 +11179,7 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/aggregated_account_summary", "p": { }, "i": 123 @@ -12092,58 +11188,61 @@ LITE ENDPOINT: lite/v1/socialized_loss_status ```

-## InitialLeverage -### Get All Initial Leverage +### Funding Account Summary ``` -FULL ENDPOINT: full/v1/get_all_initial_leverage -LITE ENDPOINT: lite/v1/get_all_initial_leverage +FULL ENDPOINT: full/v1/funding_account_summary +LITE ENDPOINT: lite/v1/funding_account_summary ``` === "Request"
- -8<- "docs/schemas/api_get_all_initial_leverage_request.md" + -8<- "docs/schemas/empty_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_all_initial_leverage_response.md" + -8<- "docs/schemas/api_funding_account_summary_response.md"
!!! success **Full Response** ``` { .json .copy } { - "results": [{ - "instrument": "BTC_USDT_Perp", - "leverage": "10", - "min_leverage": "10", - "max_leverage": "50" - }] + "result": { + "main_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "total_equity": "3945034.23", + "spot_balances": [{ + "currency": "USDT", + "balance": "123456.78", + "index_price": "1.0000102" + }] + } } ``` **Lite Response** ``` { .json .copy } { - "r": [{ - "i": "BTC_USDT_Perp", - "l": "10", - "ml": "10", - "ml1": "50" - }] + "r": { + "ma": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "3945034.23", + "sb": [{ + "c": "USDT", + "b": "123456.78", + "ip": "1.0000102" + }] + } } ```
@@ -12152,12 +11251,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage !!! 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| - |1004|404|Data Not Found| + |1008|401|Your IP has not been whitelisted for access|
!!! failure @@ -12165,18 +11262,18 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage ``` { .json .copy } { "request_id":1, - "code":1000, - "message":"You need to authenticate prior to using this functionality", - "status":401 + "code":1002, + "message":"Internal Server Error", + "status":500 } ``` **Lite Error Response** ``` { .json .copy } { "ri":1, - "c":1000, - "m":"You need to authenticate prior to using this functionality", - "s":401 + "c":1002, + "m":"Internal Server Error", + "s":500 } ```
@@ -12186,11 +11283,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/get_all_initial_leverage' \ + 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 '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12202,9 +11298,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/funding_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -12214,11 +11309,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/get_all_initial_leverage' \ + 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 '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12230,9 +11324,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/funding_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -12243,11 +11336,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/get_all_initial_leverage' \ + 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 '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12259,9 +11351,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/funding_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -12271,11 +11362,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/get_all_initial_leverage' \ + 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 '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12287,9 +11377,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/funding_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -12300,11 +11389,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/get_all_initial_leverage' \ + 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 '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12316,9 +11404,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/funding_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -12328,11 +11415,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/get_all_initial_leverage' \ + 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 '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12344,9 +11430,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/funding_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -12357,11 +11442,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/get_all_initial_leverage' \ + curl --location 'https://trades.grvt.io/full/v1/funding_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12373,9 +11457,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/funding_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -12385,11 +11468,10 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/get_all_initial_leverage' \ + curl --location 'https://trades.grvt.io/lite/v1/funding_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12401,9 +11483,8 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/funding_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -12411,51 +11492,48 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage ```

-### Set Initial Leverage +## SocializedLoss +### Socialized Loss Status ``` -FULL ENDPOINT: full/v1/set_initial_leverage -LITE ENDPOINT: lite/v1/set_initial_leverage +FULL ENDPOINT: full/v1/socialized_loss_status +LITE ENDPOINT: lite/v1/socialized_loss_status ``` === "Request"
- -8<- "docs/schemas/api_set_initial_leverage_request.md" + -8<- "docs/schemas/empty_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" } ``` **Lite Request** ``` { .json .copy } { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" } ```
=== "Response"
- -8<- "docs/schemas/api_set_initial_leverage_response.md" + -8<- "docs/schemas/api_socialized_loss_status_response.md"
!!! success **Full Response** ``` { .json .copy } { - "success": "true" + "is_active": "false", + "haircut_ratio": "0.34" } ``` **Lite Response** ``` { .json .copy } { - "s": "true" + "ia": "false", + "hr": "0.34" } ```
@@ -12464,13 +11542,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage !!! 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| - |1004|404|Data Not Found| - |2100|400|Invalid initial leverage| + |1008|401|Your IP has not been whitelisted for access|
!!! failure @@ -12478,18 +11553,18 @@ LITE ENDPOINT: lite/v1/set_initial_leverage ``` { .json .copy } { "request_id":1, - "code":1000, - "message":"You need to authenticate prior to using this functionality", - "status":401 + "code":1002, + "message":"Internal Server Error", + "status":500 } ``` **Lite Error Response** ``` { .json .copy } { "ri":1, - "c":1000, - "m":"You need to authenticate prior to using this functionality", - "s":401 + "c":1002, + "m":"Internal Server Error", + "s":500 } ```
@@ -12499,13 +11574,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/set_initial_leverage' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" } ' ``` @@ -12517,11 +11589,8 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/socialized_loss_status", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" }, "id": 123 } @@ -12531,13 +11600,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/set_initial_leverage' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" } ' ``` @@ -12549,11 +11615,8 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/socialized_loss_status", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" }, "i": 123 } @@ -12564,13 +11627,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/set_initial_leverage' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" } ' ``` @@ -12582,11 +11642,8 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/socialized_loss_status", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" }, "id": 123 } @@ -12596,13 +11653,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/set_initial_leverage' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" } ' ``` @@ -12614,11 +11668,8 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/socialized_loss_status", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" }, "i": 123 } @@ -12629,13 +11680,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/set_initial_leverage' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" } ' ``` @@ -12647,11 +11695,8 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/socialized_loss_status", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" }, "id": 123 } @@ -12661,13 +11706,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/set_initial_leverage' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" } ' ``` @@ -12679,11 +11721,8 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/socialized_loss_status", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" }, "i": 123 } @@ -12694,13 +11733,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/set_initial_leverage' \ + curl --location 'https://trades.grvt.io/full/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" } ' ``` @@ -12712,11 +11748,8 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/socialized_loss_status", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" }, "id": 123 } @@ -12726,13 +11759,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/set_initial_leverage' \ + curl --location 'https://trades.grvt.io/lite/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" } ' ``` @@ -12744,11 +11774,8 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/socialized_loss_status", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" }, "i": 123 } @@ -12756,33 +11783,35 @@ LITE ENDPOINT: lite/v1/set_initial_leverage ```

-## Margin -### Get Margin Tiers +## InitialLeverage +### Get All Initial Leverage ``` -FULL ENDPOINT: full/v1/get_margin_tiers -LITE ENDPOINT: lite/v1/get_margin_tiers +FULL ENDPOINT: full/v1/get_all_initial_leverage +LITE ENDPOINT: lite/v1/get_all_initial_leverage ``` === "Request"
- -8<- "docs/schemas/empty_request.md" + -8<- "docs/schemas/api_get_all_initial_leverage_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_margin_tiers_response.md" + -8<- "docs/schemas/api_get_all_initial_leverage_response.md"
!!! success @@ -12790,11 +11819,10 @@ LITE ENDPOINT: lite/v1/get_margin_tiers ``` { .json .copy } { "results": [{ - "asset": null, - "tiers": [{ - "lower_bound": null, - "rate": null - }] + "instrument": "BTC_USDT_Perp", + "leverage": "10", + "min_leverage": "10", + "max_leverage": "50" }] } ``` @@ -12802,11 +11830,10 @@ LITE ENDPOINT: lite/v1/get_margin_tiers ``` { .json .copy } { "r": [{ - "a": null, - "t": [{ - "lb": null, - "r": null - }] + "i": "BTC_USDT_Perp", + "l": "10", + "ml": "10", + "ml1": "50" }] } ``` @@ -12816,10 +11843,12 @@ LITE ENDPOINT: lite/v1/get_margin_tiers !!! 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|
!!! failure @@ -12827,18 +11856,18 @@ LITE ENDPOINT: lite/v1/get_margin_tiers ``` { .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 } ```
@@ -12848,10 +11877,11 @@ LITE ENDPOINT: lite/v1/get_margin_tiers
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/get_margin_tiers' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12863,8 +11893,9 @@ LITE ENDPOINT: lite/v1/get_margin_tiers -x ' { "jsonrpc": "2.0", - "method": "v1/get_margin_tiers", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -12874,10 +11905,11 @@ LITE ENDPOINT: lite/v1/get_margin_tiers
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/get_margin_tiers' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12889,8 +11921,9 @@ LITE ENDPOINT: lite/v1/get_margin_tiers -x ' { "j": "2.0", - "m": "v1/get_margin_tiers", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -12901,10 +11934,11 @@ LITE ENDPOINT: lite/v1/get_margin_tiers
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/get_margin_tiers' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12916,8 +11950,9 @@ LITE ENDPOINT: lite/v1/get_margin_tiers -x ' { "jsonrpc": "2.0", - "method": "v1/get_margin_tiers", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -12927,10 +11962,11 @@ LITE ENDPOINT: lite/v1/get_margin_tiers
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/get_margin_tiers' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12942,8 +11978,9 @@ LITE ENDPOINT: lite/v1/get_margin_tiers -x ' { "j": "2.0", - "m": "v1/get_margin_tiers", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -12954,10 +11991,11 @@ LITE ENDPOINT: lite/v1/get_margin_tiers
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/get_margin_tiers' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12969,8 +12007,9 @@ LITE ENDPOINT: lite/v1/get_margin_tiers -x ' { "jsonrpc": "2.0", - "method": "v1/get_margin_tiers", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -12980,10 +12019,11 @@ LITE ENDPOINT: lite/v1/get_margin_tiers
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/get_margin_tiers' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -12995,8 +12035,9 @@ LITE ENDPOINT: lite/v1/get_margin_tiers -x ' { "j": "2.0", - "m": "v1/get_margin_tiers", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -13007,10 +12048,11 @@ LITE ENDPOINT: lite/v1/get_margin_tiers
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/get_margin_tiers' \ + curl --location 'https://trades.grvt.io/full/v1/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -13022,8 +12064,9 @@ LITE ENDPOINT: lite/v1/get_margin_tiers -x ' { "jsonrpc": "2.0", - "method": "v1/get_margin_tiers", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -13033,10 +12076,11 @@ LITE ENDPOINT: lite/v1/get_margin_tiers
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/get_margin_tiers' \ + curl --location 'https://trades.grvt.io/lite/v1/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -13048,8 +12092,9 @@ LITE ENDPOINT: lite/v1/get_margin_tiers -x ' { "j": "2.0", - "m": "v1/get_margin_tiers", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -13057,16 +12102,15 @@ LITE ENDPOINT: lite/v1/get_margin_tiers ```

-## Order -### Query Trading Performance +### Set Initial Leverage ``` -FULL ENDPOINT: full/v1/trading_performance -LITE ENDPOINT: lite/v1/trading_performance +FULL ENDPOINT: full/v1/set_initial_leverage +LITE ENDPOINT: lite/v1/set_initial_leverage ``` === "Request"
- -8<- "docs/schemas/api_query_trading_performance_request.md" + -8<- "docs/schemas/api_set_initial_leverage_request.md"
!!! question "Query" @@ -13074,35 +12118,35 @@ LITE ENDPOINT: lite/v1/trading_performance ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "asset": "BTC_USDT_Perp" + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ``` **Lite Request** ``` { .json .copy } { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "a": "BTC_USDT_Perp" + "i": "BTC_USDT_Perp", + "l": "10" } ```
=== "Response"
- -8<- "docs/schemas/api_query_trading_performance_response.md" + -8<- "docs/schemas/api_set_initial_leverage_response.md"
!!! success **Full Response** ``` { .json .copy } { - "trading_volume": "3456.78", - "realized_pnl": "9.75" + "success": "true" } ``` **Lite Response** ``` { .json .copy } { - "tv": "3456.78", - "rp": "9.75" + "s": "true" } ```
@@ -13116,7 +12160,8 @@ LITE ENDPOINT: lite/v1/trading_performance |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| + |2100|400|Invalid initial leverage|
!!! failure @@ -13145,12 +12190,13 @@ LITE ENDPOINT: lite/v1/trading_performance
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/trading_performance' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "asset": "BTC_USDT_Perp" + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -13162,10 +12208,11 @@ LITE ENDPOINT: lite/v1/trading_performance -x ' { "jsonrpc": "2.0", - "method": "v1/trading_performance", + "method": "v1/set_initial_leverage", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "asset": "BTC_USDT_Perp" + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -13175,12 +12222,13 @@ LITE ENDPOINT: lite/v1/trading_performance
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/trading_performance' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "a": "BTC_USDT_Perp" + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -13192,10 +12240,11 @@ LITE ENDPOINT: lite/v1/trading_performance -x ' { "j": "2.0", - "m": "v1/trading_performance", + "m": "v1/set_initial_leverage", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "a": "BTC_USDT_Perp" + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -13206,12 +12255,13 @@ LITE ENDPOINT: lite/v1/trading_performance
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/trading_performance' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "asset": "BTC_USDT_Perp" + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -13223,10 +12273,11 @@ LITE ENDPOINT: lite/v1/trading_performance -x ' { "jsonrpc": "2.0", - "method": "v1/trading_performance", + "method": "v1/set_initial_leverage", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "asset": "BTC_USDT_Perp" + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -13236,12 +12287,13 @@ LITE ENDPOINT: lite/v1/trading_performance
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/trading_performance' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "a": "BTC_USDT_Perp" + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -13253,10 +12305,11 @@ LITE ENDPOINT: lite/v1/trading_performance -x ' { "j": "2.0", - "m": "v1/trading_performance", + "m": "v1/set_initial_leverage", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "a": "BTC_USDT_Perp" + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -13267,12 +12320,13 @@ LITE ENDPOINT: lite/v1/trading_performance
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/trading_performance' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "asset": "BTC_USDT_Perp" + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -13284,10 +12338,11 @@ LITE ENDPOINT: lite/v1/trading_performance -x ' { "jsonrpc": "2.0", - "method": "v1/trading_performance", + "method": "v1/set_initial_leverage", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "asset": "BTC_USDT_Perp" + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -13297,12 +12352,13 @@ LITE ENDPOINT: lite/v1/trading_performance
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/trading_performance' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "a": "BTC_USDT_Perp" + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -13314,10 +12370,11 @@ LITE ENDPOINT: lite/v1/trading_performance -x ' { "j": "2.0", - "m": "v1/trading_performance", + "m": "v1/set_initial_leverage", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "a": "BTC_USDT_Perp" + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -13328,12 +12385,13 @@ LITE ENDPOINT: lite/v1/trading_performance
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/trading_performance' \ + curl --location 'https://trades.grvt.io/full/v1/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "asset": "BTC_USDT_Perp" + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -13345,10 +12403,11 @@ LITE ENDPOINT: lite/v1/trading_performance -x ' { "jsonrpc": "2.0", - "method": "v1/trading_performance", + "method": "v1/set_initial_leverage", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "asset": "BTC_USDT_Perp" + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -13358,12 +12417,13 @@ LITE ENDPOINT: lite/v1/trading_performance
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/trading_performance' \ + curl --location 'https://trades.grvt.io/lite/v1/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "a": "BTC_USDT_Perp" + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -13375,10 +12435,11 @@ LITE ENDPOINT: lite/v1/trading_performance -x ' { "j": "2.0", - "m": "v1/trading_performance", + "m": "v1/set_initial_leverage", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "a": "BTC_USDT_Perp" + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } diff --git a/artifacts/apidocs/trading_streams.md b/artifacts/apidocs/trading_streams.md index 1971003..5f009fc 100644 --- a/artifacts/apidocs/trading_streams.md +++ b/artifacts/apidocs/trading_streams.md @@ -28,7 +28,8 @@ STREAM: v1.order "method": "subscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -42,7 +43,8 @@ STREAM: v1.order "subs": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -56,7 +58,8 @@ STREAM: v1.order "method": "unsubscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -149,7 +152,8 @@ STREAM: v1.order "update_time": "1697788800000000000", "avg_fill_price": ["60000.4"] } - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -199,7 +203,8 @@ STREAM: v1.order "ut": "1697788800000000000", "af": ["60000.4"] } - } + }, + "ps": "872634875" } ```
@@ -269,7 +274,8 @@ STREAM: v1.order "method": "subscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -286,7 +292,8 @@ STREAM: v1.order "method": "unsubscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -320,7 +327,8 @@ STREAM: v1.order "m": "subscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -337,7 +345,8 @@ STREAM: v1.order "m": "unsubscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -372,7 +381,8 @@ STREAM: v1.order "method": "subscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -389,7 +399,8 @@ STREAM: v1.order "method": "unsubscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -423,7 +434,8 @@ STREAM: v1.order "m": "subscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -440,7 +452,8 @@ STREAM: v1.order "m": "unsubscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -475,7 +488,8 @@ STREAM: v1.order "method": "subscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -492,7 +506,8 @@ STREAM: v1.order "method": "unsubscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -526,7 +541,8 @@ STREAM: v1.order "m": "subscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -543,7 +559,8 @@ STREAM: v1.order "m": "unsubscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -578,7 +595,8 @@ STREAM: v1.order "method": "subscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -595,7 +613,8 @@ STREAM: v1.order "method": "unsubscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -629,7 +648,8 @@ STREAM: v1.order "m": "subscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -646,7 +666,8 @@ STREAM: v1.order "m": "unsubscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -696,7 +717,8 @@ STREAM: v1.state "method": "subscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -710,7 +732,8 @@ STREAM: v1.state "subs": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -724,7 +747,8 @@ STREAM: v1.state "method": "unsubscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -787,7 +811,8 @@ STREAM: v1.state "update_time": "1697788800000000000", "avg_fill_price": ["60000.4"] } - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -807,7 +832,8 @@ STREAM: v1.state "ut": "1697788800000000000", "af": ["60000.4"] } - } + }, + "ps": "872634875" } ```
@@ -877,7 +903,8 @@ STREAM: v1.state "method": "subscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -894,7 +921,8 @@ STREAM: v1.state "method": "unsubscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -928,7 +956,8 @@ STREAM: v1.state "m": "subscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -945,7 +974,8 @@ STREAM: v1.state "m": "unsubscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -980,7 +1010,8 @@ STREAM: v1.state "method": "subscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -997,7 +1028,8 @@ STREAM: v1.state "method": "unsubscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -1031,7 +1063,8 @@ STREAM: v1.state "m": "subscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -1048,7 +1081,8 @@ STREAM: v1.state "m": "unsubscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -1083,7 +1117,8 @@ STREAM: v1.state "method": "subscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -1100,7 +1135,8 @@ STREAM: v1.state "method": "unsubscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -1134,7 +1170,8 @@ STREAM: v1.state "m": "subscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -1151,7 +1188,8 @@ STREAM: v1.state "m": "unsubscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -1186,7 +1224,8 @@ STREAM: v1.state "method": "subscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -1203,7 +1242,8 @@ STREAM: v1.state "method": "unsubscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -1237,7 +1277,8 @@ STREAM: v1.state "m": "subscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -1254,7 +1295,8 @@ STREAM: v1.state "m": "unsubscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -1304,7 +1346,8 @@ STREAM: v1.cancel "method": "subscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1318,7 +1361,8 @@ STREAM: v1.cancel "subs": ["'$GRVT_SUB_ACCOUNT_ID'"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -1332,7 +1376,8 @@ STREAM: v1.cancel "method": "unsubscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1391,7 +1436,8 @@ STREAM: v1.cancel "reason": "UNSPECIFIED", "update_time": "1697788800000000000", "cancel_status": "EXPIRED" - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -1407,7 +1453,8 @@ STREAM: v1.cancel "r": "UNSPECIFIED", "ut": "1697788800000000000", "cs": "EXPIRED" - } + }, + "ps": "872634875" } ```
@@ -1477,7 +1524,8 @@ STREAM: v1.cancel "method": "subscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1494,7 +1542,8 @@ STREAM: v1.cancel "method": "unsubscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1528,7 +1577,8 @@ STREAM: v1.cancel "m": "subscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -1545,7 +1595,8 @@ STREAM: v1.cancel "m": "unsubscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -1580,7 +1631,8 @@ STREAM: v1.cancel "method": "subscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1597,7 +1649,8 @@ STREAM: v1.cancel "method": "unsubscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1631,7 +1684,8 @@ STREAM: v1.cancel "m": "subscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -1648,7 +1702,8 @@ STREAM: v1.cancel "m": "unsubscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -1683,7 +1738,8 @@ STREAM: v1.cancel "method": "subscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1700,7 +1756,8 @@ STREAM: v1.cancel "method": "unsubscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1734,7 +1791,8 @@ STREAM: v1.cancel "m": "subscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -1751,7 +1809,8 @@ STREAM: v1.cancel "m": "unsubscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -1786,7 +1845,8 @@ STREAM: v1.cancel "method": "subscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1803,7 +1863,8 @@ STREAM: v1.cancel "method": "unsubscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1837,7 +1898,8 @@ STREAM: v1.cancel "m": "subscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -1854,7 +1916,8 @@ STREAM: v1.cancel "m": "unsubscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -1904,7 +1967,8 @@ STREAM: v1.group "method": "subscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1918,7 +1982,8 @@ STREAM: v1.group "subs": ["'$GRVT_SUB_ACCOUNT_ID'"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -1932,7 +1997,8 @@ STREAM: v1.group "method": "unsubscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -1988,7 +2054,8 @@ STREAM: v1.group "group_id": "0x10000101000203040506", "client_order_id": ["[23042, 54232]"], "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -2001,7 +2068,8 @@ STREAM: v1.group "gi": "0x10000101000203040506", "co": ["[23042, 54232]"], "sa": "'$GRVT_SUB_ACCOUNT_ID'" - } + }, + "ps": "872634875" } ```
@@ -2072,7 +2140,8 @@ STREAM: v1.group "method": "subscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -2089,7 +2158,8 @@ STREAM: v1.group "method": "unsubscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -2123,7 +2193,8 @@ STREAM: v1.group "m": "subscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -2140,7 +2211,8 @@ STREAM: v1.group "m": "unsubscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -2175,7 +2247,8 @@ STREAM: v1.group "method": "subscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -2192,7 +2265,8 @@ STREAM: v1.group "method": "unsubscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -2226,7 +2300,8 @@ STREAM: v1.group "m": "subscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -2243,7 +2318,8 @@ STREAM: v1.group "m": "unsubscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -2278,7 +2354,8 @@ STREAM: v1.group "method": "subscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -2295,7 +2372,8 @@ STREAM: v1.group "method": "unsubscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -2329,7 +2407,8 @@ STREAM: v1.group "m": "subscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -2346,7 +2425,8 @@ STREAM: v1.group "m": "unsubscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -2381,7 +2461,8 @@ STREAM: v1.group "method": "subscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -2398,7 +2479,8 @@ STREAM: v1.group "method": "unsubscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -2432,7 +2514,8 @@ STREAM: v1.group "m": "subscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -2449,7 +2532,8 @@ STREAM: v1.group "m": "unsubscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -2500,7 +2584,8 @@ STREAM: v1.fill "method": "subscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -2514,7 +2599,8 @@ STREAM: v1.fill "subs": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -2528,7 +2614,8 @@ STREAM: v1.fill "method": "unsubscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -2601,7 +2688,8 @@ STREAM: v1.fill "client_order_id": "23042", "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "broker": "UNSPECIFIED" - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -2631,7 +2719,8 @@ STREAM: v1.fill "co": "23042", "s1": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "b": "UNSPECIFIED" - } + }, + "ps": "872634875" } ```
@@ -2701,7 +2790,8 @@ STREAM: v1.fill "method": "subscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -2718,7 +2808,8 @@ STREAM: v1.fill "method": "unsubscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -2752,7 +2843,8 @@ STREAM: v1.fill "m": "subscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -2769,7 +2861,8 @@ STREAM: v1.fill "m": "unsubscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -2804,7 +2897,8 @@ STREAM: v1.fill "method": "subscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -2821,7 +2915,8 @@ STREAM: v1.fill "method": "unsubscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -2855,7 +2950,8 @@ STREAM: v1.fill "m": "subscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -2872,7 +2968,8 @@ STREAM: v1.fill "m": "unsubscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -2907,7 +3004,8 @@ STREAM: v1.fill "method": "subscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -2924,7 +3022,8 @@ STREAM: v1.fill "method": "unsubscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -2958,7 +3057,8 @@ STREAM: v1.fill "m": "subscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -2975,7 +3075,8 @@ STREAM: v1.fill "m": "unsubscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3010,7 +3111,8 @@ STREAM: v1.fill "method": "subscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3027,7 +3129,8 @@ STREAM: v1.fill "method": "unsubscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3061,7 +3164,8 @@ STREAM: v1.fill "m": "subscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3078,7 +3182,8 @@ STREAM: v1.fill "m": "unsubscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3128,7 +3233,8 @@ STREAM: v1.position "method": "subscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3142,7 +3248,8 @@ STREAM: v1.position "subs": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -3156,7 +3263,8 @@ STREAM: v1.position "method": "unsubscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3223,7 +3331,8 @@ STREAM: v1.position "roi": "10.20", "quote_index_price": "1.0000102", "est_liquidation_price": 60000.25 - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -3247,7 +3356,8 @@ STREAM: v1.position "r": "10.20", "qi": "1.0000102", "el": 60000.25 - } + }, + "ps": "872634875" } ```
@@ -3317,7 +3427,8 @@ STREAM: v1.position "method": "subscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3334,7 +3445,8 @@ STREAM: v1.position "method": "unsubscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3368,7 +3480,8 @@ STREAM: v1.position "m": "subscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3385,7 +3498,8 @@ STREAM: v1.position "m": "unsubscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3420,7 +3534,8 @@ STREAM: v1.position "method": "subscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3437,7 +3552,8 @@ STREAM: v1.position "method": "unsubscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3471,7 +3587,8 @@ STREAM: v1.position "m": "subscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3488,7 +3605,8 @@ STREAM: v1.position "m": "unsubscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3523,7 +3641,8 @@ STREAM: v1.position "method": "subscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3540,7 +3659,8 @@ STREAM: v1.position "method": "unsubscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3574,7 +3694,8 @@ STREAM: v1.position "m": "subscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3591,7 +3712,8 @@ STREAM: v1.position "m": "unsubscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3626,7 +3748,8 @@ STREAM: v1.position "method": "subscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3643,7 +3766,8 @@ STREAM: v1.position "method": "unsubscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "use_global_sequence_number": true }, "id": 123 } @@ -3677,7 +3801,8 @@ STREAM: v1.position "m": "subscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3694,7 +3819,8 @@ STREAM: v1.position "m": "unsubscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], + "ug": true }, "i": 123 } @@ -3745,7 +3871,8 @@ STREAM: v1.deposit "method": "subscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -3759,7 +3886,8 @@ STREAM: v1.deposit "subs": ["'$GRVT_MAIN_ACCOUNT_ID'"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -3773,7 +3901,8 @@ STREAM: v1.deposit "method": "unsubscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -3830,7 +3959,8 @@ STREAM: v1.deposit "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "10.50" - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -3844,7 +3974,8 @@ STREAM: v1.deposit "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "10.50" - } + }, + "ps": "872634875" } ```
@@ -3910,7 +4041,8 @@ STREAM: v1.deposit "method": "subscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -3927,7 +4059,8 @@ STREAM: v1.deposit "method": "unsubscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -3961,7 +4094,8 @@ STREAM: v1.deposit "m": "subscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -3978,7 +4112,8 @@ STREAM: v1.deposit "m": "unsubscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4013,7 +4148,8 @@ STREAM: v1.deposit "method": "subscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4030,7 +4166,8 @@ STREAM: v1.deposit "method": "unsubscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4064,7 +4201,8 @@ STREAM: v1.deposit "m": "subscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4081,7 +4219,8 @@ STREAM: v1.deposit "m": "unsubscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4116,7 +4255,8 @@ STREAM: v1.deposit "method": "subscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4133,7 +4273,8 @@ STREAM: v1.deposit "method": "unsubscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4167,7 +4308,8 @@ STREAM: v1.deposit "m": "subscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4184,7 +4326,8 @@ STREAM: v1.deposit "m": "unsubscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4219,7 +4362,8 @@ STREAM: v1.deposit "method": "subscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4236,7 +4380,8 @@ STREAM: v1.deposit "method": "unsubscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4270,7 +4415,8 @@ STREAM: v1.deposit "m": "subscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4287,7 +4433,8 @@ STREAM: v1.deposit "m": "unsubscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4337,7 +4484,8 @@ STREAM: v1.transfer "method": "subscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4351,7 +4499,8 @@ STREAM: v1.transfer "subs": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -4365,7 +4514,8 @@ STREAM: v1.transfer "method": "unsubscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4436,7 +4586,8 @@ STREAM: v1.transfer "event_time": "1697788800000000000", "transfer_type": "STANDARD", "transfer_metadata": null - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -4464,7 +4615,8 @@ STREAM: v1.transfer "et": "1697788800000000000", "tt": "STANDARD", "tm": null - } + }, + "ps": "872634875" } ```
@@ -4531,7 +4683,8 @@ STREAM: v1.transfer "method": "subscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4548,7 +4701,8 @@ STREAM: v1.transfer "method": "unsubscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4582,7 +4736,8 @@ STREAM: v1.transfer "m": "subscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4599,7 +4754,8 @@ STREAM: v1.transfer "m": "unsubscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4634,7 +4790,8 @@ STREAM: v1.transfer "method": "subscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4651,7 +4808,8 @@ STREAM: v1.transfer "method": "unsubscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4685,7 +4843,8 @@ STREAM: v1.transfer "m": "subscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4702,7 +4861,8 @@ STREAM: v1.transfer "m": "unsubscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4737,7 +4897,8 @@ STREAM: v1.transfer "method": "subscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4754,7 +4915,8 @@ STREAM: v1.transfer "method": "unsubscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4788,7 +4950,8 @@ STREAM: v1.transfer "m": "subscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4805,7 +4968,8 @@ STREAM: v1.transfer "m": "unsubscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4840,7 +5004,8 @@ STREAM: v1.transfer "method": "subscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4857,7 +5022,8 @@ STREAM: v1.transfer "method": "unsubscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4891,7 +5057,8 @@ STREAM: v1.transfer "m": "subscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4908,7 +5075,8 @@ STREAM: v1.transfer "m": "unsubscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -4958,7 +5126,8 @@ STREAM: v1.withdrawal "method": "subscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -4972,7 +5141,8 @@ STREAM: v1.withdrawal "subs": ["'$GRVT_MAIN_ACCOUNT_ID'"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876] + "first_sequence_number": [872634876], + "latest_sequence_number": [872634875] }, "id": 123, "method": "subscribe" @@ -4986,7 +5156,8 @@ STREAM: v1.withdrawal "method": "unsubscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -5051,7 +5222,8 @@ STREAM: v1.withdrawal "expiration": "1697788800000000000", "nonce": 1234567890 } - } + }, + "prev_sequence_number": "872634875" } ``` **Lite Feed Response** @@ -5073,7 +5245,8 @@ STREAM: v1.withdrawal "e": "1697788800000000000", "n": 1234567890 } - } + }, + "ps": "872634875" } ```
@@ -5139,7 +5312,8 @@ STREAM: v1.withdrawal "method": "subscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -5156,7 +5330,8 @@ STREAM: v1.withdrawal "method": "unsubscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -5190,7 +5365,8 @@ STREAM: v1.withdrawal "m": "subscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -5207,7 +5383,8 @@ STREAM: v1.withdrawal "m": "unsubscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -5242,7 +5419,8 @@ STREAM: v1.withdrawal "method": "subscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -5259,7 +5437,8 @@ STREAM: v1.withdrawal "method": "unsubscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -5293,7 +5472,8 @@ STREAM: v1.withdrawal "m": "subscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -5310,7 +5490,8 @@ STREAM: v1.withdrawal "m": "unsubscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -5345,7 +5526,8 @@ STREAM: v1.withdrawal "method": "subscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -5362,7 +5544,8 @@ STREAM: v1.withdrawal "method": "unsubscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -5396,7 +5579,8 @@ STREAM: v1.withdrawal "m": "subscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -5413,7 +5597,8 @@ STREAM: v1.withdrawal "m": "unsubscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -5448,7 +5633,8 @@ STREAM: v1.withdrawal "method": "subscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -5465,7 +5651,8 @@ STREAM: v1.withdrawal "method": "unsubscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "use_global_sequence_number": true }, "id": 123 } @@ -5499,7 +5686,8 @@ STREAM: v1.withdrawal "m": "subscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } @@ -5516,7 +5704,8 @@ STREAM: v1.withdrawal "m": "unsubscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], + "ug": true }, "i": 123 } diff --git a/src/codegen/apidocs/apidocs.py b/src/codegen/apidocs/apidocs.py index 5c89c27..9b1d8c2 100644 --- a/src/codegen/apidocs/apidocs.py +++ b/src/codegen/apidocs/apidocs.py @@ -28,14 +28,13 @@ ] # skip these fields for all structs, at all levels of nesting -IGNORE_FIELDS_ANY_PATH = [ - "prev_sequence_number", - "latest_sequence_number", - "use_global_sequence_number", -] +IGNORE_FIELDS_ANY_PATH = [] IGNORE_RPCS: list[str] = [ "RPCDedustPositionV1", + "RPCDropClientWS", + "RPCGetMarginTiersV1", + "RPCQueryTradingPerformanceV1", ] IGNORE_ENUM_VALUES: dict[str, list[str]] = { @@ -47,20 +46,13 @@ "KSHIB", "POPCAT", "PENGU", - "LINK", "KBONK", - "JUP", - "ENA", - "DOGE", "AIXBT", "AI_16_Z", - "ADA", - "AAVE", "VINE", "PENDLE", "UXLINK", "KAITO", - "IP", ], } From c89f229f811b98a944dc5d8023adf8ec8a195baf Mon Sep 17 00:00:00 2001 From: thangnguyen-19 Date: Wed, 9 Apr 2025 17:24:59 +0700 Subject: [PATCH 3/4] [RFC] Update API docs and specs --- artifacts/apidocs/trading_api.md | 256 +++++++++++++-------------- artifacts/apidocs/trading_streams.md | 8 +- src/codegen/apispec.json | 4 +- 3 files changed, 134 insertions(+), 134 deletions(-) diff --git a/artifacts/apidocs/trading_api.md b/artifacts/apidocs/trading_api.md index 01ee1cc..7aa74d7 100644 --- a/artifacts/apidocs/trading_api.md +++ b/artifacts/apidocs/trading_api.md @@ -41,9 +41,9 @@ LITE ENDPOINT: lite/v1/create_order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -79,9 +79,9 @@ LITE ENDPOINT: lite/v1/create_order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -125,9 +125,9 @@ LITE ENDPOINT: lite/v1/create_order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -172,9 +172,9 @@ LITE ENDPOINT: lite/v1/create_order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -302,9 +302,9 @@ LITE ENDPOINT: lite/v1/create_order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -348,9 +348,9 @@ LITE ENDPOINT: lite/v1/create_order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -394,9 +394,9 @@ LITE ENDPOINT: lite/v1/create_order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -440,9 +440,9 @@ LITE ENDPOINT: lite/v1/create_order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -487,9 +487,9 @@ LITE ENDPOINT: lite/v1/create_order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -533,9 +533,9 @@ LITE ENDPOINT: lite/v1/create_order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -579,9 +579,9 @@ LITE ENDPOINT: lite/v1/create_order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -625,9 +625,9 @@ LITE ENDPOINT: lite/v1/create_order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -672,9 +672,9 @@ LITE ENDPOINT: lite/v1/create_order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -718,9 +718,9 @@ LITE ENDPOINT: lite/v1/create_order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -764,9 +764,9 @@ LITE ENDPOINT: lite/v1/create_order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -810,9 +810,9 @@ LITE ENDPOINT: lite/v1/create_order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -857,9 +857,9 @@ LITE ENDPOINT: lite/v1/create_order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -903,9 +903,9 @@ LITE ENDPOINT: lite/v1/create_order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -949,9 +949,9 @@ LITE ENDPOINT: lite/v1/create_order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -995,9 +995,9 @@ LITE ENDPOINT: lite/v1/create_order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -1809,9 +1809,9 @@ LITE ENDPOINT: lite/v1/order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -1856,9 +1856,9 @@ LITE ENDPOINT: lite/v1/order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -2239,9 +2239,9 @@ LITE ENDPOINT: lite/v1/open_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -2286,9 +2286,9 @@ LITE ENDPOINT: lite/v1/open_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -2691,9 +2691,9 @@ LITE ENDPOINT: lite/v1/order_history "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -2739,9 +2739,9 @@ LITE ENDPOINT: lite/v1/order_history "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -3177,9 +3177,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -3225,9 +3225,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -3356,9 +3356,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -3412,9 +3412,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -3468,9 +3468,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -3524,9 +3524,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -3581,9 +3581,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -3637,9 +3637,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -3693,9 +3693,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -3749,9 +3749,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -3806,9 +3806,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -3862,9 +3862,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -3918,9 +3918,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -3974,9 +3974,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -4031,9 +4031,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -4087,9 +4087,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -4143,9 +4143,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -4199,9 +4199,9 @@ LITE ENDPOINT: lite/v1/pre_order_check "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -4594,9 +4594,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -4641,9 +4641,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -4695,9 +4695,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -4742,9 +4742,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -4877,9 +4877,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -4932,9 +4932,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -4987,9 +4987,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -5042,9 +5042,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -5098,9 +5098,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -5153,9 +5153,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -5208,9 +5208,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -5263,9 +5263,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -5319,9 +5319,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -5374,9 +5374,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -5429,9 +5429,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -5484,9 +5484,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -5540,9 +5540,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -5595,9 +5595,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -5650,9 +5650,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, @@ -5705,9 +5705,9 @@ LITE ENDPOINT: lite/v1/create_bulk_orders "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, diff --git a/artifacts/apidocs/trading_streams.md b/artifacts/apidocs/trading_streams.md index 5f009fc..d49b801 100644 --- a/artifacts/apidocs/trading_streams.md +++ b/artifacts/apidocs/trading_streams.md @@ -136,9 +136,9 @@ STREAM: v1.order "client_order_id": "23042", "create_time": "1697788800000000000", "trigger": { - "trigger_type": TAKE_PROFIT, + "trigger_type": "TAKE_PROFIT", "tpsl": { - "trigger_by": LAST, + "trigger_by": "LAST", "trigger_price": "65038.10" } }, @@ -187,9 +187,9 @@ STREAM: v1.order "co": "23042", "ct": "1697788800000000000", "t": { - "tt": TAKE_PROFIT, + "tt": "TAKE_PROFIT", "t": { - "tb": LAST, + "tb": "LAST", "tp": "65038.10" } }, diff --git a/src/codegen/apispec.json b/src/codegen/apispec.json index 4c9dacb..fd1de76 100644 --- a/src/codegen/apispec.json +++ b/src/codegen/apispec.json @@ -8435,7 +8435,7 @@ "index": 0, "array_depth": 0, "optional": false, - "example": "LAST", + "example": "'LAST'", "comment": [ "Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order" ] @@ -8476,7 +8476,7 @@ "index": 0, "array_depth": 0, "optional": false, - "example": "TAKE_PROFIT", + "example": "'TAKE_PROFIT'", "comment": [ "Type of the trigger order. eg: Take Profit, Stop Loss, etc" ] From 9c3a8a5eacb7fdb22a821e1884d1bd64ef795ffc Mon Sep 17 00:00:00 2001 From: thangnguyen-19 Date: Wed, 9 Apr 2025 17:30:21 +0700 Subject: [PATCH 4/4] [RFC] Update API docs and specs --- artifacts/apidocs/market_data_streams.md | 504 ++++++---------- .../apidocs/schemas/ws_cancel_feed_data_v1.md | 1 - .../schemas/ws_candlestick_feed_data_v1.md | 1 - .../schemas/ws_deposit_feed_data_v1.md | 1 - .../apidocs/schemas/ws_fill_feed_data_v1.md | 1 - .../schemas/ws_mini_ticker_feed_data_v1.md | 1 - .../apidocs/schemas/ws_order_feed_data_v1.md | 1 - .../schemas/ws_order_group_feed_data_v1.md | 1 - .../schemas/ws_order_state_feed_data_v1.md | 1 - .../ws_orderbook_levels_feed_data_v1.md | 1 - .../schemas/ws_positions_feed_data_v1.md | 1 - .../apidocs/schemas/ws_subscribe_params.md | 1 - .../ws_subscribe_response_v1_legacy.md | 1 - .../apidocs/schemas/ws_subscribe_result.md | 1 - .../apidocs/schemas/ws_ticker_feed_data_v1.md | 1 - .../apidocs/schemas/ws_trade_feed_data_v1.md | 1 - .../schemas/ws_transfer_feed_data_v1.md | 1 - .../apidocs/schemas/ws_unsubscribe_params.md | 1 - .../schemas/ws_withdrawal_feed_data_v1.md | 1 - artifacts/apidocs/trading_streams.md | 567 ++++++------------ src/codegen/apidocs/apidocs.py | 6 +- 21 files changed, 362 insertions(+), 733 deletions(-) diff --git a/artifacts/apidocs/market_data_streams.md b/artifacts/apidocs/market_data_streams.md index 8f44fc7..463c4dc 100644 --- a/artifacts/apidocs/market_data_streams.md +++ b/artifacts/apidocs/market_data_streams.md @@ -28,8 +28,7 @@ STREAM: v1.mini.s "method": "subscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -43,8 +42,7 @@ STREAM: v1.mini.s "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -58,8 +56,7 @@ STREAM: v1.mini.s "method": "unsubscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -123,8 +120,7 @@ STREAM: v1.mini.s "best_bid_size": "123456.78", "best_ask_price": "65038.01", "best_ask_size": "123456.78" - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -145,8 +141,7 @@ STREAM: v1.mini.s "bb1": "123456.78", "ba": "65038.01", "ba1": "123456.78" - }, - "ps": "872634875" + } } ```
@@ -211,8 +206,7 @@ STREAM: v1.mini.s "method": "subscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -227,8 +221,7 @@ STREAM: v1.mini.s "method": "unsubscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -258,8 +251,7 @@ STREAM: v1.mini.s "m": "subscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -274,8 +266,7 @@ STREAM: v1.mini.s "m": "unsubscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -306,8 +297,7 @@ STREAM: v1.mini.s "method": "subscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -322,8 +312,7 @@ STREAM: v1.mini.s "method": "unsubscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -353,8 +342,7 @@ STREAM: v1.mini.s "m": "subscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -369,8 +357,7 @@ STREAM: v1.mini.s "m": "unsubscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -401,8 +388,7 @@ STREAM: v1.mini.s "method": "subscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -417,8 +403,7 @@ STREAM: v1.mini.s "method": "unsubscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -448,8 +433,7 @@ STREAM: v1.mini.s "m": "subscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -464,8 +448,7 @@ STREAM: v1.mini.s "m": "unsubscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -496,8 +479,7 @@ STREAM: v1.mini.s "method": "subscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -512,8 +494,7 @@ STREAM: v1.mini.s "method": "unsubscribe", "params": { "stream": "v1.mini.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -543,8 +524,7 @@ STREAM: v1.mini.s "m": "subscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -559,8 +539,7 @@ STREAM: v1.mini.s "m": "unsubscribe", "p": { "s": "v1.mini.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -608,8 +587,7 @@ STREAM: v1.mini.d "method": "subscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -623,8 +601,7 @@ STREAM: v1.mini.d "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -638,8 +615,7 @@ STREAM: v1.mini.d "method": "unsubscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -703,8 +679,7 @@ STREAM: v1.mini.d "best_bid_size": "123456.78", "best_ask_price": "65038.01", "best_ask_size": "123456.78" - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -725,8 +700,7 @@ STREAM: v1.mini.d "bb1": "123456.78", "ba": "65038.01", "ba1": "123456.78" - }, - "ps": "872634875" + } } ```
@@ -791,8 +765,7 @@ STREAM: v1.mini.d "method": "subscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -807,8 +780,7 @@ STREAM: v1.mini.d "method": "unsubscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -838,8 +810,7 @@ STREAM: v1.mini.d "m": "subscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -854,8 +825,7 @@ STREAM: v1.mini.d "m": "unsubscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -886,8 +856,7 @@ STREAM: v1.mini.d "method": "subscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -902,8 +871,7 @@ STREAM: v1.mini.d "method": "unsubscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -933,8 +901,7 @@ STREAM: v1.mini.d "m": "subscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -949,8 +916,7 @@ STREAM: v1.mini.d "m": "unsubscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -981,8 +947,7 @@ STREAM: v1.mini.d "method": "subscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -997,8 +962,7 @@ STREAM: v1.mini.d "method": "unsubscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1028,8 +992,7 @@ STREAM: v1.mini.d "m": "subscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1044,8 +1007,7 @@ STREAM: v1.mini.d "m": "unsubscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1076,8 +1038,7 @@ STREAM: v1.mini.d "method": "subscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1092,8 +1053,7 @@ STREAM: v1.mini.d "method": "unsubscribe", "params": { "stream": "v1.mini.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1123,8 +1083,7 @@ STREAM: v1.mini.d "m": "subscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1139,8 +1098,7 @@ STREAM: v1.mini.d "m": "unsubscribe", "p": { "s": "v1.mini.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1188,8 +1146,7 @@ STREAM: v1.ticker.s "method": "subscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1203,8 +1160,7 @@ STREAM: v1.ticker.s "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -1218,8 +1174,7 @@ STREAM: v1.ticker.s "method": "unsubscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1296,8 +1251,7 @@ STREAM: v1.ticker.s "open_price": "65038.01", "open_interest": "123456.78", "long_short_ratio": "0.5" - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -1331,8 +1285,7 @@ STREAM: v1.ticker.s "op": "65038.01", "oi": "123456.78", "ls1": "0.5" - }, - "ps": "872634875" + } } ```
@@ -1397,8 +1350,7 @@ STREAM: v1.ticker.s "method": "subscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1413,8 +1365,7 @@ STREAM: v1.ticker.s "method": "unsubscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1444,8 +1395,7 @@ STREAM: v1.ticker.s "m": "subscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1460,8 +1410,7 @@ STREAM: v1.ticker.s "m": "unsubscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1492,8 +1441,7 @@ STREAM: v1.ticker.s "method": "subscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1508,8 +1456,7 @@ STREAM: v1.ticker.s "method": "unsubscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1539,8 +1486,7 @@ STREAM: v1.ticker.s "m": "subscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1555,8 +1501,7 @@ STREAM: v1.ticker.s "m": "unsubscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1587,8 +1532,7 @@ STREAM: v1.ticker.s "method": "subscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1603,8 +1547,7 @@ STREAM: v1.ticker.s "method": "unsubscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1634,8 +1577,7 @@ STREAM: v1.ticker.s "m": "subscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1650,8 +1592,7 @@ STREAM: v1.ticker.s "m": "unsubscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1682,8 +1623,7 @@ STREAM: v1.ticker.s "method": "subscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1698,8 +1638,7 @@ STREAM: v1.ticker.s "method": "unsubscribe", "params": { "stream": "v1.ticker.s", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1729,8 +1668,7 @@ STREAM: v1.ticker.s "m": "subscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1745,8 +1683,7 @@ STREAM: v1.ticker.s "m": "unsubscribe", "p": { "s": "v1.ticker.s", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -1794,8 +1731,7 @@ STREAM: v1.ticker.d "method": "subscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1809,8 +1745,7 @@ STREAM: v1.ticker.d "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -1824,8 +1759,7 @@ STREAM: v1.ticker.d "method": "unsubscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -1902,8 +1836,7 @@ STREAM: v1.ticker.d "open_price": "65038.01", "open_interest": "123456.78", "long_short_ratio": "0.5" - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -1937,8 +1870,7 @@ STREAM: v1.ticker.d "op": "65038.01", "oi": "123456.78", "ls1": "0.5" - }, - "ps": "872634875" + } } ```
@@ -2003,8 +1935,7 @@ STREAM: v1.ticker.d "method": "subscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -2019,8 +1950,7 @@ STREAM: v1.ticker.d "method": "unsubscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -2050,8 +1980,7 @@ STREAM: v1.ticker.d "m": "subscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -2066,8 +1995,7 @@ STREAM: v1.ticker.d "m": "unsubscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -2098,8 +2026,7 @@ STREAM: v1.ticker.d "method": "subscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -2114,8 +2041,7 @@ STREAM: v1.ticker.d "method": "unsubscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -2145,8 +2071,7 @@ STREAM: v1.ticker.d "m": "subscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -2161,8 +2086,7 @@ STREAM: v1.ticker.d "m": "unsubscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -2193,8 +2117,7 @@ STREAM: v1.ticker.d "method": "subscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -2209,8 +2132,7 @@ STREAM: v1.ticker.d "method": "unsubscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -2240,8 +2162,7 @@ STREAM: v1.ticker.d "m": "subscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -2256,8 +2177,7 @@ STREAM: v1.ticker.d "m": "unsubscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -2288,8 +2208,7 @@ STREAM: v1.ticker.d "method": "subscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -2304,8 +2223,7 @@ STREAM: v1.ticker.d "method": "unsubscribe", "params": { "stream": "v1.ticker.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -2335,8 +2253,7 @@ STREAM: v1.ticker.d "m": "subscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -2351,8 +2268,7 @@ STREAM: v1.ticker.d "m": "unsubscribe", "p": { "s": "v1.ticker.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -2401,8 +2317,7 @@ STREAM: v1.book.s "method": "subscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500-50"] }, "id": 123 } @@ -2416,8 +2331,7 @@ STREAM: v1.book.s "subs": ["BTC_USDT_Perp@500-50"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -2431,8 +2345,7 @@ STREAM: v1.book.s "method": "unsubscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500-50"] }, "id": 123 } @@ -2497,8 +2410,7 @@ STREAM: v1.book.s "size": "3456.78", "num_orders": 123 }] - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -2520,8 +2432,7 @@ STREAM: v1.book.s "s": "3456.78", "no": 123 }] - }, - "ps": "872634875" + } } ```
@@ -2587,8 +2498,7 @@ STREAM: v1.book.s "method": "subscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500-50"] }, "id": 123 } @@ -2603,8 +2513,7 @@ STREAM: v1.book.s "method": "unsubscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500-50"] }, "id": 123 } @@ -2634,8 +2543,7 @@ STREAM: v1.book.s "m": "subscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"], - "ug": true + "s1": ["BTC_USDT_Perp@500-50"] }, "i": 123 } @@ -2650,8 +2558,7 @@ STREAM: v1.book.s "m": "unsubscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"], - "ug": true + "s1": ["BTC_USDT_Perp@500-50"] }, "i": 123 } @@ -2682,8 +2589,7 @@ STREAM: v1.book.s "method": "subscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500-50"] }, "id": 123 } @@ -2698,8 +2604,7 @@ STREAM: v1.book.s "method": "unsubscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500-50"] }, "id": 123 } @@ -2729,8 +2634,7 @@ STREAM: v1.book.s "m": "subscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"], - "ug": true + "s1": ["BTC_USDT_Perp@500-50"] }, "i": 123 } @@ -2745,8 +2649,7 @@ STREAM: v1.book.s "m": "unsubscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"], - "ug": true + "s1": ["BTC_USDT_Perp@500-50"] }, "i": 123 } @@ -2777,8 +2680,7 @@ STREAM: v1.book.s "method": "subscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500-50"] }, "id": 123 } @@ -2793,8 +2695,7 @@ STREAM: v1.book.s "method": "unsubscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500-50"] }, "id": 123 } @@ -2824,8 +2725,7 @@ STREAM: v1.book.s "m": "subscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"], - "ug": true + "s1": ["BTC_USDT_Perp@500-50"] }, "i": 123 } @@ -2840,8 +2740,7 @@ STREAM: v1.book.s "m": "unsubscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"], - "ug": true + "s1": ["BTC_USDT_Perp@500-50"] }, "i": 123 } @@ -2872,8 +2771,7 @@ STREAM: v1.book.s "method": "subscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500-50"] }, "id": 123 } @@ -2888,8 +2786,7 @@ STREAM: v1.book.s "method": "unsubscribe", "params": { "stream": "v1.book.s", - "selectors": ["BTC_USDT_Perp@500-50"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500-50"] }, "id": 123 } @@ -2919,8 +2816,7 @@ STREAM: v1.book.s "m": "subscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"], - "ug": true + "s1": ["BTC_USDT_Perp@500-50"] }, "i": 123 } @@ -2935,8 +2831,7 @@ STREAM: v1.book.s "m": "unsubscribe", "p": { "s": "v1.book.s", - "s1": ["BTC_USDT_Perp@500-50"], - "ug": true + "s1": ["BTC_USDT_Perp@500-50"] }, "i": 123 } @@ -2984,8 +2879,7 @@ STREAM: v1.book.d "method": "subscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -2999,8 +2893,7 @@ STREAM: v1.book.d "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -3014,8 +2907,7 @@ STREAM: v1.book.d "method": "unsubscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3080,8 +2972,7 @@ STREAM: v1.book.d "size": "3456.78", "num_orders": 123 }] - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -3103,8 +2994,7 @@ STREAM: v1.book.d "s": "3456.78", "no": 123 }] - }, - "ps": "872634875" + } } ```
@@ -3169,8 +3059,7 @@ STREAM: v1.book.d "method": "subscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3185,8 +3074,7 @@ STREAM: v1.book.d "method": "unsubscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3216,8 +3104,7 @@ STREAM: v1.book.d "m": "subscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3232,8 +3119,7 @@ STREAM: v1.book.d "m": "unsubscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3264,8 +3150,7 @@ STREAM: v1.book.d "method": "subscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3280,8 +3165,7 @@ STREAM: v1.book.d "method": "unsubscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3311,8 +3195,7 @@ STREAM: v1.book.d "m": "subscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3327,8 +3210,7 @@ STREAM: v1.book.d "m": "unsubscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3359,8 +3241,7 @@ STREAM: v1.book.d "method": "subscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3375,8 +3256,7 @@ STREAM: v1.book.d "method": "unsubscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3406,8 +3286,7 @@ STREAM: v1.book.d "m": "subscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3422,8 +3301,7 @@ STREAM: v1.book.d "m": "unsubscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3454,8 +3332,7 @@ STREAM: v1.book.d "method": "subscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3470,8 +3347,7 @@ STREAM: v1.book.d "method": "unsubscribe", "params": { "stream": "v1.book.d", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3501,8 +3377,7 @@ STREAM: v1.book.d "m": "subscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3517,8 +3392,7 @@ STREAM: v1.book.d "m": "unsubscribe", "p": { "s": "v1.book.d", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3567,8 +3441,7 @@ STREAM: v1.trade "method": "subscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3582,8 +3455,7 @@ STREAM: v1.trade "subs": ["BTC_USDT_Perp@500"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -3597,8 +3469,7 @@ STREAM: v1.trade "method": "unsubscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3662,8 +3533,7 @@ STREAM: v1.trade "forward_price": "65038.01", "trade_id": "209358-2", "venue": "ORDERBOOK" - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -3684,8 +3554,7 @@ STREAM: v1.trade "fp": "65038.01", "ti": "209358-2", "v": "ORDERBOOK" - }, - "ps": "872634875" + } } ```
@@ -3750,8 +3619,7 @@ STREAM: v1.trade "method": "subscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3766,8 +3634,7 @@ STREAM: v1.trade "method": "unsubscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3797,8 +3664,7 @@ STREAM: v1.trade "m": "subscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3813,8 +3679,7 @@ STREAM: v1.trade "m": "unsubscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3845,8 +3710,7 @@ STREAM: v1.trade "method": "subscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3861,8 +3725,7 @@ STREAM: v1.trade "method": "unsubscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3892,8 +3755,7 @@ STREAM: v1.trade "m": "subscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3908,8 +3770,7 @@ STREAM: v1.trade "m": "unsubscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -3940,8 +3801,7 @@ STREAM: v1.trade "method": "subscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3956,8 +3816,7 @@ STREAM: v1.trade "method": "unsubscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -3987,8 +3846,7 @@ STREAM: v1.trade "m": "subscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -4003,8 +3861,7 @@ STREAM: v1.trade "m": "unsubscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -4035,8 +3892,7 @@ STREAM: v1.trade "method": "subscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -4051,8 +3907,7 @@ STREAM: v1.trade "method": "unsubscribe", "params": { "stream": "v1.trade", - "selectors": ["BTC_USDT_Perp@500"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@500"] }, "id": 123 } @@ -4082,8 +3937,7 @@ STREAM: v1.trade "m": "subscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -4098,8 +3952,7 @@ STREAM: v1.trade "m": "unsubscribe", "p": { "s": "v1.trade", - "s1": ["BTC_USDT_Perp@500"], - "ug": true + "s1": ["BTC_USDT_Perp@500"] }, "i": 123 } @@ -4148,8 +4001,7 @@ STREAM: v1.candle "method": "subscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "id": 123 } @@ -4163,8 +4015,7 @@ STREAM: v1.candle "subs": ["BTC_USDT_Perp@CI_1_M-TRADE"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -4178,8 +4029,7 @@ STREAM: v1.candle "method": "unsubscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "id": 123 } @@ -4242,8 +4092,7 @@ STREAM: v1.candle "volume_q": "123456.78", "trades": 123456, "instrument": "BTC_USDT_Perp" - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -4263,8 +4112,7 @@ STREAM: v1.candle "vq": "123456.78", "t": 123456, "i": "BTC_USDT_Perp" - }, - "ps": "872634875" + } } ```
@@ -4329,8 +4177,7 @@ STREAM: v1.candle "method": "subscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "id": 123 } @@ -4345,8 +4192,7 @@ STREAM: v1.candle "method": "unsubscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "id": 123 } @@ -4376,8 +4222,7 @@ STREAM: v1.candle "m": "subscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "ug": true + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "i": 123 } @@ -4392,8 +4237,7 @@ STREAM: v1.candle "m": "unsubscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "ug": true + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "i": 123 } @@ -4424,8 +4268,7 @@ STREAM: v1.candle "method": "subscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "id": 123 } @@ -4440,8 +4283,7 @@ STREAM: v1.candle "method": "unsubscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "id": 123 } @@ -4471,8 +4313,7 @@ STREAM: v1.candle "m": "subscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "ug": true + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "i": 123 } @@ -4487,8 +4328,7 @@ STREAM: v1.candle "m": "unsubscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "ug": true + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "i": 123 } @@ -4519,8 +4359,7 @@ STREAM: v1.candle "method": "subscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "id": 123 } @@ -4535,8 +4374,7 @@ STREAM: v1.candle "method": "unsubscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "id": 123 } @@ -4566,8 +4404,7 @@ STREAM: v1.candle "m": "subscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "ug": true + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "i": 123 } @@ -4582,8 +4419,7 @@ STREAM: v1.candle "m": "unsubscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "ug": true + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "i": 123 } @@ -4614,8 +4450,7 @@ STREAM: v1.candle "method": "subscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "id": 123 } @@ -4630,8 +4465,7 @@ STREAM: v1.candle "method": "unsubscribe", "params": { "stream": "v1.candle", - "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "use_global_sequence_number": true + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "id": 123 } @@ -4661,8 +4495,7 @@ STREAM: v1.candle "m": "subscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "ug": true + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "i": 123 } @@ -4677,8 +4510,7 @@ STREAM: v1.candle "m": "unsubscribe", "p": { "s": "v1.candle", - "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"], - "ug": true + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] }, "i": 123 } diff --git a/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md b/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md index df91b80..2924a18 100644 --- a/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |CancelStatusFeed|True|Data relating to the status of the cancellation attempt| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[CancelStatusFeed](/../../schemas/cancel_status_feed)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md b/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md index d805ffb..72d1fd2 100644 --- a/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Candlestick|True|A candlestick entry matching the request filters| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Candlestick](/../../schemas/candlestick)"
diff --git a/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md b/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md index 2b8a828..09370cc 100644 --- a/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_deposit_feed_data_v1.md @@ -7,7 +7,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Deposit|True|The Deposit object| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Deposit](/../../schemas/deposit)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md index 186748b..d78ab8c 100644 --- a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Fill|True|A private trade matching the request filter| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Fill](/../../schemas/fill)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md b/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md index 810a6ac..5aae76f 100644 --- a/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_mini_ticker_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |MiniTicker|True|A mini ticker matching the request filter| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[MiniTicker](/../../schemas/mini_ticker)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md index 2bcba48..60a656b 100644 --- a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Order|True|The order object being created or updated| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Order](/../../schemas/order)" 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
diff --git a/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md index 4f516e7..469e03f 100644 --- a/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_group_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |ClientOrderIDsByGroup|True|The order object being created or updated| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[ClientOrderIDsByGroup](/../../schemas/client_order_i_ds_by_group)" 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.
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 f80df14..e371c6c 100644 --- a/artifacts/apidocs/schemas/ws_order_state_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_state_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |OrderStateFeed|True|The Order State Feed| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[OrderStateFeed](/../../schemas/order_state_feed)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md b/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md index 4538302..e37a0ed 100644 --- a/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_orderbook_levels_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |OrderbookLevels|True|An orderbook levels object matching the request filter| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[OrderbookLevels](/../../schemas/orderbook_levels)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md b/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md index ebe54cb..c4cbcda 100644 --- a/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_positions_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Positions|True|A Position being created or updated matching the request filter| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Positions](/../../schemas/positions)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_subscribe_params.md b/artifacts/apidocs/schemas/ws_subscribe_params.md index f8ccd86..896bfaa 100644 --- a/artifacts/apidocs/schemas/ws_subscribe_params.md +++ b/artifacts/apidocs/schemas/ws_subscribe_params.md @@ -5,4 +5,3 @@ |-|-|-|-| |stream
`s` |string|True|The channel to subscribe to (eg: ticker.s / ticker.d)| |selectors
`s1` |[string]|True|The list of feeds to subscribe to| - |use_global_sequence_number
`ug` |boolean|False
`false`|Whether to use the global sequence number for the stream| diff --git a/artifacts/apidocs/schemas/ws_subscribe_response_v1_legacy.md b/artifacts/apidocs/schemas/ws_subscribe_response_v1_legacy.md index dce4145..0ddb8ed 100644 --- a/artifacts/apidocs/schemas/ws_subscribe_response_v1_legacy.md +++ b/artifacts/apidocs/schemas/ws_subscribe_response_v1_legacy.md @@ -9,4 +9,3 @@ |unsubs
`u` |[string]|True|The list of feeds unsubscribed from| |num_snapshots
`ns` |[integer]|True|The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`| |first_sequence_number
`fs` |[string]|True|The first sequence number to expect for each subscribed feed. Returned in same order as `subs`| - |latest_sequence_number
`ls` |[string]|True|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`| diff --git a/artifacts/apidocs/schemas/ws_subscribe_result.md b/artifacts/apidocs/schemas/ws_subscribe_result.md index 084eb60..a60e253 100644 --- a/artifacts/apidocs/schemas/ws_subscribe_result.md +++ b/artifacts/apidocs/schemas/ws_subscribe_result.md @@ -8,4 +8,3 @@ |unsubs
`u` |[string]|True|The list of feeds unsubscribed from| |num_snapshots
`ns` |[integer]|True|The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`| |first_sequence_number
`fs` |[string]|True|The first sequence number to expect for each subscribed feed. Returned in same order as `subs`| - |latest_sequence_number
`ls` |[string]|True|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`| diff --git a/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md b/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md index 2014bb1..e9dacdc 100644 --- a/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_ticker_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Ticker|True|A ticker matching the request filter| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Ticker](/../../schemas/ticker)" 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.

diff --git a/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md b/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md index a69312b..8328e51 100644 --- a/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_trade_feed_data_v1.md @@ -5,7 +5,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Trade|True|A public trade matching the request filter| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Trade](/../../schemas/trade)" All private RFQs and Private AXEs will be filtered out from the responses
diff --git a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md index 83f466f..0f2328b 100644 --- a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md @@ -7,7 +7,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |TransferHistory|True|The transfer history matching the requested filters| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[TransferHistory](/../../schemas/transfer_history)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/ws_unsubscribe_params.md b/artifacts/apidocs/schemas/ws_unsubscribe_params.md index af207e0..5914171 100644 --- a/artifacts/apidocs/schemas/ws_unsubscribe_params.md +++ b/artifacts/apidocs/schemas/ws_unsubscribe_params.md @@ -5,4 +5,3 @@ |-|-|-|-| |stream
`s` |string|True|The channel to unsubscribe from (eg: ticker.s / ticker.d)| |selectors
`s1` |[string]|True|The list of feeds to unsubscribe from| - |use_global_sequence_number
`ug` |boolean|False
`false`|Whether to use the global sequence number for the stream| diff --git a/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md b/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md index 77bb4de..54f0895 100644 --- a/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md @@ -7,7 +7,6 @@ |selector
`s1` |string|True|Primary selector| |sequence_number
`sn` |string|True|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`.| |feed
`f` |Withdrawal|True|The Withdrawal object| - |prev_sequence_number
`ps` |string|True|The previous sequence number that determines the message order| ??? info "[Withdrawal](/../../schemas/withdrawal)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/trading_streams.md b/artifacts/apidocs/trading_streams.md index d49b801..3ea5d86 100644 --- a/artifacts/apidocs/trading_streams.md +++ b/artifacts/apidocs/trading_streams.md @@ -28,8 +28,7 @@ STREAM: v1.order "method": "subscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -43,8 +42,7 @@ STREAM: v1.order "subs": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -58,8 +56,7 @@ STREAM: v1.order "method": "unsubscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -152,8 +149,7 @@ STREAM: v1.order "update_time": "1697788800000000000", "avg_fill_price": ["60000.4"] } - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -203,8 +199,7 @@ STREAM: v1.order "ut": "1697788800000000000", "af": ["60000.4"] } - }, - "ps": "872634875" + } } ```
@@ -274,8 +269,7 @@ STREAM: v1.order "method": "subscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -292,8 +286,7 @@ STREAM: v1.order "method": "unsubscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -327,8 +320,7 @@ STREAM: v1.order "m": "subscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -345,8 +337,7 @@ STREAM: v1.order "m": "unsubscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -381,8 +372,7 @@ STREAM: v1.order "method": "subscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -399,8 +389,7 @@ STREAM: v1.order "method": "unsubscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -434,8 +423,7 @@ STREAM: v1.order "m": "subscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -452,8 +440,7 @@ STREAM: v1.order "m": "unsubscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -488,8 +475,7 @@ STREAM: v1.order "method": "subscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -506,8 +492,7 @@ STREAM: v1.order "method": "unsubscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -541,8 +526,7 @@ STREAM: v1.order "m": "subscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -559,8 +543,7 @@ STREAM: v1.order "m": "unsubscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -595,8 +578,7 @@ STREAM: v1.order "method": "subscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -613,8 +595,7 @@ STREAM: v1.order "method": "unsubscribe", "params": { "stream": "v1.order", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -648,8 +629,7 @@ STREAM: v1.order "m": "subscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -666,8 +646,7 @@ STREAM: v1.order "m": "unsubscribe", "p": { "s": "v1.order", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -717,8 +696,7 @@ STREAM: v1.state "method": "subscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -732,8 +710,7 @@ STREAM: v1.state "subs": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -747,8 +724,7 @@ STREAM: v1.state "method": "unsubscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -811,8 +787,7 @@ STREAM: v1.state "update_time": "1697788800000000000", "avg_fill_price": ["60000.4"] } - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -832,8 +807,7 @@ STREAM: v1.state "ut": "1697788800000000000", "af": ["60000.4"] } - }, - "ps": "872634875" + } } ```
@@ -903,8 +877,7 @@ STREAM: v1.state "method": "subscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -921,8 +894,7 @@ STREAM: v1.state "method": "unsubscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -956,8 +928,7 @@ STREAM: v1.state "m": "subscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -974,8 +945,7 @@ STREAM: v1.state "m": "unsubscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -1010,8 +980,7 @@ STREAM: v1.state "method": "subscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -1028,8 +997,7 @@ STREAM: v1.state "method": "unsubscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -1063,8 +1031,7 @@ STREAM: v1.state "m": "subscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -1081,8 +1048,7 @@ STREAM: v1.state "m": "unsubscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -1117,8 +1083,7 @@ STREAM: v1.state "method": "subscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -1135,8 +1100,7 @@ STREAM: v1.state "method": "unsubscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -1170,8 +1134,7 @@ STREAM: v1.state "m": "subscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -1188,8 +1151,7 @@ STREAM: v1.state "m": "unsubscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -1224,8 +1186,7 @@ STREAM: v1.state "method": "subscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -1242,8 +1203,7 @@ STREAM: v1.state "method": "unsubscribe", "params": { "stream": "v1.state", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -1277,8 +1237,7 @@ STREAM: v1.state "m": "subscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -1295,8 +1254,7 @@ STREAM: v1.state "m": "unsubscribe", "p": { "s": "v1.state", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -1346,8 +1304,7 @@ STREAM: v1.cancel "method": "subscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1361,8 +1318,7 @@ STREAM: v1.cancel "subs": ["'$GRVT_SUB_ACCOUNT_ID'"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -1376,8 +1332,7 @@ STREAM: v1.cancel "method": "unsubscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1436,8 +1391,7 @@ STREAM: v1.cancel "reason": "UNSPECIFIED", "update_time": "1697788800000000000", "cancel_status": "EXPIRED" - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -1453,8 +1407,7 @@ STREAM: v1.cancel "r": "UNSPECIFIED", "ut": "1697788800000000000", "cs": "EXPIRED" - }, - "ps": "872634875" + } } ```
@@ -1524,8 +1477,7 @@ STREAM: v1.cancel "method": "subscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1542,8 +1494,7 @@ STREAM: v1.cancel "method": "unsubscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1577,8 +1528,7 @@ STREAM: v1.cancel "m": "subscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -1595,8 +1545,7 @@ STREAM: v1.cancel "m": "unsubscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -1631,8 +1580,7 @@ STREAM: v1.cancel "method": "subscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1649,8 +1597,7 @@ STREAM: v1.cancel "method": "unsubscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1684,8 +1631,7 @@ STREAM: v1.cancel "m": "subscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -1702,8 +1648,7 @@ STREAM: v1.cancel "m": "unsubscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -1738,8 +1683,7 @@ STREAM: v1.cancel "method": "subscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1756,8 +1700,7 @@ STREAM: v1.cancel "method": "unsubscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1791,8 +1734,7 @@ STREAM: v1.cancel "m": "subscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -1809,8 +1751,7 @@ STREAM: v1.cancel "m": "unsubscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -1845,8 +1786,7 @@ STREAM: v1.cancel "method": "subscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1863,8 +1803,7 @@ STREAM: v1.cancel "method": "unsubscribe", "params": { "stream": "v1.cancel", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1898,8 +1837,7 @@ STREAM: v1.cancel "m": "subscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -1916,8 +1854,7 @@ STREAM: v1.cancel "m": "unsubscribe", "p": { "s": "v1.cancel", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -1967,8 +1904,7 @@ STREAM: v1.group "method": "subscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -1982,8 +1918,7 @@ STREAM: v1.group "subs": ["'$GRVT_SUB_ACCOUNT_ID'"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -1997,8 +1932,7 @@ STREAM: v1.group "method": "unsubscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -2054,8 +1988,7 @@ STREAM: v1.group "group_id": "0x10000101000203040506", "client_order_id": ["[23042, 54232]"], "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -2068,8 +2001,7 @@ STREAM: v1.group "gi": "0x10000101000203040506", "co": ["[23042, 54232]"], "sa": "'$GRVT_SUB_ACCOUNT_ID'" - }, - "ps": "872634875" + } } ```
@@ -2140,8 +2072,7 @@ STREAM: v1.group "method": "subscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -2158,8 +2089,7 @@ STREAM: v1.group "method": "unsubscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -2193,8 +2123,7 @@ STREAM: v1.group "m": "subscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -2211,8 +2140,7 @@ STREAM: v1.group "m": "unsubscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -2247,8 +2175,7 @@ STREAM: v1.group "method": "subscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -2265,8 +2192,7 @@ STREAM: v1.group "method": "unsubscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -2300,8 +2226,7 @@ STREAM: v1.group "m": "subscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -2318,8 +2243,7 @@ STREAM: v1.group "m": "unsubscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -2354,8 +2278,7 @@ STREAM: v1.group "method": "subscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -2372,8 +2295,7 @@ STREAM: v1.group "method": "unsubscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -2407,8 +2329,7 @@ STREAM: v1.group "m": "subscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -2425,8 +2346,7 @@ STREAM: v1.group "m": "unsubscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -2461,8 +2381,7 @@ STREAM: v1.group "method": "subscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -2479,8 +2398,7 @@ STREAM: v1.group "method": "unsubscribe", "params": { "stream": "v1.group", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -2514,8 +2432,7 @@ STREAM: v1.group "m": "subscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -2532,8 +2449,7 @@ STREAM: v1.group "m": "unsubscribe", "p": { "s": "v1.group", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -2584,8 +2500,7 @@ STREAM: v1.fill "method": "subscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -2599,8 +2514,7 @@ STREAM: v1.fill "subs": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -2614,8 +2528,7 @@ STREAM: v1.fill "method": "unsubscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -2688,8 +2601,7 @@ STREAM: v1.fill "client_order_id": "23042", "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "broker": "UNSPECIFIED" - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -2719,8 +2631,7 @@ STREAM: v1.fill "co": "23042", "s1": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "b": "UNSPECIFIED" - }, - "ps": "872634875" + } } ```
@@ -2790,8 +2701,7 @@ STREAM: v1.fill "method": "subscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -2808,8 +2718,7 @@ STREAM: v1.fill "method": "unsubscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -2843,8 +2752,7 @@ STREAM: v1.fill "m": "subscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -2861,8 +2769,7 @@ STREAM: v1.fill "m": "unsubscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -2897,8 +2804,7 @@ STREAM: v1.fill "method": "subscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -2915,8 +2821,7 @@ STREAM: v1.fill "method": "unsubscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -2950,8 +2855,7 @@ STREAM: v1.fill "m": "subscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -2968,8 +2872,7 @@ STREAM: v1.fill "m": "unsubscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3004,8 +2907,7 @@ STREAM: v1.fill "method": "subscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3022,8 +2924,7 @@ STREAM: v1.fill "method": "unsubscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3057,8 +2958,7 @@ STREAM: v1.fill "m": "subscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3075,8 +2975,7 @@ STREAM: v1.fill "m": "unsubscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3111,8 +3010,7 @@ STREAM: v1.fill "method": "subscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3129,8 +3027,7 @@ STREAM: v1.fill "method": "unsubscribe", "params": { "stream": "v1.fill", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3164,8 +3061,7 @@ STREAM: v1.fill "m": "subscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3182,8 +3078,7 @@ STREAM: v1.fill "m": "unsubscribe", "p": { "s": "v1.fill", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3233,8 +3128,7 @@ STREAM: v1.position "method": "subscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3248,8 +3142,7 @@ STREAM: v1.position "subs": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -3263,8 +3156,7 @@ STREAM: v1.position "method": "unsubscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3331,8 +3223,7 @@ STREAM: v1.position "roi": "10.20", "quote_index_price": "1.0000102", "est_liquidation_price": 60000.25 - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -3356,8 +3247,7 @@ STREAM: v1.position "r": "10.20", "qi": "1.0000102", "el": 60000.25 - }, - "ps": "872634875" + } } ```
@@ -3427,8 +3317,7 @@ STREAM: v1.position "method": "subscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3445,8 +3334,7 @@ STREAM: v1.position "method": "unsubscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3480,8 +3368,7 @@ STREAM: v1.position "m": "subscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3498,8 +3385,7 @@ STREAM: v1.position "m": "unsubscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3534,8 +3420,7 @@ STREAM: v1.position "method": "subscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3552,8 +3437,7 @@ STREAM: v1.position "method": "unsubscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3587,8 +3471,7 @@ STREAM: v1.position "m": "subscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3605,8 +3488,7 @@ STREAM: v1.position "m": "unsubscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3641,8 +3523,7 @@ STREAM: v1.position "method": "subscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3659,8 +3540,7 @@ STREAM: v1.position "method": "unsubscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3694,8 +3574,7 @@ STREAM: v1.position "m": "subscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3712,8 +3591,7 @@ STREAM: v1.position "m": "unsubscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3748,8 +3626,7 @@ STREAM: v1.position "method": "subscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3766,8 +3643,7 @@ STREAM: v1.position "method": "unsubscribe", "params": { "stream": "v1.position", - "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "id": 123 } @@ -3801,8 +3677,7 @@ STREAM: v1.position "m": "subscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3819,8 +3694,7 @@ STREAM: v1.position "m": "unsubscribe", "p": { "s": "v1.position", - "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"], - "ug": true + "s1": ["'$GRVT_SUB_ACCOUNT_ID'-BTC_USDT_Perp"] }, "i": 123 } @@ -3871,8 +3745,7 @@ STREAM: v1.deposit "method": "subscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -3886,8 +3759,7 @@ STREAM: v1.deposit "subs": ["'$GRVT_MAIN_ACCOUNT_ID'"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -3901,8 +3773,7 @@ STREAM: v1.deposit "method": "unsubscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -3959,8 +3830,7 @@ STREAM: v1.deposit "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "currency": "USDT", "num_tokens": "10.50" - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -3974,8 +3844,7 @@ STREAM: v1.deposit "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "c": "USDT", "nt": "10.50" - }, - "ps": "872634875" + } } ```
@@ -4041,8 +3910,7 @@ STREAM: v1.deposit "method": "subscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -4059,8 +3927,7 @@ STREAM: v1.deposit "method": "unsubscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -4094,8 +3961,7 @@ STREAM: v1.deposit "m": "subscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -4112,8 +3978,7 @@ STREAM: v1.deposit "m": "unsubscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -4148,8 +4013,7 @@ STREAM: v1.deposit "method": "subscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -4166,8 +4030,7 @@ STREAM: v1.deposit "method": "unsubscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -4201,8 +4064,7 @@ STREAM: v1.deposit "m": "subscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -4219,8 +4081,7 @@ STREAM: v1.deposit "m": "unsubscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -4255,8 +4116,7 @@ STREAM: v1.deposit "method": "subscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -4273,8 +4133,7 @@ STREAM: v1.deposit "method": "unsubscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -4308,8 +4167,7 @@ STREAM: v1.deposit "m": "subscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -4326,8 +4184,7 @@ STREAM: v1.deposit "m": "unsubscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -4362,8 +4219,7 @@ STREAM: v1.deposit "method": "subscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -4380,8 +4236,7 @@ STREAM: v1.deposit "method": "unsubscribe", "params": { "stream": "v1.deposit", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -4415,8 +4270,7 @@ STREAM: v1.deposit "m": "subscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -4433,8 +4287,7 @@ STREAM: v1.deposit "m": "unsubscribe", "p": { "s": "v1.deposit", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -4484,8 +4337,7 @@ STREAM: v1.transfer "method": "subscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -4499,8 +4351,7 @@ STREAM: v1.transfer "subs": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -4514,8 +4365,7 @@ STREAM: v1.transfer "method": "unsubscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -4586,8 +4436,7 @@ STREAM: v1.transfer "event_time": "1697788800000000000", "transfer_type": "STANDARD", "transfer_metadata": null - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -4615,8 +4464,7 @@ STREAM: v1.transfer "et": "1697788800000000000", "tt": "STANDARD", "tm": null - }, - "ps": "872634875" + } } ```
@@ -4683,8 +4531,7 @@ STREAM: v1.transfer "method": "subscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -4701,8 +4548,7 @@ STREAM: v1.transfer "method": "unsubscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -4736,8 +4582,7 @@ STREAM: v1.transfer "m": "subscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -4754,8 +4599,7 @@ STREAM: v1.transfer "m": "unsubscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -4790,8 +4634,7 @@ STREAM: v1.transfer "method": "subscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -4808,8 +4651,7 @@ STREAM: v1.transfer "method": "unsubscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -4843,8 +4685,7 @@ STREAM: v1.transfer "m": "subscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -4861,8 +4702,7 @@ STREAM: v1.transfer "m": "unsubscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -4897,8 +4737,7 @@ STREAM: v1.transfer "method": "subscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -4915,8 +4754,7 @@ STREAM: v1.transfer "method": "unsubscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -4950,8 +4788,7 @@ STREAM: v1.transfer "m": "subscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -4968,8 +4805,7 @@ STREAM: v1.transfer "m": "unsubscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -5004,8 +4840,7 @@ STREAM: v1.transfer "method": "subscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -5022,8 +4857,7 @@ STREAM: v1.transfer "method": "unsubscribe", "params": { "stream": "v1.transfer", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "id": 123 } @@ -5057,8 +4891,7 @@ STREAM: v1.transfer "m": "subscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -5075,8 +4908,7 @@ STREAM: v1.transfer "m": "unsubscribe", "p": { "s": "v1.transfer", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'-'$GRVT_SUB_ACCOUNT_ID'"] }, "i": 123 } @@ -5126,8 +4958,7 @@ STREAM: v1.withdrawal "method": "subscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -5141,8 +4972,7 @@ STREAM: v1.withdrawal "subs": ["'$GRVT_MAIN_ACCOUNT_ID'"], "unsubs": [], "num_snapshots": [10], - "first_sequence_number": [872634876], - "latest_sequence_number": [872634875] + "first_sequence_number": [872634876] }, "id": 123, "method": "subscribe" @@ -5156,8 +4986,7 @@ STREAM: v1.withdrawal "method": "unsubscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -5222,8 +5051,7 @@ STREAM: v1.withdrawal "expiration": "1697788800000000000", "nonce": 1234567890 } - }, - "prev_sequence_number": "872634875" + } } ``` **Lite Feed Response** @@ -5245,8 +5073,7 @@ STREAM: v1.withdrawal "e": "1697788800000000000", "n": 1234567890 } - }, - "ps": "872634875" + } } ```
@@ -5312,8 +5139,7 @@ STREAM: v1.withdrawal "method": "subscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -5330,8 +5156,7 @@ STREAM: v1.withdrawal "method": "unsubscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -5365,8 +5190,7 @@ STREAM: v1.withdrawal "m": "subscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -5383,8 +5207,7 @@ STREAM: v1.withdrawal "m": "unsubscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -5419,8 +5242,7 @@ STREAM: v1.withdrawal "method": "subscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -5437,8 +5259,7 @@ STREAM: v1.withdrawal "method": "unsubscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -5472,8 +5293,7 @@ STREAM: v1.withdrawal "m": "subscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -5490,8 +5310,7 @@ STREAM: v1.withdrawal "m": "unsubscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -5526,8 +5345,7 @@ STREAM: v1.withdrawal "method": "subscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -5544,8 +5362,7 @@ STREAM: v1.withdrawal "method": "unsubscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -5579,8 +5396,7 @@ STREAM: v1.withdrawal "m": "subscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -5597,8 +5413,7 @@ STREAM: v1.withdrawal "m": "unsubscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -5633,8 +5448,7 @@ STREAM: v1.withdrawal "method": "subscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -5651,8 +5465,7 @@ STREAM: v1.withdrawal "method": "unsubscribe", "params": { "stream": "v1.withdrawal", - "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "use_global_sequence_number": true + "selectors": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "id": 123 } @@ -5686,8 +5499,7 @@ STREAM: v1.withdrawal "m": "subscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } @@ -5704,8 +5516,7 @@ STREAM: v1.withdrawal "m": "unsubscribe", "p": { "s": "v1.withdrawal", - "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"], - "ug": true + "s1": ["'$GRVT_MAIN_ACCOUNT_ID'"] }, "i": 123 } diff --git a/src/codegen/apidocs/apidocs.py b/src/codegen/apidocs/apidocs.py index 9b1d8c2..6f5d525 100644 --- a/src/codegen/apidocs/apidocs.py +++ b/src/codegen/apidocs/apidocs.py @@ -28,7 +28,11 @@ ] # skip these fields for all structs, at all levels of nesting -IGNORE_FIELDS_ANY_PATH = [] +IGNORE_FIELDS_ANY_PATH = [ + "prev_sequence_number", + "latest_sequence_number", + "use_global_sequence_number", +] IGNORE_RPCS: list[str] = [ "RPCDedustPositionV1",