diff --git a/artifacts/apidocs/schemas/aggregated_account_summary.md b/artifacts/apidocs/schemas/aggregated_account_summary.md index 33aae2a..91f4a10 100644 --- a/artifacts/apidocs/schemas/aggregated_account_summary.md +++ b/artifacts/apidocs/schemas/aggregated_account_summary.md @@ -29,3 +29,8 @@ |`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/api_aggregated_account_summary_response.md b/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md index 05c7964..dbe4d6d 100644 --- a/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md +++ b/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md @@ -35,3 +35,8 @@ |`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/api_cancel_all_orders_request.md b/artifacts/apidocs/schemas/api_cancel_all_orders_request.md index b37e067..7792003 100644 --- a/artifacts/apidocs/schemas/api_cancel_all_orders_request.md +++ b/artifacts/apidocs/schemas/api_cancel_all_orders_request.md @@ -35,6 +35,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -54,3 +59,8 @@ |`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/api_cancel_on_disconnect_request.md b/artifacts/apidocs/schemas/api_cancel_on_disconnect_request.md new file mode 100644 index 0000000..2fdc090 --- /dev/null +++ b/artifacts/apidocs/schemas/api_cancel_on_disconnect_request.md @@ -0,0 +1,7 @@ +!!! info "[ApiCancelOnDisconnectRequest](/../../schemas/api_cancel_on_disconnect_request)" + Auto-Cancel All Open Orders when the countdown time hits zero.

Market Maker inputs a countdown time parameter in milliseconds (e.g. 120000 for 120s) rounded down to the smallest second follows the following logic:
- Market Maker initially entered a value between 0 -> 1000, which is rounded to 0: will result in termination of their COD
- Market Maker initially entered a value between 1001 -> 300_000, which is rounded to the nearest second: will result in refresh of their COD
- Market Maker initially entered a value bigger than 300_000, which will result in error (upper bound)
Market Maker will send a heartbeat message by calling the endpoint at specific intervals (ex. every 30 seconds) to the server to refresh the count down.

If the server does not receive a heartbeat message within the countdown time, it will cancel all open orders for the specified Sub Account ID.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|True|The subaccount ID cancelling the orders for| + |countdown_time
`ct` |string|False
`1000`|Countdown time in milliseconds (ex. 120000 for 120s).

0 to disable the timer.

Does not accept negative values.

Minimum acceptable value is 1,000.

Maximum acceptable value is 300,000| diff --git a/artifacts/apidocs/schemas/api_cancel_order_request.md b/artifacts/apidocs/schemas/api_cancel_order_request.md index 70bd101..49be94f 100644 --- a/artifacts/apidocs/schemas/api_cancel_order_request.md +++ b/artifacts/apidocs/schemas/api_cancel_order_request.md @@ -6,3 +6,4 @@ |sub_account_id
`sa` |string|True|The subaccount ID cancelling the order| |order_id
`oi` |string|False
`0`|Cancel the order with this `order_id`| |client_order_id
`co` |string|False
`0`|Cancel the order with this `client_order_id`| + |time_to_live_ms
`tt` |string|False
`500`|Specifies the time-to-live (in milliseconds) for this cancellation.
During this period, any order creation with a matching `client_order_id` will also be cancelled.
This mechanism helps mitigate time-of-flight issues where cancellations might arrive before the corresponding orders.
Hence, cancellation by `order_id` ignores this field as the exchange can only assign `order_id`s to already-processed order creations.
The duration cannot be negative, is rounded down to the nearest 100ms (e.g., `670` -> `600`, `30` -> `0`) and capped at 5 seconds (i.e., `5000`).
Value of `0` or omission disables the TTL mechanism, so only orders already existing in matcher state at request time will be searched.
| diff --git a/artifacts/apidocs/schemas/api_cancel_order_response.md b/artifacts/apidocs/schemas/api_cancel_order_response.md index b47ccd1..2f66a4c 100644 --- a/artifacts/apidocs/schemas/api_cancel_order_response.md +++ b/artifacts/apidocs/schemas/api_cancel_order_response.md @@ -53,52 +53,58 @@ |-|-|-|-| |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| - ??? info "[OrderState](/../../schemas/order_state)" - |Name
`Lite`|Type|Required
`Default`| Description | - |-|-|-|-| - |status
`s` |OrderStatus|True|The status of the order| - |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| - |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| - |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| - |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| - |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| - ??? info "[OrderStatus](/../../schemas/order_status)" - |Value| Description | - |-|-| - |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| - |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| - |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| - |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| - |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| - ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" - |Value| Description | - |-|-| - |`UNSPECIFIED` = 0|order is not cancelled or rejected| - |`CLIENT_CANCEL` = 1|client called a Cancel API| - |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| - |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| - |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| - |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| - |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| - |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| - |`EXPIRED` = 8|the order was cancelled as it has expired| - |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| - |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| - |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| - |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| - |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| - |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| - |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| - |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| - |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| - |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| - |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| - |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| - |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| - |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| - |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| - |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| - |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| - |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| - |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| - |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |trigger
`t` |TriggerOrderMetadata|True|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 "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/api_create_order_request.md b/artifacts/apidocs/schemas/api_create_order_request.md index c6b3da1..f721ee2 100644 --- a/artifacts/apidocs/schemas/api_create_order_request.md +++ b/artifacts/apidocs/schemas/api_create_order_request.md @@ -55,52 +55,58 @@ |-|-|-|-| |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| - ??? info "[OrderState](/../../schemas/order_state)" - |Name
`Lite`|Type|Required
`Default`| Description | - |-|-|-|-| - |status
`s` |OrderStatus|True|The status of the order| - |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| - |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| - |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| - |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| - |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| - ??? info "[OrderStatus](/../../schemas/order_status)" - |Value| Description | - |-|-| - |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| - |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| - |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| - |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| - |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| - ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" - |Value| Description | - |-|-| - |`UNSPECIFIED` = 0|order is not cancelled or rejected| - |`CLIENT_CANCEL` = 1|client called a Cancel API| - |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| - |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| - |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| - |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| - |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| - |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| - |`EXPIRED` = 8|the order was cancelled as it has expired| - |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| - |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| - |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| - |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| - |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| - |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| - |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| - |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| - |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| - |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| - |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| - |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| - |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| - |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| - |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| - |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| - |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| - |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| - |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| - |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |trigger
`t` |TriggerOrderMetadata|True|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 "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/api_create_order_response.md b/artifacts/apidocs/schemas/api_create_order_response.md index d646a8f..0a35bc3 100644 --- a/artifacts/apidocs/schemas/api_create_order_response.md +++ b/artifacts/apidocs/schemas/api_create_order_response.md @@ -53,52 +53,58 @@ |-|-|-|-| |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| - ??? info "[OrderState](/../../schemas/order_state)" - |Name
`Lite`|Type|Required
`Default`| Description | - |-|-|-|-| - |status
`s` |OrderStatus|True|The status of the order| - |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| - |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| - |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| - |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| - |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| - ??? info "[OrderStatus](/../../schemas/order_status)" - |Value| Description | - |-|-| - |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| - |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| - |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| - |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| - |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| - ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" - |Value| Description | - |-|-| - |`UNSPECIFIED` = 0|order is not cancelled or rejected| - |`CLIENT_CANCEL` = 1|client called a Cancel API| - |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| - |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| - |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| - |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| - |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| - |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| - |`EXPIRED` = 8|the order was cancelled as it has expired| - |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| - |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| - |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| - |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| - |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| - |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| - |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| - |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| - |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| - |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| - |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| - |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| - |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| - |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| - |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| - |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| - |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| - |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| - |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| - |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |trigger
`t` |TriggerOrderMetadata|True|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 "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/api_dedust_position_request.md b/artifacts/apidocs/schemas/api_dedust_position_request.md new file mode 100644 index 0000000..e69de29 diff --git a/artifacts/apidocs/schemas/api_dedust_position_response.md b/artifacts/apidocs/schemas/api_dedust_position_response.md new file mode 100644 index 0000000..e69de29 diff --git a/artifacts/apidocs/schemas/api_deposit_history_request.md b/artifacts/apidocs/schemas/api_deposit_history_request.md index 6c34a45..8dd39d9 100644 --- a/artifacts/apidocs/schemas/api_deposit_history_request.md +++ b/artifacts/apidocs/schemas/api_deposit_history_request.md @@ -27,3 +27,8 @@ |`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/api_deposit_history_response.md b/artifacts/apidocs/schemas/api_deposit_history_response.md index a70cf9c..b1e6a7e 100644 --- a/artifacts/apidocs/schemas/api_deposit_history_response.md +++ b/artifacts/apidocs/schemas/api_deposit_history_response.md @@ -33,3 +33,8 @@ |`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/api_fill_history_request.md b/artifacts/apidocs/schemas/api_fill_history_request.md index 8e54131..bfb6b4e 100644 --- a/artifacts/apidocs/schemas/api_fill_history_request.md +++ b/artifacts/apidocs/schemas/api_fill_history_request.md @@ -39,6 +39,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -58,3 +63,8 @@ |`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/api_fill_history_response.md b/artifacts/apidocs/schemas/api_fill_history_response.md index 324b7c7..6e01447 100644 --- a/artifacts/apidocs/schemas/api_fill_history_response.md +++ b/artifacts/apidocs/schemas/api_fill_history_response.md @@ -25,6 +25,7 @@ |venue
`v` |Venue|True|The venue where the trade occurred| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |signer
`s1` |string|True|The address (public key) of the wallet signing the payload| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[Venue](/../../schemas/venue)" The list of Trading Venues that are supported on the GRVT exchange
@@ -32,3 +33,6 @@ |-|-| |`ORDERBOOK` = 1|the trade is cleared on the orderbook venue| |`RFQ` = 2|the trade is cleared on the RFQ venue| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ diff --git a/artifacts/apidocs/schemas/api_funding_account_summary_response.md b/artifacts/apidocs/schemas/api_funding_account_summary_response.md index 65a07cc..6fff816 100644 --- a/artifacts/apidocs/schemas/api_funding_account_summary_response.md +++ b/artifacts/apidocs/schemas/api_funding_account_summary_response.md @@ -37,3 +37,8 @@ |`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/api_funding_payment_history_response.md b/artifacts/apidocs/schemas/api_funding_payment_history_response.md index 684214a..00b1fa8 100644 --- a/artifacts/apidocs/schemas/api_funding_payment_history_response.md +++ b/artifacts/apidocs/schemas/api_funding_payment_history_response.md @@ -31,3 +31,8 @@ |`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/api_get_all_instruments_response.md b/artifacts/apidocs/schemas/api_get_all_instruments_response.md index 919b97a..194a032 100644 --- a/artifacts/apidocs/schemas/api_get_all_instruments_response.md +++ b/artifacts/apidocs/schemas/api_get_all_instruments_response.md @@ -37,6 +37,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -56,6 +61,11 @@ |`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| ??? 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 1f4c698..91afdfb 100644 --- a/artifacts/apidocs/schemas/api_get_filtered_instruments_request.md +++ b/artifacts/apidocs/schemas/api_get_filtered_instruments_request.md @@ -36,6 +36,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -55,3 +60,8 @@ |`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/api_get_filtered_instruments_response.md b/artifacts/apidocs/schemas/api_get_filtered_instruments_response.md index f0e7082..00eb893 100644 --- a/artifacts/apidocs/schemas/api_get_filtered_instruments_response.md +++ b/artifacts/apidocs/schemas/api_get_filtered_instruments_response.md @@ -37,6 +37,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -56,6 +61,11 @@ |`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| ??? 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 02d2821..c345b82 100644 --- a/artifacts/apidocs/schemas/api_get_instrument_response.md +++ b/artifacts/apidocs/schemas/api_get_instrument_response.md @@ -37,6 +37,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -56,6 +61,11 @@ |`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| ??? 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 79d7060..d60c753 100644 --- a/artifacts/apidocs/schemas/api_get_latest_lp_snapshot_request.md +++ b/artifacts/apidocs/schemas/api_get_latest_lp_snapshot_request.md @@ -31,3 +31,8 @@ |`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/api_get_list_epoch_badge_response.md b/artifacts/apidocs/schemas/api_get_list_epoch_badge_response.md new file mode 100644 index 0000000..115d6d5 --- /dev/null +++ b/artifacts/apidocs/schemas/api_get_list_epoch_badge_response.md @@ -0,0 +1,54 @@ +!!! info "[ApiGetListEpochBadgeResponse](/../../schemas/api_get_list_epoch_badge_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[EpochBadge]|True|The list of epoch badges| + ??? info "[EpochBadge](/../../schemas/epoch_badge)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|True|The off chain account id| + |main_account_id
`ma` |string|True|The account ID| + |type
`t` |RewardProgramType|True|The type of the reward program| + |epoch
`e` |integer|True|The epoch number| + |epoch_start_time
`es` |string|True|The start time of the epoch| + |epoch_end_time
`ee` |string|True|The end time of the epoch| + |badge
`b` |EpochBadgeType|True|The type of the badge| + |distributed_badges
`db` |[EpochBadgeType]|True|The distributed badges| + |total_point
`tp` |string|True|Total point| + |rank
`r` |integer|True|Rank| + |claimed_at
`ca` |string|True|The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process| + ??? info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| 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 0612797..01d3d78 100644 --- a/artifacts/apidocs/schemas/api_get_list_flat_referral_response.md +++ b/artifacts/apidocs/schemas/api_get_list_flat_referral_response.md @@ -14,3 +14,6 @@ |main_account_id
`ma` |string|True|The main account id| |referrer_main_account_id
`rm` |string|True|The referrer main account id| |is_business
`ib` |boolean|True|The account is a business account or not| + |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'| diff --git a/artifacts/apidocs/schemas/api_get_list_reward_epoch_response.md b/artifacts/apidocs/schemas/api_get_list_reward_epoch_response.md new file mode 100644 index 0000000..6d1f1ff --- /dev/null +++ b/artifacts/apidocs/schemas/api_get_list_reward_epoch_response.md @@ -0,0 +1,31 @@ +!!! info "[ApiGetListRewardEpochResponse](/../../schemas/api_get_list_reward_epoch_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |ecosystem_epochs
`ee` |[RewardEpochInfo]|True|The list of epoch for ecosystem reward| + |trading_epochs
`te` |[RewardEpochInfo]|True|The list of epoch for trader reward and lp reward| + ??? info "[RewardEpochInfo](/../../schemas/reward_epoch_info)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |epoch
`e` |integer|True|The epoch number| + |epoch_start_time
`es` |string|True|The start time of the epoch| + |epoch_end_time
`ee` |string|True|The end time of the epoch| + |status
`s` |RewardEpochStatus|True|The status of the epoch| + ??? info "[RewardEpochStatus](/../../schemas/reward_epoch_status)" + |Value| Description | + |-|-| + |`PAST` = 1|Past| + |`CURRENT` = 2|Current| + |`FUTURE` = 3|Future| + ??? info "[RewardEpochInfo](/../../schemas/reward_epoch_info)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |epoch
`e` |integer|True|The epoch number| + |epoch_start_time
`es` |string|True|The start time of the epoch| + |epoch_end_time
`ee` |string|True|The end time of the epoch| + |status
`s` |RewardEpochStatus|True|The status of the epoch| + ??? info "[RewardEpochStatus](/../../schemas/reward_epoch_status)" + |Value| Description | + |-|-| + |`PAST` = 1|Past| + |`CURRENT` = 2|Current| + |`FUTURE` = 3|Future| diff --git a/artifacts/apidocs/schemas/api_get_lp_info_request.md b/artifacts/apidocs/schemas/api_get_lp_info_request.md index db7cbb7..3b014c4 100644 --- a/artifacts/apidocs/schemas/api_get_lp_info_request.md +++ b/artifacts/apidocs/schemas/api_get_lp_info_request.md @@ -31,3 +31,8 @@ |`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/api_get_lp_leaderboard_request.md b/artifacts/apidocs/schemas/api_get_lp_leaderboard_request.md index 77ac464..a3f1c78 100644 --- a/artifacts/apidocs/schemas/api_get_lp_leaderboard_request.md +++ b/artifacts/apidocs/schemas/api_get_lp_leaderboard_request.md @@ -1,7 +1,7 @@ !!! info "[ApiGetLPLeaderboardRequest](/../../schemas/api_get_lp_leaderboard_request)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| - |start_interval
`si` |string|True|Start time of the epoch - phase| + |epoch
`e` |integer|False
`0`|The epoch to filter| |limit
`l` |integer|True|The number of accounts to return| |kind
`k` |Kind|True|The kind filter to apply| |base
`b` |Currency|True|The base filter to apply| @@ -33,3 +33,8 @@ |`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/api_get_lp_point_request.md b/artifacts/apidocs/schemas/api_get_lp_point_request.md index e987712..54116b6 100644 --- a/artifacts/apidocs/schemas/api_get_lp_point_request.md +++ b/artifacts/apidocs/schemas/api_get_lp_point_request.md @@ -1,7 +1,7 @@ !!! info "[ApiGetLPPointRequest](/../../schemas/api_get_lp_point_request)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| - |start_interval
`si` |string|False
`0`|Optional. Start time of the epoch - phase| + |epoch
`e` |integer|False
`0`|The epoch to filter| |kind
`k` |Kind|False
`0`|Optional. The kind filter to apply| |base
`b` |Currency|False
`0`|Optional. The base filter to apply| ??? info "[Kind](/../../schemas/kind)" @@ -32,3 +32,8 @@ |`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/api_get_order_response.md b/artifacts/apidocs/schemas/api_get_order_response.md index 2381e38..bdd3b3b 100644 --- a/artifacts/apidocs/schemas/api_get_order_response.md +++ b/artifacts/apidocs/schemas/api_get_order_response.md @@ -53,52 +53,58 @@ |-|-|-|-| |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| - ??? info "[OrderState](/../../schemas/order_state)" - |Name
`Lite`|Type|Required
`Default`| Description | - |-|-|-|-| - |status
`s` |OrderStatus|True|The status of the order| - |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| - |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| - |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| - |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| - |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| - ??? info "[OrderStatus](/../../schemas/order_status)" - |Value| Description | - |-|-| - |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| - |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| - |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| - |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| - |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| - ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" - |Value| Description | - |-|-| - |`UNSPECIFIED` = 0|order is not cancelled or rejected| - |`CLIENT_CANCEL` = 1|client called a Cancel API| - |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| - |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| - |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| - |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| - |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| - |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| - |`EXPIRED` = 8|the order was cancelled as it has expired| - |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| - |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| - |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| - |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| - |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| - |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| - |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| - |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| - |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| - |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| - |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| - |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| - |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| - |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| - |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| - |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| - |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| - |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| - |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| - |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |trigger
`t` |TriggerOrderMetadata|True|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 "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/api_get_verified_ecosystem_leaderboard_request.md b/artifacts/apidocs/schemas/api_get_verified_ecosystem_leaderboard_request.md new file mode 100644 index 0000000..6604e10 --- /dev/null +++ b/artifacts/apidocs/schemas/api_get_verified_ecosystem_leaderboard_request.md @@ -0,0 +1,5 @@ +!!! info "[ApiGetVerifiedEcosystemLeaderboardRequest](/../../schemas/api_get_verified_ecosystem_leaderboard_request)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |calculate_from
`cf` |string|True|Start time of the epoch| + |completed_kyc_before
`ck` |string|True|Completed KYC before this time| 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 3732d3a..735ee64 100644 --- a/artifacts/apidocs/schemas/api_latest_snap_sub_accounts_response.md +++ b/artifacts/apidocs/schemas/api_latest_snap_sub_accounts_response.md @@ -41,6 +41,11 @@ |`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| ??? info "[SpotBalance](/../../schemas/spot_balance)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -66,6 +71,11 @@ |`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| ??? 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 3d335f3..f05992f 100644 --- a/artifacts/apidocs/schemas/api_list_aggregated_account_summary_response.md +++ b/artifacts/apidocs/schemas/api_list_aggregated_account_summary_response.md @@ -39,3 +39,8 @@ |`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/api_open_orders_request.md b/artifacts/apidocs/schemas/api_open_orders_request.md index 1b65fa1..0e76b77 100644 --- a/artifacts/apidocs/schemas/api_open_orders_request.md +++ b/artifacts/apidocs/schemas/api_open_orders_request.md @@ -33,6 +33,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -52,3 +57,8 @@ |`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/api_open_orders_response.md b/artifacts/apidocs/schemas/api_open_orders_response.md index e632d66..b2a0c29 100644 --- a/artifacts/apidocs/schemas/api_open_orders_response.md +++ b/artifacts/apidocs/schemas/api_open_orders_response.md @@ -55,52 +55,58 @@ |-|-|-|-| |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| - ??? info "[OrderState](/../../schemas/order_state)" - |Name
`Lite`|Type|Required
`Default`| Description | - |-|-|-|-| - |status
`s` |OrderStatus|True|The status of the order| - |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| - |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| - |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| - |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| - |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| - ??? info "[OrderStatus](/../../schemas/order_status)" - |Value| Description | - |-|-| - |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| - |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| - |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| - |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| - |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| - ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" - |Value| Description | - |-|-| - |`UNSPECIFIED` = 0|order is not cancelled or rejected| - |`CLIENT_CANCEL` = 1|client called a Cancel API| - |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| - |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| - |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| - |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| - |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| - |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| - |`EXPIRED` = 8|the order was cancelled as it has expired| - |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| - |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| - |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| - |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| - |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| - |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| - |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| - |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| - |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| - |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| - |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| - |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| - |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| - |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| - |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| - |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| - |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| - |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| - |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| - |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |trigger
`t` |TriggerOrderMetadata|True|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 "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/api_order_history_request.md b/artifacts/apidocs/schemas/api_order_history_request.md index e62d262..8a47eb5 100644 --- a/artifacts/apidocs/schemas/api_order_history_request.md +++ b/artifacts/apidocs/schemas/api_order_history_request.md @@ -39,6 +39,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -58,3 +63,8 @@ |`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/api_order_history_response.md b/artifacts/apidocs/schemas/api_order_history_response.md index b9cdd96..f1b0778 100644 --- a/artifacts/apidocs/schemas/api_order_history_response.md +++ b/artifacts/apidocs/schemas/api_order_history_response.md @@ -54,52 +54,58 @@ |-|-|-|-| |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| - ??? info "[OrderState](/../../schemas/order_state)" - |Name
`Lite`|Type|Required
`Default`| Description | - |-|-|-|-| - |status
`s` |OrderStatus|True|The status of the order| - |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| - |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| - |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| - |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| - |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| - ??? info "[OrderStatus](/../../schemas/order_status)" - |Value| Description | - |-|-| - |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| - |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| - |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| - |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| - |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| - ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" - |Value| Description | - |-|-| - |`UNSPECIFIED` = 0|order is not cancelled or rejected| - |`CLIENT_CANCEL` = 1|client called a Cancel API| - |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| - |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| - |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| - |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| - |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| - |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| - |`EXPIRED` = 8|the order was cancelled as it has expired| - |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| - |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| - |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| - |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| - |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| - |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| - |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| - |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| - |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| - |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| - |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| - |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| - |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| - |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| - |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| - |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| - |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| - |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| - |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| - |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |trigger
`t` |TriggerOrderMetadata|True|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 "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/api_order_state_response.md b/artifacts/apidocs/schemas/api_order_state_response.md index 2d46b9d..2744a2f 100644 --- a/artifacts/apidocs/schemas/api_order_state_response.md +++ b/artifacts/apidocs/schemas/api_order_state_response.md @@ -51,3 +51,4 @@ |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/api_positions_request.md b/artifacts/apidocs/schemas/api_positions_request.md index 7a89fcb..1aa7fdb 100644 --- a/artifacts/apidocs/schemas/api_positions_request.md +++ b/artifacts/apidocs/schemas/api_positions_request.md @@ -35,6 +35,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -54,3 +59,8 @@ |`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/api_pre_deposit_check_request.md b/artifacts/apidocs/schemas/api_pre_deposit_check_request.md index 07b00a7..0cb5a85 100644 --- a/artifacts/apidocs/schemas/api_pre_deposit_check_request.md +++ b/artifacts/apidocs/schemas/api_pre_deposit_check_request.md @@ -24,6 +24,11 @@ |`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| ??? 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 ede4191..1d679ce 100644 --- a/artifacts/apidocs/schemas/api_pre_deposit_check_response.md +++ b/artifacts/apidocs/schemas/api_pre_deposit_check_response.md @@ -22,3 +22,8 @@ |`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/api_pre_order_check_request.md b/artifacts/apidocs/schemas/api_pre_order_check_request.md index 4fe8ed5..3f9d0ad 100644 --- a/artifacts/apidocs/schemas/api_pre_order_check_request.md +++ b/artifacts/apidocs/schemas/api_pre_order_check_request.md @@ -56,52 +56,58 @@ |-|-|-|-| |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| - ??? info "[OrderState](/../../schemas/order_state)" - |Name
`Lite`|Type|Required
`Default`| Description | - |-|-|-|-| - |status
`s` |OrderStatus|True|The status of the order| - |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| - |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| - |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| - |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| - |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| - ??? info "[OrderStatus](/../../schemas/order_status)" - |Value| Description | - |-|-| - |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| - |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| - |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| - |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| - |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| - ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" - |Value| Description | - |-|-| - |`UNSPECIFIED` = 0|order is not cancelled or rejected| - |`CLIENT_CANCEL` = 1|client called a Cancel API| - |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| - |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| - |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| - |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| - |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| - |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| - |`EXPIRED` = 8|the order was cancelled as it has expired| - |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| - |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| - |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| - |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| - |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| - |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| - |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| - |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| - |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| - |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| - |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| - |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| - |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| - |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| - |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| - |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| - |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| - |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| - |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| - |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |trigger
`t` |TriggerOrderMetadata|True|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 "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/api_pre_order_check_response.md b/artifacts/apidocs/schemas/api_pre_order_check_response.md index 6c61426..5a56900 100644 --- a/artifacts/apidocs/schemas/api_pre_order_check_response.md +++ b/artifacts/apidocs/schemas/api_pre_order_check_response.md @@ -35,3 +35,8 @@ |`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/api_settlement_price.md b/artifacts/apidocs/schemas/api_settlement_price.md index c1b225f..60e0300 100644 --- a/artifacts/apidocs/schemas/api_settlement_price.md +++ b/artifacts/apidocs/schemas/api_settlement_price.md @@ -24,6 +24,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -43,3 +48,8 @@ |`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/api_settlement_price_request.md b/artifacts/apidocs/schemas/api_settlement_price_request.md index c33c144..9be5b8e 100644 --- a/artifacts/apidocs/schemas/api_settlement_price_request.md +++ b/artifacts/apidocs/schemas/api_settlement_price_request.md @@ -28,6 +28,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -47,3 +52,8 @@ |`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/api_settlement_price_response.md b/artifacts/apidocs/schemas/api_settlement_price_response.md index d24b764..04990a9 100644 --- a/artifacts/apidocs/schemas/api_settlement_price_response.md +++ b/artifacts/apidocs/schemas/api_settlement_price_response.md @@ -29,6 +29,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -48,3 +53,8 @@ |`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/api_sub_account_history_response.md b/artifacts/apidocs/schemas/api_sub_account_history_response.md index 2ab2fe1..95bad3a 100644 --- a/artifacts/apidocs/schemas/api_sub_account_history_response.md +++ b/artifacts/apidocs/schemas/api_sub_account_history_response.md @@ -42,6 +42,11 @@ |`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| ??? info "[SpotBalance](/../../schemas/spot_balance)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -67,6 +72,11 @@ |`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| ??? 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 e4d18b0..042a944 100644 --- a/artifacts/apidocs/schemas/api_sub_account_summary_response.md +++ b/artifacts/apidocs/schemas/api_sub_account_summary_response.md @@ -43,6 +43,11 @@ |`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| ??? info "[SpotBalance](/../../schemas/spot_balance)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -68,6 +73,11 @@ |`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| ??? 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 1f5c2d0..c1fc682 100644 --- a/artifacts/apidocs/schemas/api_transfer_history_request.md +++ b/artifacts/apidocs/schemas/api_transfer_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| + |tx_id
`ti` |string|False
`0`|The transaction ID to query for| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -27,3 +28,8 @@ |`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/api_transfer_history_response.md b/artifacts/apidocs/schemas/api_transfer_history_response.md index eecee98..0b2e6c0 100644 --- a/artifacts/apidocs/schemas/api_transfer_history_response.md +++ b/artifacts/apidocs/schemas/api_transfer_history_response.md @@ -36,6 +36,11 @@ |`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| ??? 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 4bf5317..3b125bf 100644 --- a/artifacts/apidocs/schemas/api_transfer_request.md +++ b/artifacts/apidocs/schemas/api_transfer_request.md @@ -31,6 +31,11 @@ |`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| ??? 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 2ed90db..30005f0 100644 --- a/artifacts/apidocs/schemas/api_withdrawal_history_request.md +++ b/artifacts/apidocs/schemas/api_withdrawal_history_request.md @@ -27,3 +27,8 @@ |`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/api_withdrawal_history_response.md b/artifacts/apidocs/schemas/api_withdrawal_history_response.md index adf3c34..7d38da5 100644 --- a/artifacts/apidocs/schemas/api_withdrawal_history_response.md +++ b/artifacts/apidocs/schemas/api_withdrawal_history_response.md @@ -32,6 +32,11 @@ |`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| ??? 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 c0787b8..c79afd1 100644 --- a/artifacts/apidocs/schemas/api_withdrawal_request.md +++ b/artifacts/apidocs/schemas/api_withdrawal_request.md @@ -27,6 +27,11 @@ |`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| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/broker_tag.md b/artifacts/apidocs/schemas/broker_tag.md new file mode 100644 index 0000000..c5532c0 --- /dev/null +++ b/artifacts/apidocs/schemas/broker_tag.md @@ -0,0 +1,3 @@ +!!! info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ diff --git a/artifacts/apidocs/schemas/cancel_status.md b/artifacts/apidocs/schemas/cancel_status.md new file mode 100644 index 0000000..4c19353 --- /dev/null +++ b/artifacts/apidocs/schemas/cancel_status.md @@ -0,0 +1,4 @@ +!!! info "[CancelStatus](/../../schemas/cancel_status)" + |Value| Description | + |-|-| + |`EXPIRED` = 1|Cancellation has expired because corresponding order had not arrived within the defined time-to-live window.| diff --git a/artifacts/apidocs/schemas/cancel_status_feed.md b/artifacts/apidocs/schemas/cancel_status_feed.md new file mode 100644 index 0000000..f0e5279 --- /dev/null +++ b/artifacts/apidocs/schemas/cancel_status_feed.md @@ -0,0 +1,46 @@ +!!! info "[CancelStatusFeed](/../../schemas/cancel_status_feed)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|True|The subaccount ID that requested the cancellation| + |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client| + |order_id
`oi` |string|True|A unique 128-bit identifier for the order, deterministically generated within the GRVT backend| + |reason
`r` |OrderRejectReason|True|The user-provided reason for cancelling the order| + |update_time
`ut` |string|False
`0`|[Filled by GRVT Backend] Time at which the cancellation status was updated by GRVT in unix nanoseconds| + |cancel_status
`cs` |CancelStatus|True|Status of the cancellation attempt| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| + ??? info "[CancelStatus](/../../schemas/cancel_status)" + |Value| Description | + |-|-| + |`EXPIRED` = 1|Cancellation has expired because corresponding order had not arrived within the defined time-to-live window.| diff --git a/artifacts/apidocs/schemas/claim_ecosystem_badge_response.md b/artifacts/apidocs/schemas/claim_ecosystem_badge_response.md new file mode 100644 index 0000000..ba155e6 --- /dev/null +++ b/artifacts/apidocs/schemas/claim_ecosystem_badge_response.md @@ -0,0 +1,54 @@ +!!! info "[ClaimEcosystemBadgeResponse](/../../schemas/claim_ecosystem_badge_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |badge
`b` |EpochBadge|True|The epoch badge| + ??? info "[EpochBadge](/../../schemas/epoch_badge)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|True|The off chain account id| + |main_account_id
`ma` |string|True|The account ID| + |type
`t` |RewardProgramType|True|The type of the reward program| + |epoch
`e` |integer|True|The epoch number| + |epoch_start_time
`es` |string|True|The start time of the epoch| + |epoch_end_time
`ee` |string|True|The end time of the epoch| + |badge
`b` |EpochBadgeType|True|The type of the badge| + |distributed_badges
`db` |[EpochBadgeType]|True|The distributed badges| + |total_point
`tp` |string|True|Total point| + |rank
`r` |integer|True|Rank| + |claimed_at
`ca` |string|True|The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process| + ??? info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| diff --git a/artifacts/apidocs/schemas/currency.md b/artifacts/apidocs/schemas/currency.md index b66b266..7b268f9 100644 --- a/artifacts/apidocs/schemas/currency.md +++ b/artifacts/apidocs/schemas/currency.md @@ -17,3 +17,8 @@ |`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/deposit.md b/artifacts/apidocs/schemas/deposit.md index 249134b..29d5e17 100644 --- a/artifacts/apidocs/schemas/deposit.md +++ b/artifacts/apidocs/schemas/deposit.md @@ -24,3 +24,8 @@ |`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/deposit_history.md b/artifacts/apidocs/schemas/deposit_history.md index ffa9431..95b2926 100644 --- a/artifacts/apidocs/schemas/deposit_history.md +++ b/artifacts/apidocs/schemas/deposit_history.md @@ -28,3 +28,8 @@ |`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/epoch_badge.md b/artifacts/apidocs/schemas/epoch_badge.md new file mode 100644 index 0000000..2827adf --- /dev/null +++ b/artifacts/apidocs/schemas/epoch_badge.md @@ -0,0 +1,50 @@ +!!! info "[EpochBadge](/../../schemas/epoch_badge)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|True|The off chain account id| + |main_account_id
`ma` |string|True|The account ID| + |type
`t` |RewardProgramType|True|The type of the reward program| + |epoch
`e` |integer|True|The epoch number| + |epoch_start_time
`es` |string|True|The start time of the epoch| + |epoch_end_time
`ee` |string|True|The end time of the epoch| + |badge
`b` |EpochBadgeType|True|The type of the badge| + |distributed_badges
`db` |[EpochBadgeType]|True|The distributed badges| + |total_point
`tp` |string|True|Total point| + |rank
`r` |integer|True|Rank| + |claimed_at
`ca` |string|True|The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process| + ??? info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| diff --git a/artifacts/apidocs/schemas/epoch_badge_point_distribution.md b/artifacts/apidocs/schemas/epoch_badge_point_distribution.md new file mode 100644 index 0000000..6f7dede --- /dev/null +++ b/artifacts/apidocs/schemas/epoch_badge_point_distribution.md @@ -0,0 +1,33 @@ +!!! info "[EpochBadgePointDistribution](/../../schemas/epoch_badge_point_distribution)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |badge
`b` |EpochBadgeType|True|The type of the badge| + |epoch
`e` |integer|True|The epoch number| + |type
`t` |RewardProgramType|True|The type of the reward program| + |min_point
`mp` |string|True|The minimum point to get the badge| + |max_point
`mp1` |string|True|The maximum point to get the badge| + |min_rank
`mr` |integer|True|The minimum rank to get the badge| + |max_rank
`mr1` |integer|True|The maximum rank to get the badge| + |total_point
`tp` |string|True|The total point to get the badge| + |count
`c` |integer|True|The number of users to get the badge| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| + ??? info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| diff --git a/artifacts/apidocs/schemas/epoch_badge_type.md b/artifacts/apidocs/schemas/epoch_badge_type.md new file mode 100644 index 0000000..623f02b --- /dev/null +++ b/artifacts/apidocs/schemas/epoch_badge_type.md @@ -0,0 +1,15 @@ +!!! info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| diff --git a/artifacts/apidocs/schemas/fill.md b/artifacts/apidocs/schemas/fill.md index a6f4359..54794d3 100644 --- a/artifacts/apidocs/schemas/fill.md +++ b/artifacts/apidocs/schemas/fill.md @@ -20,6 +20,7 @@ |venue
`v` |Venue|True|The venue where the trade occurred| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |signer
`s1` |string|True|The address (public key) of the wallet signing the payload| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[Venue](/../../schemas/venue)" The list of Trading Venues that are supported on the GRVT exchange
@@ -27,3 +28,6 @@ |-|-| |`ORDERBOOK` = 1|the trade is cleared on the orderbook venue| |`RFQ` = 2|the trade is cleared on the RFQ venue| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ diff --git a/artifacts/apidocs/schemas/flat_referral.md b/artifacts/apidocs/schemas/flat_referral.md index 790b36d..9e17431 100644 --- a/artifacts/apidocs/schemas/flat_referral.md +++ b/artifacts/apidocs/schemas/flat_referral.md @@ -10,3 +10,6 @@ |main_account_id
`ma` |string|True|The main account id| |referrer_main_account_id
`rm` |string|True|The referrer main account id| |is_business
`ib` |boolean|True|The account is a business account or not| + |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'| diff --git a/artifacts/apidocs/schemas/funding_account_summary.md b/artifacts/apidocs/schemas/funding_account_summary.md index 0b6bc09..1ba48cc 100644 --- a/artifacts/apidocs/schemas/funding_account_summary.md +++ b/artifacts/apidocs/schemas/funding_account_summary.md @@ -31,3 +31,8 @@ |`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/funding_payment.md b/artifacts/apidocs/schemas/funding_payment.md index 0fd50f2..24f9d6c 100644 --- a/artifacts/apidocs/schemas/funding_payment.md +++ b/artifacts/apidocs/schemas/funding_payment.md @@ -26,3 +26,8 @@ |`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/get_claimable_ecosystem_badge_response.md b/artifacts/apidocs/schemas/get_claimable_ecosystem_badge_response.md new file mode 100644 index 0000000..8572e59 --- /dev/null +++ b/artifacts/apidocs/schemas/get_claimable_ecosystem_badge_response.md @@ -0,0 +1,56 @@ +!!! info "[GetClaimableEcosystemBadgeResponse](/../../schemas/get_claimable_ecosystem_badge_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |badge
`b` |EpochBadge|True|The epoch badge| + |is_claimable
`ic` |boolean|True|Whether the badge is claimable| + |claimable_until
`cu` |string|True|The time when the badge is claimable| + ??? info "[EpochBadge](/../../schemas/epoch_badge)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|True|The off chain account id| + |main_account_id
`ma` |string|True|The account ID| + |type
`t` |RewardProgramType|True|The type of the reward program| + |epoch
`e` |integer|True|The epoch number| + |epoch_start_time
`es` |string|True|The start time of the epoch| + |epoch_end_time
`ee` |string|True|The end time of the epoch| + |badge
`b` |EpochBadgeType|True|The type of the badge| + |distributed_badges
`db` |[EpochBadgeType]|True|The distributed badges| + |total_point
`tp` |string|True|Total point| + |rank
`r` |integer|True|Rank| + |claimed_at
`ca` |string|True|The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process| + ??? info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| diff --git a/artifacts/apidocs/schemas/instrument.md b/artifacts/apidocs/schemas/instrument.md index e0aeb3a..70c3b41 100644 --- a/artifacts/apidocs/schemas/instrument.md +++ b/artifacts/apidocs/schemas/instrument.md @@ -33,6 +33,11 @@ |`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| ??? info "[Currency](/../../schemas/currency)" The list of Currencies that are supported on the GRVT exchange
@@ -52,6 +57,11 @@ |`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| ??? info "[Kind](/../../schemas/kind)" The list of asset kinds that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/order.md b/artifacts/apidocs/schemas/order.md index 162941c..dc30486 100644 --- a/artifacts/apidocs/schemas/order.md +++ b/artifacts/apidocs/schemas/order.md @@ -49,52 +49,58 @@ |-|-|-|-| |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| - ??? info "[OrderState](/../../schemas/order_state)" - |Name
`Lite`|Type|Required
`Default`| Description | - |-|-|-|-| - |status
`s` |OrderStatus|True|The status of the order| - |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| - |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| - |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| - |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| - |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| - ??? info "[OrderStatus](/../../schemas/order_status)" - |Value| Description | - |-|-| - |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| - |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| - |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| - |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| - |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| - ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" - |Value| Description | - |-|-| - |`UNSPECIFIED` = 0|order is not cancelled or rejected| - |`CLIENT_CANCEL` = 1|client called a Cancel API| - |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| - |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| - |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| - |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| - |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| - |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| - |`EXPIRED` = 8|the order was cancelled as it has expired| - |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| - |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| - |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| - |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| - |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| - |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| - |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| - |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| - |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| - |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| - |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| - |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| - |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| - |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| - |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| - |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| - |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| - |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| - |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| - |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |trigger
`t` |TriggerOrderMetadata|True|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 "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/order_metadata.md b/artifacts/apidocs/schemas/order_metadata.md index 9ddd4b7..f591907 100644 --- a/artifacts/apidocs/schemas/order_metadata.md +++ b/artifacts/apidocs/schemas/order_metadata.md @@ -5,3 +5,8 @@ |-|-|-|-| |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| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ diff --git a/artifacts/apidocs/schemas/order_reject_reason.md b/artifacts/apidocs/schemas/order_reject_reason.md index 10779bd..93bb9d3 100644 --- a/artifacts/apidocs/schemas/order_reject_reason.md +++ b/artifacts/apidocs/schemas/order_reject_reason.md @@ -30,3 +30,4 @@ |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/order_state.md b/artifacts/apidocs/schemas/order_state.md index e09b367..a3c24c7 100644 --- a/artifacts/apidocs/schemas/order_state.md +++ b/artifacts/apidocs/schemas/order_state.md @@ -47,3 +47,4 @@ |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/order_state_feed.md b/artifacts/apidocs/schemas/order_state_feed.md index 7917ac7..3d25347 100644 --- a/artifacts/apidocs/schemas/order_state_feed.md +++ b/artifacts/apidocs/schemas/order_state_feed.md @@ -53,3 +53,4 @@ |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| diff --git a/artifacts/apidocs/schemas/pre_order_check_result.md b/artifacts/apidocs/schemas/pre_order_check_result.md index 8fb5651..a7185c4 100644 --- a/artifacts/apidocs/schemas/pre_order_check_result.md +++ b/artifacts/apidocs/schemas/pre_order_check_result.md @@ -31,3 +31,8 @@ |`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/query_epoch_badge_point_distribution_request.md b/artifacts/apidocs/schemas/query_epoch_badge_point_distribution_request.md new file mode 100644 index 0000000..937a21d --- /dev/null +++ b/artifacts/apidocs/schemas/query_epoch_badge_point_distribution_request.md @@ -0,0 +1,13 @@ +!!! info "[QueryEpochBadgePointDistributionRequest](/../../schemas/query_epoch_badge_point_distribution_request)" + Query list of epoch badges
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |epoch
`e` |integer|False
`'all'`|The numerical epoch index| + |type
`t` |RewardProgramType|True|The type of the reward program| + ??? info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| diff --git a/artifacts/apidocs/schemas/query_epoch_badge_point_distribution_response.md b/artifacts/apidocs/schemas/query_epoch_badge_point_distribution_response.md new file mode 100644 index 0000000..3831ba8 --- /dev/null +++ b/artifacts/apidocs/schemas/query_epoch_badge_point_distribution_response.md @@ -0,0 +1,37 @@ +!!! info "[QueryEpochBadgePointDistributionResponse](/../../schemas/query_epoch_badge_point_distribution_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[EpochBadgePointDistribution]|True|The list of epoch badges| + ??? info "[EpochBadgePointDistribution](/../../schemas/epoch_badge_point_distribution)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |badge
`b` |EpochBadgeType|True|The type of the badge| + |epoch
`e` |integer|True|The epoch number| + |type
`t` |RewardProgramType|True|The type of the reward program| + |min_point
`mp` |string|True|The minimum point to get the badge| + |max_point
`mp1` |string|True|The maximum point to get the badge| + |min_rank
`mr` |integer|True|The minimum rank to get the badge| + |max_rank
`mr1` |integer|True|The maximum rank to get the badge| + |total_point
`tp` |string|True|The total point to get the badge| + |count
`c` |integer|True|The number of users to get the badge| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| + ??? info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| diff --git a/artifacts/apidocs/schemas/query_epoch_badge_request.md b/artifacts/apidocs/schemas/query_epoch_badge_request.md new file mode 100644 index 0000000..6cac69e --- /dev/null +++ b/artifacts/apidocs/schemas/query_epoch_badge_request.md @@ -0,0 +1,16 @@ +!!! info "[QueryEpochBadgeRequest](/../../schemas/query_epoch_badge_request)" + Query list of epoch badges
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|False
`'all'`|The off chain account id to get referral stats| + |epoch
`e` |integer|False
`'all'`|The numerical epoch index| + |type
`t` |RewardProgramType|False
`'all'`|The type of the reward program| + |limit
`l` |integer|False
`'500'`|The limit to query for. Defaults to 500; Max 1000| + |cursor
`c` |string|False
`'all'`|The cursor to indicate when to start the query from| + ??? info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| diff --git a/artifacts/apidocs/schemas/query_epoch_badge_response.md b/artifacts/apidocs/schemas/query_epoch_badge_response.md new file mode 100644 index 0000000..9700a5a --- /dev/null +++ b/artifacts/apidocs/schemas/query_epoch_badge_response.md @@ -0,0 +1,55 @@ +!!! info "[QueryEpochBadgeResponse](/../../schemas/query_epoch_badge_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[EpochBadge]|True|The list of epoch badges| + |next
`n` |string|True|The cursor to indicate when to start the query from| + ??? info "[EpochBadge](/../../schemas/epoch_badge)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|True|The off chain account id| + |main_account_id
`ma` |string|True|The account ID| + |type
`t` |RewardProgramType|True|The type of the reward program| + |epoch
`e` |integer|True|The epoch number| + |epoch_start_time
`es` |string|True|The start time of the epoch| + |epoch_end_time
`ee` |string|True|The end time of the epoch| + |badge
`b` |EpochBadgeType|True|The type of the badge| + |distributed_badges
`db` |[EpochBadgeType]|True|The distributed badges| + |total_point
`tp` |string|True|Total point| + |rank
`r` |integer|True|Rank| + |claimed_at
`ca` |string|True|The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process| + ??? info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| diff --git a/artifacts/apidocs/schemas/reward_epoch_info.md b/artifacts/apidocs/schemas/reward_epoch_info.md new file mode 100644 index 0000000..e598eaf --- /dev/null +++ b/artifacts/apidocs/schemas/reward_epoch_info.md @@ -0,0 +1,13 @@ +!!! info "[RewardEpochInfo](/../../schemas/reward_epoch_info)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |epoch
`e` |integer|True|The epoch number| + |epoch_start_time
`es` |string|True|The start time of the epoch| + |epoch_end_time
`ee` |string|True|The end time of the epoch| + |status
`s` |RewardEpochStatus|True|The status of the epoch| + ??? info "[RewardEpochStatus](/../../schemas/reward_epoch_status)" + |Value| Description | + |-|-| + |`PAST` = 1|Past| + |`CURRENT` = 2|Current| + |`FUTURE` = 3|Future| diff --git a/artifacts/apidocs/schemas/reward_epoch_status.md b/artifacts/apidocs/schemas/reward_epoch_status.md new file mode 100644 index 0000000..8cb3e94 --- /dev/null +++ b/artifacts/apidocs/schemas/reward_epoch_status.md @@ -0,0 +1,6 @@ +!!! info "[RewardEpochStatus](/../../schemas/reward_epoch_status)" + |Value| Description | + |-|-| + |`PAST` = 1|Past| + |`CURRENT` = 2|Current| + |`FUTURE` = 3|Future| diff --git a/artifacts/apidocs/schemas/reward_program_type.md b/artifacts/apidocs/schemas/reward_program_type.md new file mode 100644 index 0000000..c9e3094 --- /dev/null +++ b/artifacts/apidocs/schemas/reward_program_type.md @@ -0,0 +1,6 @@ +!!! info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| diff --git a/artifacts/apidocs/schemas/spot_balance.md b/artifacts/apidocs/schemas/spot_balance.md index 93c15e8..4eae88d 100644 --- a/artifacts/apidocs/schemas/spot_balance.md +++ b/artifacts/apidocs/schemas/spot_balance.md @@ -23,3 +23,8 @@ |`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.md b/artifacts/apidocs/schemas/sub_account.md index 88cfd84..c947b90 100644 --- a/artifacts/apidocs/schemas/sub_account.md +++ b/artifacts/apidocs/schemas/sub_account.md @@ -37,6 +37,11 @@ |`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| ??? info "[SpotBalance](/../../schemas/spot_balance)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -62,6 +67,11 @@ |`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| ??? info "[Positions](/../../schemas/positions)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/tpsl_order_metadata.md b/artifacts/apidocs/schemas/tpsl_order_metadata.md new file mode 100644 index 0000000..0b760a8 --- /dev/null +++ b/artifacts/apidocs/schemas/tpsl_order_metadata.md @@ -0,0 +1,15 @@ +!!! info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)" + Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

### Fields:
- **triggerBy**: Defines the price type that activates the order (e.g., index price).
- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order| + |trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.| + ??? info "[TriggerBy](/../../schemas/trigger_by)" + Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.

Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|no trigger condition| + |`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price| + |`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price| diff --git a/artifacts/apidocs/schemas/transfer_history.md b/artifacts/apidocs/schemas/transfer_history.md index b3e5b6f..55adcbd 100644 --- a/artifacts/apidocs/schemas/transfer_history.md +++ b/artifacts/apidocs/schemas/transfer_history.md @@ -31,6 +31,11 @@ |`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| ??? info "[Signature](/../../schemas/signature)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/trigger_by.md b/artifacts/apidocs/schemas/trigger_by.md new file mode 100644 index 0000000..fe337fd --- /dev/null +++ b/artifacts/apidocs/schemas/trigger_by.md @@ -0,0 +1,8 @@ +!!! info "[TriggerBy](/../../schemas/trigger_by)" + Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.

Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|no trigger condition| + |`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price| + |`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price| diff --git a/artifacts/apidocs/schemas/trigger_order_metadata.md b/artifacts/apidocs/schemas/trigger_order_metadata.md new file mode 100644 index 0000000..e69de29 diff --git a/artifacts/apidocs/schemas/trigger_type.md b/artifacts/apidocs/schemas/trigger_type.md new file mode 100644 index 0000000..9407e67 --- /dev/null +++ b/artifacts/apidocs/schemas/trigger_type.md @@ -0,0 +1,3 @@ +!!! info "[TriggerType](/../../schemas/trigger_type)" + Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.

Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.


+ diff --git a/artifacts/apidocs/schemas/withdrawal.md b/artifacts/apidocs/schemas/withdrawal.md index 82e7877..1f8271e 100644 --- a/artifacts/apidocs/schemas/withdrawal.md +++ b/artifacts/apidocs/schemas/withdrawal.md @@ -25,6 +25,11 @@ |`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| ??? 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 00c6893..9b835e8 100644 --- a/artifacts/apidocs/schemas/withdrawal_history.md +++ b/artifacts/apidocs/schemas/withdrawal_history.md @@ -27,6 +27,11 @@ |`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| ??? 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 new file mode 100644 index 0000000..0206e12 --- /dev/null +++ b/artifacts/apidocs/schemas/ws_cancel_feed_data_v1.md @@ -0,0 +1,54 @@ +!!! info "[WSCancelFeedDataV1](/../../schemas/ws_cancel_feed_data_v1)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |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| + |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 global message order within the specific stream| + ??? info "[CancelStatusFeed](/../../schemas/cancel_status_feed)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|True|The subaccount ID that requested the cancellation| + |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client| + |order_id
`oi` |string|True|A unique 128-bit identifier for the order, deterministically generated within the GRVT backend| + |reason
`r` |OrderRejectReason|True|The user-provided reason for cancelling the order| + |update_time
`ut` |string|False
`0`|[Filled by GRVT Backend] Time at which the cancellation status was updated by GRVT in unix nanoseconds| + |cancel_status
`cs` |CancelStatus|True|Status of the cancellation attempt| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| + ??? info "[CancelStatus](/../../schemas/cancel_status)" + |Value| Description | + |-|-| + |`EXPIRED` = 1|Cancellation has expired because corresponding order had not arrived within the defined time-to-live window.| diff --git a/artifacts/apidocs/schemas/ws_cancel_feed_selector_v1.md b/artifacts/apidocs/schemas/ws_cancel_feed_selector_v1.md new file mode 100644 index 0000000..016d250 --- /dev/null +++ b/artifacts/apidocs/schemas/ws_cancel_feed_selector_v1.md @@ -0,0 +1,6 @@ +!!! info "[WSCancelFeedSelectorV1](/../../schemas/ws_cancel_feed_selector_v1)" + Subscribes to a feed of time-to-live expiry events for order cancellations requested by a given subaccount.
**This stream presently only provides expiry updates for cancel-order requests set with a valid TTL value**.
Successful order cancellations will reflect as updates published to the (order-state stream)[https://api-docs.grvt.io/trading_streams/#order-state].
_A future release will expand the functionality of this stream to provide more general status updates on order cancellation requests._
Each Order can be uniquely identified by its `client_order_id`.

+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|True|The subaccount ID to filter by| diff --git a/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md b/artifacts/apidocs/schemas/ws_candlestick_feed_data_v1.md index 253e439..04fab98 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 running sequence number that determines global message order within the specific stream| |feed
`f` |Candlestick|True|A candlestick entry matching the request filters| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| ??? 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 b12a0ce..eed835f 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 running sequence number that determines global message order within the specific stream| |feed
`f` |Deposit|True|The Deposit object| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| ??? info "[Deposit](/../../schemas/deposit)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -33,3 +34,8 @@ |`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/ws_fill_feed_data_v1.md b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md index bb1c270..25713f5 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 running sequence number that determines global message order within the specific stream| |feed
`f` |Fill|True|A private trade matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| ??? info "[Fill](/../../schemas/fill)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -27,6 +28,7 @@ |venue
`v` |Venue|True|The venue where the trade occurred| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |signer
`s1` |string|True|The address (public key) of the wallet signing the payload| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[Venue](/../../schemas/venue)" The list of Trading Venues that are supported on the GRVT exchange
@@ -34,3 +36,6 @@ |-|-| |`ORDERBOOK` = 1|the trade is cleared on the orderbook venue| |`RFQ` = 2|the trade is cleared on the RFQ venue| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ 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..9a5fd62 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 running sequence number that determines global message order within the specific stream| |feed
`f` |MiniTicker|True|A mini ticker matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| ??? 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 140e0b3..3c0038a 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 running sequence number that determines global message order within the specific stream| |feed
`f` |Order|True|The order object being created or updated| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| ??? 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,52 +57,58 @@ |-|-|-|-| |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| - ??? info "[OrderState](/../../schemas/order_state)" - |Name
`Lite`|Type|Required
`Default`| Description | - |-|-|-|-| - |status
`s` |OrderStatus|True|The status of the order| - |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| - |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| - |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| - |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| - |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| - ??? info "[OrderStatus](/../../schemas/order_status)" - |Value| Description | - |-|-| - |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| - |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| - |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| - |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| - |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| - ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" - |Value| Description | - |-|-| - |`UNSPECIFIED` = 0|order is not cancelled or rejected| - |`CLIENT_CANCEL` = 1|client called a Cancel API| - |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| - |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| - |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| - |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| - |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| - |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| - |`EXPIRED` = 8|the order was cancelled as it has expired| - |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| - |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| - |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| - |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| - |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| - |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| - |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| - |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| - |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| - |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| - |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| - |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| - |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| - |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| - |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| - |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| - |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| - |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| - |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| - |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |trigger
`t` |TriggerOrderMetadata|True|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 "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| 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 e48e822..ce19912 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 running sequence number that determines global message order within the specific stream| |feed
`f` |OrderStateFeed|True|The Order State Feed| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| ??? info "[OrderStateFeed](/../../schemas/order_state_feed)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -60,3 +61,4 @@ |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| 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..22ebdae 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 running sequence number that determines global message order within the specific stream| |feed
`f` |OrderbookLevels|True|An orderbook levels object matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| ??? 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..34429db 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 running sequence number that determines global message order within the specific stream| |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 global message order within the specific stream| ??? 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..e79ced4 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 b821c89..f8dc199 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 running sequence number that determines global message order within the specific stream| |feed
`f` |Ticker|True|A ticker matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| ??? 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..e1c1d55 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 running sequence number that determines global message order within the specific stream| |feed
`f` |Trade|True|A public trade matching the request filter| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| ??? 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 cc04e7d..c62c1f5 100644 --- a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md @@ -6,10 +6,12 @@ |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| - |feed
`f` |Transfer|True|The Transfer object| - ??? info "[Transfer](/../../schemas/transfer)" + |feed
`f` |TransferHistory|True|The transfer history matching the requested filters| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| + ??? info "[TransferHistory](/../../schemas/transfer_history)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| + |tx_id
`ti` |string|True|The transaction ID of the transfer| |from_account_id
`fa` |string|True|The account to transfer from| |from_sub_account_id
`fs` |string|True|The subaccount to transfer from (0 if transferring from main account)| |to_account_id
`ta` |string|True|The account to deposit into| @@ -17,6 +19,7 @@ |currency
`c` |Currency|True|The token currency to transfer| |num_tokens
`nt` |string|True|The number of tokens to transfer| |signature
`s` |Signature|True|The signature of the transfer| + |event_time
`et` |string|True|The timestamp of the transfer in unix nanoseconds| |transfer_type
`tt` |TransferType|True|The type of transfer| |transfer_metadata
`tm` |string|True|The metadata of the transfer| ??? info "[Currency](/../../schemas/currency)" @@ -38,6 +41,11 @@ |`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| ??? 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 7fcaa6b..071d96c 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 ac0adb3..2a55bca 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 running sequence number that determines global message order within the specific stream| |feed
`f` |Withdrawal|True|The Withdrawal object| + |prev_sequence_number
`ps` |string|True|The previous sequence number that determines global message order within the specific stream| ??? info "[Withdrawal](/../../schemas/withdrawal)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| @@ -34,6 +35,11 @@ |`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| ??? 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 220bbff..7d45758 100644 --- a/artifacts/apidocs/trading_api.md +++ b/artifacts/apidocs/trading_api.md @@ -36,11 +36,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, + } "metadata": { "client_order_id": "23042", "create_time": "1697788800000000000" - }, + } } } ``` @@ -66,11 +66,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, + } "m": { "co": "23042", "ct": "1697788800000000000" - }, + } } } ``` @@ -174,6 +174,7 @@ LITE ENDPOINT: lite/v1/create_order |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| @@ -205,7 +206,11 @@ LITE ENDPOINT: lite/v1/create_order |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|
!!! failure @@ -257,11 +262,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, + } "metadata": { "client_order_id": "23042", "create_time": "1697788800000000000" - }, + } } } ' @@ -295,11 +300,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, + } "metadata": { "client_order_id": "23042", "create_time": "1697788800000000000" - }, + } } }, "id": 123 @@ -333,11 +338,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, + } "m": { "co": "23042", "ct": "1697788800000000000" - }, + } } } ' @@ -371,11 +376,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, + } "m": { "co": "23042", "ct": "1697788800000000000" - }, + } } }, "i": 123 @@ -410,11 +415,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, + } "metadata": { "client_order_id": "23042", "create_time": "1697788800000000000" - }, + } } } ' @@ -448,11 +453,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, + } "metadata": { "client_order_id": "23042", "create_time": "1697788800000000000" - }, + } } }, "id": 123 @@ -486,11 +491,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, + } "m": { "co": "23042", "ct": "1697788800000000000" - }, + } } } ' @@ -524,11 +529,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, + } "m": { "co": "23042", "ct": "1697788800000000000" - }, + } } }, "i": 123 @@ -563,11 +568,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, + } "metadata": { "client_order_id": "23042", "create_time": "1697788800000000000" - }, + } } } ' @@ -601,11 +606,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, + } "metadata": { "client_order_id": "23042", "create_time": "1697788800000000000" - }, + } } }, "id": 123 @@ -639,11 +644,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, + } "m": { "co": "23042", "ct": "1697788800000000000" - }, + } } } ' @@ -677,11 +682,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, + } "m": { "co": "23042", "ct": "1697788800000000000" - }, + } } }, "i": 123 @@ -716,11 +721,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, + } "metadata": { "client_order_id": "23042", "create_time": "1697788800000000000" - }, + } } } ' @@ -754,11 +759,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "expiration": "1697788800000000000", "nonce": 1234567890 - }, + } "metadata": { "client_order_id": "23042", "create_time": "1697788800000000000" - }, + } } }, "id": 123 @@ -792,11 +797,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, + } "m": { "co": "23042", "ct": "1697788800000000000" - }, + } } } ' @@ -830,11 +835,11 @@ LITE ENDPOINT: lite/v1/create_order "v": 28, "e": "1697788800000000000", "n": 1234567890 - }, + } "m": { "co": "23042", "ct": "1697788800000000000" - }, + } } }, "i": 123 @@ -860,7 +865,8 @@ LITE ENDPOINT: lite/v1/cancel_order { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "order_id": "0x1028403", - "client_order_id": "23042" + "client_order_id": "23042", + "time_to_live_ms": `500` } ``` **Lite Request** @@ -868,7 +874,8 @@ LITE ENDPOINT: lite/v1/cancel_order { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "oi": "0x1028403", - "co": "23042" + "co": "23042", + "tt": `500` } ```
@@ -906,6 +913,8 @@ 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|
@@ -941,7 +950,8 @@ LITE ENDPOINT: lite/v1/cancel_order --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "order_id": "0x1028403", - "client_order_id": "23042" + "client_order_id": "23042", + "time_to_live_ms": `500` } ' ``` @@ -957,7 +967,8 @@ LITE ENDPOINT: lite/v1/cancel_order "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "order_id": "0x1028403", - "client_order_id": "23042" + "client_order_id": "23042", + "time_to_live_ms": `500` }, "id": 123 } @@ -973,7 +984,8 @@ LITE ENDPOINT: lite/v1/cancel_order --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", "oi": "0x1028403", - "co": "23042" + "co": "23042", + "tt": `500` } ' ``` @@ -989,7 +1001,8 @@ LITE ENDPOINT: lite/v1/cancel_order "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "oi": "0x1028403", - "co": "23042" + "co": "23042", + "tt": `500` }, "i": 123 } @@ -1006,7 +1019,8 @@ LITE ENDPOINT: lite/v1/cancel_order --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "order_id": "0x1028403", - "client_order_id": "23042" + "client_order_id": "23042", + "time_to_live_ms": `500` } ' ``` @@ -1022,7 +1036,8 @@ LITE ENDPOINT: lite/v1/cancel_order "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "order_id": "0x1028403", - "client_order_id": "23042" + "client_order_id": "23042", + "time_to_live_ms": `500` }, "id": 123 } @@ -1038,7 +1053,8 @@ LITE ENDPOINT: lite/v1/cancel_order --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", "oi": "0x1028403", - "co": "23042" + "co": "23042", + "tt": `500` } ' ``` @@ -1054,7 +1070,8 @@ LITE ENDPOINT: lite/v1/cancel_order "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "oi": "0x1028403", - "co": "23042" + "co": "23042", + "tt": `500` }, "i": 123 } @@ -1071,7 +1088,8 @@ LITE ENDPOINT: lite/v1/cancel_order --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "order_id": "0x1028403", - "client_order_id": "23042" + "client_order_id": "23042", + "time_to_live_ms": `500` } ' ``` @@ -1087,7 +1105,8 @@ LITE ENDPOINT: lite/v1/cancel_order "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "order_id": "0x1028403", - "client_order_id": "23042" + "client_order_id": "23042", + "time_to_live_ms": `500` }, "id": 123 } @@ -1103,7 +1122,8 @@ LITE ENDPOINT: lite/v1/cancel_order --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", "oi": "0x1028403", - "co": "23042" + "co": "23042", + "tt": `500` } ' ``` @@ -1119,7 +1139,8 @@ LITE ENDPOINT: lite/v1/cancel_order "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "oi": "0x1028403", - "co": "23042" + "co": "23042", + "tt": `500` }, "i": 123 } @@ -1136,7 +1157,8 @@ LITE ENDPOINT: lite/v1/cancel_order --data '{ "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "order_id": "0x1028403", - "client_order_id": "23042" + "client_order_id": "23042", + "time_to_live_ms": `500` } ' ``` @@ -1152,7 +1174,8 @@ LITE ENDPOINT: lite/v1/cancel_order "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "order_id": "0x1028403", - "client_order_id": "23042" + "client_order_id": "23042", + "time_to_live_ms": `500` }, "id": 123 } @@ -1168,7 +1191,8 @@ LITE ENDPOINT: lite/v1/cancel_order --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", "oi": "0x1028403", - "co": "23042" + "co": "23042", + "tt": `500` } ' ``` @@ -1184,7 +1208,8 @@ LITE ENDPOINT: lite/v1/cancel_order "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "oi": "0x1028403", - "co": "23042" + "co": "23042", + "tt": `500` }, "i": 123 } @@ -3840,16 +3865,15 @@ LITE ENDPOINT: lite/v1/pre_order_check ```

-## Execution -### Fill History +### Cancel Trigger Order ``` -FULL ENDPOINT: full/v1/fill_history -LITE ENDPOINT: lite/v1/fill_history +FULL ENDPOINT: full/v1/cancel_trigger_order +LITE ENDPOINT: lite/v1/cancel_trigger_order ``` === "Request"
- -8<- "docs/schemas/api_fill_history_request.md" + -8<- "docs/schemas/api_cancel_order_request.md"
!!! question "Query" @@ -3857,87 +3881,41 @@ LITE ENDPOINT: lite/v1/fill_history ``` { .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": "" + "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"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "oi": "0x1028403", + "co": "23042", + "tt": `500` } ```
=== "Response"
- -8<- "docs/schemas/api_fill_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", - "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" - }], - "next": "Qw0918=" + "result": { + "ack": "true" + } } ``` **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" - }], - "n": "Qw0918=" + "r": { + "a": "true" + } } ```
@@ -3952,6 +3930,7 @@ LITE ENDPOINT: lite/v1/fill_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| + |3021|400|Either order ID or client order ID must be supplied|
!!! failure @@ -3980,18 +3959,14 @@ 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/cancel_trigger_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"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": `500` } ' ``` @@ -4003,16 +3978,12 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/cancel_trigger_order", "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": "" + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": `500` }, "id": 123 } @@ -4022,18 +3993,14 @@ 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/cancel_trigger_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"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "oi": "0x1028403", + "co": "23042", + "tt": `500` } ' ``` @@ -4045,16 +4012,12 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/cancel_trigger_order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "oi": "0x1028403", + "co": "23042", + "tt": `500` }, "i": 123 } @@ -4065,18 +4028,14 @@ 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/cancel_trigger_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"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": `500` } ' ``` @@ -4088,16 +4047,12 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/cancel_trigger_order", "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": "" + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": `500` }, "id": 123 } @@ -4107,18 +4062,14 @@ 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/cancel_trigger_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"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "oi": "0x1028403", + "co": "23042", + "tt": `500` } ' ``` @@ -4130,16 +4081,12 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/cancel_trigger_order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "oi": "0x1028403", + "co": "23042", + "tt": `500` }, "i": 123 } @@ -4150,18 +4097,14 @@ 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/cancel_trigger_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"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": `500` } ' ``` @@ -4173,16 +4116,12 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/cancel_trigger_order", "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": "" + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": `500` }, "id": 123 } @@ -4192,18 +4131,14 @@ 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/cancel_trigger_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"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "oi": "0x1028403", + "co": "23042", + "tt": `500` } ' ``` @@ -4215,16 +4150,12 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/cancel_trigger_order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "oi": "0x1028403", + "co": "23042", + "tt": `500` }, "i": 123 } @@ -4235,18 +4166,14 @@ 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/cancel_trigger_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"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": `500` } ' ``` @@ -4258,16 +4185,12 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "jsonrpc": "2.0", - "method": "v1/fill_history", + "method": "v1/cancel_trigger_order", "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": "" + "order_id": "0x1028403", + "client_order_id": "23042", + "time_to_live_ms": `500` }, "id": 123 } @@ -4277,18 +4200,14 @@ 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/cancel_trigger_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"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "oi": "0x1028403", + "co": "23042", + "tt": `500` } ' ``` @@ -4300,16 +4219,12 @@ LITE ENDPOINT: lite/v1/fill_history -x ' { "j": "2.0", - "m": "v1/fill_history", + "m": "v1/cancel_trigger_order", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "k": ["PERPETUAL"], - "b": ["BTC", "ETH"], - "q": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" + "oi": "0x1028403", + "co": "23042", + "tt": `500` }, "i": 123 } @@ -4317,15 +4232,15 @@ LITE ENDPOINT: lite/v1/fill_history ```

-### Positions +### Cancel All Trigger Orders ``` -FULL ENDPOINT: full/v1/positions -LITE ENDPOINT: lite/v1/positions +FULL ENDPOINT: full/v1/cancel_all_trigger_orders +LITE ENDPOINT: lite/v1/cancel_all_trigger_orders ``` === "Request"
- -8<- "docs/schemas/api_positions_request.md" + -8<- "docs/schemas/api_cancel_all_orders_request.md"
!!! question "Query" @@ -4350,50 +4265,24 @@ LITE ENDPOINT: lite/v1/positions
=== "Response"
- -8<- "docs/schemas/api_positions_response.md" + -8<- "docs/schemas/ack_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": [{ - "event_time": "1697788800000000000", - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "size": "2635000.50", - "notional": "2635000.50", - "entry_price": "65038.01", - "exit_price": "65038.01", - "mark_price": "65038.01", - "unrealized_pnl": "135000.50", - "realized_pnl": "-35000.30", - "total_pnl": "100000.20", - "roi": "10.20", - "quote_index_price": "1.0000102", - "est_liquidation_price": 60000.25 - }] + "result": { + "ack": "true" + } } ``` **Lite Response** ``` { .json .copy } { - "r": [{ - "et": "1697788800000000000", - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "s": "2635000.50", - "n": "2635000.50", - "ep": "65038.01", - "ep1": "65038.01", - "mp": "65038.01", - "up": "135000.50", - "rp": "-35000.30", - "tp": "100000.20", - "r": "10.20", - "qi": "1.0000102", - "el": 60000.25 - }] + "r": { + "a": "true" + } } ```
@@ -4436,7 +4325,7 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/positions' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/cancel_all_trigger_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -4455,7 +4344,7 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/cancel_all_trigger_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "kind": ["PERPETUAL"], @@ -4470,7 +4359,7 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/positions' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/cancel_all_trigger_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -4489,7 +4378,7 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/cancel_all_trigger_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "k": ["PERPETUAL"], @@ -4505,7 +4394,7 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/positions' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/cancel_all_trigger_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -4524,7 +4413,7 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/cancel_all_trigger_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "kind": ["PERPETUAL"], @@ -4539,7 +4428,7 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/positions' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/cancel_all_trigger_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -4558,7 +4447,7 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/cancel_all_trigger_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "k": ["PERPETUAL"], @@ -4574,7 +4463,7 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/positions' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/cancel_all_trigger_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -4593,7 +4482,7 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/cancel_all_trigger_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "kind": ["PERPETUAL"], @@ -4608,7 +4497,7 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/positions' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/cancel_all_trigger_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -4627,7 +4516,7 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/cancel_all_trigger_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "k": ["PERPETUAL"], @@ -4643,7 +4532,7 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/positions' \ + curl --location 'https://trades.grvt.io/full/v1/cancel_all_trigger_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -4662,7 +4551,7 @@ LITE ENDPOINT: lite/v1/positions -x ' { "jsonrpc": "2.0", - "method": "v1/positions", + "method": "v1/cancel_all_trigger_orders", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "kind": ["PERPETUAL"], @@ -4677,7 +4566,7 @@ LITE ENDPOINT: lite/v1/positions
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/positions' \ + curl --location 'https://trades.grvt.io/lite/v1/cancel_all_trigger_orders' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -4696,7 +4585,7 @@ LITE ENDPOINT: lite/v1/positions -x ' { "j": "2.0", - "m": "v1/positions", + "m": "v1/cancel_all_trigger_orders", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", "k": ["PERPETUAL"], @@ -4709,15 +4598,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" @@ -4725,7 +4615,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, @@ -4736,7 +4628,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, @@ -4746,7 +4640,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 @@ -4757,9 +4651,22 @@ 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" }], "next": "Qw0918=" } @@ -4771,9 +4678,22 @@ 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" }], "n": "Qw0918=" } @@ -4818,12 +4738,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, @@ -4839,10 +4761,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, @@ -4856,12 +4780,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, @@ -4877,10 +4803,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, @@ -4895,12 +4823,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, @@ -4916,10 +4846,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, @@ -4933,12 +4865,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, @@ -4954,10 +4888,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, @@ -4972,14 +4908,16 @@ 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", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", "limit": 500, "cursor": "" } @@ -4993,10 +4931,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, @@ -5010,12 +4950,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, @@ -5031,10 +4973,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, @@ -5049,12 +4993,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, @@ -5070,10 +5016,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, @@ -5087,12 +5035,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, @@ -5108,10 +5058,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, @@ -5123,43 +5075,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": "" + "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": "" + "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 @@ -5167,32 +5116,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 + }] } ```
@@ -5235,15 +5194,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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -5255,13 +5213,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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -5271,15 +5228,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": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -5291,13 +5247,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": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -5308,15 +5263,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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -5328,13 +5282,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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -5344,15 +5297,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": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -5364,13 +5316,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": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -5381,15 +5332,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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -5401,13 +5351,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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -5417,15 +5366,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": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -5437,15 +5385,14 @@ 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": "" - }, - "i": 123 + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] + }, + "i": 123 } ' -w 360 ``` @@ -5454,15 +5401,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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] } ' ``` @@ -5474,13 +5420,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": "" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"] }, "id": 123 } @@ -5490,15 +5435,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": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] } ' ``` @@ -5510,13 +5454,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": "" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"] }, "i": 123 } @@ -5524,81 +5467,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=" } ```
@@ -5641,26 +5576,16 @@ LITE ENDPOINT: lite/v1/transfer
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/transfer' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/funding_payment_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "from_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "from_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "to_account_id": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "to_sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "currency": "USDT", - "num_tokens": "1500.0", - "signature": { - "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "expiration": "1697788800000000000", - "nonce": 1234567890 - }, - "transfer_type": "STANDARD", - "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -5672,24 +5597,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 } @@ -5699,26 +5614,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": "" } ' ``` @@ -5730,24 +5635,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 } @@ -5758,26 +5653,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": "" } ' ``` @@ -5789,24 +5674,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 } @@ -5816,26 +5691,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": "" } ' ``` @@ -5847,24 +5712,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 } @@ -5875,26 +5730,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": "" } ' ``` @@ -5906,24 +5751,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 } @@ -5933,26 +5768,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": "" } ' ``` @@ -5964,24 +5789,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 } @@ -5992,26 +5807,1443 @@ 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 + "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.grvt.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": "" }, - "transfer_type": "STANDARD", - "transfer_metadata": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + 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'", + "i": "BTC_USDT_Perp", + "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/funding_payment_history", + "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+
+## Transfer +### Deposit History +``` +FULL ENDPOINT: full/v1/deposit_history +LITE ENDPOINT: lite/v1/deposit_history +``` + +=== "Request" +
+ -8<- "docs/schemas/api_deposit_history_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ``` + **Lite Request** + ``` { .json .copy } + { + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_deposit_history_response.md" +
+
+ !!! success + **Full Response** + ``` { .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=" + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": [{ + "l1": "0x10000101000203040506", + "l2": "0x10000101000203040506", + "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "it": "1697788800000000000", + "ct": "1697788800000000000", + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0" + }], + "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/deposit_history' \ + --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": "" + } + ' + ``` + !!! 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/deposit_history", + "params": { + "currency": ["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/deposit_history' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" + } + ' + ``` + !!! 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/deposit_history", + "p": { + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/deposit_history' \ + --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": "" + } + ' + ``` + !!! 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/deposit_history", + "params": { + "currency": ["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/deposit_history' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" + } + ' + ``` + !!! 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/deposit_history", + "p": { + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://trades.testnet.grvt.io/full/v1/deposit_history' \ + --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": "" + } + ' + ``` + !!! 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/deposit_history", + "params": { + "currency": ["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/deposit_history' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" + } + ' + ``` + !!! 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/deposit_history", + "p": { + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://trades.grvt.io/full/v1/deposit_history' \ + --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": "" + } + ' + ``` + !!! 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/deposit_history", + "params": { + "currency": ["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/deposit_history' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" + } + ' + ``` + !!! 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/deposit_history", + "p": { + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+
+### Transfer +``` +FULL ENDPOINT: full/v1/transfer +LITE ENDPOINT: lite/v1/transfer +``` + +=== "Request" +
+ -8<- "docs/schemas/api_transfer_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"} + } + ``` + **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"} + } + ``` +
+=== "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| + |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 + **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/transfer' \ + --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"} + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + 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", + "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"} + } + ' + ``` + !!! 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/transfer", + "p": { + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "fs": "'$GRVT_SUB_ACCOUNT_ID'", + "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "ts": "'$GRVT_SUB_ACCOUNT_ID'", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + }, + "tt": "STANDARD", + "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + 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", + "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.staging.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"} + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + 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", + "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"} + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "v1/transfer", + "p": { + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "fs": "'$GRVT_SUB_ACCOUNT_ID'", + "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "ts": "'$GRVT_SUB_ACCOUNT_ID'", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + }, + "tt": "STANDARD", + "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + 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", + "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.testnet.grvt.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"} + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + 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", + "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"} + } + ' + ``` + !!! 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/transfer", + "p": { + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "fs": "'$GRVT_SUB_ACCOUNT_ID'", + "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "ts": "'$GRVT_SUB_ACCOUNT_ID'", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + }, + "tt": "STANDARD", + "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + 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", + "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.grvt.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"} + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://trades.grvt.io/lite/v1/transfer' \ + --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"} + } + ' + ``` + !!! 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/transfer", + "p": { + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "fs": "'$GRVT_SUB_ACCOUNT_ID'", + "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "ts": "'$GRVT_SUB_ACCOUNT_ID'", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + }, + "tt": "STANDARD", + "tm": {"provider":"XY","direction":"WITHDRAWAL","provider_tx_id":"txn123456","chainid":"42161","endpoint":"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0"} + }, + "i": 123 + } + ' -w 360 + ``` +
+
+### Transfer History +``` +FULL ENDPOINT: full/v1/transfer_history +LITE ENDPOINT: lite/v1/transfer_history +``` + +=== "Request" +
+ -8<- "docs/schemas/api_transfer_history_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "tx_id": "1028403" + } + ``` + **Lite Request** + ``` { .json .copy } + { + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ti": "1028403" + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_transfer_history_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "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'", + "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 + }], + "next": "Qw0918=" + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": [{ + "ti": "1028403", + "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 + }, + "et": "1697788800000000000", + "tt": "STANDARD", + "tm": null + }], + "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/transfer_history' \ + --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": "", + "tx_id": "1028403" + } + ' + ``` + !!! 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_history", + "params": { + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "tx_id": "1028403" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/transfer_history' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ti": "1028403" + } + ' + ``` + !!! 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/transfer_history", + "p": { + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ti": "1028403" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/transfer_history' \ + --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": "", + "tx_id": "1028403" + } + ' + ``` + !!! 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/transfer_history", + "params": { + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "tx_id": "1028403" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/transfer_history' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ti": "1028403" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "v1/transfer_history", + "p": { + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ti": "1028403" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://trades.testnet.grvt.io/full/v1/transfer_history' \ + --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": "", + "tx_id": "1028403" + } + ' + ``` + !!! 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/transfer_history", + "params": { + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "tx_id": "1028403" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://trades.testnet.grvt.io/lite/v1/transfer_history' \ + --header "Cookie: $GRVT_COOKIE" \ + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ti": "1028403" + } + ' + ``` + !!! 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/transfer_history", + "p": { + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ti": "1028403" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://trades.grvt.io/full/v1/transfer_history' \ + --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": "", + "tx_id": "1028403" } ' ``` @@ -6023,24 +7255,14 @@ LITE ENDPOINT: lite/v1/transfer -x ' { "jsonrpc": "2.0", - "method": "v1/transfer", + "method": "v1/transfer_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"} + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "", + "tx_id": "1028403" }, "id": 123 } @@ -6050,26 +7272,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/transfer_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"} + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ti": "1028403" } ' ``` @@ -6081,24 +7293,14 @@ LITE ENDPOINT: lite/v1/transfer -x ' { "j": "2.0", - "m": "v1/transfer", + "m": "v1/transfer_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"} + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "", + "ti": "1028403" }, "i": 123 } @@ -6106,95 +7308,73 @@ LITE ENDPOINT: lite/v1/transfer ```

-### Transfer History +### Withdrawal ``` -FULL ENDPOINT: full/v1/transfer_history -LITE ENDPOINT: lite/v1/transfer_history +FULL ENDPOINT: full/v1/withdrawal +LITE ENDPOINT: lite/v1/withdrawal ``` === "Request"
- -8<- "docs/schemas/api_transfer_history_request.md" + -8<- "docs/schemas/api_withdrawal_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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 + } } ``` **Lite Request** ``` { .json .copy } { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + } } ```
=== "Response"
- -8<- "docs/schemas/api_transfer_history_response.md" + -8<- "docs/schemas/ack_response.md"
!!! success **Full Response** ``` { .json .copy } { - "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'", - "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 - }], - "next": "Qw0918=" + "result": { + "ack": "true" + } } ``` **Lite Response** ``` { .json .copy } { - "r": [{ - "ti": "1028403", - "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 - }, - "et": "1697788800000000000", - "tt": "STANDARD", - "tm": null - }], - "n": "Qw0918=" + "r": { + "a": "true" + } } ```
@@ -6209,6 +7389,7 @@ LITE ENDPOINT: lite/v1/transfer_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| + |4010|400|This wallet is not supported. Please try another wallet.|
!!! failure @@ -6237,15 +7418,22 @@ 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' \ --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": "" + "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 + } } ' ``` @@ -6257,13 +7445,20 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "jsonrpc": "2.0", - "method": "v1/transfer_history", + "method": "v1/withdrawal", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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 + } }, "id": 123 } @@ -6273,15 +7468,22 @@ 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' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + } } ' ``` @@ -6293,13 +7495,20 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "j": "2.0", - "m": "v1/transfer_history", + "m": "v1/withdrawal", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + } }, "i": 123 } @@ -6310,15 +7519,22 @@ 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' \ --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": "" + "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 + } } ' ``` @@ -6330,13 +7546,20 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "jsonrpc": "2.0", - "method": "v1/transfer_history", + "method": "v1/withdrawal", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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 + } }, "id": 123 } @@ -6346,15 +7569,22 @@ 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' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + } } ' ``` @@ -6366,13 +7596,20 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "j": "2.0", - "m": "v1/transfer_history", + "m": "v1/withdrawal", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + } }, "i": 123 } @@ -6383,15 +7620,22 @@ 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' \ --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": "" + "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 + } } ' ``` @@ -6403,13 +7647,20 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "jsonrpc": "2.0", - "method": "v1/transfer_history", + "method": "v1/withdrawal", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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 + } }, "id": 123 } @@ -6419,15 +7670,22 @@ 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' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + } } ' ``` @@ -6439,13 +7697,20 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "j": "2.0", - "m": "v1/transfer_history", + "m": "v1/withdrawal", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + } }, "i": 123 } @@ -6456,15 +7721,22 @@ 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' \ --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": "" + "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 + } } ' ``` @@ -6476,13 +7748,20 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "jsonrpc": "2.0", - "method": "v1/transfer_history", + "method": "v1/withdrawal", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "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 + } }, "id": 123 } @@ -6492,15 +7771,22 @@ 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' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + } } ' ``` @@ -6512,13 +7798,20 @@ LITE ENDPOINT: lite/v1/transfer_history -x ' { "j": "2.0", - "m": "v1/transfer_history", + "m": "v1/withdrawal", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "c": "USDT", + "nt": "1500.0", + "s": { + "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", + "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", + "v": 28, + "e": "1697788800000000000", + "n": 1234567890 + } }, "i": 123 } @@ -6526,73 +7819,87 @@ LITE ENDPOINT: lite/v1/transfer_history ```

-### Withdrawal +### Withdrawal History ``` -FULL ENDPOINT: full/v1/withdrawal -LITE ENDPOINT: lite/v1/withdrawal +FULL ENDPOINT: full/v1/withdrawal_history +LITE ENDPOINT: lite/v1/withdrawal_history ``` === "Request"
- -8<- "docs/schemas/api_withdrawal_request.md" + -8<- "docs/schemas/api_withdrawal_history_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 - } + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ``` **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 - } + { + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" } ```
=== "Response"
- -8<- "docs/schemas/ack_response.md" + -8<- "docs/schemas/api_withdrawal_history_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": { - "ack": "true" - } + "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": { - "a": "true" - } + "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=" } ```
@@ -6607,7 +7914,6 @@ 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.|
!!! failure @@ -6636,22 +7942,15 @@ 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/withdrawal_history' \ --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 - } + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -6663,20 +7962,13 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal", + "method": "v1/withdrawal_history", "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 - } + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -6686,22 +7978,15 @@ 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/withdrawal_history' \ --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 - } + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" } ' ``` @@ -6713,20 +7998,13 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "j": "2.0", - "m": "v1/withdrawal", + "m": "v1/withdrawal_history", "p": { - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" }, "i": 123 } @@ -6737,22 +8015,15 @@ 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/withdrawal_history' \ --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 - } + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -6764,20 +8035,13 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal", + "method": "v1/withdrawal_history", "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 - } + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -6787,22 +8051,15 @@ 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/withdrawal_history' \ --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 - } + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" } ' ``` @@ -6814,20 +8071,13 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "j": "2.0", - "m": "v1/withdrawal", + "m": "v1/withdrawal_history", "p": { - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" }, "i": 123 } @@ -6838,22 +8088,15 @@ 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/withdrawal_history' \ --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 - } + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -6865,20 +8108,13 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal", + "method": "v1/withdrawal_history", "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 - } + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -6888,22 +8124,15 @@ 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/withdrawal_history' \ --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 - } + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" } ' ``` @@ -6915,20 +8144,13 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "j": "2.0", - "m": "v1/withdrawal", + "m": "v1/withdrawal_history", "p": { - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" }, "i": 123 } @@ -6939,22 +8161,15 @@ 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/withdrawal_history' \ --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 - } + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -6966,20 +8181,13 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal", + "method": "v1/withdrawal_history", "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 - } + "currency": ["USDT", "USDC"], + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -6989,22 +8197,15 @@ 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/withdrawal_history' \ --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 - } + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" } ' ``` @@ -7016,20 +8217,13 @@ LITE ENDPOINT: lite/v1/withdrawal -x ' { "j": "2.0", - "m": "v1/withdrawal", + "m": "v1/withdrawal_history", "p": { - "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "te": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "c": "USDT", - "nt": "1500.0", - "s": { - "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", - "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", - "s1": "0x3d786193125f7c29c958647da64d0e2875ece2c3f845a591bdd7dae8c475e26d", - "v": 28, - "e": "1697788800000000000", - "n": 1234567890 - } + "c": ["USDT", "USDC"], + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c1": "" }, "i": 123 } @@ -7037,87 +8231,52 @@ LITE ENDPOINT: lite/v1/withdrawal ```

-### Withdrawal History +## PreDepositCheck +### Pre Deposit Check ``` -FULL ENDPOINT: full/v1/withdrawal_history -LITE ENDPOINT: lite/v1/withdrawal_history +FULL ENDPOINT: full/v1/pre_deposit_check +LITE ENDPOINT: lite/v1/pre_deposit_check ``` === "Request"
- -8<- "docs/schemas/api_withdrawal_history_request.md" + -8<- "docs/schemas/api_pre_deposit_check_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "currency": "USDT", + "bridge": "XY" } ``` **Lite Request** ``` { .json .copy } { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "c": "USDT", + "b": "XY" } ```
=== "Response"
- -8<- "docs/schemas/api_withdrawal_history_response.md" + -8<- "docs/schemas/api_pre_deposit_check_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=" + "max_deposit_limit": "3945034.23", + "currency": "USDT" } ``` **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=" + "md": "3945034.23", + "c": "USDT" } ```
@@ -7126,11 +8285,10 @@ LITE ENDPOINT: lite/v1/withdrawal_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|
@@ -7139,18 +8297,18 @@ LITE ENDPOINT: lite/v1/withdrawal_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 } ```
@@ -7160,15 +8318,12 @@ 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/pre_deposit_check' \ --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": "" + "currency": "USDT", + "bridge": "XY" } ' ``` @@ -7180,13 +8335,10 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal_history", + "method": "v1/pre_deposit_check", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "currency": "USDT", + "bridge": "XY" }, "id": 123 } @@ -7196,15 +8348,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "c": "USDT", + "b": "XY" } ' ``` @@ -7216,13 +8365,10 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "j": "2.0", - "m": "v1/withdrawal_history", + "m": "v1/pre_deposit_check", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "c": "USDT", + "b": "XY" }, "i": 123 } @@ -7233,15 +8379,12 @@ 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/pre_deposit_check' \ --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": "" + "currency": "USDT", + "bridge": "XY" } ' ``` @@ -7253,13 +8396,10 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal_history", + "method": "v1/pre_deposit_check", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "currency": "USDT", + "bridge": "XY" }, "id": 123 } @@ -7269,15 +8409,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "c": "USDT", + "b": "XY" } ' ``` @@ -7289,13 +8426,10 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "j": "2.0", - "m": "v1/withdrawal_history", + "m": "v1/pre_deposit_check", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "c": "USDT", + "b": "XY" }, "i": 123 } @@ -7306,15 +8440,12 @@ 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/pre_deposit_check' \ --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": "" + --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + --data '{ + "currency": "USDT", + "bridge": "XY" } ' ``` @@ -7326,13 +8457,10 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal_history", + "method": "v1/pre_deposit_check", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "currency": "USDT", + "bridge": "XY" }, "id": 123 } @@ -7342,15 +8470,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "c": "USDT", + "b": "XY" } ' ``` @@ -7362,13 +8487,10 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "j": "2.0", - "m": "v1/withdrawal_history", + "m": "v1/pre_deposit_check", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "c": "USDT", + "b": "XY" }, "i": 123 } @@ -7379,15 +8501,12 @@ 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/pre_deposit_check' \ --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": "" + "currency": "USDT", + "bridge": "XY" } ' ``` @@ -7399,13 +8518,10 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "jsonrpc": "2.0", - "method": "v1/withdrawal_history", + "method": "v1/pre_deposit_check", "params": { - "currency": ["USDT", "USDC"], - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" + "currency": "USDT", + "bridge": "XY" }, "id": 123 } @@ -7415,15 +8531,12 @@ 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/pre_deposit_check' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "c": "USDT", + "b": "XY" } ' ``` @@ -7435,13 +8548,10 @@ LITE ENDPOINT: lite/v1/withdrawal_history -x ' { "j": "2.0", - "m": "v1/withdrawal_history", + "m": "v1/pre_deposit_check", "p": { - "c": ["USDT", "USDC"], - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c1": "" + "c": "USDT", + "b": "XY" }, "i": 123 } @@ -7449,52 +8559,112 @@ LITE ENDPOINT: lite/v1/withdrawal_history ```

-## PreDepositCheck -### Pre Deposit Check +## Account +### Sub Account Summary ``` -FULL ENDPOINT: full/v1/pre_deposit_check -LITE ENDPOINT: lite/v1/pre_deposit_check +FULL ENDPOINT: full/v1/account_summary +LITE ENDPOINT: lite/v1/account_summary ``` === "Request"
- -8<- "docs/schemas/api_pre_deposit_check_request.md" + -8<- "docs/schemas/api_sub_account_summary_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ``` **Lite Request** ``` { .json .copy } { - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ```
=== "Response"
- -8<- "docs/schemas/api_pre_deposit_check_response.md" + -8<- "docs/schemas/api_sub_account_summary_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" + } } ``` **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" + } } ```
@@ -7503,10 +8673,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|
@@ -7515,18 +8686,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 } ```
@@ -7536,12 +8707,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7553,10 +8723,9 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_deposit_check", + "method": "v1/account_summary", "params": { - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -7566,12 +8735,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7583,10 +8751,9 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "j": "2.0", - "m": "v1/pre_deposit_check", + "m": "v1/account_summary", "p": { - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -7597,12 +8764,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7614,10 +8780,9 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_deposit_check", + "method": "v1/account_summary", "params": { - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -7627,12 +8792,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7644,10 +8808,9 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "j": "2.0", - "m": "v1/pre_deposit_check", + "m": "v1/account_summary", "p": { - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -7658,12 +8821,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7675,10 +8837,9 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_deposit_check", + "method": "v1/account_summary", "params": { - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -7688,12 +8849,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7705,10 +8865,9 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "j": "2.0", - "m": "v1/pre_deposit_check", + "m": "v1/account_summary", "p": { - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -7719,12 +8878,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7736,10 +8894,9 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "jsonrpc": "2.0", - "method": "v1/pre_deposit_check", + "method": "v1/account_summary", "params": { - "currency": "USDT", - "bridge": "XY" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -7749,12 +8906,11 @@ 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_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -7766,10 +8922,9 @@ LITE ENDPOINT: lite/v1/pre_deposit_check -x ' { "j": "2.0", - "m": "v1/pre_deposit_check", + "m": "v1/account_summary", "p": { - "c": "USDT", - "b": "XY" + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -7777,42 +8932,49 @@ LITE ENDPOINT: lite/v1/pre_deposit_check ```

-## Account -### Sub Account Summary +### Sub Account History ``` -FULL ENDPOINT: full/v1/account_summary -LITE ENDPOINT: lite/v1/account_summary +FULL ENDPOINT: full/v1/account_history +LITE ENDPOINT: lite/v1/account_history ``` === "Request"
- -8<- "docs/schemas/api_sub_account_summary_request.md" + -8<- "docs/schemas/api_sub_account_history_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "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'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ```
=== "Response"
- -8<- "docs/schemas/api_sub_account_summary_response.md" + -8<- "docs/schemas/api_sub_account_history_response.md"
!!! success **Full Response** ``` { .json .copy } { - "result": { + "result": [{ "event_time": "1697788800000000000", "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", "margin_type": "SIMPLE_CROSS_MARGIN", @@ -7844,13 +9006,14 @@ LITE ENDPOINT: lite/v1/account_summary "est_liquidation_price": 60000.25 }], "settle_index_price": "1.0000102" - } + }], + "next": "Qw0918=" } ``` **Lite Response** ``` { .json .copy } { - "r": { + "r": [{ "et": "1697788800000000000", "sa": "'$GRVT_SUB_ACCOUNT_ID'", "mt": "SIMPLE_CROSS_MARGIN", @@ -7882,7 +9045,8 @@ LITE ENDPOINT: lite/v1/account_summary "el": 60000.25 }], "si": "1.0000102" - } + }], + "n": "Qw0918=" } ```
@@ -7925,11 +9089,15 @@ 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/account_history' \ --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'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -7941,9 +9109,13 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/account_summary", + "method": "v1/account_history", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -7953,11 +9125,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -7969,9 +9145,13 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "j": "2.0", - "m": "v1/account_summary", + "m": "v1/account_history", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -7982,11 +9162,15 @@ 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/account_history' \ --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'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -7998,9 +9182,13 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/account_summary", + "method": "v1/account_history", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -8010,11 +9198,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -8026,9 +9218,13 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "j": "2.0", - "m": "v1/account_summary", + "m": "v1/account_history", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -8039,11 +9235,15 @@ 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/account_history' \ --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'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -8055,9 +9255,13 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/account_summary", + "method": "v1/account_history", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -8067,11 +9271,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -8083,9 +9291,13 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "j": "2.0", - "m": "v1/account_summary", + "m": "v1/account_history", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -8096,11 +9308,15 @@ 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/account_history' \ --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'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" } ' ``` @@ -8112,9 +9328,13 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/account_summary", + "method": "v1/account_history", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" }, "id": 123 } @@ -8124,11 +9344,15 @@ 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/account_history' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" } ' ``` @@ -8140,9 +9364,13 @@ LITE ENDPOINT: lite/v1/account_summary -x ' { "j": "2.0", - "m": "v1/account_summary", + "m": "v1/account_history", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" }, "i": 123 } @@ -8150,121 +9378,61 @@ LITE ENDPOINT: lite/v1/account_summary ```

-### Sub Account History +### Aggregated Account Summary ``` -FULL ENDPOINT: full/v1/account_history -LITE ENDPOINT: lite/v1/account_history +FULL ENDPOINT: full/v1/aggregated_account_summary +LITE ENDPOINT: lite/v1/aggregated_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_aggregated_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=" + }] + } } ```
@@ -8273,8 +9441,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| @@ -8286,18 +9452,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 } ```
@@ -8307,15 +9473,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/aggregated_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": "" } ' ``` @@ -8327,13 +9488,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/aggregated_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" }, "id": 123 } @@ -8343,15 +9499,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/aggregated_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": "" } ' ``` @@ -8363,13 +9514,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/aggregated_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" }, "i": 123 } @@ -8380,15 +9526,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/aggregated_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": "" } ' ``` @@ -8400,13 +9541,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/aggregated_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" }, "id": 123 } @@ -8416,15 +9552,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/aggregated_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": "" } ' ``` @@ -8436,13 +9567,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/aggregated_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" }, "i": 123 } @@ -8453,15 +9579,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/aggregated_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": "" } ' ``` @@ -8473,13 +9594,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/aggregated_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" }, "id": 123 } @@ -8489,15 +9605,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/aggregated_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": "" } ' ``` @@ -8509,13 +9620,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/aggregated_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" }, "i": 123 } @@ -8526,15 +9632,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/aggregated_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": "" } ' ``` @@ -8546,13 +9647,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "jsonrpc": "2.0", - "method": "v1/account_history", + "method": "v1/aggregated_account_summary", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "start_time": "1697788800000000000", - "end_time": "1697788800000000000", - "limit": 500, - "cursor": "" }, "id": 123 } @@ -8562,15 +9658,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/aggregated_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": "" } ' ``` @@ -8582,13 +9673,8 @@ LITE ENDPOINT: lite/v1/account_history -x ' { "j": "2.0", - "m": "v1/account_history", + "m": "v1/aggregated_account_summary", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "st": "1697788800000000000", - "et": "1697788800000000000", - "l": 500, - "c": "" }, "i": 123 } @@ -8596,10 +9682,10 @@ LITE ENDPOINT: lite/v1/account_history ```

-### Aggregated Account Summary +### Funding Account Summary ``` -FULL ENDPOINT: full/v1/aggregated_account_summary -LITE ENDPOINT: lite/v1/aggregated_account_summary +FULL ENDPOINT: full/v1/funding_account_summary +LITE ENDPOINT: lite/v1/funding_account_summary ``` === "Request" @@ -8621,7 +9707,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
=== "Response"
- -8<- "docs/schemas/api_aggregated_account_summary_response.md" + -8<- "docs/schemas/api_funding_account_summary_response.md"
!!! success @@ -8691,7 +9777,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/funding_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8706,7 +9792,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/funding_account_summary", "params": { }, "id": 123 @@ -8717,7 +9803,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/funding_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8732,7 +9818,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/funding_account_summary", "p": { }, "i": 123 @@ -8744,7 +9830,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/funding_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8759,7 +9845,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/funding_account_summary", "params": { }, "id": 123 @@ -8770,7 +9856,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/funding_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8785,7 +9871,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/funding_account_summary", "p": { }, "i": 123 @@ -8797,7 +9883,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/funding_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8812,7 +9898,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/funding_account_summary", "params": { }, "id": 123 @@ -8823,7 +9909,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/funding_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8838,7 +9924,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/funding_account_summary", "p": { }, "i": 123 @@ -8850,7 +9936,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/funding_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8865,7 +9951,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/aggregated_account_summary", + "method": "v1/funding_account_summary", "params": { }, "id": 123 @@ -8876,7 +9962,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/funding_account_summary' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -8891,7 +9977,7 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary -x ' { "j": "2.0", - "m": "v1/aggregated_account_summary", + "m": "v1/funding_account_summary", "p": { }, "i": 123 @@ -8900,10 +9986,11 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary ```

-### Funding Account Summary +## SocializedLoss +### Socialized Loss Status ``` -FULL ENDPOINT: full/v1/funding_account_summary -LITE ENDPOINT: lite/v1/funding_account_summary +FULL ENDPOINT: full/v1/socialized_loss_status +LITE ENDPOINT: lite/v1/socialized_loss_status ``` === "Request" @@ -8925,36 +10012,22 @@ LITE ENDPOINT: lite/v1/funding_account_summary
=== "Response"
- -8<- "docs/schemas/api_funding_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" } ```
@@ -8995,7 +10068,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/full/v1/funding_account_summary' \ + curl --location 'https://trades.dev.gravitymarkets.io/full/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -9010,7 +10083,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_account_summary", + "method": "v1/socialized_loss_status", "params": { }, "id": 123 @@ -9021,7 +10094,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/funding_account_summary' \ + curl --location 'https://trades.dev.gravitymarkets.io/lite/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -9036,7 +10109,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/socialized_loss_status", "p": { }, "i": 123 @@ -9048,7 +10121,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/full/v1/funding_account_summary' \ + curl --location 'https://trades.staging.gravitymarkets.io/full/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -9063,7 +10136,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_account_summary", + "method": "v1/socialized_loss_status", "params": { }, "id": 123 @@ -9074,7 +10147,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/funding_account_summary' \ + curl --location 'https://trades.staging.gravitymarkets.io/lite/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -9089,7 +10162,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/socialized_loss_status", "p": { }, "i": 123 @@ -9101,7 +10174,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/full/v1/funding_account_summary' \ + curl --location 'https://trades.testnet.grvt.io/full/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -9116,7 +10189,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_account_summary", + "method": "v1/socialized_loss_status", "params": { }, "id": 123 @@ -9127,7 +10200,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.testnet.grvt.io/lite/v1/funding_account_summary' \ + curl --location 'https://trades.testnet.grvt.io/lite/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -9142,7 +10215,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/socialized_loss_status", "p": { }, "i": 123 @@ -9154,7 +10227,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Full" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/full/v1/funding_account_summary' \ + curl --location 'https://trades.grvt.io/full/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -9169,7 +10242,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "jsonrpc": "2.0", - "method": "v1/funding_account_summary", + "method": "v1/socialized_loss_status", "params": { }, "id": 123 @@ -9180,7 +10253,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary
!!! example "REST Lite" ``` { .bash .copy } - curl --location 'https://trades.grvt.io/lite/v1/funding_account_summary' \ + curl --location 'https://trades.grvt.io/lite/v1/socialized_loss_status' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ @@ -9195,7 +10268,7 @@ LITE ENDPOINT: lite/v1/funding_account_summary -x ' { "j": "2.0", - "m": "v1/funding_account_summary", + "m": "v1/socialized_loss_status", "p": { }, "i": 123 @@ -9204,48 +10277,58 @@ LITE ENDPOINT: lite/v1/funding_account_summary ```

-## SocializedLoss -### Socialized Loss Status +## InitialLeverage +### Get All Initial Leverage ``` -FULL ENDPOINT: full/v1/socialized_loss_status -LITE ENDPOINT: lite/v1/socialized_loss_status +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_socialized_loss_status_response.md" + -8<- "docs/schemas/api_get_all_initial_leverage_response.md"
!!! success **Full Response** ``` { .json .copy } { - "is_active": "false", - "haircut_ratio": "0.34" + "results": [{ + "instrument": "BTC_USDT_Perp", + "leverage": "10", + "min_leverage": "10", + "max_leverage": "50" + }] } ``` **Lite Response** ``` { .json .copy } { - "ia": "false", - "hr": "0.34" + "r": [{ + "i": "BTC_USDT_Perp", + "l": "10", + "ml": "10", + "ml1": "50" + }] } ```
@@ -9254,10 +10337,12 @@ 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|
!!! failure @@ -9265,18 +10350,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 } ```
@@ -9286,10 +10371,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9301,8 +10387,9 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -9312,10 +10399,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9327,8 +10415,9 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -9339,10 +10428,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9354,8 +10444,9 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -9365,10 +10456,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9380,8 +10472,9 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -9392,10 +10485,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9407,8 +10501,9 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -9418,10 +10513,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9433,8 +10529,9 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -9445,10 +10542,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9460,8 +10558,9 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "jsonrpc": "2.0", - "method": "v1/socialized_loss_status", + "method": "v1/get_all_initial_leverage", "params": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" }, "id": 123 } @@ -9471,10 +10570,11 @@ 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/get_all_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ + "sa": "'$GRVT_SUB_ACCOUNT_ID'" } ' ``` @@ -9486,8 +10586,9 @@ LITE ENDPOINT: lite/v1/socialized_loss_status -x ' { "j": "2.0", - "m": "v1/socialized_loss_status", + "m": "v1/get_all_initial_leverage", "p": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'" }, "i": 123 } @@ -9495,58 +10596,51 @@ LITE ENDPOINT: lite/v1/socialized_loss_status ```

-## InitialLeverage -### Get All Initial Leverage +### Set Initial Leverage ``` -FULL ENDPOINT: full/v1/get_all_initial_leverage -LITE ENDPOINT: lite/v1/get_all_initial_leverage +FULL ENDPOINT: full/v1/set_initial_leverage +LITE ENDPOINT: lite/v1/set_initial_leverage ``` === "Request"
- -8<- "docs/schemas/api_get_all_initial_leverage_request.md" + -8<- "docs/schemas/api_set_initial_leverage_request.md"
!!! question "Query" **Full Request** ``` { .json .copy } { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ``` **Lite Request** ``` { .json .copy } { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" } ```
=== "Response"
- -8<- "docs/schemas/api_get_all_initial_leverage_response.md" + -8<- "docs/schemas/api_set_initial_leverage_response.md"
!!! success **Full Response** ``` { .json .copy } { - "results": [{ - "instrument": "BTC_USDT_Perp", - "leverage": "10", - "min_leverage": "10", - "max_leverage": "50" - }] + "success": "true" } ``` **Lite Response** ``` { .json .copy } { - "r": [{ - "i": "BTC_USDT_Perp", - "l": "10", - "ml": "10", - "ml1": "50" - }] + "s": "true" } ```
@@ -9561,6 +10655,7 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage |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|
!!! failure @@ -9589,11 +10684,13 @@ 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/set_initial_leverage' \ --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'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -9605,9 +10702,11 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/set_initial_leverage", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -9617,11 +10716,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -9633,9 +10734,11 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/set_initial_leverage", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -9646,11 +10749,13 @@ 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/set_initial_leverage' \ --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'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -9662,9 +10767,11 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/set_initial_leverage", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -9674,11 +10781,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -9690,9 +10799,11 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/set_initial_leverage", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -9703,11 +10814,13 @@ 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/set_initial_leverage' \ --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'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -9719,9 +10832,11 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/set_initial_leverage", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -9731,11 +10846,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -9747,9 +10864,11 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/set_initial_leverage", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -9760,11 +10879,13 @@ 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/set_initial_leverage' \ --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'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" } ' ``` @@ -9776,9 +10897,11 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/get_all_initial_leverage", + "method": "v1/set_initial_leverage", "params": { - "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'" + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "instrument": "BTC_USDT_Perp", + "leverage": "10" }, "id": 123 } @@ -9788,11 +10911,13 @@ 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/set_initial_leverage' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" } ' ``` @@ -9804,9 +10929,11 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage -x ' { "j": "2.0", - "m": "v1/get_all_initial_leverage", + "m": "v1/set_initial_leverage", "p": { - "sa": "'$GRVT_SUB_ACCOUNT_ID'" + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "i": "BTC_USDT_Perp", + "l": "10" }, "i": 123 } @@ -9814,15 +10941,16 @@ LITE ENDPOINT: lite/v1/get_all_initial_leverage ```

-### Set Initial Leverage +## Order +### Cancel On Disconnect ``` -FULL ENDPOINT: full/v1/set_initial_leverage -LITE ENDPOINT: lite/v1/set_initial_leverage +FULL ENDPOINT: full/v1/cancel_on_disconnect +LITE ENDPOINT: lite/v1/cancel_on_disconnect ``` === "Request"
- -8<- "docs/schemas/api_set_initial_leverage_request.md" + -8<- "docs/schemas/api_cancel_on_disconnect_request.md"
!!! question "Query" @@ -9830,35 +10958,37 @@ LITE ENDPOINT: lite/v1/set_initial_leverage ``` { .json .copy } { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "countdown_time": 300 } ``` **Lite Request** ``` { .json .copy } { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "ct": 300 } ```
=== "Response"
- -8<- "docs/schemas/api_set_initial_leverage_response.md" + -8<- "docs/schemas/ack_response.md"
!!! success **Full Response** ``` { .json .copy } { - "success": "true" + "result": { + "ack": "true" + } } ``` **Lite Response** ``` { .json .copy } { - "s": "true" + "r": { + "a": "true" + } } ```
@@ -9872,8 +11002,8 @@ 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| + |6000|400|Countdown time is bigger than 300s supported|
!!! failure @@ -9902,13 +11032,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/cancel_on_disconnect' \ --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" + "countdown_time": 300 } ' ``` @@ -9920,11 +11049,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/cancel_on_disconnect", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "countdown_time": 300 }, "id": 123 } @@ -9934,13 +11062,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/cancel_on_disconnect' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "ct": 300 } ' ``` @@ -9952,11 +11079,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/cancel_on_disconnect", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "ct": 300 }, "i": 123 } @@ -9967,13 +11093,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/cancel_on_disconnect' \ --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" + "countdown_time": 300 } ' ``` @@ -9985,11 +11110,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/cancel_on_disconnect", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "countdown_time": 300 }, "id": 123 } @@ -9999,13 +11123,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/cancel_on_disconnect' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "ct": 300 } ' ``` @@ -10017,11 +11140,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/cancel_on_disconnect", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "ct": 300 }, "i": 123 } @@ -10032,13 +11154,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/cancel_on_disconnect' \ --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" + "countdown_time": 300 } ' ``` @@ -10050,11 +11171,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/cancel_on_disconnect", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "countdown_time": 300 }, "id": 123 } @@ -10064,13 +11184,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/cancel_on_disconnect' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "ct": 300 } ' ``` @@ -10082,11 +11201,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/cancel_on_disconnect", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "ct": 300 }, "i": 123 } @@ -10097,13 +11215,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/cancel_on_disconnect' \ --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" + "countdown_time": 300 } ' ``` @@ -10115,11 +11232,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "jsonrpc": "2.0", - "method": "v1/set_initial_leverage", + "method": "v1/cancel_on_disconnect", "params": { "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", - "instrument": "BTC_USDT_Perp", - "leverage": "10" + "countdown_time": 300 }, "id": 123 } @@ -10129,13 +11245,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/cancel_on_disconnect' \ --header "Cookie: $GRVT_COOKIE" \ --header "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ --data '{ "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "ct": 300 } ' ``` @@ -10147,11 +11262,10 @@ LITE ENDPOINT: lite/v1/set_initial_leverage -x ' { "j": "2.0", - "m": "v1/set_initial_leverage", + "m": "v1/cancel_on_disconnect", "p": { "sa": "'$GRVT_SUB_ACCOUNT_ID'", - "i": "BTC_USDT_Perp", - "l": "10" + "ct": 300 }, "i": 123 } diff --git a/artifacts/apidocs/trading_streams.md b/artifacts/apidocs/trading_streams.md index f59894a..82a6364 100644 --- a/artifacts/apidocs/trading_streams.md +++ b/artifacts/apidocs/trading_streams.md @@ -1261,6 +1261,606 @@ STREAM: v1.state ```

+### Cancel Status +``` +STREAM: v1.cancel +``` + +=== "Feed Selector" +
+ -8<- "docs/schemas/ws_cancel_feed_selector_v1.md" + ??? info "JSONRPC Wrappers" + -8<- "docs/schemas/jsonrpc_request.md" + -8<- "docs/schemas/jsonrpc_response.md" + -8<- "docs/schemas/ws_subscribe_params.md" + -8<- "docs/schemas/ws_subscribe_result.md" + -8<- "docs/schemas/ws_unsubscribe_params.md" + -8<- "docs/schemas/ws_unsubscribe_result.md" + -8<- "docs/schemas/ws_subscribe_request_v1_legacy.md" + -8<- "docs/schemas/ws_subscribe_response_v1_legacy.md" +
+
+ ???+ question "Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.cancel", + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123 + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.cancel", + "subs": ["'$GRVT_SUB_ACCOUNT_ID'"], + "unsubs": [], + "num_snapshots": [10], + "first_sequence_number": [872634876] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Unsubscribe" + **Full Unsubscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.cancel", + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123 + } + ``` + **Full Unsubscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.cancel", + "unsubs": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Legacy Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.cancel", + "feed":["'$GRVT_SUB_ACCOUNT_ID'"], + "method":"subscribe", + "is_full":true + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.cancel", + "subs":["'$GRVT_SUB_ACCOUNT_ID'"], + "unsubs":[], + "num_snapshots":[1], + "first_sequence_number":[2813] + } + ``` +
+=== "Feed Data" +
+ -8<- "docs/schemas/ws_cancel_feed_data_v1.md" +
+
+ !!! success + **Full Feed Response** + ``` { .json .copy } + { + "stream": "v1.cancel", + "selector": "'$GRVT_SUB_ACCOUNT_ID'", + "sequence_number": "872634876", + "feed": { + "sub_account_id": "'$GRVT_SUB_ACCOUNT_ID'", + "client_order_id": "23042", + "order_id": "10000101000203040506", + "reason": "UNSPECIFIED", + "update_time": "1697788800000000000", + "cancel_status": "EXPIRED" + } + } + ``` + **Lite Feed Response** + ``` { .json .copy } + { + "s": "v1.cancel", + "s1": "'$GRVT_SUB_ACCOUNT_ID'", + "sn": "872634876", + "f": { + "sa": "'$GRVT_SUB_ACCOUNT_ID'", + "co": "23042", + "oi": "10000101000203040506", + "r": "UNSPECIFIED", + "ut": "1697788800000000000", + "cs": "EXPIRED" + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1000|401|You need to authenticate prior to using this functionality| + |1001|403|You are not authorized to access this functionality| + |1002|500|Internal Server Error| + |1008|401|Your IP has not been whitelisted for access| + |1101|400|Feed Format must be in the format of @| + |1102|400|Wrong number of primary selectors| + |1103|400|Wrong number of secondary selectors| + |3000|400|Instrument is invalid| + |3020|400|Sub account ID must be an uint64 integer| + -8<- "docs/schemas/jsonrpc_response.md" +
+
+ !!! failure "Error" + **Full Error Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "error": { + "code": 1000, + "message": "You need to authenticate prior to using this functionality" + }, + "id": 123, + "method": "subscribe" + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "j": "2.0", + "e": { + "c": 1000, + "m": "You need to authenticate prior to using this functionality" + }, + "i": 123, + "m": "subscribe" + } + ``` + **Legacy Error Response** + ``` { .json .copy } + { + "code":1000, + "message":"You need to authenticate prior to using this functionality", + "status":401 + } + ``` +
+=== "Try it out" + -8<- "sections/auth_closed.md" + === "DEV" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.dev.gravitymarkets.io/ws/full" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.cancel", + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.dev.gravitymarkets.io/ws/full" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.cancel", + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.dev.gravitymarkets.io/ws" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "request_id":1, + "stream":"v1.cancel", + "feed":["'$GRVT_SUB_ACCOUNT_ID'"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.dev.gravitymarkets.io/ws/lite" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.cancel", + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.dev.gravitymarkets.io/ws/lite" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.cancel", + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.dev.gravitymarkets.io/ws" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "request_id":1, + "stream":"v1.cancel", + "feed":["'$GRVT_SUB_ACCOUNT_ID'"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.staging.gravitymarkets.io/ws/full" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.cancel", + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.staging.gravitymarkets.io/ws/full" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.cancel", + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.staging.gravitymarkets.io/ws" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "request_id":1, + "stream":"v1.cancel", + "feed":["'$GRVT_SUB_ACCOUNT_ID'"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.cancel", + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.staging.gravitymarkets.io/ws/lite" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.cancel", + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.staging.gravitymarkets.io/ws" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "request_id":1, + "stream":"v1.cancel", + "feed":["'$GRVT_SUB_ACCOUNT_ID'"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.testnet.grvt.io/ws/full" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.cancel", + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.testnet.grvt.io/ws/full" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.cancel", + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.testnet.grvt.io/ws" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "request_id":1, + "stream":"v1.cancel", + "feed":["'$GRVT_SUB_ACCOUNT_ID'"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.testnet.grvt.io/ws/lite" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.cancel", + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.testnet.grvt.io/ws/lite" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.cancel", + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.testnet.grvt.io/ws" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "request_id":1, + "stream":"v1.cancel", + "feed":["'$GRVT_SUB_ACCOUNT_ID'"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.grvt.io/ws/full" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.cancel", + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.grvt.io/ws/full" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.cancel", + "selectors": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://trades.grvt.io/ws" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "request_id":1, + "stream":"v1.cancel", + "feed":["'$GRVT_SUB_ACCOUNT_ID'"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.grvt.io/ws/lite" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.cancel", + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.grvt.io/ws/lite" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.cancel", + "s1": ["'$GRVT_SUB_ACCOUNT_ID'"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://trades.grvt.io/ws" \ + -H "Cookie: $GRVT_COOKIE" \ + -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \ + -x ' + { + "request_id":1, + "stream":"v1.cancel", + "feed":["'$GRVT_SUB_ACCOUNT_ID'"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+
## Execution ### Fill ``` @@ -3205,12 +3805,13 @@ STREAM: v1.transfer "selector": "BTC_USDT_Perp", "sequence_number": "872634876", "feed": { + "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": "10.50", + "num_tokens": "1500.0", "signature": { "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", @@ -3219,6 +3820,7 @@ STREAM: v1.transfer "expiration": "1697788800000000000", "nonce": 1234567890 }, + "event_time": "1697788800000000000", "transfer_type": "STANDARD", "transfer_metadata": null } @@ -3231,12 +3833,13 @@ STREAM: v1.transfer "s1": "BTC_USDT_Perp", "sn": "872634876", "f": { + "ti": "1028403", "fa": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "fs": "'$GRVT_SUB_ACCOUNT_ID'", "ta": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "ts": "'$GRVT_SUB_ACCOUNT_ID'", "c": "USDT", - "nt": "10.50", + "nt": "1500.0", "s": { "s": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", "r": "0xb788d96fee91c7cdc35918e0441b756d4000ec1d07d900c73347d9abbc20acc8", @@ -3245,6 +3848,7 @@ STREAM: v1.transfer "e": "1697788800000000000", "n": 1234567890 }, + "et": "1697788800000000000", "tt": "STANDARD", "tm": null } diff --git a/artifacts/pysdk/grvt_raw_async.py b/artifacts/pysdk/grvt_raw_async.py index 8ec7600..5ecd289 100644 --- a/artifacts/pysdk/grvt_raw_async.py +++ b/artifacts/pysdk/grvt_raw_async.py @@ -152,6 +152,32 @@ async def pre_order_check_v1( return GrvtError(**resp) return from_dict(types.ApiPreOrderCheckResponse, resp, Config(cast=[Enum])) + async def cancel_trigger_order_v1( + self, req: types.ApiCancelOrderRequest + ) -> types.AckResponse | GrvtError: + resp = await self._post(True, self.td_rpc + "/full/v1/cancel_trigger_order", req) + if resp.get("code"): + return GrvtError(**resp) + return from_dict(types.AckResponse, resp, Config(cast=[Enum])) + + async def cancel_all_trigger_orders_v1( + self, req: types.ApiCancelAllOrdersRequest + ) -> types.AckResponse | GrvtError: + resp = await self._post( + True, self.td_rpc + "/full/v1/cancel_all_trigger_orders", req + ) + if resp.get("code"): + return GrvtError(**resp) + return from_dict(types.AckResponse, resp, Config(cast=[Enum])) + + async def dedust_position_v1( + self, req: types.ApiDedustPositionRequest + ) -> types.ApiDedustPositionResponse | GrvtError: + resp = await self._post(True, self.td_rpc + "/full/v1/dedust_position", req) + if resp.get("code"): + return GrvtError(**resp) + return from_dict(types.ApiDedustPositionResponse, resp, Config(cast=[Enum])) + async def fill_history_v1( self, req: types.ApiFillHistoryRequest ) -> types.ApiFillHistoryResponse | GrvtError: @@ -297,3 +323,11 @@ async def set_initial_leverage_v1( if resp.get("code"): return GrvtError(**resp) return from_dict(types.ApiSetInitialLeverageResponse, resp, Config(cast=[Enum])) + + async def cancel_on_disconnect_v1( + self, req: types.ApiCancelOnDisconnectRequest + ) -> types.AckResponse | GrvtError: + resp = await self._post(True, self.td_rpc + "/full/v1/cancel_on_disconnect", req) + if resp.get("code"): + return GrvtError(**resp) + return from_dict(types.AckResponse, resp, Config(cast=[Enum])) diff --git a/artifacts/pysdk/grvt_raw_sync.py b/artifacts/pysdk/grvt_raw_sync.py index ea8c3f8..7743a30 100644 --- a/artifacts/pysdk/grvt_raw_sync.py +++ b/artifacts/pysdk/grvt_raw_sync.py @@ -150,6 +150,30 @@ def pre_order_check_v1( return GrvtError(**resp) return from_dict(types.ApiPreOrderCheckResponse, resp, Config(cast=[Enum])) + def cancel_trigger_order_v1( + self, req: types.ApiCancelOrderRequest + ) -> types.AckResponse | GrvtError: + resp = self._post(True, self.td_rpc + "/full/v1/cancel_trigger_order", req) + if resp.get("code"): + return GrvtError(**resp) + return from_dict(types.AckResponse, resp, Config(cast=[Enum])) + + def cancel_all_trigger_orders_v1( + self, req: types.ApiCancelAllOrdersRequest + ) -> types.AckResponse | GrvtError: + resp = self._post(True, self.td_rpc + "/full/v1/cancel_all_trigger_orders", req) + if resp.get("code"): + return GrvtError(**resp) + return from_dict(types.AckResponse, resp, Config(cast=[Enum])) + + def dedust_position_v1( + self, req: types.ApiDedustPositionRequest + ) -> types.ApiDedustPositionResponse | GrvtError: + resp = self._post(True, self.td_rpc + "/full/v1/dedust_position", req) + if resp.get("code"): + return GrvtError(**resp) + return from_dict(types.ApiDedustPositionResponse, resp, Config(cast=[Enum])) + def fill_history_v1( self, req: types.ApiFillHistoryRequest ) -> types.ApiFillHistoryResponse | GrvtError: @@ -283,3 +307,11 @@ def set_initial_leverage_v1( if resp.get("code"): return GrvtError(**resp) return from_dict(types.ApiSetInitialLeverageResponse, resp, Config(cast=[Enum])) + + def cancel_on_disconnect_v1( + self, req: types.ApiCancelOnDisconnectRequest + ) -> types.AckResponse | GrvtError: + resp = self._post(True, self.td_rpc + "/full/v1/cancel_on_disconnect", req) + if resp.get("code"): + return GrvtError(**resp) + return from_dict(types.AckResponse, resp, Config(cast=[Enum])) diff --git a/artifacts/pysdk/grvt_raw_types.py b/artifacts/pysdk/grvt_raw_types.py index a2e4b2a..57c58cb 100644 --- a/artifacts/pysdk/grvt_raw_types.py +++ b/artifacts/pysdk/grvt_raw_types.py @@ -15,6 +15,20 @@ class BridgeType(Enum): XY = "XY" +class BrokerTag(Enum): + # CoinRoutes + COIN_ROUTES = "COIN_ROUTES" + # Alertatron + ALERTATRON = "ALERTATRON" + # Origami + ORIGAMI = "ORIGAMI" + + +class CancelStatus(Enum): + # Cancellation has expired because corresponding order had not arrived within the defined time-to-live window. + EXPIRED = "EXPIRED" + + class CandlestickInterval(Enum): # 1 minute CI_1_M = "CI_1_M" @@ -94,6 +108,81 @@ class Currency(Enum): KPEPE = "KPEPE" # the TON token TON = "TON" + # the XRP token + XRP = "XRP" + # the XLM token + XLM = "XLM" + # the WLD token + WLD = "WLD" + # the WIF token + WIF = "WIF" + # the VIRTUAL token + VIRTUAL = "VIRTUAL" + # the TRUMP token + TRUMP = "TRUMP" + # the SUI token + SUI = "SUI" + # the 1000SHIB token + KSHIB = "KSHIB" + # the POPCAT token + POPCAT = "POPCAT" + # the PENGU token + PENGU = "PENGU" + # the LINK token + LINK = "LINK" + # the 1000BONK token + KBONK = "KBONK" + # the JUP token + JUP = "JUP" + # the FARTCOIN token + FARTCOIN = "FARTCOIN" + # the ENA token + ENA = "ENA" + # the DOGE token + DOGE = "DOGE" + # the AIXBT token + AIXBT = "AIXBT" + # the AI16Z token + AI_16_Z = "AI_16_Z" + # the ADA token + ADA = "ADA" + # the AAVE token + AAVE = "AAVE" + # the BERA token + BERA = "BERA" + # the VINE token + VINE = "VINE" + # the PENDLE token + PENDLE = "PENDLE" + # the UXLINK token + UXLINK = "UXLINK" + + +class EpochBadgeType(Enum): + # Champion + CHAMPION = "CHAMPION" + # Legend + LEGEND = "LEGEND" + # Veteran + VETERAN = "VETERAN" + # Elite + ELITE = "ELITE" + # Master + MASTER = "MASTER" + # Expert + EXPERT = "EXPERT" + # Warrior + WARRIOR = "WARRIOR" + # Sergeant + SERGEANT = "SERGEANT" + # Ranger + RANGER = "RANGER" + # Challenger + CHALLENGER = "CHALLENGER" + # Apprentice + APPRENTICE = "APPRENTICE" + # Rookie + ROOKIE = "ROOKIE" class InstrumentSettlementPeriod(Enum): @@ -186,6 +275,8 @@ class OrderRejectReason(Enum): EXCEED_MAX_SIGNATURE_EXPIRATION = "EXCEED_MAX_SIGNATURE_EXPIRATION" # the market order has a limit price set MARKET_ORDER_WITH_LIMIT_PRICE = "MARKET_ORDER_WITH_LIMIT_PRICE" + # client cancel on disconnect triggered + CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED = "CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED" class OrderStatus(Enum): @@ -201,6 +292,21 @@ class OrderStatus(Enum): CANCELLED = "CANCELLED" +class RewardEpochStatus(Enum): + # Past + PAST = "PAST" + # Current + CURRENT = "CURRENT" + # Future + FUTURE = "FUTURE" + + +class RewardProgramType(Enum): + ECOSYSTEM = "ECOSYSTEM" + TRADER = "TRADER" + LP = "LP" + + class SubAccountTradeInterval(Enum): # 1 month SAT_1_MO = "SAT_1_MO" @@ -238,6 +344,40 @@ class TransferType(Enum): FAST_ARB_WITHDRAWAL = "FAST_ARB_WITHDRAWAL" +class TriggerBy(Enum): + """ + Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order. + + Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions. + + + """ + + # no trigger condition + UNSPECIFIED = "UNSPECIFIED" + # INDEX - Order is activated when the index price reaches the trigger price + INDEX = "INDEX" + # LAST - Order is activated when the last trade price reaches the trigger price + LAST = "LAST" + + +class TriggerType(Enum): + """ + Defines the type of trigger order used in trading, such as Take Profit or Stop Loss. + + Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions. + + + """ + + # Not a trigger order. The order executes normally without any trigger conditions. + UNSPECIFIED = "UNSPECIFIED" + # Take Profit Order - Executes when the price reaches a specified level to secure profits. + TAKE_PROFIT = "TAKE_PROFIT" + # Stop Loss Order - Executes when the price reaches a specified level to limit losses. + STOP_LOSS = "STOP_LOSS" + + class Venue(Enum): # the trade is cleared on the orderbook venue ORDERBOOK = "ORDERBOOK" @@ -395,6 +535,8 @@ class Fill: client_order_id: str # The address (public key) of the wallet signing the payload signer: str + # Specifies the broker who brokered the order + broker: BrokerTag | None = None @dataclass @@ -1160,6 +1302,8 @@ class WSSubscribeParams: stream: str # The list of feeds to subscribe to selectors: list[str] + # Whether to use the global sequence number for the stream + use_global_sequence_number: bool | None = None @dataclass @@ -1179,6 +1323,8 @@ class WSSubscribeResult: num_snapshots: list[int] # The first sequence number to expect for each subscribed feed. Returned in same order as `subs` first_sequence_number: list[str] + # 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` + latest_sequence_number: list[str] @dataclass @@ -1187,6 +1333,8 @@ class WSUnsubscribeParams: stream: str # The list of feeds to unsubscribe from selectors: list[str] + # Whether to use the global sequence number for the stream + use_global_sequence_number: bool | None = None @dataclass @@ -1239,6 +1387,8 @@ class WSSubscribeResponseV1Legacy: num_snapshots: list[int] # The first sequence number to expect for each subscribed feed. Returned in same order as `subs` first_sequence_number: list[str] + # 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` + latest_sequence_number: list[str] """ Optional Field which is used to match the response by the client. If not passed, this field will not be returned @@ -1285,6 +1435,8 @@ class WSOrderbookLevelsFeedDataV1: 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 + prev_sequence_number: str @dataclass @@ -1318,6 +1470,8 @@ class WSMiniTickerFeedDataV1: 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 + prev_sequence_number: str @dataclass @@ -1351,6 +1505,8 @@ class WSTickerFeedDataV1: sequence_number: str # A ticker matching the request filter feed: Ticker + # The previous sequence number that determines global message order within the specific stream + prev_sequence_number: str @dataclass @@ -1377,6 +1533,8 @@ class WSTradeFeedDataV1: 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 + prev_sequence_number: str @dataclass @@ -1404,6 +1562,8 @@ class WSCandlestickFeedDataV1: 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 + prev_sequence_number: str @dataclass @@ -1485,6 +1645,44 @@ class Signature: nonce: int +@dataclass +class TPSLOrderMetadata: + """ + Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders. + + ### Fields: + - **triggerBy**: Defines the price type that activates the order (e.g., index price). + - **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision. + + + """ + + # Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order + trigger_by: TriggerBy + # The Trigger Price of the order, expressed in `9` decimals. + trigger_price: str + + +@dataclass +class TriggerOrderMetadata: + """ + 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. + + + """ + + # Type of the trigger order. eg: Take Profit, Stop Loss, etc + trigger_type: TriggerType + """ + Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders. + + + """ + tpsl: TPSLOrderMetadata + + @dataclass class OrderMetadata: """ @@ -1504,8 +1702,12 @@ 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 + # Specifies the broker who brokered the order + broker: BrokerTag | None = None @dataclass @@ -1603,6 +1805,16 @@ class ApiCancelOrderRequest: order_id: str | None = None # Cancel the order with this `client_order_id` client_order_id: str | None = None + """ + Specifies the time-to-live (in milliseconds) for this cancellation. + During this period, any order creation with a matching `client_order_id` will also be cancelled. + This mechanism helps mitigate time-of-flight issues where cancellations might arrive before the corresponding orders. + Hence, cancellation by `order_id` ignores this field as the exchange can only assign `order_id`s to already-processed order creations. + The duration cannot be negative, is rounded down to the nearest 100ms (e.g., `670` -> `600`, `30` -> `0`) and capped at 5 seconds (i.e., `5000`). + Value of `0` or omission disables the TTL mechanism, so only orders already existing in matcher state at request time will be searched. + + """ + time_to_live_ms: str | None = None @dataclass @@ -1784,6 +1996,48 @@ class ApiPreDepositCheckResponse: currency: Currency +@dataclass +class ApiDedustPositionRequest: + # The order to create + order: Order + + +@dataclass +class ApiDedustPositionResponse: + # The created order + result: Order + + +@dataclass +class ApiCancelOnDisconnectRequest: + """ + Auto-Cancel All Open Orders when the countdown time hits zero. + + Market Maker inputs a countdown time parameter in milliseconds (e.g. 120000 for 120s) rounded down to the smallest second follows the following logic: + - Market Maker initially entered a value between 0 -> 1000, which is rounded to 0: will result in termination of their COD + - Market Maker initially entered a value between 1001 -> 300_000, which is rounded to the nearest second: will result in refresh of their COD + - Market Maker initially entered a value bigger than 300_000, which will result in error (upper bound) + Market Maker will send a heartbeat message by calling the endpoint at specific intervals (ex. every 30 seconds) to the server to refresh the count down. + + If the server does not receive a heartbeat message within the countdown time, it will cancel all open orders for the specified Sub Account ID. + """ + + # The subaccount ID cancelling the orders for + sub_account_id: str + """ + Countdown time in milliseconds (ex. 120000 for 120s). + + 0 to disable the timer. + + Does not accept negative values. + + Minimum acceptable value is 1,000. + + Maximum acceptable value is 300,000 + """ + countdown_time: str | None = None + + @dataclass class ApiGetUserEcosystemPointRequest: # The off chain account id @@ -1834,6 +2088,14 @@ class ApiGetEcosystemLeaderboardRequest: limit: int +@dataclass +class ApiGetVerifiedEcosystemLeaderboardRequest: + # Start time of the epoch + calculate_from: str + # Completed KYC before this time + completed_kyc_before: str + + @dataclass class ApiGetEcosystemLeaderboardResponse: # The list of ecosystem points @@ -1926,6 +2188,112 @@ class ApiFindEcosystemLeaderboardResponse: users: list[EcosystemLeaderboardUser] +@dataclass +class QueryEpochBadgeRequest: + # The off chain account id to get referral stats + account_id: str | None = None + # The numerical epoch index + epoch: int | None = None + # The type of the reward program + type: RewardProgramType | None = None + # The limit to query for. Defaults to 500; Max 1000 + limit: int | None = None + # The cursor to indicate when to start the query from + cursor: str | None = None + + +@dataclass +class EpochBadge: + # The off chain account id + account_id: str + # The account ID + main_account_id: str + # The type of the reward program + type: RewardProgramType + # The epoch number + epoch: int + # The start time of the epoch + epoch_start_time: str + # The end time of the epoch + epoch_end_time: str + # The type of the badge + badge: EpochBadgeType + # The distributed badges + distributed_badges: list[EpochBadgeType] + # Total point + total_point: str + # Rank + rank: int + # The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process + claimed_at: str + + +@dataclass +class QueryEpochBadgeResponse: + # The list of epoch badges + result: list[EpochBadge] + # The cursor to indicate when to start the query from + next: str + + +@dataclass +class QueryEpochBadgePointDistributionRequest: + # The type of the reward program + type: RewardProgramType + # The numerical epoch index + epoch: int | None = None + + +@dataclass +class EpochBadgePointDistribution: + # The type of the badge + badge: EpochBadgeType + # The epoch number + epoch: int + # The type of the reward program + type: RewardProgramType + # The minimum point to get the badge + min_point: str + # The maximum point to get the badge + max_point: str + # The minimum rank to get the badge + min_rank: int + # The maximum rank to get the badge + max_rank: int + # The total point to get the badge + total_point: str + # The number of users to get the badge + count: int + + +@dataclass +class QueryEpochBadgePointDistributionResponse: + # The list of epoch badges + result: list[EpochBadgePointDistribution] + + +@dataclass +class ApiGetListEpochBadgeResponse: + # The list of epoch badges + result: list[EpochBadge] + + +@dataclass +class GetClaimableEcosystemBadgeResponse: + # The epoch badge + badge: EpochBadge + # Whether the badge is claimable + is_claimable: bool + # The time when the badge is claimable + claimable_until: str + + +@dataclass +class ClaimEcosystemBadgeResponse: + # The epoch badge + badge: EpochBadge + + @dataclass class ApiGetListFlatReferralRequest: # The off chain referrer account id to get all flat referrals @@ -1954,6 +2322,12 @@ class FlatReferral: referrer_main_account_id: str # The account is a business account or not is_business: bool + # The account is KYC verified or not + is_kyc_completed: bool + # The KYC completed time + kyc_completed_at: str + # The KYC type, can be 'individual' or 'business' + kyc_type: str @dataclass @@ -2056,14 +2430,14 @@ class ApiGetLatestLPSnapshotResponse: @dataclass class ApiGetLPLeaderboardRequest: - # Start time of the epoch - phase - start_interval: str # The number of accounts to return limit: int # The kind filter to apply kind: Kind # The base filter to apply base: Currency + # The epoch to filter + epoch: int | None = None @dataclass @@ -2074,8 +2448,8 @@ class ApiGetLPLeaderboardResponse: @dataclass class ApiGetLPPointRequest: - # Optional. Start time of the epoch - phase - start_interval: str | None = None + # The epoch to filter + epoch: int | None = None # Optional. The kind filter to apply kind: Kind | None = None # Optional. The base filter to apply @@ -2118,6 +2492,26 @@ class ApiGetLPInfoResponse: bid_fast_market_multiplier: int +@dataclass +class RewardEpochInfo: + # The epoch number + epoch: int + # The start time of the epoch + epoch_start_time: str + # The end time of the epoch + epoch_end_time: str + # The status of the epoch + status: RewardEpochStatus + + +@dataclass +class ApiGetListRewardEpochResponse: + # The list of epoch for ecosystem reward + ecosystem_epochs: list[RewardEpochInfo] + # The list of epoch for trader reward and lp reward + trading_epochs: list[RewardEpochInfo] + + @dataclass class ApiSubAccountTradeAggregationRequest: # Optional. The limit of the number of results to return @@ -2231,6 +2625,8 @@ class WSOrderFeedDataV1: 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 + prev_sequence_number: str @dataclass @@ -2269,6 +2665,8 @@ class WSOrderStateFeedDataV1: sequence_number: str # The Order State Feed feed: OrderStateFeed + # The previous sequence number that determines global message order within the specific stream + prev_sequence_number: str @dataclass @@ -2295,6 +2693,8 @@ class WSPositionsFeedDataV1: 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 + prev_sequence_number: str @dataclass @@ -2321,6 +2721,8 @@ class WSFillFeedDataV1: 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 + prev_sequence_number: str @dataclass @@ -2338,7 +2740,9 @@ class WSTransferFeedSelectorV1: @dataclass -class Transfer: +class TransferHistory: + # The transaction ID of the transfer + tx_id: str # The account to transfer from from_account_id: str # The subaccount to transfer from (0 if transferring from main account) @@ -2353,6 +2757,8 @@ class Transfer: num_tokens: str # The signature of the transfer signature: Signature + # The timestamp of the transfer in unix nanoseconds + event_time: str # The type of transfer transfer_type: TransferType # The metadata of the transfer @@ -2367,8 +2773,10 @@ class WSTransferFeedDataV1: selector: str # A running sequence number that determines global message order within the specific stream sequence_number: str - # The Transfer object - feed: Transfer + # The transfer history matching the requested filters + feed: TransferHistory + # The previous sequence number that determines global message order within the specific stream + prev_sequence_number: str @dataclass @@ -2404,6 +2812,8 @@ class WSDepositFeedDataV1: sequence_number: str # The Deposit object feed: Deposit + # The previous sequence number that determines global message order within the specific stream + prev_sequence_number: str @dataclass @@ -2441,6 +2851,53 @@ class WSWithdrawalFeedDataV1: sequence_number: str # The Withdrawal object feed: Withdrawal + # The previous sequence number that determines global message order within the specific stream + prev_sequence_number: str + + +@dataclass +class CancelStatusFeed: + # The subaccount ID that requested the cancellation + sub_account_id: str + # A unique identifier for the active order within a subaccount, specified by the client + client_order_id: str + # A unique 128-bit identifier for the order, deterministically generated within the GRVT backend + order_id: str + # The user-provided reason for cancelling the order + reason: OrderRejectReason + # Status of the cancellation attempt + cancel_status: CancelStatus + # [Filled by GRVT Backend] Time at which the cancellation status was updated by GRVT in unix nanoseconds + update_time: str | None = None + + +@dataclass +class WSCancelFeedDataV1: + # Stream name + stream: str + # Primary selector + selector: str + # A running sequence number that determines global message order within the specific stream + 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 + prev_sequence_number: str + + +@dataclass +class WSCancelFeedSelectorV1: + """ + Subscribes to a feed of time-to-live expiry events for order cancellations requested by a given subaccount. + **This stream presently only provides expiry updates for cancel-order requests set with a valid TTL value**. + Successful order cancellations will reflect as updates published to the (order-state stream)[https://api-docs.grvt.io/trading_streams/#order-state]. + _A future release will expand the functionality of this stream to provide more general status updates on order cancellation requests._ + Each Order can be uniquely identified by its `client_order_id`. + + """ + + # The subaccount ID to filter by + sub_account_id: str @dataclass @@ -2569,32 +3026,8 @@ class ApiTransferHistoryRequest: limit: int | None = None # The cursor to indicate when to start the next query from cursor: str | None = None - - -@dataclass -class TransferHistory: - # The transaction ID of the transfer - tx_id: str - # The account to transfer from - from_account_id: str - # The subaccount to transfer from (0 if transferring from main account) - from_sub_account_id: str - # The account to deposit into - to_account_id: str - # The subaccount to transfer to (0 if transferring to main account) - to_sub_account_id: str - # The token currency to transfer - currency: Currency - # The number of tokens to transfer - num_tokens: str - # The signature of the transfer - signature: Signature - # The timestamp of the transfer in unix nanoseconds - event_time: str - # The type of transfer - transfer_type: TransferType - # The metadata of the transfer - transfer_metadata: str + # The transaction ID to query for + tx_id: str | None = None @dataclass diff --git a/src/codegen/apidocs/apidocs.py b/src/codegen/apidocs/apidocs.py index 3c1b781..1d475a9 100644 --- a/src/codegen/apidocs/apidocs.py +++ b/src/codegen/apidocs/apidocs.py @@ -1,3 +1,4 @@ +from dataclasses import fields import re from copy import deepcopy from typing import cast @@ -21,10 +22,48 @@ ["JSONRPCRequest", "ApiCreateOrderRequest", "Order", "order_id"], ] -IGNORE_RPCS: list[str] = [] +IGNORE_STRUCTS = [ + "ApiDedustPositionRequest", + "ApiDedustPositionResponse", + "TriggerOrderMetadata", + "TriggerBy", +] + +# 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", + "trigger", + "broker", +] + +IGNORE_RPCS: list[str] = ["RPCDedustPositionV1"] IGNORE_ENUM_VALUES: dict[str, list[str]] = { - # "Currency": ["SOL", "ARB", "BNB", "ZK", "POL", "OP", "ATOM", "KPEPE", "TON"], + "Currency": [ + "XLM", + "WLD", + "WIF", + "VIRTUAL", + "KSHIB", + "POPCAT", + "PENGU", + "LINK", + "KBONK", + "JUP", + "ENA", + "DOGE", + "AIXBT", + "AI_16_Z", + "ADA", + "AAVE", + "VINE", + "PENDLE", + "UXLINK", + ], + "BrokerTag": ["*"], + "TriggerType": ["*"], } @@ -615,11 +654,21 @@ def write_struct_example_with_generics( field_path = field_path + [struct.name] + fields_skipped = 0 + for i, field in enumerate(struct.fields): + if ( + field.name in IGNORE_FIELDS_ANY_PATH + or field_path + [field.name] in IGNORE_FIELD_PATHS + ): + fields_skipped += 1 for i, field in enumerate(struct.fields): - if field_path + [field.name] in IGNORE_FIELD_PATHS: + if ( + field.name in IGNORE_FIELDS_ANY_PATH + or field_path + [field.name] in IGNORE_FIELD_PATHS + ): continue fn = field.name if is_full else field.lite_name - comma = "," if i < len(struct.fields) - 1 else "" + comma = "," if i < len(struct.fields) - fields_skipped - 1 else "" md.write(f'"{fn}": ') for _ in range(field.array_depth): md.write("[") @@ -658,6 +707,8 @@ def import_struct_schema(md: MarkdownWriter, struct: Struct) -> None: def write_struct_schema( ctx: CodegenCtx, md: MarkdownWriter, struct: Struct, is_root: bool ) -> None: + if struct.name in IGNORE_STRUCTS or struct.name in IGNORE_FIELDS_ANY_PATH: + return # Header path = "/../../schemas/" + inflection.underscore(struct.name).lower() if is_root: @@ -704,6 +755,11 @@ def write_enum_schema(md: MarkdownWriter, enum: Enum, is_root: bool = False) -> write_comment(md, enum.comment) if enum.name in IGNORE_ENUM_VALUES: + if ( + len(IGNORE_ENUM_VALUES[enum.name]) == 1 + and IGNORE_ENUM_VALUES[enum.name][0] == "*" + ): + return enum.values = [ value for value in enum.values diff --git a/src/codegen/apispec.json b/src/codegen/apispec.json index 1a02398..867533c 100644 --- a/src/codegen/apispec.json +++ b/src/codegen/apispec.json @@ -755,6 +755,11 @@ "message": "Signer does not have trade permission", "status": 403 }, + { + "code": 1009, + "message": "We are temporarily deactivating this API endpoint, please try again later", + "status": 503 + }, { "code": 2000, "message": "Order signature is from an unauthorized signer", @@ -910,10 +915,30 @@ "message": "Pre-order check failed", "status": 400 }, + { + "code": 2083, + "message": "Order Fill would result in exceeding maximum position size under current configurable leverage tier", + "status": 400 + }, { "code": 2090, "message": "Max open orders exceeded", "status": 429 + }, + { + "code": 2110, + "message": "Invalid trigger by", + "status": 400 + }, + { + "code": 2111, + "message": "Unsupported trigger by", + "status": 400 + }, + { + "code": 2112, + "message": "Invalid trigger order", + "status": 400 } ] }, @@ -956,6 +981,16 @@ "message": "Your IP has not been whitelisted for access", "status": 401 }, + { + "code": 2300, + "message": "Order cancel time-to-live settings currently disabled.", + "status": 400 + }, + { + "code": 2301, + "message": "Order cancel time-to-live exceeds maximum allowed value.", + "status": 400 + }, { "code": 3021, "message": "Either order ID or client order ID must be supplied", @@ -1179,13 +1214,13 @@ ] }, { - "namespace": "Execution", - "name": "RPCFillHistoryV1", + "namespace": "Order", + "name": "RPCCancelTriggerOrderV1", "version": 1, - "route": "/fill_history", + "route": "/cancel_trigger_order", "auth_required": true, - "request": "ApiFillHistoryRequest", - "response": "ApiFillHistoryResponse", + "request": "ApiCancelOrderRequest", + "response": "AckResponse", "on_request_errors": [ { "code": 1000, @@ -1216,17 +1251,22 @@ "code": 1008, "message": "Your IP has not been whitelisted for access", "status": 401 + }, + { + "code": 3021, + "message": "Either order ID or client order ID must be supplied", + "status": 400 } ] }, { - "namespace": "Execution", - "name": "RPCPositionsV1", + "namespace": "Order", + "name": "RPCCancelAllTriggerOrdersV1", "version": 1, - "route": "/positions", + "route": "/cancel_all_trigger_orders", "auth_required": true, - "request": "ApiPositionsRequest", - "response": "ApiPositionsResponse", + "request": "ApiCancelAllOrdersRequest", + "response": "AckResponse", "on_request_errors": [ { "code": 1000, @@ -1261,13 +1301,13 @@ ] }, { - "namespace": "Execution", - "name": "RPCFundingPaymentHistoryV1", + "namespace": "Position", + "name": "RPCDedustPositionV1", "version": 1, - "route": "/funding_payment_history", + "route": "/dedust_position", "auth_required": true, - "request": "ApiFundingPaymentHistoryRequest", - "response": "ApiFundingPaymentHistoryResponse", + "request": "ApiDedustPositionRequest", + "response": "ApiDedustPositionResponse", "on_request_errors": [ { "code": 1000, @@ -1289,6 +1329,16 @@ "message": "Request could not be processed due to malformed syntax", "status": 400 }, + { + "code": 1004, + "message": "Data Not Found", + "status": 404 + }, + { + "code": 1005, + "message": "Unknown Error", + "status": 500 + }, { "code": 1006, "message": "You have surpassed the allocated rate limit for your tier", @@ -1298,17 +1348,197 @@ "code": 1008, "message": "Your IP has not been whitelisted for access", "status": 401 + }, + { + "code": 1400, + "message": "Signer does not have trade permission", + "status": 403 + }, + { + "code": 1009, + "message": "We are temporarily deactivating this API endpoint, please try again later", + "status": 503 + }, + { + "code": 2000, + "message": "Order signature is from an unauthorized signer", + "status": 403 + }, + { + "code": 2001, + "message": "Order signature has expired", + "status": 403 + }, + { + "code": 2002, + "message": "Order signature does not match payload", + "status": 403 + }, + { + "code": 2003, + "message": "Order sub account does not match logged in user", + "status": 403 + }, + { + "code": 2004, + "message": "Order signature is from an expired session key", + "status": 403 + }, + { + "code": 2010, + "message": "Order ID should be empty when creating an order", + "status": 400 + }, + { + "code": 2011, + "message": "Client Order ID should be supplied when creating an order", + "status": 400 + }, + { + "code": 2012, + "message": "Client Order ID overlaps with existing active order", + "status": 400 + }, + { + "code": 2030, + "message": "Orderbook Orders must have a TimeInForce of GTT/IOC/FOK", + "status": 400 + }, + { + "code": 2031, + "message": "RFQ Orders must have a TimeInForce of GTT/AON/IOC/FOK", + "status": 400 + }, + { + "code": 2032, + "message": "Post Only can only be set to true for GTT/AON orders", + "status": 400 + }, + { + "code": 2020, + "message": "Market Order must always be supplied without a limit price", + "status": 400 + }, + { + "code": 2021, + "message": "Limit Order must always be supplied with a limit price", + "status": 400 + }, + { + "code": 2040, + "message": "Order must contain at least one leg", + "status": 400 + }, + { + "code": 2041, + "message": "Order Legs must be sorted by Derivative.Instrument/Underlying/BaseCurrency/Expiration/StrikePrice", + "status": 400 + }, + { + "code": 2042, + "message": "Orderbook Orders must contain only one leg", + "status": 400 + }, + { + "code": 2050, + "message": "Order state must be empty upon creation", + "status": 400 + }, + { + "code": 2051, + "message": "Order execution metadata must be empty upon creation", + "status": 400 + }, + { + "code": 2060, + "message": "Order Legs contain one or more inactive derivative", + "status": 400 + }, + { + "code": 2061, + "message": "Unsupported Instrument Requested", + "status": 400 + }, + { + "code": 2063, + "message": "Order size smaller than min block size in block trade venue", + "status": 400 + }, + { + "code": 2064, + "message": "Invalid limit price tick", + "status": 400 + }, + { + "code": 2200, + "message": "Order size should exactly tally to the dust portion (i.e., smaller than minimum size) of a position", + "status": 400 + }, + { + "code": 2201, + "message": "Order level should match or beat mark price", + "status": 400 + }, + { + "code": 2202, + "message": "Cannot dedust position via a market order", + "status": 400 + }, + { + "code": 2203, + "message": "Cannot dedust position via a post-only order", + "status": 400 + }, + { + "code": 2204, + "message": "Can only dedust position via a fill-or-kill order", + "status": 400 + }, + { + "code": 2205, + "message": "Can only dedust position via a reduce-only order", + "status": 400 + }, + { + "code": 2206, + "message": "Attempting to trade the wrong buy/sell direction for dedusting position", + "status": 400 + }, + { + "code": 2070, + "message": "Liquidation Order is not supported", + "status": 400 + }, + { + "code": 2080, + "message": "Insufficient margin to create order", + "status": 400 + }, + { + "code": 2081, + "message": "Order Fill would result in exceeding maximum position size", + "status": 400 + }, + { + "code": 2082, + "message": "Pre-order check failed", + "status": 400 + }, + { + "code": 2090, + "message": "Max open orders exceeded", + "status": 429 } ] }, { - "namespace": "Transfer", - "name": "RPCDepositHistoryV1", + "namespace": "Execution", + "name": "RPCFillHistoryV1", "version": 1, - "route": "/deposit_history", + "route": "/fill_history", "auth_required": true, - "request": "ApiDepositHistoryRequest", - "response": "ApiDepositHistoryResponse", + "request": "ApiFillHistoryRequest", + "response": "ApiFillHistoryResponse", "on_request_errors": [ { "code": 1000, @@ -1343,13 +1573,13 @@ ] }, { - "namespace": "Transfer", - "name": "RPCTransferV1", + "namespace": "Execution", + "name": "RPCPositionsV1", "version": 1, - "route": "/transfer", + "route": "/positions", "auth_required": true, - "request": "ApiTransferRequest", - "response": "AckResponse", + "request": "ApiPositionsRequest", + "response": "ApiPositionsResponse", "on_request_errors": [ { "code": 1000, @@ -1384,13 +1614,13 @@ ] }, { - "namespace": "Transfer", - "name": "RPCTransferHistoryV1", + "namespace": "Execution", + "name": "RPCFundingPaymentHistoryV1", "version": 1, - "route": "/transfer_history", + "route": "/funding_payment_history", "auth_required": true, - "request": "ApiTransferHistoryRequest", - "response": "ApiTransferHistoryResponse", + "request": "ApiFundingPaymentHistoryRequest", + "response": "ApiFundingPaymentHistoryResponse", "on_request_errors": [ { "code": 1000, @@ -1426,13 +1656,166 @@ }, { "namespace": "Transfer", - "name": "RPCWithdrawalV1", + "name": "RPCDepositHistoryV1", "version": 1, - "route": "/withdrawal", + "route": "/deposit_history", "auth_required": true, - "request": "ApiWithdrawalRequest", - "response": "AckResponse", - "on_request_errors": [ + "request": "ApiDepositHistoryRequest", + "response": "ApiDepositHistoryResponse", + "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": "Transfer", + "name": "RPCTransferV1", + "version": 1, + "route": "/transfer", + "auth_required": true, + "request": "ApiTransferRequest", + "response": "AckResponse", + "on_request_errors": [ + { + "code": 1000, + "message": "You need to authenticate prior to using this functionality", + "status": 401 + }, + { + "code": 1001, + "message": "You are not authorized to access this functionality", + "status": 403 + }, + { + "code": 1002, + "message": "Internal Server Error", + "status": 500 + }, + { + "code": 1003, + "message": "Request could not be processed due to malformed syntax", + "status": 400 + }, + { + "code": 1006, + "message": "You have surpassed the allocated rate limit for your tier", + "status": 429 + }, + { + "code": 1008, + "message": "Your IP has not been whitelisted for access", + "status": 401 + }, + { + "code": 5000, + "message": "Transfer Metadata does not match the expected structure.", + "status": 400 + }, + { + "code": 5001, + "message": "Transfer Provider does not match the expected provider.", + "status": 400 + }, + { + "code": 5002, + "message": "Direction of the transfer does not match the expected direction.", + "status": 400 + }, + { + "code": 5003, + "message": "Endpoint account ID is invalid.", + "status": 400 + }, + { + "code": 5004, + "message": "Funding account does not exist in our system.", + "status": 400 + }, + { + "code": 5005, + "message": "Invalid ChainID for the transfer request.", + "status": 400 + } + ] + }, + { + "namespace": "Transfer", + "name": "RPCTransferHistoryV1", + "version": 1, + "route": "/transfer_history", + "auth_required": true, + "request": "ApiTransferHistoryRequest", + "response": "ApiTransferHistoryResponse", + "on_request_errors": [ + { + "code": 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": "Transfer", + "name": "RPCWithdrawalV1", + "version": 1, + "route": "/withdrawal", + "auth_required": true, + "request": "ApiWithdrawalRequest", + "response": "AckResponse", + "on_request_errors": [ { "code": 1000, "message": "You need to authenticate prior to using this functionality", @@ -1808,6 +2191,52 @@ "status": 400 } ] + }, + { + "namespace": "Order", + "name": "RPCCancelOnDisconnectV1", + "version": 1, + "route": "/cancel_on_disconnect", + "auth_required": true, + "request": "ApiCancelOnDisconnectRequest", + "response": "AckResponse", + "on_request_errors": [ + { + "code": 1000, + "message": "You need to authenticate prior to using this functionality", + "status": 401 + }, + { + "code": 1001, + "message": "You are not authorized to access this functionality", + "status": 403 + }, + { + "code": 1002, + "message": "Internal Server Error", + "status": 500 + }, + { + "code": 1003, + "message": "Request could not be processed due to malformed syntax", + "status": 400 + }, + { + "code": 1006, + "message": "You have surpassed the allocated rate limit for your tier", + "status": 429 + }, + { + "code": 1008, + "message": "Your IP has not been whitelisted for access", + "status": 401 + }, + { + "code": 6000, + "message": "Countdown time is bigger than 300s supported", + "status": 400 + } + ] } ], "streams": [ @@ -1921,6 +2350,61 @@ } ] }, + { + "namespace": "Order", + "name": "StreamCancelStatusV1", + "channel": "v1.cancel", + "auth_required": true, + "feed_selector": "WSCancelFeedSelectorV1", + "feed": "WSCancelFeedDataV1", + "on_subscribe_errors": [ + { + "code": 1000, + "message": "You need to authenticate prior to using this functionality", + "status": 401 + }, + { + "code": 1001, + "message": "You are not authorized to access this functionality", + "status": 403 + }, + { + "code": 1002, + "message": "Internal Server Error", + "status": 500 + }, + { + "code": 1008, + "message": "Your IP has not been whitelisted for access", + "status": 401 + }, + { + "code": 1101, + "message": "Feed Format must be in the format of \u003cprimary\u003e@\u003csecondary\u003e", + "status": 400 + }, + { + "code": 1102, + "message": "Wrong number of primary selectors", + "status": 400 + }, + { + "code": 1103, + "message": "Wrong number of secondary selectors", + "status": 400 + }, + { + "code": 3000, + "message": "Instrument is invalid", + "status": 400 + }, + { + "code": 3020, + "message": "Sub account ID must be an uint64 integer", + "status": 400 + } + ] + }, { "namespace": "Execution", "name": "StreamFillV1", @@ -2807,6 +3291,19 @@ "comment": [ "The address (public key) of the wallet signing the payload" ] + }, + { + "name": "broker", + "lite_name": "b", + "semantic_type": "BrokerTag", + "json_type": "BrokerTag", + "index": 21, + "array_depth": 0, + "optional": true, + "default": "", + "comment": [ + "Specifies the broker who brokered the order" + ] } ], "comment": [] @@ -6046,6 +6543,20 @@ "comment": [ "The list of feeds to subscribe to" ] + }, + { + "name": "use_global_sequence_number", + "lite_name": "ug", + "semantic_type": "bool", + "json_type": "boolean", + "index": 2, + "array_depth": 0, + "optional": true, + "default": "false", + "example": "true", + "comment": [ + "Whether to use the global sequence number for the stream" + ] } ], "comment": [ @@ -6121,6 +6632,19 @@ "comment": [ "The first sequence number to expect for each subscribed feed. Returned in same order as `subs`" ] + }, + { + "name": "latest_sequence_number", + "lite_name": "ls", + "semantic_type": "uint64", + "json_type": "string", + "index": 5, + "array_depth": 1, + "optional": false, + "example": "872634875", + "comment": [ + "The sequence number of the most recent message in the stream. Next received sequence number must be larger than this one. Returned in same order as `subs`" + ] } ], "comment": [ @@ -6157,6 +6681,20 @@ "comment": [ "The list of feeds to unsubscribe from" ] + }, + { + "name": "use_global_sequence_number", + "lite_name": "ug", + "semantic_type": "bool", + "json_type": "boolean", + "index": 2, + "array_depth": 0, + "optional": true, + "default": "false", + "example": "true", + "comment": [ + "Whether to use the global sequence number for the stream" + ] } ], "comment": [ @@ -6360,6 +6898,19 @@ "comment": [ "The first sequence number to expect for each subscribed feed. Returned in same order as `subs`" ] + }, + { + "name": "latest_sequence_number", + "lite_name": "ls", + "semantic_type": "uint64", + "json_type": "string", + "index": 6, + "array_depth": 1, + "optional": false, + "example": "872634875", + "comment": [ + "The sequence number of the most recent message in the stream. Next received sequence number must be larger than this one. Returned in same order as `subs`" + ] } ], "comment": [ @@ -6486,6 +7037,19 @@ "comment": [ "An orderbook levels object matching the request filter" ] + }, + { + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'872634875'", + "comment": [ + "The previous sequence number that determines global message order within the specific stream" + ] } ], "comment": [] @@ -6588,6 +7152,19 @@ "comment": [ "A mini ticker matching the request filter" ] + }, + { + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'872634875'", + "comment": [ + "The previous sequence number that determines global message order within the specific stream" + ] } ], "comment": [] @@ -6690,6 +7267,19 @@ "comment": [ "A ticker matching the request filter" ] + }, + { + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'872634875'", + "comment": [ + "The previous sequence number that determines global message order within the specific stream" + ] } ], "comment": [] @@ -6804,6 +7394,19 @@ "comment": [ "A public trade matching the request filter" ] + }, + { + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'872634875'", + "comment": [ + "The previous sequence number that determines global message order within the specific stream" + ] } ], "comment": [] @@ -6912,6 +7515,19 @@ "comment": [ "A candlestick entry matching the request filters" ] + }, + { + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'872634875'", + "comment": [ + "The previous sequence number that determines global message order within the specific stream" + ] } ], "comment": [] @@ -7199,6 +7815,85 @@ ], "comment": [] }, + { + "name": "TPSLOrderMetadata", + "is_root": false, + "fields": [ + { + "name": "trigger_by", + "lite_name": "tb", + "semantic_type": "TriggerBy", + "json_type": "TriggerBy", + "index": 0, + "array_depth": 0, + "optional": false, + "comment": [ + "Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order" + ] + }, + { + "name": "trigger_price", + "lite_name": "tp", + "semantic_type": "string", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": false, + "example": "'65038.10'", + "comment": [ + "The Trigger Price of the order, expressed in `9` decimals." + ] + } + ], + "comment": [ + "Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.", + "", + "### Fields:", + "- **triggerBy**: Defines the price type that activates the order (e.g., index price).", + "- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.", + "", + "" + ] + }, + { + "name": "TriggerOrderMetadata", + "is_root": false, + "fields": [ + { + "name": "trigger_type", + "lite_name": "tt", + "semantic_type": "TriggerType", + "json_type": "TriggerType", + "index": 0, + "array_depth": 0, + "optional": false, + "comment": [ + "Type of the trigger order. eg: Take Profit, Stop Loss, etc" + ] + }, + { + "name": "tpsl", + "lite_name": "t", + "semantic_type": "TPSLOrderMetadata", + "json_type": "TPSLOrderMetadata", + "index": 1, + "array_depth": 0, + "optional": false, + "comment": [ + "Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.", + "", + "" + ] + } + ], + "comment": [ + "Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).", + "", + "Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.", + "", + "" + ] + }, { "name": "OrderMetadata", "is_root": false, @@ -7237,6 +7932,31 @@ "comment": [ "[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds" ] + }, + { + "name": "trigger", + "lite_name": "t", + "semantic_type": "TriggerOrderMetadata", + "json_type": "TriggerOrderMetadata", + "index": 2, + "array_depth": 0, + "optional": false, + "comment": [ + "Trigger fields are used to support any type of trigger order such as TP/SL" + ] + }, + { + "name": "broker", + "lite_name": "b", + "semantic_type": "BrokerTag", + "json_type": "BrokerTag", + "index": 3, + "array_depth": 0, + "optional": true, + "default": "", + "comment": [ + "Specifies the broker who brokered the order" + ] } ], "comment": [ @@ -7574,6 +8294,26 @@ "comment": [ "Cancel the order with this `client_order_id`" ] + }, + { + "name": "time_to_live_ms", + "lite_name": "tt", + "semantic_type": "uint64", + "json_type": "string", + "index": 3, + "array_depth": 0, + "optional": true, + "default": "500", + "example": "`500`", + "comment": [ + "Specifies the time-to-live (in milliseconds) for this cancellation.", + "During this period, any order creation with a matching `client_order_id` will also be cancelled.", + "This mechanism helps mitigate time-of-flight issues where cancellations might arrive before the corresponding orders.", + "Hence, cancellation by `order_id` ignores this field as the exchange can only assign `order_id`s to already-processed order creations.", + "The duration cannot be negative, is rounded down to the nearest 100ms (e.g., `670` -\u003e `600`, `30` -\u003e `0`) and capped at 5 seconds (i.e., `5000`).", + "Value of `0` or omission disables the TTL mechanism, so only orders already existing in matcher state at request time will be searched.", + "" + ] } ], "comment": [ @@ -8343,6 +9083,98 @@ ], "comment": [] }, + { + "name": "ApiDedustPositionRequest", + "is_root": true, + "fields": [ + { + "name": "order", + "lite_name": "o", + "semantic_type": "Order", + "json_type": "Order", + "index": 0, + "array_depth": 0, + "optional": false, + "comment": [ + "The order to create" + ] + } + ], + "comment": [ + "Remove dust position (i.e., order quantity smaller than minimum required increment) on an account, by matching the specified order against GRVT directly. Limit price should always be better than mark price." + ] + }, + { + "name": "ApiDedustPositionResponse", + "is_root": true, + "fields": [ + { + "name": "result", + "lite_name": "r", + "semantic_type": "Order", + "json_type": "Order", + "index": 0, + "array_depth": 0, + "optional": false, + "comment": [ + "The created order" + ] + } + ], + "comment": [] + }, + { + "name": "ApiCancelOnDisconnectRequest", + "is_root": true, + "fields": [ + { + "name": "sub_account_id", + "lite_name": "sa", + "semantic_type": "uint64", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": false, + "example": "'$GRVT_SUB_ACCOUNT_ID'", + "comment": [ + "The subaccount ID cancelling the orders for" + ] + }, + { + "name": "countdown_time", + "lite_name": "ct", + "semantic_type": "uint64", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": true, + "default": "1000", + "example": "300", + "comment": [ + "Countdown time in milliseconds (ex. 120000 for 120s).", + "", + "0 to disable the timer.", + "", + "Does not accept negative values.", + "", + "Minimum acceptable value is 1,000.", + "", + "Maximum acceptable value is 300,000" + ] + } + ], + "comment": [ + "Auto-Cancel All Open Orders when the countdown time hits zero.", + "", + "Market Maker inputs a countdown time parameter in milliseconds (e.g. 120000 for 120s) rounded down to the smallest second follows the following logic:", + " - Market Maker initially entered a value between 0 -\u003e 1000, which is rounded to 0: will result in termination of their COD", + " - Market Maker initially entered a value between 1001 -\u003e 300_000, which is rounded to the nearest second: will result in refresh of their COD", + " - Market Maker initially entered a value bigger than 300_000, which will result in error (upper bound)", + "Market Maker will send a heartbeat message by calling the endpoint at specific intervals (ex. every 30 seconds) to the server to refresh the count down.", + "", + "If the server does not receive a heartbeat message within the countdown time, it will cancel all open orders for the specified Sub Account ID." + ] + }, { "name": "ApiGetUserEcosystemPointRequest", "is_root": true, @@ -8594,26 +9426,59 @@ "comment": [] }, { - "name": "ApiGetEcosystemLeaderboardResponse", + "name": "ApiGetVerifiedEcosystemLeaderboardRequest", "is_root": true, "fields": [ { - "name": "points", - "lite_name": "p", - "semantic_type": "EcosystemPoint", - "json_type": "EcosystemPoint", + "name": "calculate_from", + "lite_name": "cf", + "semantic_type": "timestamp", + "json_type": "string", "index": 0, - "array_depth": 1, + "array_depth": 0, "optional": false, + "example": "'1697788800000000000'", "comment": [ - "The list of ecosystem points" + "Start time of the epoch" + ] + }, + { + "name": "completed_kyc_before", + "lite_name": "ck", + "semantic_type": "timestamp", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": false, + "example": "'1697788800000000000'", + "comment": [ + "Completed KYC before this time" ] } ], "comment": [] }, { - "name": "ApiGetEcosystemReferralStatResponse", + "name": "ApiGetEcosystemLeaderboardResponse", + "is_root": true, + "fields": [ + { + "name": "points", + "lite_name": "p", + "semantic_type": "EcosystemPoint", + "json_type": "EcosystemPoint", + "index": 0, + "array_depth": 1, + "optional": false, + "comment": [ + "The list of ecosystem points" + ] + } + ], + "comment": [] + }, + { + "name": "ApiGetEcosystemReferralStatResponse", "is_root": true, "fields": [ { @@ -9035,70 +9900,86 @@ "comment": [] }, { - "name": "ApiGetListFlatReferralRequest", + "name": "QueryEpochBadgeRequest", "is_root": true, "fields": [ { - "name": "referral_id", - "lite_name": "ri", + "name": "account_id", + "lite_name": "ai", "semantic_type": "string", "json_type": "string", "index": 0, "array_depth": 0, - "optional": false, + "optional": true, + "default": "'all'", "example": "'ACC_1234567890'", "comment": [ - "The off chain referrer account id to get all flat referrals" + "The off chain account id to get referral stats" ] }, { - "name": "start_time", - "lite_name": "st", - "semantic_type": "timestamp", - "json_type": "string", + "name": "epoch", + "lite_name": "e", + "semantic_type": "int32", + "json_type": "integer", "index": 1, "array_depth": 0, "optional": true, - "default": "0", - "example": "'1697788800000000000'", + "default": "'all'", + "example": "'1'", "comment": [ - "Optional. Start time in unix nanoseconds" + "The numerical epoch index" ] }, { - "name": "end_time", - "lite_name": "et", - "semantic_type": "timestamp", - "json_type": "string", + "name": "type", + "lite_name": "t", + "semantic_type": "RewardProgramType", + "json_type": "RewardProgramType", "index": 2, "array_depth": 0, "optional": true, - "default": "now()", - "example": "'1697788800000000000'", + "default": "'all'", + "example": "'trader'", "comment": [ - "Optional. End time in unix nanoseconds" + "The type of the reward program" ] }, { - "name": "account_id", - "lite_name": "ai", + "name": "limit", + "lite_name": "l", + "semantic_type": "uint32", + "json_type": "integer", + "index": 3, + "array_depth": 0, + "optional": true, + "default": "'500'", + "example": "'500'", + "comment": [ + "The limit to query for. Defaults to 500; Max 1000" + ] + }, + { + "name": "cursor", + "lite_name": "c", "semantic_type": "string", "json_type": "string", - "index": 3, + "index": 4, "array_depth": 0, - "optional": false, - "example": "'ACC_1234567890'", + "optional": true, + "default": "'all'", + "example": "'Qw0918='", "comment": [ - "The off chain account id to get all user's referrers" + "The cursor to indicate when to start the query from" ] } ], "comment": [ - "startTime and endTime are optional parameters. The semantics of these parameters are as follows:\u003cul\u003e" + "Query list of epoch badges" ] }, { - "name": "FlatReferral", + "name": "EpochBadge", "is_root": false, "fields": [ { @@ -9109,688 +9990,689 @@ "index": 0, "array_depth": 0, "optional": false, - "example": "'ACC_1234567890'", + "example": "'ACC:10001'", "comment": [ "The off chain account id" ] }, { - "name": "referrer_id", - "lite_name": "ri", - "semantic_type": "string", + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "address", "json_type": "string", "index": 1, "array_depth": 0, "optional": false, - "example": "'ACC_1234567890'", + "example": "'$GRVT_ACCOUNT_ID'", "comment": [ - "The off chain referrer account id" + "The account ID" ] }, { - "name": "referrer_level", - "lite_name": "rl", - "semantic_type": "uint8", - "json_type": "integer", + "name": "type", + "lite_name": "t", + "semantic_type": "RewardProgramType", + "json_type": "RewardProgramType", "index": 2, "array_depth": 0, "optional": false, - "example": "'1'", + "example": "'trader'", "comment": [ - "The referrer level; 1: direct referrer, 2: indirect referrer" + "The type of the reward program" ] }, { - "name": "account_create_time", - "lite_name": "ac", - "semantic_type": "timestamp", - "json_type": "string", + "name": "epoch", + "lite_name": "e", + "semantic_type": "int32", + "json_type": "integer", "index": 3, "array_depth": 0, "optional": false, - "example": "'1697788800000000000'", + "example": "'2'", "comment": [ - "The account creation time" + "The epoch number" ] }, { - "name": "main_account_id", - "lite_name": "ma", - "semantic_type": "uint256", + "name": "epoch_start_time", + "lite_name": "es", + "semantic_type": "timestamp", "json_type": "string", "index": 4, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", + "example": "'1726790400000000000'", "comment": [ - "The main account id" + "The start time of the epoch" ] }, { - "name": "referrer_main_account_id", - "lite_name": "rm", - "semantic_type": "uint256", + "name": "epoch_end_time", + "lite_name": "ee", + "semantic_type": "timestamp", "json_type": "string", "index": 5, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", + "example": "'1726790400000000000'", "comment": [ - "The referrer main account id" + "The end time of the epoch" ] }, { - "name": "is_business", - "lite_name": "ib", - "semantic_type": "bool", - "json_type": "boolean", + "name": "badge", + "lite_name": "b", + "semantic_type": "EpochBadgeType", + "json_type": "EpochBadgeType", "index": 6, "array_depth": 0, "optional": false, - "example": "true", + "example": "'champion'", "comment": [ - "The account is a business account or not" + "The type of the badge" ] - } - ], - "comment": [ - "" - ] - }, - { - "name": "ApiGetListFlatReferralResponse", - "is_root": true, - "fields": [ + }, { - "name": "flat_referrals", - "lite_name": "fr", - "semantic_type": "FlatReferral", - "json_type": "FlatReferral", - "index": 0, + "name": "distributed_badges", + "lite_name": "db", + "semantic_type": "EpochBadgeType", + "json_type": "EpochBadgeType", + "index": 7, "array_depth": 1, "optional": false, "comment": [ - "The list of flat referrals" + "The distributed badges" + ] + }, + { + "name": "total_point", + "lite_name": "tp", + "semantic_type": "uint64", + "json_type": "string", + "index": 8, + "array_depth": 0, + "optional": false, + "example": "'10000101000203040506'", + "comment": [ + "Total point" + ] + }, + { + "name": "rank", + "lite_name": "r", + "semantic_type": "uint32", + "json_type": "integer", + "index": 9, + "array_depth": 0, + "optional": false, + "example": "'10000101000203040506'", + "comment": [ + "Rank" + ] + }, + { + "name": "claimed_at", + "lite_name": "ca", + "semantic_type": "timestamp", + "json_type": "string", + "index": 10, + "array_depth": 0, + "optional": false, + "example": "'1726790400000000000'", + "comment": [ + "The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process" ] } ], "comment": [] }, { - "name": "ApiQueryFlatReferralStatRequest", + "name": "QueryEpochBadgeResponse", "is_root": true, "fields": [ { - "name": "account_id", - "lite_name": "ai", + "name": "result", + "lite_name": "r", + "semantic_type": "EpochBadge", + "json_type": "EpochBadge", + "index": 0, + "array_depth": 1, + "optional": false, + "comment": [ + "The list of epoch badges" + ] + }, + { + "name": "next", + "lite_name": "n", "semantic_type": "string", "json_type": "string", - "index": 0, + "index": 1, "array_depth": 0, "optional": false, - "example": "'ACC_1234567890'", + "example": "'Qw0918='", "comment": [ - "The off chain account id to get referral stats" + "The cursor to indicate when to start the query from" ] } ], - "comment": [ - "Query flat referral stats" - ] + "comment": [] }, { - "name": "ApiQueryFlatReferralStatResponse", + "name": "QueryEpochBadgePointDistributionRequest", "is_root": true, "fields": [ { - "name": "direct_invite_count", - "lite_name": "di", - "semantic_type": "uint32", + "name": "epoch", + "lite_name": "e", + "semantic_type": "int32", "json_type": "integer", "index": 0, "array_depth": 0, - "optional": false, - "example": "'52'", + "optional": true, + "default": "'all'", + "example": "'1'", "comment": [ - "Direct invite count" + "The numerical epoch index" ] }, { - "name": "indirect_invite_count", - "lite_name": "ii", - "semantic_type": "uint32", - "json_type": "integer", + "name": "type", + "lite_name": "t", + "semantic_type": "RewardProgramType", + "json_type": "RewardProgramType", "index": 1, "array_depth": 0, "optional": false, - "example": "'52'", + "example": "'trader'", "comment": [ - "Indirect invite count" + "The type of the reward program" ] } ], - "comment": [] + "comment": [ + "Query list of epoch badges" + ] }, { - "name": "LPSnapshot", - "is_root": true, + "name": "EpochBadgePointDistribution", + "is_root": false, "fields": [ { - "name": "main_account_id", - "lite_name": "ma", - "semantic_type": "uint256", - "json_type": "string", + "name": "badge", + "lite_name": "b", + "semantic_type": "EpochBadgeType", + "json_type": "EpochBadgeType", "index": 0, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", "comment": [ - "The main account id" + "The type of the badge" ] }, { - "name": "lp_asset", - "lite_name": "la", - "semantic_type": "uint64", - "json_type": "string", + "name": "epoch", + "lite_name": "e", + "semantic_type": "int32", + "json_type": "integer", "index": 1, "array_depth": 0, "optional": false, - "example": "'10000'", "comment": [ - "The LP Asset" + "The epoch number" ] }, { - "name": "underlying_multiplier", - "lite_name": "um", - "semantic_type": "uint64", - "json_type": "string", + "name": "type", + "lite_name": "t", + "semantic_type": "RewardProgramType", + "json_type": "RewardProgramType", "index": 2, "array_depth": 0, "optional": false, - "example": "'52'", "comment": [ - "Underlying multiplier" + "The type of the reward program" ] }, { - "name": "maker_trading_volume", - "lite_name": "mt", - "semantic_type": "uint256", - "json_type": "string", + "name": "min_point", + "lite_name": "mp", + "semantic_type": "uint64", + "json_type": "string", "index": 3, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", "comment": [ - "Maker trading volume" + "The minimum point to get the badge" ] }, { - "name": "bid_fast_market_multiplier", - "lite_name": "bf", - "semantic_type": "uint32", - "json_type": "integer", + "name": "max_point", + "lite_name": "mp1", + "semantic_type": "uint64", + "json_type": "string", "index": 4, "array_depth": 0, "optional": false, - "example": "'52'", "comment": [ - "Fast market multiplier" + "The maximum point to get the badge" ] }, { - "name": "ask_fast_market_multiplier", - "lite_name": "af", + "name": "min_rank", + "lite_name": "mr", "semantic_type": "uint32", "json_type": "integer", "index": 5, "array_depth": 0, "optional": false, - "example": "'52'", "comment": [ - "Fast market multiplier" + "The minimum rank to get the badge" ] }, { - "name": "liquidity_score", - "lite_name": "ls", - "semantic_type": "uint256", - "json_type": "string", + "name": "max_rank", + "lite_name": "mr1", + "semantic_type": "uint32", + "json_type": "integer", "index": 6, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", "comment": [ - "Liquidity score" + "The maximum rank to get the badge" ] }, { - "name": "calculate_at", - "lite_name": "ca", - "semantic_type": "timestamp", + "name": "total_point", + "lite_name": "tp", + "semantic_type": "uint64", "json_type": "string", "index": 7, "array_depth": 0, "optional": false, - "example": "'1726790400000000000'", "comment": [ - "The time when the snapshot was calculated" + "The total point to get the badge" + ] + }, + { + "name": "count", + "lite_name": "c", + "semantic_type": "uint32", + "json_type": "integer", + "index": 8, + "array_depth": 0, + "optional": false, + "comment": [ + "The number of users to get the badge" ] } ], "comment": [] }, { - "name": "ApproximateLPSnapshot", + "name": "QueryEpochBadgePointDistributionResponse", "is_root": true, "fields": [ { - "name": "main_account_id", - "lite_name": "ma", - "semantic_type": "uint256", - "json_type": "string", + "name": "result", + "lite_name": "r", + "semantic_type": "EpochBadgePointDistribution", + "json_type": "EpochBadgePointDistribution", "index": 0, - "array_depth": 0, - "optional": false, - "example": "'10000101000203040506'", - "comment": [ - "The main account id" - ] - }, - { - "name": "underlying_multiplier", - "lite_name": "um", - "semantic_type": "uint64", - "json_type": "string", - "index": 1, - "array_depth": 0, + "array_depth": 1, "optional": false, - "example": "'52'", "comment": [ - "Underlying multiplier" + "The list of epoch badges" ] - }, + } + ], + "comment": [] + }, + { + "name": "ApiGetListEpochBadgeResponse", + "is_root": true, + "fields": [ { - "name": "market_share_multiplier", - "lite_name": "ms", - "semantic_type": "uint64", - "json_type": "string", - "index": 2, - "array_depth": 0, + "name": "result", + "lite_name": "r", + "semantic_type": "EpochBadge", + "json_type": "EpochBadge", + "index": 0, + "array_depth": 1, "optional": false, - "example": "'10000101000203040506'", "comment": [ - "Market share multiplier" + "The list of epoch badges" ] - }, + } + ], + "comment": [] + }, + { + "name": "GetClaimableEcosystemBadgeResponse", + "is_root": true, + "fields": [ { - "name": "bid_fast_market_multiplier", - "lite_name": "bf", - "semantic_type": "uint32", - "json_type": "integer", - "index": 3, + "name": "badge", + "lite_name": "b", + "semantic_type": "EpochBadge", + "json_type": "EpochBadge", + "index": 0, "array_depth": 0, "optional": false, - "example": "'52'", "comment": [ - "Fast market multiplier" + "The epoch badge" ] }, { - "name": "ask_fast_market_multiplier", - "lite_name": "af", - "semantic_type": "uint32", - "json_type": "integer", - "index": 4, + "name": "is_claimable", + "lite_name": "ic", + "semantic_type": "bool", + "json_type": "boolean", + "index": 1, "array_depth": 0, "optional": false, - "example": "'52'", "comment": [ - "Fast market multiplier" + "Whether the badge is claimable" ] }, { - "name": "liquidity_score", - "lite_name": "ls", - "semantic_type": "uint256", + "name": "claimable_until", + "lite_name": "cu", + "semantic_type": "timestamp", "json_type": "string", - "index": 5, + "index": 2, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", "comment": [ - "Liquidity score" + "The time when the badge is claimable" ] - }, + } + ], + "comment": [] + }, + { + "name": "ClaimEcosystemBadgeResponse", + "is_root": true, + "fields": [ { - "name": "calculate_at", - "lite_name": "ca", - "semantic_type": "timestamp", - "json_type": "string", - "index": 6, + "name": "badge", + "lite_name": "b", + "semantic_type": "EpochBadge", + "json_type": "EpochBadge", + "index": 0, "array_depth": 0, "optional": false, - "example": "'1726790400000000000'", "comment": [ - "The time when the snapshot was calculated" + "The epoch badge" ] } ], "comment": [] }, { - "name": "LPPoint", + "name": "ApiGetListFlatReferralRequest", "is_root": true, "fields": [ { - "name": "main_account_id", - "lite_name": "ma", - "semantic_type": "uint256", + "name": "referral_id", + "lite_name": "ri", + "semantic_type": "string", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", + "example": "'ACC_1234567890'", "comment": [ - "The main account id" + "The off chain referrer account id to get all flat referrals" ] }, { - "name": "liquidity_score", - "lite_name": "ls", - "semantic_type": "uint256", + "name": "start_time", + "lite_name": "st", + "semantic_type": "timestamp", "json_type": "string", "index": 1, "array_depth": 0, - "optional": false, - "example": "'10000101000203040506'", + "optional": true, + "default": "0", + "example": "'1697788800000000000'", "comment": [ - "Liquidity score" + "Optional. Start time in unix nanoseconds" ] }, { - "name": "rank", - "lite_name": "r", - "semantic_type": "uint32", - "json_type": "integer", + "name": "end_time", + "lite_name": "et", + "semantic_type": "timestamp", + "json_type": "string", "index": 2, "array_depth": 0, + "optional": true, + "default": "now()", + "example": "'1697788800000000000'", + "comment": [ + "Optional. End time in unix nanoseconds" + ] + }, + { + "name": "account_id", + "lite_name": "ai", + "semantic_type": "string", + "json_type": "string", + "index": 3, + "array_depth": 0, "optional": false, - "example": "'52'", + "example": "'ACC_1234567890'", "comment": [ - "The rank of user in the LP leaderboard" + "The off chain account id to get all user's referrers" ] } ], - "comment": [] + "comment": [ + "startTime and endTime are optional parameters. The semantics of these parameters are as follows:\u003cul\u003e" + ] }, { - "name": "ApproximateLPPoint", - "is_root": true, + "name": "FlatReferral", + "is_root": false, "fields": [ { - "name": "off_chain_account_id", - "lite_name": "oc", + "name": "account_id", + "lite_name": "ai", "semantic_type": "string", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'ACC:123456'", + "example": "'ACC_1234567890'", "comment": [ "The off chain account id" ] }, { - "name": "liquidity_score", - "lite_name": "ls", - "semantic_type": "uint256", + "name": "referrer_id", + "lite_name": "ri", + "semantic_type": "string", "json_type": "string", "index": 1, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", + "example": "'ACC_1234567890'", "comment": [ - "Liquidity score" + "The off chain referrer account id" ] }, { - "name": "rank", - "lite_name": "r", - "semantic_type": "uint32", + "name": "referrer_level", + "lite_name": "rl", + "semantic_type": "uint8", "json_type": "integer", "index": 2, "array_depth": 0, "optional": false, - "example": "'52'", + "example": "'1'", "comment": [ - "The rank of user in the LP leaderboard" + "The referrer level; 1: direct referrer, 2: indirect referrer" ] - } - ], - "comment": [] - }, - { - "name": "QueryGetLatestLPSnapshotResponse", - "is_root": true, - "fields": [ + }, { - "name": "snapshot", - "lite_name": "s", - "semantic_type": "LPSnapshot", - "json_type": "LPSnapshot", - "index": 0, + "name": "account_create_time", + "lite_name": "ac", + "semantic_type": "timestamp", + "json_type": "string", + "index": 3, "array_depth": 0, "optional": false, + "example": "'1697788800000000000'", "comment": [ - "The latest LP snapshot" - ] - } - ], - "comment": [] - }, - { - "name": "ApiGetLatestLPSnapshotRequest", - "is_root": true, - "fields": [ - { - "name": "kind", - "lite_name": "k", - "semantic_type": "Kind", - "json_type": "Kind", - "index": 0, - "array_depth": 0, - "optional": true, - "default": "0", - "example": "'PERPETUAL'", - "comment": [ - "The kind filter to apply" + "The account creation time" ] }, { - "name": "base", - "lite_name": "b", - "semantic_type": "Currency", - "json_type": "Currency", - "index": 1, + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "uint256", + "json_type": "string", + "index": 4, "array_depth": 0, - "optional": true, - "default": "0", - "example": "'BTC'", + "optional": false, + "example": "'10000101000203040506'", "comment": [ - "The base filter to apply" + "The main account id" ] - } - ], - "comment": [] - }, - { - "name": "ApiGetLatestLPSnapshotResponse", - "is_root": true, - "fields": [ + }, { - "name": "snapshot", - "lite_name": "s", - "semantic_type": "ApproximateLPSnapshot", - "json_type": "ApproximateLPSnapshot", - "index": 0, + "name": "referrer_main_account_id", + "lite_name": "rm", + "semantic_type": "uint256", + "json_type": "string", + "index": 5, "array_depth": 0, "optional": false, + "example": "'10000101000203040506'", "comment": [ - "The latest LP snapshot" + "The referrer main account id" ] - } - ], - "comment": [] - }, - { - "name": "ApiGetLPLeaderboardRequest", - "is_root": true, - "fields": [ + }, { - "name": "start_interval", - "lite_name": "si", - "semantic_type": "timestamp", - "json_type": "string", - "index": 0, + "name": "is_business", + "lite_name": "ib", + "semantic_type": "bool", + "json_type": "boolean", + "index": 6, "array_depth": 0, "optional": false, - "example": "'1726790400000000000'", + "example": "true", "comment": [ - "Start time of the epoch - phase" + "The account is a business account or not" ] }, { - "name": "limit", - "lite_name": "l", - "semantic_type": "uint32", - "json_type": "integer", - "index": 1, + "name": "is_kyc_completed", + "lite_name": "ik", + "semantic_type": "bool", + "json_type": "boolean", + "index": 7, "array_depth": 0, "optional": false, - "example": "100", + "example": "true", "comment": [ - "The number of accounts to return" + "The account is KYC verified or not" ] }, { - "name": "kind", - "lite_name": "k", - "semantic_type": "Kind", - "json_type": "Kind", - "index": 2, + "name": "kyc_completed_at", + "lite_name": "kc", + "semantic_type": "timestamp", + "json_type": "string", + "index": 8, "array_depth": 0, "optional": false, - "example": "'PERPETUAL'", + "example": "'1697788800000000000'", "comment": [ - "The kind filter to apply" + "The KYC completed time" ] }, { - "name": "base", - "lite_name": "b", - "semantic_type": "Currency", - "json_type": "Currency", - "index": 3, + "name": "kyc_type", + "lite_name": "kt", + "semantic_type": "string", + "json_type": "string", + "index": 9, "array_depth": 0, "optional": false, - "example": "'BTC'", + "example": "'individual'", "comment": [ - "The base filter to apply" + "The KYC type, can be 'individual' or 'business'" ] } ], - "comment": [] + "comment": [ + "" + ] }, { - "name": "ApiGetLPLeaderboardResponse", + "name": "ApiGetListFlatReferralResponse", "is_root": true, "fields": [ { - "name": "points", - "lite_name": "p", - "semantic_type": "ApproximateLPPoint", - "json_type": "ApproximateLPPoint", + "name": "flat_referrals", + "lite_name": "fr", + "semantic_type": "FlatReferral", + "json_type": "FlatReferral", "index": 0, "array_depth": 1, "optional": false, "comment": [ - "The list of LP points" + "The list of flat referrals" ] } ], "comment": [] }, { - "name": "ApiGetLPPointRequest", + "name": "ApiQueryFlatReferralStatRequest", "is_root": true, "fields": [ { - "name": "start_interval", - "lite_name": "si", - "semantic_type": "timestamp", + "name": "account_id", + "lite_name": "ai", + "semantic_type": "string", "json_type": "string", "index": 0, "array_depth": 0, - "optional": true, - "default": "0", - "example": "'1726790400000000000'", - "comment": [ - "Optional. Start time of the epoch - phase" - ] - }, - { - "name": "kind", - "lite_name": "k", - "semantic_type": "Kind", - "json_type": "Kind", - "index": 1, - "array_depth": 0, - "optional": true, - "default": "0", - "example": "'PERPETUAL'", - "comment": [ - "Optional. The kind filter to apply" - ] - }, - { - "name": "base", - "lite_name": "b", - "semantic_type": "Currency", - "json_type": "Currency", - "index": 2, - "array_depth": 0, - "optional": true, - "default": "0", - "example": "'BTC'", + "optional": false, + "example": "'ACC_1234567890'", "comment": [ - "Optional. The base filter to apply" + "The off chain account id to get referral stats" ] } ], - "comment": [] + "comment": [ + "Query flat referral stats" + ] }, { - "name": "ApiGetLPPointResponse", + "name": "ApiQueryFlatReferralStatResponse", "is_root": true, "fields": [ { - "name": "point", - "lite_name": "p", - "semantic_type": "LPPoint", - "json_type": "LPPoint", + "name": "direct_invite_count", + "lite_name": "di", + "semantic_type": "uint32", + "json_type": "integer", "index": 0, "array_depth": 0, "optional": false, + "example": "'52'", "comment": [ - "LP points of user" + "Direct invite count" ] }, { - "name": "maker_count", - "lite_name": "mc", + "name": "indirect_invite_count", + "lite_name": "ii", "semantic_type": "uint32", "json_type": "integer", "index": 1, @@ -9798,1327 +10680,1247 @@ "optional": false, "example": "'52'", "comment": [ - "The number of maker" + "Indirect invite count" ] } ], "comment": [] }, { - "name": "ApiGetLPInfoRequest", + "name": "LPSnapshot", "is_root": true, "fields": [ { - "name": "kind", - "lite_name": "k", - "semantic_type": "Kind", - "json_type": "Kind", + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "uint256", + "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'PERPETUAL'", + "example": "'10000101000203040506'", "comment": [ - "The kind filter to apply" + "The main account id" ] }, { - "name": "base", - "lite_name": "b", - "semantic_type": "Currency", - "json_type": "Currency", + "name": "lp_asset", + "lite_name": "la", + "semantic_type": "uint64", + "json_type": "string", "index": 1, "array_depth": 0, - "optional": true, - "default": "0", - "example": "'BTC'", - "comment": [ - "The base filter to apply" - ] - } - ], - "comment": [] - }, - { - "name": "ApiGetLPInfoResponse", - "is_root": true, - "fields": [ - { - "name": "is_lp_maker", - "lite_name": "il", - "semantic_type": "bool", - "json_type": "boolean", - "index": 0, - "array_depth": 0, "optional": false, - "example": "true", + "example": "'10000'", "comment": [ - "Is LP maker" + "The LP Asset" ] }, { - "name": "spread_score_value_multiplier", - "lite_name": "ss", + "name": "underlying_multiplier", + "lite_name": "um", "semantic_type": "uint64", "json_type": "string", - "index": 1, + "index": 2, "array_depth": 0, "optional": false, - "example": "'1000000000'", + "example": "'52'", "comment": [ - "The spread score value multiplier" + "Underlying multiplier" ] }, { - "name": "depth_score_value_multiplier", - "lite_name": "ds", - "semantic_type": "uint64", + "name": "maker_trading_volume", + "lite_name": "mt", + "semantic_type": "uint256", "json_type": "string", - "index": 2, + "index": 3, "array_depth": 0, "optional": false, - "example": "'1000000000'", + "example": "'10000101000203040506'", "comment": [ - "The depth score value multiplier" - ] - }, - { - "name": "market_share_value_multiplier", - "lite_name": "ms", - "semantic_type": "uint64", - "json_type": "string", - "index": 3, - "array_depth": 0, - "optional": false, - "example": "'1000000000'", - "comment": [ - "The market share value multiplier" + "Maker trading volume" ] }, { - "name": "underlying_multiplier", - "lite_name": "um", - "semantic_type": "uint64", - "json_type": "string", + "name": "bid_fast_market_multiplier", + "lite_name": "bf", + "semantic_type": "uint32", + "json_type": "integer", "index": 4, "array_depth": 0, "optional": false, "example": "'52'", "comment": [ - "Underlying multiplier" + "Fast market multiplier" ] }, { - "name": "market_share_multiplier", - "lite_name": "ms1", - "semantic_type": "uint64", - "json_type": "string", + "name": "ask_fast_market_multiplier", + "lite_name": "af", + "semantic_type": "uint32", + "json_type": "integer", "index": 5, "array_depth": 0, "optional": false, - "example": "'1000000000'", + "example": "'52'", "comment": [ - "The market share multiplier, equal to the maker trading volume in the past 2 hours" + "Fast market multiplier" ] }, { - "name": "ask_fast_market_multiplier", - "lite_name": "af", - "semantic_type": "uint32", - "json_type": "integer", + "name": "liquidity_score", + "lite_name": "ls", + "semantic_type": "uint256", + "json_type": "string", "index": 6, "array_depth": 0, "optional": false, - "example": "'100'", + "example": "'10000101000203040506'", "comment": [ - "Ask fast market multiplier" + "Liquidity score" ] }, { - "name": "bid_fast_market_multiplier", - "lite_name": "bf", - "semantic_type": "uint32", - "json_type": "integer", + "name": "calculate_at", + "lite_name": "ca", + "semantic_type": "timestamp", + "json_type": "string", "index": 7, "array_depth": 0, "optional": false, - "example": "'100'", + "example": "'1726790400000000000'", "comment": [ - "Bid fast market multiplier" + "The time when the snapshot was calculated" ] } ], "comment": [] }, { - "name": "ApiSubAccountTradeAggregationRequest", + "name": "ApproximateLPSnapshot", "is_root": true, "fields": [ { - "name": "limit", - "lite_name": "l", - "semantic_type": "int32", - "json_type": "integer", + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "uint256", + "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "100", + "example": "'10000101000203040506'", "comment": [ - "Optional. The limit of the number of results to return" + "The main account id" ] }, { - "name": "interval", - "lite_name": "i", - "semantic_type": "SubAccountTradeInterval", - "json_type": "SubAccountTradeInterval", + "name": "underlying_multiplier", + "lite_name": "um", + "semantic_type": "uint64", + "json_type": "string", "index": 1, "array_depth": 0, "optional": false, + "example": "'52'", "comment": [ - "The interval of each sub account trade" + "Underlying multiplier" ] }, { - "name": "sub_account_i_ds", - "lite_name": "sa", + "name": "market_share_multiplier", + "lite_name": "ms", "semantic_type": "uint64", "json_type": "string", "index": 2, - "array_depth": 1, + "array_depth": 0, "optional": false, - "example": "['2376', '5821']", + "example": "'10000101000203040506'", "comment": [ - "The list of sub account ids to query" + "Market share multiplier" ] }, { - "name": "start_interval", - "lite_name": "si", - "semantic_type": "timestamp", - "json_type": "string", + "name": "bid_fast_market_multiplier", + "lite_name": "bf", + "semantic_type": "uint32", + "json_type": "integer", "index": 3, "array_depth": 0, "optional": false, - "example": "'1697788800000000000'", + "example": "'52'", "comment": [ - "Optional. The starting time in unix nanoseconds of a specific interval to query" + "Fast market multiplier" ] }, { - "name": "start_time", - "lite_name": "st", - "semantic_type": "timestamp", - "json_type": "string", + "name": "ask_fast_market_multiplier", + "lite_name": "af", + "semantic_type": "uint32", + "json_type": "integer", "index": 4, "array_depth": 0, - "optional": true, - "default": "0", - "example": "'1697788800000000000'", + "optional": false, + "example": "'52'", "comment": [ - "Optional. Start time in unix nanoseconds" + "Fast market multiplier" ] }, { - "name": "end_time", - "lite_name": "et", - "semantic_type": "timestamp", + "name": "liquidity_score", + "lite_name": "ls", + "semantic_type": "uint256", "json_type": "string", "index": 5, "array_depth": 0, - "optional": true, - "default": "now()", - "example": "'1697788800000000000'", - "comment": [ - "Optional. End time in unix nanoseconds" - ] - }, - { - "name": "is_maker", - "lite_name": "im", - "semantic_type": "bool", - "json_type": "boolean", - "index": 6, - "array_depth": 0, - "optional": false, - "example": "true", - "comment": [ - "Filter on the maker of the trade" - ] - }, - { - "name": "is_taker", - "lite_name": "it", - "semantic_type": "bool", - "json_type": "boolean", - "index": 7, - "array_depth": 0, "optional": false, - "example": "true", + "example": "'10000101000203040506'", "comment": [ - "Filter on the taker of the trade" + "Liquidity score" ] }, { - "name": "cursor", - "lite_name": "c", - "semantic_type": "string", + "name": "calculate_at", + "lite_name": "ca", + "semantic_type": "timestamp", "json_type": "string", - "index": 8, + "index": 6, "array_depth": 0, - "optional": true, - "default": "", - "example": "''", + "optional": false, + "example": "'1726790400000000000'", "comment": [ - "The cursor to indicate when to start the next query from" + "The time when the snapshot was calculated" ] } ], - "comment": [ - "startTime are optional parameters. The semantics of these parameters are as follows:\u003cul\u003e" - ] + "comment": [] }, { - "name": "SubAccountTradeAggregation", - "is_root": false, + "name": "LPPoint", + "is_root": true, "fields": [ { - "name": "sub_account_id", - "lite_name": "sa", - "semantic_type": "uint64", + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "uint256", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", + "example": "'10000101000203040506'", "comment": [ - "The sub account id" + "The main account id" ] }, { - "name": "total_fee", - "lite_name": "tf", - "semantic_type": "int64", + "name": "liquidity_score", + "lite_name": "ls", + "semantic_type": "uint256", "json_type": "string", "index": 1, "array_depth": 0, "optional": false, "example": "'10000101000203040506'", "comment": [ - "Total fee paid" + "Liquidity score" ] }, { - "name": "total_trade_volume", - "lite_name": "tt", - "semantic_type": "uint256", - "json_type": "string", + "name": "rank", + "lite_name": "r", + "semantic_type": "uint32", + "json_type": "integer", "index": 2, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", + "example": "'52'", "comment": [ - "Total volume traded" + "The rank of user in the LP leaderboard" ] - }, + } + ], + "comment": [] + }, + { + "name": "ApproximateLPPoint", + "is_root": true, + "fields": [ { - "name": "num_traded", - "lite_name": "nt", - "semantic_type": "uint64", + "name": "off_chain_account_id", + "lite_name": "oc", + "semantic_type": "string", "json_type": "string", - "index": 3, + "index": 0, "array_depth": 0, "optional": false, - "example": "100", + "example": "'ACC:123456'", "comment": [ - "Number of trades" + "The off chain account id" ] }, { - "name": "positive_fee", - "lite_name": "pf", - "semantic_type": "int64", + "name": "liquidity_score", + "lite_name": "ls", + "semantic_type": "uint256", "json_type": "string", - "index": 4, + "index": 1, "array_depth": 0, "optional": false, "example": "'10000101000203040506'", "comment": [ - "Total positive fee paid by user" + "Liquidity score" ] - } - ], - "comment": [ - "Similar to sub-account trade, but not divided by individual assets." - ] - }, - { - "name": "ApiSubAccountTradeAggregationResponse", - "is_root": true, - "fields": [ + }, { - "name": "result", + "name": "rank", "lite_name": "r", - "semantic_type": "SubAccountTradeAggregation", - "json_type": "SubAccountTradeAggregation", - "index": 0, - "array_depth": 1, - "optional": false, - "comment": [ - "The sub account trade aggregation result set for given interval" - ] - }, - { - "name": "next", - "lite_name": "n", - "semantic_type": "string", - "json_type": "string", - "index": 1, + "semantic_type": "uint32", + "json_type": "integer", + "index": 2, "array_depth": 0, - "optional": true, - "default": "''", - "example": "'Qw0918='", + "optional": false, + "example": "'52'", "comment": [ - "The cursor to indicate when to start the next query from" + "The rank of user in the LP leaderboard" ] } ], "comment": [] }, { - "name": "ApiGetTraderStatResponse", + "name": "QueryGetLatestLPSnapshotResponse", "is_root": true, "fields": [ { - "name": "total_fee", - "lite_name": "tf", - "semantic_type": "int64", - "json_type": "string", + "name": "snapshot", + "lite_name": "s", + "semantic_type": "LPSnapshot", + "json_type": "LPSnapshot", "index": 0, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", "comment": [ - "Total fee paid" + "The latest LP snapshot" ] } ], "comment": [] }, { - "name": "TraderMetric", + "name": "ApiGetLatestLPSnapshotRequest", "is_root": true, "fields": [ { - "name": "total_fee", - "lite_name": "tf", - "semantic_type": "int64", - "json_type": "string", + "name": "kind", + "lite_name": "k", + "semantic_type": "Kind", + "json_type": "Kind", "index": 0, "array_depth": 0, - "optional": false, - "example": "'10000101000203040506'", + "optional": true, + "default": "0", + "example": "'PERPETUAL'", "comment": [ - "Total fee paid" + "The kind filter to apply" ] }, { - "name": "total_point", - "lite_name": "tp", - "semantic_type": "float64", - "json_type": "number", + "name": "base", + "lite_name": "b", + "semantic_type": "Currency", + "json_type": "Currency", "index": 1, "array_depth": 0, - "optional": false, - "example": "'10000000.5'", + "optional": true, + "default": "0", + "example": "'BTC'", "comment": [ - "Total trader point of this epoch/phase" + "The base filter to apply" ] } ], "comment": [] }, { - "name": "ApiFindTraderEpochMetricResponse", + "name": "ApiGetLatestLPSnapshotResponse", "is_root": true, "fields": [ { - "name": "metric", - "lite_name": "m", - "semantic_type": "TraderMetric", - "json_type": "TraderMetric", + "name": "snapshot", + "lite_name": "s", + "semantic_type": "ApproximateLPSnapshot", + "json_type": "ApproximateLPSnapshot", "index": 0, "array_depth": 0, "optional": false, "comment": [ - "Phase zero metric" - ] - }, - { - "name": "rank", - "lite_name": "r", - "semantic_type": "uint32", - "json_type": "integer", - "index": 1, - "array_depth": 0, - "optional": false, - "example": "'52'", - "comment": [ - "The rank of the account in the trader" - ] - }, - { - "name": "total", - "lite_name": "t", - "semantic_type": "uint32", - "json_type": "integer", - "index": 2, - "array_depth": 0, - "optional": false, - "example": "52", - "comment": [ - "The total number of accounts in the trader" - ] - }, - { - "name": "last_calculated_at", - "lite_name": "lc", - "semantic_type": "timestamp", - "json_type": "string", - "index": 3, - "array_depth": 0, - "optional": false, - "example": "'1697788800000000000'", - "comment": [ - "The time when the trader points were last calculated" + "The latest LP snapshot" ] } ], "comment": [] }, { - "name": "TraderLeaderboardUser", + "name": "ApiGetLPLeaderboardRequest", "is_root": true, "fields": [ { - "name": "account_id", - "lite_name": "ai", - "semantic_type": "string", - "json_type": "string", + "name": "epoch", + "lite_name": "e", + "semantic_type": "uint32", + "json_type": "integer", "index": 0, "array_depth": 0, - "optional": false, - "example": "'ACC_1234567890'", + "optional": true, + "default": "0", + "example": "1", "comment": [ - "The off chain account id" + "The epoch to filter" ] }, { - "name": "rank", - "lite_name": "r", + "name": "limit", + "lite_name": "l", "semantic_type": "uint32", "json_type": "integer", "index": 1, "array_depth": 0, "optional": false, - "example": "'52'", + "example": "100", "comment": [ - "The rank of the account in the Trader" + "The number of accounts to return" ] }, { - "name": "total_point", - "lite_name": "tp", - "semantic_type": "float64", - "json_type": "number", + "name": "kind", + "lite_name": "k", + "semantic_type": "Kind", + "json_type": "Kind", "index": 2, "array_depth": 0, "optional": false, - "example": "'10000000.5'", + "example": "'PERPETUAL'", "comment": [ - "Total Trader point" + "The kind filter to apply" ] }, { - "name": "twitter_username", - "lite_name": "tu", - "semantic_type": "string", - "json_type": "string", + "name": "base", + "lite_name": "b", + "semantic_type": "Currency", + "json_type": "Currency", "index": 3, "array_depth": 0, "optional": false, - "example": "'elonmusk'", + "example": "'BTC'", "comment": [ - "The twitter username of the account" + "The base filter to apply" ] } ], "comment": [] }, { - "name": "ApiFindTraderLeaderboardResponse", + "name": "ApiGetLPLeaderboardResponse", "is_root": true, "fields": [ { - "name": "users", - "lite_name": "u", - "semantic_type": "TraderLeaderboardUser", - "json_type": "TraderLeaderboardUser", + "name": "points", + "lite_name": "p", + "semantic_type": "ApproximateLPPoint", + "json_type": "ApproximateLPPoint", "index": 0, "array_depth": 1, "optional": false, "comment": [ - "The list of trader leaderboard users" + "The list of LP points" ] } ], "comment": [] }, { - "name": "WSOrderFeedSelectorV1", + "name": "ApiGetLPPointRequest", "is_root": true, "fields": [ { - "name": "sub_account_id", - "lite_name": "sa", - "semantic_type": "uint64", - "json_type": "string", + "name": "epoch", + "lite_name": "e", + "semantic_type": "uint32", + "json_type": "integer", "index": 0, "array_depth": 0, - "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", + "optional": true, + "default": "0", + "example": "1", "comment": [ - "The subaccount ID to filter by" - ], - "selector": "primary" + "The epoch to filter" + ] }, { - "name": "instrument", - "lite_name": "i", - "semantic_type": "asset", - "json_type": "string", + "name": "kind", + "lite_name": "k", + "semantic_type": "Kind", + "json_type": "Kind", "index": 1, "array_depth": 0, "optional": true, - "default": "'all'", - "example": "'BTC_USDT_Perp'", + "default": "0", + "example": "'PERPETUAL'", "comment": [ - "The instrument filter to apply." - ], - "selector": "primary" + "Optional. The kind filter to apply" + ] + }, + { + "name": "base", + "lite_name": "b", + "semantic_type": "Currency", + "json_type": "Currency", + "index": 2, + "array_depth": 0, + "optional": true, + "default": "0", + "example": "'BTC'", + "comment": [ + "Optional. The base filter to apply" + ] } ], - "comment": [ - "Subscribes to a feed of order updates pertaining to orders made by your account.", - "Each Order can be uniquely identified by its `order_id` or `client_order_id`.", - "To subscribe to all orders, specify an empty `instrument` (eg. `2345123`).", - "Otherwise, specify the `instrument` to only receive orders for that instrument (eg. `2345123-BTC_USDT_Perp`)." - ] + "comment": [] }, { - "name": "WSOrderFeedDataV1", + "name": "ApiGetLPPointResponse", "is_root": true, "fields": [ { - "name": "stream", - "lite_name": "s", - "semantic_type": "string", - "json_type": "string", + "name": "point", + "lite_name": "p", + "semantic_type": "LPPoint", + "json_type": "LPPoint", "index": 0, "array_depth": 0, "optional": false, - "example": "'v1.order'", "comment": [ - "Stream name" + "LP points of user" ] }, { - "name": "selector", - "lite_name": "s1", - "semantic_type": "string", - "json_type": "string", + "name": "maker_count", + "lite_name": "mc", + "semantic_type": "uint32", + "json_type": "integer", "index": 1, "array_depth": 0, "optional": false, - "example": "'BTC_USDT_Perp'", - "comment": [ - "Primary selector" - ] - }, - { - "name": "sequence_number", - "lite_name": "sn", - "semantic_type": "uint64", - "json_type": "string", - "index": 2, - "array_depth": 0, - "optional": false, - "example": "'872634876'", - "comment": [ - "A running sequence number that determines global message order within the specific stream" - ] - }, - { - "name": "feed", - "lite_name": "f", - "semantic_type": "Order", - "json_type": "Order", - "index": 3, - "array_depth": 0, - "optional": false, + "example": "'52'", "comment": [ - "The order object being created or updated" + "The number of maker" ] } ], "comment": [] }, { - "name": "WSOrderStateFeedSelectorV1", + "name": "ApiGetLPInfoRequest", "is_root": true, "fields": [ { - "name": "sub_account_id", - "lite_name": "sa", - "semantic_type": "uint64", - "json_type": "string", + "name": "kind", + "lite_name": "k", + "semantic_type": "Kind", + "json_type": "Kind", "index": 0, "array_depth": 0, "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", + "example": "'PERPETUAL'", "comment": [ - "The subaccount ID to filter by" - ], - "selector": "primary" + "The kind filter to apply" + ] }, { - "name": "instrument", - "lite_name": "i", - "semantic_type": "asset", - "json_type": "string", + "name": "base", + "lite_name": "b", + "semantic_type": "Currency", + "json_type": "Currency", "index": 1, "array_depth": 0, "optional": true, - "default": "'all'", - "example": "'BTC_USDT_Perp'", + "default": "0", + "example": "'BTC'", "comment": [ - "The instrument filter to apply." - ], - "selector": "primary" + "The base filter to apply" + ] } ], - "comment": [ - "Subscribes to a feed of order updates pertaining to orders made by your account.", - "Unlike the Order Stream, this only streams state updates, drastically improving throughput, and latency.", - "Each Order can be uniquely identified by its `order_id` or `client_order_id`.", - "To subscribe to all orders, specify an empty `instrument` (eg. `2345123`).", - "Otherwise, specify the `instrument` to only receive orders for that instrument (eg. `2345123-BTC_USDT_Perp`)." - ] + "comment": [] }, { - "name": "OrderStateFeed", - "is_root": false, + "name": "ApiGetLPInfoResponse", + "is_root": true, "fields": [ { - "name": "order_id", - "lite_name": "oi", - "semantic_type": "uint128", - "json_type": "string", + "name": "is_lp_maker", + "lite_name": "il", + "semantic_type": "bool", + "json_type": "boolean", "index": 0, "array_depth": 0, "optional": false, - "example": "'10000101000203040506'", + "example": "true", "comment": [ - "A unique 128-bit identifier for the order, deterministically generated within the GRVT backend" + "Is LP maker" ] }, { - "name": "client_order_id", - "lite_name": "co", + "name": "spread_score_value_multiplier", + "lite_name": "ss", "semantic_type": "uint64", "json_type": "string", "index": 1, "array_depth": 0, "optional": false, - "example": "'23042'", + "example": "'1000000000'", "comment": [ - "A unique identifier for the active order within a subaccount, specified by the client" + "The spread score value multiplier" ] }, { - "name": "order_state", - "lite_name": "os", - "semantic_type": "OrderState", - "json_type": "OrderState", + "name": "depth_score_value_multiplier", + "lite_name": "ds", + "semantic_type": "uint64", + "json_type": "string", "index": 2, "array_depth": 0, "optional": false, + "example": "'1000000000'", "comment": [ - "The order state object being created or updated" + "The depth score value multiplier" ] - } - ], - "comment": [] - }, - { - "name": "WSOrderStateFeedDataV1", - "is_root": true, - "fields": [ + }, { - "name": "stream", - "lite_name": "s", - "semantic_type": "string", + "name": "market_share_value_multiplier", + "lite_name": "ms", + "semantic_type": "uint64", "json_type": "string", - "index": 0, + "index": 3, "array_depth": 0, "optional": false, - "example": "'v1.state'", + "example": "'1000000000'", "comment": [ - "Stream name" + "The market share value multiplier" ] }, { - "name": "selector", - "lite_name": "s1", - "semantic_type": "string", + "name": "underlying_multiplier", + "lite_name": "um", + "semantic_type": "uint64", "json_type": "string", - "index": 1, + "index": 4, "array_depth": 0, "optional": false, - "example": "'BTC_USDT_Perp'", + "example": "'52'", "comment": [ - "Primary selector" + "Underlying multiplier" ] }, { - "name": "sequence_number", - "lite_name": "sn", + "name": "market_share_multiplier", + "lite_name": "ms1", "semantic_type": "uint64", "json_type": "string", - "index": 2, + "index": 5, "array_depth": 0, "optional": false, - "example": "'872634876'", + "example": "'1000000000'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "The market share multiplier, equal to the maker trading volume in the past 2 hours" ] }, { - "name": "feed", - "lite_name": "f", - "semantic_type": "OrderStateFeed", - "json_type": "OrderStateFeed", - "index": 3, + "name": "ask_fast_market_multiplier", + "lite_name": "af", + "semantic_type": "uint32", + "json_type": "integer", + "index": 6, "array_depth": 0, "optional": false, + "example": "'100'", "comment": [ - "The Order State Feed" + "Ask fast market multiplier" ] - } - ], - "comment": [] - }, - { - "name": "WSPositionsFeedSelectorV1", - "is_root": true, - "fields": [ - { - "name": "sub_account_id", - "lite_name": "sa", - "semantic_type": "uint64", - "json_type": "string", - "index": 0, - "array_depth": 0, - "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", - "comment": [ - "The subaccount ID to filter by" - ], - "selector": "primary" }, { - "name": "instrument", - "lite_name": "i", - "semantic_type": "asset", - "json_type": "string", - "index": 1, + "name": "bid_fast_market_multiplier", + "lite_name": "bf", + "semantic_type": "uint32", + "json_type": "integer", + "index": 7, "array_depth": 0, - "optional": true, - "default": "'all'", - "example": "'BTC_USDT_Perp'", + "optional": false, + "example": "'100'", "comment": [ - "The instrument filter to apply." - ], - "selector": "primary" + "Bid fast market multiplier" + ] } ], - "comment": [ - "Subscribes to a feed of position updates. This happens when a trade is executed.", - "To subscribe to all positions, specify an empty `instrument` (eg. `2345123`).", - "Otherwise, specify the `instrument` to only receive positions for that instrument (eg. `2345123-BTC_USDT_Perp`)." - ] + "comment": [] }, { - "name": "WSPositionsFeedDataV1", - "is_root": true, + "name": "RewardEpochInfo", + "is_root": false, "fields": [ { - "name": "stream", - "lite_name": "s", - "semantic_type": "string", - "json_type": "string", + "name": "epoch", + "lite_name": "e", + "semantic_type": "int32", + "json_type": "integer", "index": 0, "array_depth": 0, "optional": false, - "example": "'v1.position'", + "example": "'2'", "comment": [ - "Stream name" + "The epoch number" ] }, { - "name": "selector", - "lite_name": "s1", - "semantic_type": "string", + "name": "epoch_start_time", + "lite_name": "es", + "semantic_type": "timestamp", "json_type": "string", "index": 1, "array_depth": 0, "optional": false, - "example": "'BTC_USDT_Perp'", + "example": "'1726790400000000000'", "comment": [ - "Primary selector" + "The start time of the epoch" ] }, { - "name": "sequence_number", - "lite_name": "sn", - "semantic_type": "uint64", + "name": "epoch_end_time", + "lite_name": "ee", + "semantic_type": "timestamp", "json_type": "string", "index": 2, "array_depth": 0, "optional": false, - "example": "'872634876'", + "example": "'1726790400000000000'", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "The end time of the epoch" ] }, { - "name": "feed", - "lite_name": "f", - "semantic_type": "Positions", - "json_type": "Positions", + "name": "status", + "lite_name": "s", + "semantic_type": "RewardEpochStatus", + "json_type": "RewardEpochStatus", "index": 3, "array_depth": 0, "optional": false, "comment": [ - "A Position being created or updated matching the request filter" + "The status of the epoch" ] } ], "comment": [] }, { - "name": "WSFillFeedSelectorV1", + "name": "ApiGetListRewardEpochResponse", "is_root": true, "fields": [ { - "name": "sub_account_id", - "lite_name": "sa", - "semantic_type": "uint64", - "json_type": "string", + "name": "ecosystem_epochs", + "lite_name": "ee", + "semantic_type": "RewardEpochInfo", + "json_type": "RewardEpochInfo", "index": 0, - "array_depth": 0, + "array_depth": 1, "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", "comment": [ - "The sub account ID to request for" - ], - "selector": "primary" + "The list of epoch for ecosystem reward" + ] }, { - "name": "instrument", - "lite_name": "i", - "semantic_type": "asset", - "json_type": "string", + "name": "trading_epochs", + "lite_name": "te", + "semantic_type": "RewardEpochInfo", + "json_type": "RewardEpochInfo", "index": 1, - "array_depth": 0, - "optional": true, - "default": "'all'", - "example": "'BTC_USDT_Perp'", + "array_depth": 1, + "optional": false, "comment": [ - "The instrument filter to apply." - ], - "selector": "primary" + "The list of epoch for trader reward and lp reward" + ] } ], - "comment": [ - "Subscribes to a feed of private trade updates. This happens when a trade is executed.", - "To subscribe to all private trades, specify an empty `instrument` (eg. `2345123`).", - "Otherwise, specify the `instrument` to only receive private trades for that instrument (eg. `2345123-BTC_USDT_Perp`)." - ] + "comment": [] }, { - "name": "WSFillFeedDataV1", + "name": "ApiSubAccountTradeAggregationRequest", "is_root": true, "fields": [ { - "name": "stream", - "lite_name": "s", - "semantic_type": "string", - "json_type": "string", + "name": "limit", + "lite_name": "l", + "semantic_type": "int32", + "json_type": "integer", "index": 0, "array_depth": 0, "optional": false, - "example": "'v1.fill'", + "example": "100", "comment": [ - "The websocket channel to which the response is sent" + "Optional. The limit of the number of results to return" ] }, { - "name": "selector", - "lite_name": "s1", - "semantic_type": "string", - "json_type": "string", + "name": "interval", + "lite_name": "i", + "semantic_type": "SubAccountTradeInterval", + "json_type": "SubAccountTradeInterval", "index": 1, "array_depth": 0, "optional": false, - "example": "'BTC_USDT_Perp'", "comment": [ - "Primary selector" + "The interval of each sub account trade" ] }, { - "name": "sequence_number", - "lite_name": "sn", + "name": "sub_account_i_ds", + "lite_name": "sa", "semantic_type": "uint64", "json_type": "string", "index": 2, - "array_depth": 0, + "array_depth": 1, "optional": false, - "example": "'872634876'", + "example": "['2376', '5821']", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "The list of sub account ids to query" ] }, { - "name": "feed", - "lite_name": "f", - "semantic_type": "Fill", - "json_type": "Fill", + "name": "start_interval", + "lite_name": "si", + "semantic_type": "timestamp", + "json_type": "string", "index": 3, "array_depth": 0, "optional": false, + "example": "'1697788800000000000'", "comment": [ - "A private trade matching the request filter" + "Optional. The starting time in unix nanoseconds of a specific interval to query" ] - } - ], - "comment": [] - }, - { - "name": "WSTransferFeedSelectorV1", - "is_root": true, - "fields": [ + }, { - "name": "main_account_id", - "lite_name": "ma", - "semantic_type": "address", + "name": "start_time", + "lite_name": "st", + "semantic_type": "timestamp", "json_type": "string", - "index": 0, + "index": 4, + "array_depth": 0, + "optional": true, + "default": "0", + "example": "'1697788800000000000'", + "comment": [ + "Optional. Start time in unix nanoseconds" + ] + }, + { + "name": "end_time", + "lite_name": "et", + "semantic_type": "timestamp", + "json_type": "string", + "index": 5, + "array_depth": 0, + "optional": true, + "default": "now()", + "example": "'1697788800000000000'", + "comment": [ + "Optional. End time in unix nanoseconds" + ] + }, + { + "name": "is_maker", + "lite_name": "im", + "semantic_type": "bool", + "json_type": "boolean", + "index": 6, "array_depth": 0, "optional": false, - "example": "'$GRVT_MAIN_ACCOUNT_ID'", + "example": "true", "comment": [ - "The main account ID to request for" - ], - "selector": "primary" + "Filter on the maker of the trade" + ] }, { - "name": "sub_account_id", - "lite_name": "sa", - "semantic_type": "uint64", + "name": "is_taker", + "lite_name": "it", + "semantic_type": "bool", + "json_type": "boolean", + "index": 7, + "array_depth": 0, + "optional": false, + "example": "true", + "comment": [ + "Filter on the taker of the trade" + ] + }, + { + "name": "cursor", + "lite_name": "c", + "semantic_type": "string", "json_type": "string", - "index": 1, + "index": 8, "array_depth": 0, "optional": true, - "default": "'0'", - "example": "'$GRVT_SUB_ACCOUNT_ID'", + "default": "", + "example": "''", "comment": [ - "The sub account ID to request for" - ], - "selector": "primary" + "The cursor to indicate when to start the next query from" + ] } ], "comment": [ - "Subscribes to a feed of transfers. This will execute when there is any transfer to or from the selected account.", - "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`).", - "To subscribe to a sub account, specify the main account and the sub account dash separated (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a-1920109784202388`)." + "startTime are optional parameters. The semantics of these parameters are as follows:\u003cul\u003e" ] }, { - "name": "Transfer", + "name": "SubAccountTradeAggregation", "is_root": false, "fields": [ { - "name": "from_account_id", - "lite_name": "fa", - "semantic_type": "address", + "name": "sub_account_id", + "lite_name": "sa", + "semantic_type": "uint64", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'$GRVT_SUB_ACCOUNT_ID'", "comment": [ - "The account to transfer from" + "The sub account id" ] }, { - "name": "from_sub_account_id", - "lite_name": "fs", - "semantic_type": "uint64", + "name": "total_fee", + "lite_name": "tf", + "semantic_type": "int64", "json_type": "string", "index": 1, "array_depth": 0, "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", + "example": "'10000101000203040506'", "comment": [ - "The subaccount to transfer from (0 if transferring from main account)" + "Total fee paid" ] }, { - "name": "to_account_id", - "lite_name": "ta", - "semantic_type": "address", + "name": "total_trade_volume", + "lite_name": "tt", + "semantic_type": "uint256", "json_type": "string", "index": 2, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'10000101000203040506'", "comment": [ - "The account to deposit into" + "Total volume traded" ] }, { - "name": "to_sub_account_id", - "lite_name": "ts", + "name": "num_traded", + "lite_name": "nt", "semantic_type": "uint64", "json_type": "string", "index": 3, "array_depth": 0, "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", + "example": "100", "comment": [ - "The subaccount to transfer to (0 if transferring to main account)" + "Number of trades" ] }, { - "name": "currency", - "lite_name": "c", - "semantic_type": "Currency", - "json_type": "Currency", + "name": "positive_fee", + "lite_name": "pf", + "semantic_type": "int64", + "json_type": "string", "index": 4, "array_depth": 0, "optional": false, - "example": "'USDT'", + "example": "'10000101000203040506'", "comment": [ - "The token currency to transfer" + "Total positive fee paid by user" + ] + } + ], + "comment": [ + "Similar to sub-account trade, but not divided by individual assets." + ] + }, + { + "name": "ApiSubAccountTradeAggregationResponse", + "is_root": true, + "fields": [ + { + "name": "result", + "lite_name": "r", + "semantic_type": "SubAccountTradeAggregation", + "json_type": "SubAccountTradeAggregation", + "index": 0, + "array_depth": 1, + "optional": false, + "comment": [ + "The sub account trade aggregation result set for given interval" ] }, { - "name": "num_tokens", - "lite_name": "nt", + "name": "next", + "lite_name": "n", "semantic_type": "string", "json_type": "string", - "index": 5, + "index": 1, "array_depth": 0, - "optional": false, - "example": "'10.50'", + "optional": true, + "default": "''", + "example": "'Qw0918='", "comment": [ - "The number of tokens to transfer" + "The cursor to indicate when to start the next query from" ] - }, + } + ], + "comment": [] + }, + { + "name": "ApiGetTraderStatResponse", + "is_root": true, + "fields": [ { - "name": "signature", - "lite_name": "s", - "semantic_type": "Signature", - "json_type": "Signature", - "index": 6, + "name": "total_fee", + "lite_name": "tf", + "semantic_type": "int64", + "json_type": "string", + "index": 0, "array_depth": 0, "optional": false, + "example": "'10000101000203040506'", "comment": [ - "The signature of the transfer" + "Total fee paid" ] - }, + } + ], + "comment": [] + }, + { + "name": "TraderMetric", + "is_root": true, + "fields": [ { - "name": "transfer_type", - "lite_name": "tt", - "semantic_type": "TransferType", - "json_type": "TransferType", - "index": 7, + "name": "total_fee", + "lite_name": "tf", + "semantic_type": "int64", + "json_type": "string", + "index": 0, "array_depth": 0, "optional": false, + "example": "'10000101000203040506'", "comment": [ - "The type of transfer" + "Total fee paid" ] }, { - "name": "transfer_metadata", - "lite_name": "tm", - "semantic_type": "string", - "json_type": "string", - "index": 8, + "name": "total_point", + "lite_name": "tp", + "semantic_type": "float64", + "json_type": "number", + "index": 1, "array_depth": 0, "optional": false, + "example": "'10000000.5'", "comment": [ - "The metadata of the transfer" + "Total trader point of this epoch/phase" ] } ], "comment": [] }, { - "name": "WSTransferFeedDataV1", + "name": "ApiFindTraderEpochMetricResponse", "is_root": true, "fields": [ { - "name": "stream", - "lite_name": "s", - "semantic_type": "string", - "json_type": "string", + "name": "metric", + "lite_name": "m", + "semantic_type": "TraderMetric", + "json_type": "TraderMetric", "index": 0, "array_depth": 0, "optional": false, - "example": "'v1.transfer'", "comment": [ - "The websocket channel to which the response is sent" + "Phase zero metric" ] }, { - "name": "selector", - "lite_name": "s1", - "semantic_type": "string", - "json_type": "string", + "name": "rank", + "lite_name": "r", + "semantic_type": "uint32", + "json_type": "integer", "index": 1, "array_depth": 0, "optional": false, - "example": "'BTC_USDT_Perp'", + "example": "'52'", "comment": [ - "Primary selector" + "The rank of the account in the trader" ] }, { - "name": "sequence_number", - "lite_name": "sn", - "semantic_type": "uint64", - "json_type": "string", + "name": "total", + "lite_name": "t", + "semantic_type": "uint32", + "json_type": "integer", "index": 2, "array_depth": 0, "optional": false, - "example": "'872634876'", + "example": "52", "comment": [ - "A running sequence number that determines global message order within the specific stream" + "The total number of accounts in the trader" ] }, { - "name": "feed", - "lite_name": "f", - "semantic_type": "Transfer", - "json_type": "Transfer", + "name": "last_calculated_at", + "lite_name": "lc", + "semantic_type": "timestamp", + "json_type": "string", "index": 3, "array_depth": 0, "optional": false, + "example": "'1697788800000000000'", "comment": [ - "The Transfer object" + "The time when the trader points were last calculated" ] } ], - "comment": [ - "Subscribes to a feed of transfer updates." - ] + "comment": [] }, { - "name": "WSDepositFeedSelectorV1", + "name": "TraderLeaderboardUser", "is_root": true, "fields": [ { - "name": "main_account_id", - "lite_name": "ma", - "semantic_type": "address", - "json_type": "string", - "index": 0, - "array_depth": 0, - "optional": false, - "example": "'$GRVT_MAIN_ACCOUNT_ID'", - "comment": [ - "The main account ID to request for" - ], - "selector": "primary" - } - ], - "comment": [ - "Subscribes to a feed of deposits. This will execute when there is any deposit to selected account.", - "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`)." - ] - }, - { - "name": "Deposit", - "is_root": false, - "fields": [ - { - "name": "tx_hash", - "lite_name": "th", - "semantic_type": "uint256", + "name": "account_id", + "lite_name": "ai", + "semantic_type": "string", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'0x1234567890123456789012345678901234567890123456789012345678901234'", + "example": "'ACC_1234567890'", "comment": [ - "The hash of the bridgemint event producing the deposit" + "The off chain account id" ] }, { - "name": "to_account_id", - "lite_name": "ta", - "semantic_type": "address", - "json_type": "string", + "name": "rank", + "lite_name": "r", + "semantic_type": "uint32", + "json_type": "integer", "index": 1, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'52'", "comment": [ - "The account to deposit into" + "The rank of the account in the Trader" ] }, { - "name": "currency", - "lite_name": "c", - "semantic_type": "Currency", - "json_type": "Currency", + "name": "total_point", + "lite_name": "tp", + "semantic_type": "float64", + "json_type": "number", "index": 2, "array_depth": 0, "optional": false, - "example": "'USDT'", + "example": "'10000000.5'", "comment": [ - "The token currency to deposit" + "Total Trader point" ] }, { - "name": "num_tokens", - "lite_name": "nt", + "name": "twitter_username", + "lite_name": "tu", "semantic_type": "string", "json_type": "string", "index": 3, "array_depth": 0, "optional": false, - "example": "'10.50'", + "example": "'elonmusk'", "comment": [ - "The number of tokens to deposit" + "The twitter username of the account" ] } ], "comment": [] }, { - "name": "WSDepositFeedDataV1", + "name": "ApiFindTraderLeaderboardResponse", + "is_root": true, + "fields": [ + { + "name": "users", + "lite_name": "u", + "semantic_type": "TraderLeaderboardUser", + "json_type": "TraderLeaderboardUser", + "index": 0, + "array_depth": 1, + "optional": false, + "comment": [ + "The list of trader leaderboard users" + ] + } + ], + "comment": [] + }, + { + "name": "WSOrderFeedSelectorV1", + "is_root": true, + "fields": [ + { + "name": "sub_account_id", + "lite_name": "sa", + "semantic_type": "uint64", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": false, + "example": "'$GRVT_SUB_ACCOUNT_ID'", + "comment": [ + "The subaccount ID to filter by" + ], + "selector": "primary" + }, + { + "name": "instrument", + "lite_name": "i", + "semantic_type": "asset", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": true, + "default": "'all'", + "example": "'BTC_USDT_Perp'", + "comment": [ + "The instrument filter to apply." + ], + "selector": "primary" + } + ], + "comment": [ + "Subscribes to a feed of order updates pertaining to orders made by your account.", + "Each Order can be uniquely identified by its `order_id` or `client_order_id`.", + "To subscribe to all orders, specify an empty `instrument` (eg. `2345123`).", + "Otherwise, specify the `instrument` to only receive orders for that instrument (eg. `2345123-BTC_USDT_Perp`)." + ] + }, + { + "name": "WSOrderFeedDataV1", "is_root": true, "fields": [ { @@ -11129,9 +11931,9 @@ "index": 0, "array_depth": 0, "optional": false, - "example": "'v1.deposit'", + "example": "'v1.order'", "comment": [ - "The websocket channel to which the response is sent" + "Stream name" ] }, { @@ -11163,117 +11965,120 @@ { "name": "feed", "lite_name": "f", - "semantic_type": "Deposit", - "json_type": "Deposit", + "semantic_type": "Order", + "json_type": "Order", "index": 3, "array_depth": 0, "optional": false, "comment": [ - "The Deposit object" + "The order object being created or updated" + ] + }, + { + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'872634875'", + "comment": [ + "The previous sequence number that determines global message order within the specific stream" ] } ], - "comment": [ - "Subscribes to a feed of deposit updates." - ] + "comment": [] }, { - "name": "WSWithdrawalFeedSelectorV1", + "name": "WSOrderStateFeedSelectorV1", "is_root": true, "fields": [ { - "name": "main_account_id", - "lite_name": "ma", - "semantic_type": "address", + "name": "sub_account_id", + "lite_name": "sa", + "semantic_type": "uint64", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'$GRVT_MAIN_ACCOUNT_ID'", + "example": "'$GRVT_SUB_ACCOUNT_ID'", "comment": [ - "The main account ID to request for" + "The subaccount ID to filter by" ], "selector": "primary" - } - ], - "comment": [ - "Subscribes to a feed of withdrawals. This will execute when there is any withdrawal from the selected account.", - "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`)." - ] + }, + { + "name": "instrument", + "lite_name": "i", + "semantic_type": "asset", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": true, + "default": "'all'", + "example": "'BTC_USDT_Perp'", + "comment": [ + "The instrument filter to apply." + ], + "selector": "primary" + } + ], + "comment": [ + "Subscribes to a feed of order updates pertaining to orders made by your account.", + "Unlike the Order Stream, this only streams state updates, drastically improving throughput, and latency.", + "Each Order can be uniquely identified by its `order_id` or `client_order_id`.", + "To subscribe to all orders, specify an empty `instrument` (eg. `2345123`).", + "Otherwise, specify the `instrument` to only receive orders for that instrument (eg. `2345123-BTC_USDT_Perp`)." + ] }, { - "name": "Withdrawal", + "name": "OrderStateFeed", "is_root": false, "fields": [ { - "name": "from_account_id", - "lite_name": "fa", - "semantic_type": "address", + "name": "order_id", + "lite_name": "oi", + "semantic_type": "uint128", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'10000101000203040506'", "comment": [ - "The subaccount to withdraw from" + "A unique 128-bit identifier for the order, deterministically generated within the GRVT backend" ] }, { - "name": "to_eth_address", - "lite_name": "te", - "semantic_type": "address", + "name": "client_order_id", + "lite_name": "co", + "semantic_type": "uint64", "json_type": "string", "index": 1, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'23042'", "comment": [ - "The ethereum address to withdraw to" + "A unique identifier for the active order within a subaccount, specified by the client" ] }, { - "name": "currency", - "lite_name": "c", - "semantic_type": "Currency", - "json_type": "Currency", + "name": "order_state", + "lite_name": "os", + "semantic_type": "OrderState", + "json_type": "OrderState", "index": 2, "array_depth": 0, "optional": false, - "example": "'USDT'", - "comment": [ - "The token currency to withdraw" - ] - }, - { - "name": "num_tokens", - "lite_name": "nt", - "semantic_type": "string", - "json_type": "string", - "index": 3, - "array_depth": 0, - "optional": false, - "example": "'10.50'", - "comment": [ - "The number of tokens to withdraw" - ] - }, - { - "name": "signature", - "lite_name": "s", - "semantic_type": "Signature", - "json_type": "Signature", - "index": 4, - "array_depth": 0, - "optional": false, "comment": [ - "The signature of the withdrawal" + "The order state object being created or updated" ] } ], "comment": [] }, { - "name": "WSWithdrawalFeedDataV1", + "name": "WSOrderStateFeedDataV1", "is_root": true, "fields": [ { @@ -11284,9 +12089,9 @@ "index": 0, "array_depth": 0, "optional": false, - "example": "'v1.withdrawal'", + "example": "'v1.state'", "comment": [ - "The websocket channel to which the response is sent" + "Stream name" ] }, { @@ -11318,340 +12123,334 @@ { "name": "feed", "lite_name": "f", - "semantic_type": "Withdrawal", - "json_type": "Withdrawal", + "semantic_type": "OrderStateFeed", + "json_type": "OrderStateFeed", "index": 3, "array_depth": 0, "optional": false, "comment": [ - "The Withdrawal object" + "The Order State Feed" + ] + }, + { + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'872634875'", + "comment": [ + "The previous sequence number that determines global message order within the specific stream" ] } ], - "comment": [ - "Subscribes to a feed of withdrawal updates." - ] + "comment": [] }, { - "name": "ApiWithdrawalRequest", + "name": "WSPositionsFeedSelectorV1", "is_root": true, "fields": [ { - "name": "from_account_id", - "lite_name": "fa", - "semantic_type": "address", + "name": "sub_account_id", + "lite_name": "sa", + "semantic_type": "uint64", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'$GRVT_SUB_ACCOUNT_ID'", "comment": [ - "The main account to withdraw from" - ] + "The subaccount ID to filter by" + ], + "selector": "primary" }, { - "name": "to_eth_address", - "lite_name": "te", - "semantic_type": "address", + "name": "instrument", + "lite_name": "i", + "semantic_type": "asset", "json_type": "string", "index": 1, "array_depth": 0, - "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", - "comment": [ - "The Ethereum wallet to withdraw into" - ] - }, - { - "name": "currency", - "lite_name": "c", - "semantic_type": "Currency", - "json_type": "Currency", - "index": 2, - "array_depth": 0, - "optional": false, - "example": "'USDT'", - "comment": [ - "The token currency to withdraw" - ] - }, - { - "name": "num_tokens", - "lite_name": "nt", - "semantic_type": "string", - "json_type": "string", - "index": 3, - "array_depth": 0, - "optional": false, - "example": "'1500.0'", - "comment": [ - "The number of tokens to withdraw, quoted in tokenCurrency decimal units" - ] - }, - { - "name": "signature", - "lite_name": "s", - "semantic_type": "Signature", - "json_type": "Signature", - "index": 4, - "array_depth": 0, - "optional": false, + "optional": true, + "default": "'all'", + "example": "'BTC_USDT_Perp'", "comment": [ - "The signature of the withdrawal" - ] + "The instrument filter to apply." + ], + "selector": "primary" } ], "comment": [ - "Leverage this API to initialize a withdrawal from GRVT's Hyperchain onto Ethereum.", - "Do take note that the bridging process does take time. The GRVT UI will help you keep track of bridging progress, and notify you once its complete.", - "", - "If not withdrawing the entirety of your balance, there is a minimum withdrawal amount. Currently that amount is ~25 USDT.", - "Withdrawal fees also apply to cover the cost of the Ethereum transaction.", - "Note that your funds will always remain in self-custory throughout the withdrawal process. At no stage does GRVT gain control over your funds." + "Subscribes to a feed of position updates. This happens when a trade is executed.", + "To subscribe to all positions, specify an empty `instrument` (eg. `2345123`).", + "Otherwise, specify the `instrument` to only receive positions for that instrument (eg. `2345123-BTC_USDT_Perp`)." ] }, { - "name": "ApiTransferRequest", + "name": "WSPositionsFeedDataV1", "is_root": true, "fields": [ { - "name": "from_account_id", - "lite_name": "fa", - "semantic_type": "address", + "name": "stream", + "lite_name": "s", + "semantic_type": "string", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'v1.position'", "comment": [ - "The main account to transfer from" + "Stream name" ] }, { - "name": "from_sub_account_id", - "lite_name": "fs", - "semantic_type": "uint64", + "name": "selector", + "lite_name": "s1", + "semantic_type": "string", "json_type": "string", "index": 1, "array_depth": 0, "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", + "example": "'BTC_USDT_Perp'", "comment": [ - "The subaccount to transfer from (0 if transferring from main account)" + "Primary selector" ] }, { - "name": "to_account_id", - "lite_name": "ta", - "semantic_type": "address", + "name": "sequence_number", + "lite_name": "sn", + "semantic_type": "uint64", "json_type": "string", "index": 2, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'872634876'", "comment": [ - "The main account to deposit into" + "A running sequence number that determines global message order within the specific stream" ] }, { - "name": "to_sub_account_id", - "lite_name": "ts", - "semantic_type": "uint64", - "json_type": "string", + "name": "feed", + "lite_name": "f", + "semantic_type": "Positions", + "json_type": "Positions", "index": 3, "array_depth": 0, "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", "comment": [ - "The subaccount to transfer to (0 if transferring to main account)" + "A Position being created or updated matching the request filter" ] }, { - "name": "currency", - "lite_name": "c", - "semantic_type": "Currency", - "json_type": "Currency", + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", + "json_type": "string", "index": 4, "array_depth": 0, "optional": false, - "example": "'USDT'", + "example": "'872634875'", "comment": [ - "The token currency to transfer" + "The previous sequence number that determines global message order within the specific stream" ] - }, + } + ], + "comment": [] + }, + { + "name": "WSFillFeedSelectorV1", + "is_root": true, + "fields": [ { - "name": "num_tokens", - "lite_name": "nt", - "semantic_type": "string", + "name": "sub_account_id", + "lite_name": "sa", + "semantic_type": "uint64", "json_type": "string", - "index": 5, + "index": 0, "array_depth": 0, "optional": false, - "example": "'1500.0'", + "example": "'$GRVT_SUB_ACCOUNT_ID'", "comment": [ - "The number of tokens to transfer, quoted in tokenCurrency decimal units" - ] - }, - { - "name": "signature", - "lite_name": "s", - "semantic_type": "Signature", - "json_type": "Signature", - "index": 6, - "array_depth": 0, - "optional": false, - "comment": [ - "The signature of the transfer" - ] - }, - { - "name": "transfer_type", - "lite_name": "tt", - "semantic_type": "TransferType", - "json_type": "TransferType", - "index": 7, - "array_depth": 0, - "optional": false, - "comment": [ - "The type of transfer" - ] + "The sub account ID to request for" + ], + "selector": "primary" }, { - "name": "transfer_metadata", - "lite_name": "tm", - "semantic_type": "string", + "name": "instrument", + "lite_name": "i", + "semantic_type": "asset", "json_type": "string", - "index": 8, + "index": 1, "array_depth": 0, - "optional": false, - "example": "{\"provider\":\"XY\",\"direction\":\"WITHDRAWAL\",\"provider_tx_id\":\"txn123456\",\"chainid\":\"42161\",\"endpoint\":\"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0\"}", + "optional": true, + "default": "'all'", + "example": "'BTC_USDT_Perp'", "comment": [ - "The metadata of the transfer" - ] + "The instrument filter to apply." + ], + "selector": "primary" } ], "comment": [ - "This API allows you to transfer funds in multiple different ways\u003cul\u003e", - "\u003cli\u003eBetween SubAccounts within your Main Account\u003c/li\u003e", - "\u003cli\u003eBetween your MainAccount and your SubAccounts\u003c/li\u003e", - "\u003cli\u003eTo other MainAccounts that you have previously allowlisted\u003c/li\u003e", - "\u003c/ul\u003e\u003cb\u003eFast Withdrawal Funding Address\u003c/b\u003e", - "For fast withdrawals, funds must be sent to the designated funding account address. Please ensure you use the correct address based on the environment:", - "\u003cb\u003eProduction Environment Address:\u003c/b\u003e", - "\u003cem\u003e[To be updated, not ready yet]\u003c/em\u003e", - "This address should be specified as the \u003ccode\u003eto_account_id\u003c/code\u003e in your API requests for transferring funds using the transfer API. Ensure accurate input to avoid loss of funds or use the UI.", - "" + "Subscribes to a feed of private trade updates. This happens when a trade is executed.", + "To subscribe to all private trades, specify an empty `instrument` (eg. `2345123`).", + "Otherwise, specify the `instrument` to only receive private trades for that instrument (eg. `2345123-BTC_USDT_Perp`)." ] }, { - "name": "ApiDepositHistoryRequest", + "name": "WSFillFeedDataV1", "is_root": true, "fields": [ { - "name": "currency", - "lite_name": "c", - "semantic_type": "Currency", - "json_type": "Currency", + "name": "stream", + "lite_name": "s", + "semantic_type": "string", + "json_type": "string", "index": 0, - "array_depth": 1, + "array_depth": 0, "optional": false, - "example": "['USDT', 'USDC']", + "example": "'v1.fill'", "comment": [ - "The token currency to query for, if nil or empty, return all deposits. Otherwise, only entries matching the filter will be returned" + "The websocket channel to which the response is sent" ] }, { - "name": "start_time", - "lite_name": "st", - "semantic_type": "timestamp", + "name": "selector", + "lite_name": "s1", + "semantic_type": "string", "json_type": "string", "index": 1, "array_depth": 0, - "optional": true, - "default": "0", - "example": "'1697788800000000000'", + "optional": false, + "example": "'BTC_USDT_Perp'", "comment": [ - "The start time to query for in unix nanoseconds" + "Primary selector" ] }, { - "name": "end_time", - "lite_name": "et", - "semantic_type": "timestamp", + "name": "sequence_number", + "lite_name": "sn", + "semantic_type": "uint64", "json_type": "string", "index": 2, "array_depth": 0, - "optional": true, - "default": "now()", - "example": "'1697788800000000000'", + "optional": false, + "example": "'872634876'", "comment": [ - "The end time to query for in unix nanoseconds" + "A running sequence number that determines global message order within the specific stream" ] }, { - "name": "limit", - "lite_name": "l", - "semantic_type": "uint32", - "json_type": "integer", + "name": "feed", + "lite_name": "f", + "semantic_type": "Fill", + "json_type": "Fill", "index": 3, "array_depth": 0, - "optional": true, - "default": "500", - "example": "500", + "optional": false, "comment": [ - "The limit to query for. Defaults to 500; Max 1000" + "A private trade matching the request filter" ] }, { - "name": "cursor", - "lite_name": "c1", - "semantic_type": "string", + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", "json_type": "string", "index": 4, "array_depth": 0, - "optional": true, - "default": "''", - "example": "''", + "optional": false, + "example": "'872634875'", "comment": [ - "The cursor to indicate when to start the next query from" + "The previous sequence number that determines global message order within the specific stream" ] } ], + "comment": [] + }, + { + "name": "WSTransferFeedSelectorV1", + "is_root": true, + "fields": [ + { + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "address", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": false, + "example": "'$GRVT_MAIN_ACCOUNT_ID'", + "comment": [ + "The main account ID to request for" + ], + "selector": "primary" + }, + { + "name": "sub_account_id", + "lite_name": "sa", + "semantic_type": "uint64", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": true, + "default": "'0'", + "example": "'$GRVT_SUB_ACCOUNT_ID'", + "comment": [ + "The sub account ID to request for" + ], + "selector": "primary" + } + ], "comment": [ - "The request to get the historical deposits of an account", - "The history is returned in reverse chronological order", - "", - "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e" + "Subscribes to a feed of transfers. This will execute when there is any transfer to or from the selected account.", + "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`).", + "To subscribe to a sub account, specify the main account and the sub account dash separated (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a-1920109784202388`)." ] }, { - "name": "DepositHistory", - "is_root": false, + "name": "TransferHistory", + "is_root": true, "fields": [ { - "name": "l_1_hash", - "lite_name": "l1", - "semantic_type": "uint256", + "name": "tx_id", + "lite_name": "ti", + "semantic_type": "uint64", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'0x10000101000203040506'", + "example": "'1028403'", "comment": [ - "The L1 txHash of the deposit" + "The transaction ID of the transfer" ] }, { - "name": "l_2_hash", - "lite_name": "l2", - "semantic_type": "uint256", + "name": "from_account_id", + "lite_name": "fa", + "semantic_type": "address", "json_type": "string", "index": 1, "array_depth": 0, "optional": false, - "example": "'0x10000101000203040506'", + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", "comment": [ - "The L2 txHash of the deposit" + "The account to transfer from" + ] + }, + { + "name": "from_sub_account_id", + "lite_name": "fs", + "semantic_type": "uint64", + "json_type": "string", + "index": 2, + "array_depth": 0, + "optional": false, + "example": "'$GRVT_SUB_ACCOUNT_ID'", + "comment": [ + "The subaccount to transfer from (0 if transferring from main account)" ] }, { @@ -11659,7 +12458,7 @@ "lite_name": "ta", "semantic_type": "address", "json_type": "string", - "index": 2, + "index": 3, "array_depth": 0, "optional": false, "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", @@ -11667,17 +12466,30 @@ "The account to deposit into" ] }, + { + "name": "to_sub_account_id", + "lite_name": "ts", + "semantic_type": "uint64", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'$GRVT_SUB_ACCOUNT_ID'", + "comment": [ + "The subaccount to transfer to (0 if transferring to main account)" + ] + }, { "name": "currency", "lite_name": "c", "semantic_type": "Currency", "json_type": "Currency", - "index": 3, + "index": 5, "array_depth": 0, "optional": false, "example": "'USDT'", "comment": [ - "The token currency to deposit" + "The token currency to transfer" ] }, { @@ -11685,211 +12497,178 @@ "lite_name": "nt", "semantic_type": "string", "json_type": "string", - "index": 4, + "index": 6, "array_depth": 0, "optional": false, "example": "'1500.0'", "comment": [ - "The number of tokens to deposit" + "The number of tokens to transfer" ] }, { - "name": "initiated_time", - "lite_name": "it", - "semantic_type": "timestamp", - "json_type": "string", - "index": 5, + "name": "signature", + "lite_name": "s", + "semantic_type": "Signature", + "json_type": "Signature", + "index": 7, "array_depth": 0, "optional": false, - "example": "'1697788800000000000'", "comment": [ - "The timestamp when the deposit was initiated on L1 in unix nanoseconds" + "The signature of the transfer" ] }, { - "name": "confirmed_time", - "lite_name": "ct", + "name": "event_time", + "lite_name": "et", "semantic_type": "timestamp", "json_type": "string", - "index": 6, + "index": 8, "array_depth": 0, "optional": false, "example": "'1697788800000000000'", "comment": [ - "The timestamp when the deposit was confirmed on L2 in unix nanoseconds" + "The timestamp of the transfer in unix nanoseconds" ] }, { - "name": "from_address", - "lite_name": "fa", - "semantic_type": "address", - "json_type": "string", - "index": 7, - "array_depth": 0, - "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", - "comment": [ - "The address of the sender" - ] - } - ], - "comment": [] - }, - { - "name": "ApiDepositHistoryResponse", - "is_root": true, - "fields": [ - { - "name": "result", - "lite_name": "r", - "semantic_type": "DepositHistory", - "json_type": "DepositHistory", - "index": 0, - "array_depth": 1, + "name": "transfer_type", + "lite_name": "tt", + "semantic_type": "TransferType", + "json_type": "TransferType", + "index": 9, + "array_depth": 0, "optional": false, "comment": [ - "The deposit history matching the request account" + "The type of transfer" ] }, { - "name": "next", - "lite_name": "n", + "name": "transfer_metadata", + "lite_name": "tm", "semantic_type": "string", "json_type": "string", - "index": 1, + "index": 10, "array_depth": 0, - "optional": true, - "default": "''", - "example": "'Qw0918='", + "optional": false, "comment": [ - "The cursor to indicate when to start the next query from" + "The metadata of the transfer" ] } ], "comment": [] }, { - "name": "ApiTransferHistoryRequest", + "name": "WSTransferFeedDataV1", "is_root": true, "fields": [ { - "name": "currency", - "lite_name": "c", - "semantic_type": "Currency", - "json_type": "Currency", + "name": "stream", + "lite_name": "s", + "semantic_type": "string", + "json_type": "string", "index": 0, - "array_depth": 1, + "array_depth": 0, "optional": false, - "example": "['USDT', 'USDC']", + "example": "'v1.transfer'", "comment": [ - "The token currency to query for, if nil or empty, return all transfers. Otherwise, only entries matching the filter will be returned" + "The websocket channel to which the response is sent" ] }, { - "name": "start_time", - "lite_name": "st", - "semantic_type": "timestamp", + "name": "selector", + "lite_name": "s1", + "semantic_type": "string", "json_type": "string", "index": 1, "array_depth": 0, - "optional": true, - "default": "0", - "example": "'1697788800000000000'", + "optional": false, + "example": "'BTC_USDT_Perp'", "comment": [ - "The start time to query for in unix nanoseconds" + "Primary selector" ] }, { - "name": "end_time", - "lite_name": "et", - "semantic_type": "timestamp", + "name": "sequence_number", + "lite_name": "sn", + "semantic_type": "uint64", "json_type": "string", "index": 2, "array_depth": 0, - "optional": true, - "default": "now()", - "example": "'1697788800000000000'", + "optional": false, + "example": "'872634876'", "comment": [ - "The end time to query for in unix nanoseconds" + "A running sequence number that determines global message order within the specific stream" ] }, { - "name": "limit", - "lite_name": "l", - "semantic_type": "uint32", - "json_type": "integer", + "name": "feed", + "lite_name": "f", + "semantic_type": "TransferHistory", + "json_type": "TransferHistory", "index": 3, "array_depth": 0, - "optional": true, - "default": "500", - "example": "500", + "optional": false, "comment": [ - "The limit to query for. Defaults to 500; Max 1000" + "The transfer history matching the requested filters" ] }, { - "name": "cursor", - "lite_name": "c1", - "semantic_type": "string", + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", "json_type": "string", "index": 4, "array_depth": 0, - "optional": true, - "default": "''", - "example": "''", + "optional": false, + "example": "'872634875'", "comment": [ - "The cursor to indicate when to start the next query from" + "The previous sequence number that determines global message order within the specific stream" ] } ], "comment": [ - "The request to get the historical transfers of an account", - "The history is returned in reverse chronological order", - "", - "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e" + "Subscribes to a feed of transfer updates." ] }, { - "name": "TransferHistory", + "name": "WSDepositFeedSelectorV1", "is_root": true, "fields": [ { - "name": "tx_id", - "lite_name": "ti", - "semantic_type": "uint64", - "json_type": "string", - "index": 0, - "array_depth": 0, - "optional": false, - "example": "'1028403'", - "comment": [ - "The transaction ID of the transfer" - ] - }, - { - "name": "from_account_id", - "lite_name": "fa", + "name": "main_account_id", + "lite_name": "ma", "semantic_type": "address", "json_type": "string", - "index": 1, + "index": 0, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'$GRVT_MAIN_ACCOUNT_ID'", "comment": [ - "The account to transfer from" - ] - }, + "The main account ID to request for" + ], + "selector": "primary" + } + ], + "comment": [ + "Subscribes to a feed of deposits. This will execute when there is any deposit to selected account.", + "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`)." + ] + }, + { + "name": "Deposit", + "is_root": false, + "fields": [ { - "name": "from_sub_account_id", - "lite_name": "fs", - "semantic_type": "uint64", + "name": "tx_hash", + "lite_name": "th", + "semantic_type": "uint256", "json_type": "string", - "index": 2, + "index": 0, "array_depth": 0, "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", + "example": "'0x1234567890123456789012345678901234567890123456789012345678901234'", "comment": [ - "The subaccount to transfer from (0 if transferring from main account)" + "The hash of the bridgemint event producing the deposit" ] }, { @@ -11897,7 +12676,7 @@ "lite_name": "ta", "semantic_type": "address", "json_type": "string", - "index": 3, + "index": 1, "array_depth": 0, "optional": false, "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", @@ -11905,30 +12684,17 @@ "The account to deposit into" ] }, - { - "name": "to_sub_account_id", - "lite_name": "ts", - "semantic_type": "uint64", - "json_type": "string", - "index": 4, - "array_depth": 0, - "optional": false, - "example": "'$GRVT_SUB_ACCOUNT_ID'", - "comment": [ - "The subaccount to transfer to (0 if transferring to main account)" - ] - }, { "name": "currency", "lite_name": "c", "semantic_type": "Currency", "json_type": "Currency", - "index": 5, + "index": 2, "array_depth": 0, "optional": false, "example": "'USDT'", "comment": [ - "The token currency to transfer" + "The token currency to deposit" ] }, { @@ -11936,596 +12702,1802 @@ "lite_name": "nt", "semantic_type": "string", "json_type": "string", - "index": 6, + "index": 3, "array_depth": 0, "optional": false, - "example": "'1500.0'", + "example": "'10.50'", "comment": [ - "The number of tokens to transfer" + "The number of tokens to deposit" ] - }, + } + ], + "comment": [] + }, + { + "name": "WSDepositFeedDataV1", + "is_root": true, + "fields": [ { - "name": "signature", + "name": "stream", "lite_name": "s", - "semantic_type": "Signature", - "json_type": "Signature", - "index": 7, + "semantic_type": "string", + "json_type": "string", + "index": 0, "array_depth": 0, "optional": false, + "example": "'v1.deposit'", "comment": [ - "The signature of the transfer" + "The websocket channel to which the response is sent" ] }, { - "name": "event_time", - "lite_name": "et", - "semantic_type": "timestamp", + "name": "selector", + "lite_name": "s1", + "semantic_type": "string", "json_type": "string", - "index": 8, + "index": 1, "array_depth": 0, "optional": false, - "example": "'1697788800000000000'", + "example": "'BTC_USDT_Perp'", "comment": [ - "The timestamp of the transfer in unix nanoseconds" + "Primary selector" ] }, { - "name": "transfer_type", - "lite_name": "tt", - "semantic_type": "TransferType", - "json_type": "TransferType", - "index": 9, + "name": "sequence_number", + "lite_name": "sn", + "semantic_type": "uint64", + "json_type": "string", + "index": 2, "array_depth": 0, "optional": false, + "example": "'872634876'", "comment": [ - "The type of transfer" + "A running sequence number that determines global message order within the specific stream" ] }, { - "name": "transfer_metadata", - "lite_name": "tm", - "semantic_type": "string", + "name": "feed", + "lite_name": "f", + "semantic_type": "Deposit", + "json_type": "Deposit", + "index": 3, + "array_depth": 0, + "optional": false, + "comment": [ + "The Deposit object" + ] + }, + { + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", "json_type": "string", - "index": 10, + "index": 4, "array_depth": 0, "optional": false, + "example": "'872634875'", "comment": [ - "The metadata of the transfer" + "The previous sequence number that determines global message order within the specific stream" ] } ], - "comment": [] + "comment": [ + "Subscribes to a feed of deposit updates." + ] }, { - "name": "ApiTransferHistoryResponse", + "name": "WSWithdrawalFeedSelectorV1", "is_root": true, "fields": [ { - "name": "result", - "lite_name": "r", - "semantic_type": "TransferHistory", - "json_type": "TransferHistory", + "name": "main_account_id", + "lite_name": "ma", + "semantic_type": "address", + "json_type": "string", "index": 0, - "array_depth": 1, + "array_depth": 0, "optional": false, + "example": "'$GRVT_MAIN_ACCOUNT_ID'", "comment": [ - "The transfer history matching the request account" + "The main account ID to request for" + ], + "selector": "primary" + } + ], + "comment": [ + "Subscribes to a feed of withdrawals. This will execute when there is any withdrawal from the selected account.", + "To subscribe to a main account, specify the account ID (eg. `0x9fe3758b67ce7a2875ee4b452f01a5282d84ed8a`)." + ] + }, + { + "name": "Withdrawal", + "is_root": false, + "fields": [ + { + "name": "from_account_id", + "lite_name": "fa", + "semantic_type": "address", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": false, + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "comment": [ + "The subaccount to withdraw from" ] }, { - "name": "next", - "lite_name": "n", - "semantic_type": "string", + "name": "to_eth_address", + "lite_name": "te", + "semantic_type": "address", "json_type": "string", "index": 1, "array_depth": 0, - "optional": true, - "default": "''", - "example": "'Qw0918='", + "optional": false, + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", "comment": [ - "The cursor to indicate when to start the next query from" + "The ethereum address to withdraw to" + ] + }, + { + "name": "currency", + "lite_name": "c", + "semantic_type": "Currency", + "json_type": "Currency", + "index": 2, + "array_depth": 0, + "optional": false, + "example": "'USDT'", + "comment": [ + "The token currency to withdraw" + ] + }, + { + "name": "num_tokens", + "lite_name": "nt", + "semantic_type": "string", + "json_type": "string", + "index": 3, + "array_depth": 0, + "optional": false, + "example": "'10.50'", + "comment": [ + "The number of tokens to withdraw" + ] + }, + { + "name": "signature", + "lite_name": "s", + "semantic_type": "Signature", + "json_type": "Signature", + "index": 4, + "array_depth": 0, + "optional": false, + "comment": [ + "The signature of the withdrawal" ] } ], "comment": [] }, { - "name": "ApiWithdrawalHistoryRequest", + "name": "WSWithdrawalFeedDataV1", "is_root": true, "fields": [ { - "name": "currency", - "lite_name": "c", - "semantic_type": "Currency", - "json_type": "Currency", + "name": "stream", + "lite_name": "s", + "semantic_type": "string", + "json_type": "string", "index": 0, - "array_depth": 1, + "array_depth": 0, "optional": false, - "example": "['USDT', 'USDC']", + "example": "'v1.withdrawal'", "comment": [ - "The token currency to query for, if nil or empty, return all withdrawals. Otherwise, only entries matching the filter will be returned" + "The websocket channel to which the response is sent" ] }, { - "name": "start_time", - "lite_name": "st", - "semantic_type": "timestamp", + "name": "selector", + "lite_name": "s1", + "semantic_type": "string", "json_type": "string", "index": 1, "array_depth": 0, - "optional": true, - "default": "0", - "example": "'1697788800000000000'", + "optional": false, + "example": "'BTC_USDT_Perp'", "comment": [ - "The start time to query for in unix nanoseconds" + "Primary selector" ] }, { - "name": "end_time", - "lite_name": "et", - "semantic_type": "timestamp", + "name": "sequence_number", + "lite_name": "sn", + "semantic_type": "uint64", "json_type": "string", "index": 2, "array_depth": 0, - "optional": true, - "default": "now()", - "example": "'1697788800000000000'", + "optional": false, + "example": "'872634876'", "comment": [ - "The end time to query for in unix nanoseconds" + "A running sequence number that determines global message order within the specific stream" ] }, { - "name": "limit", - "lite_name": "l", - "semantic_type": "uint32", - "json_type": "integer", + "name": "feed", + "lite_name": "f", + "semantic_type": "Withdrawal", + "json_type": "Withdrawal", "index": 3, "array_depth": 0, - "optional": true, - "default": "500", - "example": "500", + "optional": false, "comment": [ - "The limit to query for. Defaults to 500; Max 1000" + "The Withdrawal object" ] }, { - "name": "cursor", - "lite_name": "c1", - "semantic_type": "string", + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", "json_type": "string", "index": 4, "array_depth": 0, - "optional": true, - "default": "''", - "example": "''", + "optional": false, + "example": "'872634875'", "comment": [ - "The cursor to indicate when to start the next query from" + "The previous sequence number that determines global message order within the specific stream" ] } ], "comment": [ - "The request to get the historical withdrawals of an account", - "The history is returned in reverse chronological order", - "", - "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e" + "Subscribes to a feed of withdrawal updates." ] }, { - "name": "WithdrawalHistory", - "is_root": true, + "name": "CancelStatusFeed", + "is_root": false, "fields": [ { - "name": "tx_id", - "lite_name": "ti", + "name": "sub_account_id", + "lite_name": "sa", "semantic_type": "uint64", "json_type": "string", "index": 0, "array_depth": 0, "optional": false, - "example": "'1028403'", + "example": "'$GRVT_SUB_ACCOUNT_ID'", "comment": [ - "The transaction ID of the withdrawal" + "The subaccount ID that requested the cancellation" ] }, { - "name": "from_account_id", - "lite_name": "fa", - "semantic_type": "address", + "name": "client_order_id", + "lite_name": "co", + "semantic_type": "uint64", "json_type": "string", "index": 1, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'23042'", "comment": [ - "The subaccount to withdraw from" + "A unique identifier for the active order within a subaccount, specified by the client" ] }, { - "name": "to_eth_address", - "lite_name": "te", - "semantic_type": "address", + "name": "order_id", + "lite_name": "oi", + "semantic_type": "uint128", "json_type": "string", "index": 2, "array_depth": 0, "optional": false, - "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "example": "'10000101000203040506'", "comment": [ - "The ethereum address to withdraw to" + "A unique 128-bit identifier for the order, deterministically generated within the GRVT backend" ] }, { - "name": "currency", - "lite_name": "c", - "semantic_type": "Currency", - "json_type": "Currency", + "name": "reason", + "lite_name": "r", + "semantic_type": "OrderRejectReason", + "json_type": "OrderRejectReason", "index": 3, "array_depth": 0, "optional": false, - "example": "'USDT'", "comment": [ - "The token currency to withdraw" + "The user-provided reason for cancelling the order" ] }, { - "name": "num_tokens", - "lite_name": "nt", - "semantic_type": "string", + "name": "update_time", + "lite_name": "ut", + "semantic_type": "timestamp", "json_type": "string", "index": 4, "array_depth": 0, - "optional": false, - "example": "'1500.0'", + "optional": true, + "default": "0", + "example": "'1697788800000000000'", "comment": [ - "The number of tokens to withdraw" + "[Filled by GRVT Backend] Time at which the cancellation status was updated by GRVT in unix nanoseconds" ] }, { - "name": "signature", - "lite_name": "s", - "semantic_type": "Signature", - "json_type": "Signature", + "name": "cancel_status", + "lite_name": "cs", + "semantic_type": "CancelStatus", + "json_type": "CancelStatus", "index": 5, "array_depth": 0, "optional": false, "comment": [ - "The signature of the withdrawal" - ] - }, - { - "name": "event_time", - "lite_name": "et", - "semantic_type": "timestamp", - "json_type": "string", - "index": 6, - "array_depth": 0, - "optional": false, - "example": "'1697788800000000000'", - "comment": [ - "The timestamp of the withdrawal in unix nanoseconds" + "Status of the cancellation attempt" ] } ], "comment": [] }, { - "name": "ApiWithdrawalHistoryResponse", + "name": "WSCancelFeedDataV1", "is_root": true, "fields": [ { - "name": "result", - "lite_name": "r", - "semantic_type": "WithdrawalHistory", - "json_type": "WithdrawalHistory", + "name": "stream", + "lite_name": "s", + "semantic_type": "string", + "json_type": "string", "index": 0, - "array_depth": 1, + "array_depth": 0, "optional": false, + "example": "'v1.cancel'", "comment": [ - "The withdrawals history matching the request account" + "Stream name" + ] + }, + { + "name": "selector", + "lite_name": "s1", + "semantic_type": "string", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": false, + "example": "'$GRVT_SUB_ACCOUNT_ID'", + "comment": [ + "Primary selector" + ] + }, + { + "name": "sequence_number", + "lite_name": "sn", + "semantic_type": "uint64", + "json_type": "string", + "index": 2, + "array_depth": 0, + "optional": false, + "example": "'872634876'", + "comment": [ + "A running sequence number that determines global message order within the specific stream" + ] + }, + { + "name": "feed", + "lite_name": "f", + "semantic_type": "CancelStatusFeed", + "json_type": "CancelStatusFeed", + "index": 3, + "array_depth": 0, + "optional": false, + "comment": [ + "Data relating to the status of the cancellation attempt" + ] + }, + { + "name": "prev_sequence_number", + "lite_name": "ps", + "semantic_type": "uint64", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'872634875'", + "comment": [ + "The previous sequence number that determines global message order within the specific stream" + ] + } + ], + "comment": [] + }, + { + "name": "WSCancelFeedSelectorV1", + "is_root": true, + "fields": [ + { + "name": "sub_account_id", + "lite_name": "sa", + "semantic_type": "uint64", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": false, + "example": "'$GRVT_SUB_ACCOUNT_ID'", + "comment": [ + "The subaccount ID to filter by" + ], + "selector": "primary" + } + ], + "comment": [ + "Subscribes to a feed of time-to-live expiry events for order cancellations requested by a given subaccount.", + "**This stream presently only provides expiry updates for cancel-order requests set with a valid TTL value**.", + "Successful order cancellations will reflect as updates published to the (order-state stream)[https://api-docs.grvt.io/trading_streams/#order-state].", + "_A future release will expand the functionality of this stream to provide more general status updates on order cancellation requests._", + "Each Order can be uniquely identified by its `client_order_id`.", + "" + ] + }, + { + "name": "ApiWithdrawalRequest", + "is_root": true, + "fields": [ + { + "name": "from_account_id", + "lite_name": "fa", + "semantic_type": "address", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": false, + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "comment": [ + "The main account to withdraw from" + ] + }, + { + "name": "to_eth_address", + "lite_name": "te", + "semantic_type": "address", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": false, + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "comment": [ + "The Ethereum wallet to withdraw into" + ] + }, + { + "name": "currency", + "lite_name": "c", + "semantic_type": "Currency", + "json_type": "Currency", + "index": 2, + "array_depth": 0, + "optional": false, + "example": "'USDT'", + "comment": [ + "The token currency to withdraw" + ] + }, + { + "name": "num_tokens", + "lite_name": "nt", + "semantic_type": "string", + "json_type": "string", + "index": 3, + "array_depth": 0, + "optional": false, + "example": "'1500.0'", + "comment": [ + "The number of tokens to withdraw, quoted in tokenCurrency decimal units" + ] + }, + { + "name": "signature", + "lite_name": "s", + "semantic_type": "Signature", + "json_type": "Signature", + "index": 4, + "array_depth": 0, + "optional": false, + "comment": [ + "The signature of the withdrawal" + ] + } + ], + "comment": [ + "Leverage this API to initialize a withdrawal from GRVT's Hyperchain onto Ethereum.", + "Do take note that the bridging process does take time. The GRVT UI will help you keep track of bridging progress, and notify you once its complete.", + "", + "If not withdrawing the entirety of your balance, there is a minimum withdrawal amount. Currently that amount is ~25 USDT.", + "Withdrawal fees also apply to cover the cost of the Ethereum transaction.", + "Note that your funds will always remain in self-custory throughout the withdrawal process. At no stage does GRVT gain control over your funds." + ] + }, + { + "name": "ApiTransferRequest", + "is_root": true, + "fields": [ + { + "name": "from_account_id", + "lite_name": "fa", + "semantic_type": "address", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": false, + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "comment": [ + "The main account to transfer from" + ] + }, + { + "name": "from_sub_account_id", + "lite_name": "fs", + "semantic_type": "uint64", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": false, + "example": "'$GRVT_SUB_ACCOUNT_ID'", + "comment": [ + "The subaccount to transfer from (0 if transferring from main account)" + ] + }, + { + "name": "to_account_id", + "lite_name": "ta", + "semantic_type": "address", + "json_type": "string", + "index": 2, + "array_depth": 0, + "optional": false, + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "comment": [ + "The main account to deposit into" + ] + }, + { + "name": "to_sub_account_id", + "lite_name": "ts", + "semantic_type": "uint64", + "json_type": "string", + "index": 3, + "array_depth": 0, + "optional": false, + "example": "'$GRVT_SUB_ACCOUNT_ID'", + "comment": [ + "The subaccount to transfer to (0 if transferring to main account)" + ] + }, + { + "name": "currency", + "lite_name": "c", + "semantic_type": "Currency", + "json_type": "Currency", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'USDT'", + "comment": [ + "The token currency to transfer" + ] + }, + { + "name": "num_tokens", + "lite_name": "nt", + "semantic_type": "string", + "json_type": "string", + "index": 5, + "array_depth": 0, + "optional": false, + "example": "'1500.0'", + "comment": [ + "The number of tokens to transfer, quoted in tokenCurrency decimal units" + ] + }, + { + "name": "signature", + "lite_name": "s", + "semantic_type": "Signature", + "json_type": "Signature", + "index": 6, + "array_depth": 0, + "optional": false, + "comment": [ + "The signature of the transfer" + ] + }, + { + "name": "transfer_type", + "lite_name": "tt", + "semantic_type": "TransferType", + "json_type": "TransferType", + "index": 7, + "array_depth": 0, + "optional": false, + "comment": [ + "The type of transfer" + ] + }, + { + "name": "transfer_metadata", + "lite_name": "tm", + "semantic_type": "string", + "json_type": "string", + "index": 8, + "array_depth": 0, + "optional": false, + "example": "{\"provider\":\"XY\",\"direction\":\"WITHDRAWAL\",\"provider_tx_id\":\"txn123456\",\"chainid\":\"42161\",\"endpoint\":\"0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0\"}", + "comment": [ + "The metadata of the transfer" + ] + } + ], + "comment": [ + "This API allows you to transfer funds in multiple different ways\u003cul\u003e", + "\u003cli\u003eBetween SubAccounts within your Main Account\u003c/li\u003e", + "\u003cli\u003eBetween your MainAccount and your SubAccounts\u003c/li\u003e", + "\u003cli\u003eTo other MainAccounts that you have previously allowlisted\u003c/li\u003e", + "\u003c/ul\u003e\u003cb\u003eFast Withdrawal Funding Address\u003c/b\u003e", + "For fast withdrawals, funds must be sent to the designated funding account address. Please ensure you use the correct address based on the environment:", + "\u003cb\u003eProduction Environment Address:\u003c/b\u003e", + "\u003cem\u003e[To be updated, not ready yet]\u003c/em\u003e", + "This address should be specified as the \u003ccode\u003eto_account_id\u003c/code\u003e in your API requests for transferring funds using the transfer API. Ensure accurate input to avoid loss of funds or use the UI.", + "" + ] + }, + { + "name": "ApiDepositHistoryRequest", + "is_root": true, + "fields": [ + { + "name": "currency", + "lite_name": "c", + "semantic_type": "Currency", + "json_type": "Currency", + "index": 0, + "array_depth": 1, + "optional": false, + "example": "['USDT', 'USDC']", + "comment": [ + "The token currency to query for, if nil or empty, return all deposits. Otherwise, only entries matching the filter will be returned" + ] + }, + { + "name": "start_time", + "lite_name": "st", + "semantic_type": "timestamp", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": true, + "default": "0", + "example": "'1697788800000000000'", + "comment": [ + "The start time to query for in unix nanoseconds" + ] + }, + { + "name": "end_time", + "lite_name": "et", + "semantic_type": "timestamp", + "json_type": "string", + "index": 2, + "array_depth": 0, + "optional": true, + "default": "now()", + "example": "'1697788800000000000'", + "comment": [ + "The end time to query for in unix nanoseconds" + ] + }, + { + "name": "limit", + "lite_name": "l", + "semantic_type": "uint32", + "json_type": "integer", + "index": 3, + "array_depth": 0, + "optional": true, + "default": "500", + "example": "500", + "comment": [ + "The limit to query for. Defaults to 500; Max 1000" + ] + }, + { + "name": "cursor", + "lite_name": "c1", + "semantic_type": "string", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": true, + "default": "''", + "example": "''", + "comment": [ + "The cursor to indicate when to start the next query from" + ] + } + ], + "comment": [ + "The request to get the historical deposits of an account", + "The history is returned in reverse chronological order", + "", + "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e" + ] + }, + { + "name": "DepositHistory", + "is_root": false, + "fields": [ + { + "name": "l_1_hash", + "lite_name": "l1", + "semantic_type": "uint256", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": false, + "example": "'0x10000101000203040506'", + "comment": [ + "The L1 txHash of the deposit" + ] + }, + { + "name": "l_2_hash", + "lite_name": "l2", + "semantic_type": "uint256", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": false, + "example": "'0x10000101000203040506'", + "comment": [ + "The L2 txHash of the deposit" + ] + }, + { + "name": "to_account_id", + "lite_name": "ta", + "semantic_type": "address", + "json_type": "string", + "index": 2, + "array_depth": 0, + "optional": false, + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "comment": [ + "The account to deposit into" + ] + }, + { + "name": "currency", + "lite_name": "c", + "semantic_type": "Currency", + "json_type": "Currency", + "index": 3, + "array_depth": 0, + "optional": false, + "example": "'USDT'", + "comment": [ + "The token currency to deposit" + ] + }, + { + "name": "num_tokens", + "lite_name": "nt", + "semantic_type": "string", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'1500.0'", + "comment": [ + "The number of tokens to deposit" + ] + }, + { + "name": "initiated_time", + "lite_name": "it", + "semantic_type": "timestamp", + "json_type": "string", + "index": 5, + "array_depth": 0, + "optional": false, + "example": "'1697788800000000000'", + "comment": [ + "The timestamp when the deposit was initiated on L1 in unix nanoseconds" + ] + }, + { + "name": "confirmed_time", + "lite_name": "ct", + "semantic_type": "timestamp", + "json_type": "string", + "index": 6, + "array_depth": 0, + "optional": false, + "example": "'1697788800000000000'", + "comment": [ + "The timestamp when the deposit was confirmed on L2 in unix nanoseconds" + ] + }, + { + "name": "from_address", + "lite_name": "fa", + "semantic_type": "address", + "json_type": "string", + "index": 7, + "array_depth": 0, + "optional": false, + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "comment": [ + "The address of the sender" + ] + } + ], + "comment": [] + }, + { + "name": "ApiDepositHistoryResponse", + "is_root": true, + "fields": [ + { + "name": "result", + "lite_name": "r", + "semantic_type": "DepositHistory", + "json_type": "DepositHistory", + "index": 0, + "array_depth": 1, + "optional": false, + "comment": [ + "The deposit history matching the request account" + ] + }, + { + "name": "next", + "lite_name": "n", + "semantic_type": "string", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": true, + "default": "''", + "example": "'Qw0918='", + "comment": [ + "The cursor to indicate when to start the next query from" + ] + } + ], + "comment": [] + }, + { + "name": "ApiTransferHistoryRequest", + "is_root": true, + "fields": [ + { + "name": "currency", + "lite_name": "c", + "semantic_type": "Currency", + "json_type": "Currency", + "index": 0, + "array_depth": 1, + "optional": false, + "example": "['USDT', 'USDC']", + "comment": [ + "The token currency to query for, if nil or empty, return all transfers. Otherwise, only entries matching the filter will be returned" + ] + }, + { + "name": "start_time", + "lite_name": "st", + "semantic_type": "timestamp", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": true, + "default": "0", + "example": "'1697788800000000000'", + "comment": [ + "The start time to query for in unix nanoseconds" + ] + }, + { + "name": "end_time", + "lite_name": "et", + "semantic_type": "timestamp", + "json_type": "string", + "index": 2, + "array_depth": 0, + "optional": true, + "default": "now()", + "example": "'1697788800000000000'", + "comment": [ + "The end time to query for in unix nanoseconds" + ] + }, + { + "name": "limit", + "lite_name": "l", + "semantic_type": "uint32", + "json_type": "integer", + "index": 3, + "array_depth": 0, + "optional": true, + "default": "500", + "example": "500", + "comment": [ + "The limit to query for. Defaults to 500; Max 1000" + ] + }, + { + "name": "cursor", + "lite_name": "c1", + "semantic_type": "string", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": true, + "default": "''", + "example": "''", + "comment": [ + "The cursor to indicate when to start the next query from" + ] + }, + { + "name": "tx_id", + "lite_name": "ti", + "semantic_type": "uint64", + "json_type": "string", + "index": 5, + "array_depth": 0, + "optional": true, + "default": "0", + "example": "'1028403'", + "comment": [ + "The transaction ID to query for" + ] + } + ], + "comment": [ + "The request to get the historical transfers of an account", + "The history is returned in reverse chronological order", + "", + "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e" + ] + }, + { + "name": "ApiTransferHistoryResponse", + "is_root": true, + "fields": [ + { + "name": "result", + "lite_name": "r", + "semantic_type": "TransferHistory", + "json_type": "TransferHistory", + "index": 0, + "array_depth": 1, + "optional": false, + "comment": [ + "The transfer history matching the request account" + ] + }, + { + "name": "next", + "lite_name": "n", + "semantic_type": "string", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": true, + "default": "''", + "example": "'Qw0918='", + "comment": [ + "The cursor to indicate when to start the next query from" + ] + } + ], + "comment": [] + }, + { + "name": "ApiWithdrawalHistoryRequest", + "is_root": true, + "fields": [ + { + "name": "currency", + "lite_name": "c", + "semantic_type": "Currency", + "json_type": "Currency", + "index": 0, + "array_depth": 1, + "optional": false, + "example": "['USDT', 'USDC']", + "comment": [ + "The token currency to query for, if nil or empty, return all withdrawals. Otherwise, only entries matching the filter will be returned" + ] + }, + { + "name": "start_time", + "lite_name": "st", + "semantic_type": "timestamp", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": true, + "default": "0", + "example": "'1697788800000000000'", + "comment": [ + "The start time to query for in unix nanoseconds" + ] + }, + { + "name": "end_time", + "lite_name": "et", + "semantic_type": "timestamp", + "json_type": "string", + "index": 2, + "array_depth": 0, + "optional": true, + "default": "now()", + "example": "'1697788800000000000'", + "comment": [ + "The end time to query for in unix nanoseconds" + ] + }, + { + "name": "limit", + "lite_name": "l", + "semantic_type": "uint32", + "json_type": "integer", + "index": 3, + "array_depth": 0, + "optional": true, + "default": "500", + "example": "500", + "comment": [ + "The limit to query for. Defaults to 500; Max 1000" + ] + }, + { + "name": "cursor", + "lite_name": "c1", + "semantic_type": "string", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": true, + "default": "''", + "example": "''", + "comment": [ + "The cursor to indicate when to start the next query from" + ] + } + ], + "comment": [ + "The request to get the historical withdrawals of an account", + "The history is returned in reverse chronological order", + "", + "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e" + ] + }, + { + "name": "WithdrawalHistory", + "is_root": true, + "fields": [ + { + "name": "tx_id", + "lite_name": "ti", + "semantic_type": "uint64", + "json_type": "string", + "index": 0, + "array_depth": 0, + "optional": false, + "example": "'1028403'", + "comment": [ + "The transaction ID of the withdrawal" + ] + }, + { + "name": "from_account_id", + "lite_name": "fa", + "semantic_type": "address", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": false, + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "comment": [ + "The subaccount to withdraw from" + ] + }, + { + "name": "to_eth_address", + "lite_name": "te", + "semantic_type": "address", + "json_type": "string", + "index": 2, + "array_depth": 0, + "optional": false, + "example": "'0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0'", + "comment": [ + "The ethereum address to withdraw to" + ] + }, + { + "name": "currency", + "lite_name": "c", + "semantic_type": "Currency", + "json_type": "Currency", + "index": 3, + "array_depth": 0, + "optional": false, + "example": "'USDT'", + "comment": [ + "The token currency to withdraw" + ] + }, + { + "name": "num_tokens", + "lite_name": "nt", + "semantic_type": "string", + "json_type": "string", + "index": 4, + "array_depth": 0, + "optional": false, + "example": "'1500.0'", + "comment": [ + "The number of tokens to withdraw" + ] + }, + { + "name": "signature", + "lite_name": "s", + "semantic_type": "Signature", + "json_type": "Signature", + "index": 5, + "array_depth": 0, + "optional": false, + "comment": [ + "The signature of the withdrawal" + ] + }, + { + "name": "event_time", + "lite_name": "et", + "semantic_type": "timestamp", + "json_type": "string", + "index": 6, + "array_depth": 0, + "optional": false, + "example": "'1697788800000000000'", + "comment": [ + "The timestamp of the withdrawal in unix nanoseconds" + ] + } + ], + "comment": [] + }, + { + "name": "ApiWithdrawalHistoryResponse", + "is_root": true, + "fields": [ + { + "name": "result", + "lite_name": "r", + "semantic_type": "WithdrawalHistory", + "json_type": "WithdrawalHistory", + "index": 0, + "array_depth": 1, + "optional": false, + "comment": [ + "The withdrawals history matching the request account" + ] + }, + { + "name": "next", + "lite_name": "n", + "semantic_type": "string", + "json_type": "string", + "index": 1, + "array_depth": 0, + "optional": true, + "default": "''", + "example": "'Qw0918='", + "comment": [ + "The cursor to indicate when to start the next query from" + ] + } + ], + "comment": [] + } + ], + "enums": [ + { + "name": "BridgeType", + "values": [ + { + "name": "XY", + "value": 1, + "comment": [ + "XY Bridge type" + ] + } + ], + "comment": [] + }, + { + "name": "BrokerTag", + "values": [ + { + "name": "COIN_ROUTES", + "value": 1, + "comment": [ + "CoinRoutes" + ] + }, + { + "name": "ALERTATRON", + "value": 2, + "comment": [ + "Alertatron" + ] + }, + { + "name": "ORIGAMI", + "value": 3, + "comment": [ + "Origami" + ] + } + ], + "comment": [ + "BrokerTag is a tag for the broker that the order is sent from." + ] + }, + { + "name": "CancelStatus", + "values": [ + { + "name": "EXPIRED", + "value": 1, + "comment": [ + "Cancellation has expired because corresponding order had not arrived within the defined time-to-live window." + ] + } + ], + "comment": [] + }, + { + "name": "CandlestickInterval", + "values": [ + { + "name": "CI_1_M", + "value": 1, + "comment": [ + "1 minute" + ] + }, + { + "name": "CI_3_M", + "value": 2, + "comment": [ + "3 minutes" + ] + }, + { + "name": "CI_5_M", + "value": 3, + "comment": [ + "5 minutes" + ] + }, + { + "name": "CI_15_M", + "value": 4, + "comment": [ + "15 minutes" + ] + }, + { + "name": "CI_30_M", + "value": 5, + "comment": [ + "30 minutes" + ] + }, + { + "name": "CI_1_H", + "value": 6, + "comment": [ + "1 hour" + ] + }, + { + "name": "CI_2_H", + "value": 7, + "comment": [ + "2 hour" + ] + }, + { + "name": "CI_4_H", + "value": 8, + "comment": [ + "4 hour" + ] + }, + { + "name": "CI_6_H", + "value": 9, + "comment": [ + "6 hour" + ] + }, + { + "name": "CI_8_H", + "value": 10, + "comment": [ + "8 hour" + ] + }, + { + "name": "CI_12_H", + "value": 11, + "comment": [ + "12 hour" + ] + }, + { + "name": "CI_1_D", + "value": 12, + "comment": [ + "1 day" + ] + }, + { + "name": "CI_3_D", + "value": 13, + "comment": [ + "3 days" + ] + }, + { + "name": "CI_5_D", + "value": 14, + "comment": [ + "5 days" + ] + }, + { + "name": "CI_1_W", + "value": 15, + "comment": [ + "1 week" + ] + }, + { + "name": "CI_2_W", + "value": 16, + "comment": [ + "2 weeks" + ] + }, + { + "name": "CI_3_W", + "value": 17, + "comment": [ + "3 weeks" + ] + }, + { + "name": "CI_4_W", + "value": 18, + "comment": [ + "4 weeks" + ] + } + ], + "comment": [] + }, + { + "name": "CandlestickType", + "values": [ + { + "name": "TRADE", + "value": 1, + "comment": [ + "Tracks traded prices" + ] + }, + { + "name": "MARK", + "value": 2, + "comment": [ + "Tracks mark prices" + ] + }, + { + "name": "INDEX", + "value": 3, + "comment": [ + "Tracks index prices" + ] + }, + { + "name": "MID", + "value": 4, + "comment": [ + "Tracks book mid prices" + ] + } + ], + "comment": [] + }, + { + "name": "Currency", + "values": [ + { + "name": "USD", + "value": 1, + "comment": [ + "the USD fiat currency" + ] + }, + { + "name": "USDC", + "value": 2, + "comment": [ + "the USDC token" + ] + }, + { + "name": "USDT", + "value": 3, + "comment": [ + "the USDT token" + ] + }, + { + "name": "ETH", + "value": 4, + "comment": [ + "the ETH token" + ] + }, + { + "name": "BTC", + "value": 5, + "comment": [ + "the BTC token" + ] + }, + { + "name": "SOL", + "value": 6, + "comment": [ + "the SOL token" + ] + }, + { + "name": "ARB", + "value": 7, + "comment": [ + "the ARB token" + ] + }, + { + "name": "BNB", + "value": 8, + "comment": [ + "the BNB token" + ] + }, + { + "name": "ZK", + "value": 9, + "comment": [ + "the ZK token" + ] + }, + { + "name": "POL", + "value": 10, + "comment": [ + "the POL token" + ] + }, + { + "name": "OP", + "value": 11, + "comment": [ + "the OP token" + ] + }, + { + "name": "ATOM", + "value": 12, + "comment": [ + "the ATOM token" + ] + }, + { + "name": "KPEPE", + "value": 13, + "comment": [ + "the 1000PEPE token" + ] + }, + { + "name": "TON", + "value": 14, + "comment": [ + "the TON token" ] }, { - "name": "next", - "lite_name": "n", - "semantic_type": "string", - "json_type": "string", - "index": 1, - "array_depth": 0, - "optional": true, - "default": "''", - "example": "'Qw0918='", + "name": "XRP", + "value": 15, "comment": [ - "The cursor to indicate when to start the next query from" + "the XRP token" ] - } - ], - "comment": [] - } - ], - "enums": [ - { - "name": "BridgeType", - "values": [ + }, { - "name": "XY", - "value": 1, + "name": "XLM", + "value": 16, "comment": [ - "XY Bridge type" + "the XLM token" ] - } - ], - "comment": [] - }, - { - "name": "CandlestickInterval", - "values": [ + }, { - "name": "CI_1_M", - "value": 1, + "name": "WLD", + "value": 17, "comment": [ - "1 minute" + "the WLD token" ] }, { - "name": "CI_3_M", - "value": 2, + "name": "WIF", + "value": 18, "comment": [ - "3 minutes" + "the WIF token" ] }, { - "name": "CI_5_M", - "value": 3, + "name": "VIRTUAL", + "value": 19, "comment": [ - "5 minutes" + "the VIRTUAL token" ] }, { - "name": "CI_15_M", - "value": 4, + "name": "TRUMP", + "value": 20, "comment": [ - "15 minutes" + "the TRUMP token" ] }, { - "name": "CI_30_M", - "value": 5, + "name": "SUI", + "value": 21, "comment": [ - "30 minutes" + "the SUI token" ] }, { - "name": "CI_1_H", - "value": 6, + "name": "KSHIB", + "value": 22, "comment": [ - "1 hour" + "the 1000SHIB token" ] }, { - "name": "CI_2_H", - "value": 7, + "name": "POPCAT", + "value": 23, "comment": [ - "2 hour" + "the POPCAT token" ] }, { - "name": "CI_4_H", - "value": 8, + "name": "PENGU", + "value": 24, "comment": [ - "4 hour" + "the PENGU token" ] }, { - "name": "CI_6_H", - "value": 9, + "name": "LINK", + "value": 25, "comment": [ - "6 hour" + "the LINK token" ] }, { - "name": "CI_8_H", - "value": 10, + "name": "KBONK", + "value": 26, "comment": [ - "8 hour" + "the 1000BONK token" ] }, { - "name": "CI_12_H", - "value": 11, + "name": "JUP", + "value": 27, "comment": [ - "12 hour" + "the JUP token" ] }, { - "name": "CI_1_D", - "value": 12, + "name": "FARTCOIN", + "value": 28, "comment": [ - "1 day" + "the FARTCOIN token" ] }, { - "name": "CI_3_D", - "value": 13, + "name": "ENA", + "value": 29, "comment": [ - "3 days" + "the ENA token" ] }, { - "name": "CI_5_D", - "value": 14, + "name": "DOGE", + "value": 30, "comment": [ - "5 days" + "the DOGE token" ] }, { - "name": "CI_1_W", - "value": 15, + "name": "AIXBT", + "value": 31, "comment": [ - "1 week" + "the AIXBT token" ] }, { - "name": "CI_2_W", - "value": 16, + "name": "AI_16_Z", + "value": 32, "comment": [ - "2 weeks" + "the AI16Z token" ] }, { - "name": "CI_3_W", - "value": 17, + "name": "ADA", + "value": 33, "comment": [ - "3 weeks" + "the ADA token" ] }, { - "name": "CI_4_W", - "value": 18, + "name": "AAVE", + "value": 34, "comment": [ - "4 weeks" + "the AAVE token" ] - } - ], - "comment": [] - }, - { - "name": "CandlestickType", - "values": [ + }, { - "name": "TRADE", - "value": 1, + "name": "BERA", + "value": 35, "comment": [ - "Tracks traded prices" + "the BERA token" ] }, { - "name": "MARK", - "value": 2, + "name": "VINE", + "value": 36, "comment": [ - "Tracks mark prices" + "the VINE token" ] }, { - "name": "INDEX", - "value": 3, + "name": "PENDLE", + "value": 37, "comment": [ - "Tracks index prices" + "the PENDLE token" ] }, { - "name": "MID", - "value": 4, + "name": "UXLINK", + "value": 38, "comment": [ - "Tracks book mid prices" + "the UXLINK token" ] } ], - "comment": [] + "comment": [ + "The list of Currencies that are supported on the GRVT exchange" + ] }, { - "name": "Currency", + "name": "EpochBadgeType", "values": [ { - "name": "USD", + "name": "CHAMPION", "value": 1, "comment": [ - "the USD fiat currency" + "Champion" ] }, { - "name": "USDC", + "name": "LEGEND", "value": 2, "comment": [ - "the USDC token" + "Legend" ] }, { - "name": "USDT", + "name": "VETERAN", "value": 3, "comment": [ - "the USDT token" + "Veteran" ] }, { - "name": "ETH", + "name": "ELITE", "value": 4, "comment": [ - "the ETH token" + "Elite" ] }, { - "name": "BTC", + "name": "MASTER", "value": 5, "comment": [ - "the BTC token" + "Master" ] }, { - "name": "SOL", + "name": "EXPERT", "value": 6, "comment": [ - "the SOL token" + "Expert" ] }, { - "name": "ARB", + "name": "WARRIOR", "value": 7, "comment": [ - "the ARB token" + "Warrior" ] }, { - "name": "BNB", + "name": "SERGEANT", "value": 8, "comment": [ - "the BNB token" + "Sergeant" ] }, { - "name": "ZK", + "name": "RANGER", "value": 9, "comment": [ - "the ZK token" + "Ranger" ] }, { - "name": "POL", + "name": "CHALLENGER", "value": 10, "comment": [ - "the POL token" + "Challenger" ] }, { - "name": "OP", + "name": "APPRENTICE", "value": 11, "comment": [ - "the OP token" + "Apprentice" ] }, { - "name": "ATOM", + "name": "ROOKIE", "value": 12, "comment": [ - "the ATOM token" - ] - }, - { - "name": "KPEPE", - "value": 13, - "comment": [ - "the 1000PEPE token" - ] - }, - { - "name": "TON", - "value": 14, - "comment": [ - "the TON token" + "Rookie" ] } ], - "comment": [ - "The list of Currencies that are supported on the GRVT exchange" - ] + "comment": [] }, { "name": "InstrumentSettlementPeriod", @@ -12829,6 +14801,13 @@ "comment": [ "the market order has a limit price set" ] + }, + { + "name": "CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED", + "value": 29, + "comment": [ + "client cancel on disconnect triggered" + ] } ], "comment": [] @@ -12874,6 +14853,54 @@ ], "comment": [] }, + { + "name": "RewardEpochStatus", + "values": [ + { + "name": "PAST", + "value": 1, + "comment": [ + "Past" + ] + }, + { + "name": "CURRENT", + "value": 2, + "comment": [ + "Current" + ] + }, + { + "name": "FUTURE", + "value": 3, + "comment": [ + "Future" + ] + } + ], + "comment": [] + }, + { + "name": "RewardProgramType", + "values": [ + { + "name": "ECOSYSTEM", + "value": 1, + "comment": [] + }, + { + "name": "TRADER", + "value": 2, + "comment": [] + }, + { + "name": "LP", + "value": 3, + "comment": [] + } + ], + "comment": [] + }, { "name": "SubAccountTradeInterval", "values": [ @@ -12968,6 +14995,72 @@ ], "comment": [] }, + { + "name": "TriggerBy", + "values": [ + { + "name": "UNSPECIFIED", + "value": 0, + "comment": [ + "no trigger condition" + ] + }, + { + "name": "INDEX", + "value": 1, + "comment": [ + "INDEX - Order is activated when the index price reaches the trigger price" + ] + }, + { + "name": "LAST", + "value": 2, + "comment": [ + "LAST - Order is activated when the last trade price reaches the trigger price" + ] + } + ], + "comment": [ + "Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.", + "", + "Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.", + "", + "" + ] + }, + { + "name": "TriggerType", + "values": [ + { + "name": "UNSPECIFIED", + "value": 0, + "comment": [ + "Not a trigger order. The order executes normally without any trigger conditions." + ] + }, + { + "name": "TAKE_PROFIT", + "value": 1, + "comment": [ + "Take Profit Order - Executes when the price reaches a specified level to secure profits." + ] + }, + { + "name": "STOP_LOSS", + "value": 2, + "comment": [ + "Stop Loss Order - Executes when the price reaches a specified level to limit losses." + ] + } + ], + "comment": [ + "Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.", + "", + "Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.", + "", + "" + ] + }, { "name": "Venue", "values": [