diff --git a/artifacts/apidocs/schemas/aggregated_account_summary.md b/artifacts/apidocs/schemas/aggregated_account_summary.md
index 3934344..dfa4f5c 100644
--- a/artifacts/apidocs/schemas/aggregated_account_summary.md
+++ b/artifacts/apidocs/schemas/aggregated_account_summary.md
@@ -9,6 +9,7 @@
|total_sub_account_equity
`ts1` |string|True|Total equity of the sub accounts, denominated in USD|
|total_vault_investments_balance
`tv` |string|True|Total amount of the vault investments, denominated in USD|
|total_sub_account_available_balance
`ts2` |string|True|Total available balance of the main account, denominated in USD|
+ |total_usd_notional_invested
`tu` |string|True|Total entry (initial investment) amount of the open investments, denominated in USD|
??? info "[SpotBalance](/../../schemas/spot_balance)"
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
@@ -23,3 +24,4 @@
|vault_id
`vi` |string|True|The trading account ID of the vault invested in.|
|num_lp_tokens
`nl` |string|True|The number of shares held by the investor.|
|share_price
`sp` |string|True|The current share price (in USD) of this vault investment.|
+ |usd_notional_invested
`un` |string|True|The USD notional invested in this vault investment.|
diff --git a/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md b/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md
index c19e0de..2f6cb61 100644
--- a/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md
+++ b/artifacts/apidocs/schemas/api_aggregated_account_summary_response.md
@@ -15,6 +15,7 @@
|total_sub_account_equity
`ts1` |string|True|Total equity of the sub accounts, denominated in USD|
|total_vault_investments_balance
`tv` |string|True|Total amount of the vault investments, denominated in USD|
|total_sub_account_available_balance
`ts2` |string|True|Total available balance of the main account, denominated in USD|
+ |total_usd_notional_invested
`tu` |string|True|Total entry (initial investment) amount of the open investments, denominated in USD|
??? info "[SpotBalance](/../../schemas/spot_balance)"
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
@@ -29,3 +30,4 @@
|vault_id
`vi` |string|True|The trading account ID of the vault invested in.|
|num_lp_tokens
`nl` |string|True|The number of shares held by the investor.|
|share_price
`sp` |string|True|The current share price (in USD) of this vault investment.|
+ |usd_notional_invested
`un` |string|True|The USD notional invested in this vault investment.|
diff --git a/artifacts/apidocs/schemas/api_create_order_request.md b/artifacts/apidocs/schemas/api_create_order_request.md
index 80a66ad..503b0af 100644
--- a/artifacts/apidocs/schemas/api_create_order_request.md
+++ b/artifacts/apidocs/schemas/api_create_order_request.md
@@ -48,7 +48,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
diff --git a/artifacts/apidocs/schemas/api_create_order_response.md b/artifacts/apidocs/schemas/api_create_order_response.md
index 3cf7199..b0c6aa0 100644
--- a/artifacts/apidocs/schemas/api_create_order_response.md
+++ b/artifacts/apidocs/schemas/api_create_order_response.md
@@ -46,7 +46,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
diff --git a/artifacts/apidocs/schemas/api_funding_account_summary_response.md b/artifacts/apidocs/schemas/api_funding_account_summary_response.md
index 74d6b4b..f3cd5b5 100644
--- a/artifacts/apidocs/schemas/api_funding_account_summary_response.md
+++ b/artifacts/apidocs/schemas/api_funding_account_summary_response.md
@@ -28,6 +28,7 @@
|vault_id
`vi` |string|True|The trading account ID of the vault invested in.|
|num_lp_tokens
`nl` |string|True|The number of shares held by the investor.|
|share_price
`sp` |string|True|The current share price (in USD) of this vault investment.|
+ |usd_notional_invested
`un` |string|True|The USD notional invested in this vault investment.|
??? info "[ClientTier](/../../schemas/client_tier)"
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
diff --git a/artifacts/apidocs/schemas/api_get_order_response.md b/artifacts/apidocs/schemas/api_get_order_response.md
index 7ce9251..7b922b0 100644
--- a/artifacts/apidocs/schemas/api_get_order_response.md
+++ b/artifacts/apidocs/schemas/api_get_order_response.md
@@ -46,7 +46,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
diff --git a/artifacts/apidocs/schemas/api_open_orders_response.md b/artifacts/apidocs/schemas/api_open_orders_response.md
index 071ca49..b20c7d9 100644
--- a/artifacts/apidocs/schemas/api_open_orders_response.md
+++ b/artifacts/apidocs/schemas/api_open_orders_response.md
@@ -48,7 +48,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
diff --git a/artifacts/apidocs/schemas/api_order_history_response.md b/artifacts/apidocs/schemas/api_order_history_response.md
index 0357300..7302cae 100644
--- a/artifacts/apidocs/schemas/api_order_history_response.md
+++ b/artifacts/apidocs/schemas/api_order_history_response.md
@@ -47,7 +47,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
diff --git a/artifacts/apidocs/schemas/api_set_derisk_to_maintenance_margin_ratio_request.md b/artifacts/apidocs/schemas/api_set_derisk_to_maintenance_margin_ratio_request.md
index ffd8bc4..8aaf940 100644
--- a/artifacts/apidocs/schemas/api_set_derisk_to_maintenance_margin_ratio_request.md
+++ b/artifacts/apidocs/schemas/api_set_derisk_to_maintenance_margin_ratio_request.md
@@ -14,5 +14,5 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
diff --git a/artifacts/apidocs/schemas/api_sub_account_history_response.md b/artifacts/apidocs/schemas/api_sub_account_history_response.md
index 7192109..4150773 100644
--- a/artifacts/apidocs/schemas/api_sub_account_history_response.md
+++ b/artifacts/apidocs/schemas/api_sub_account_history_response.md
@@ -22,6 +22,8 @@
|vault_im_additions
`vi` |string|False
`None`|Total amount of IM (reported in `settle_currency`) deducted from the vault due to redemptions nearing the end of their redemption period|
|derisk_margin
`dm` |string|True|The derisk margin of this sub account|
|derisk_to_maintenance_margin_ratio
`dt` |string|True|The derisk margin to maintenance margin ratio of this sub account|
+ |total_cross_equity
`tc` |string|True|The total equity of this sub account for cross margin|
+ |cross_unrealized_pnl
`cu` |string|True|The unrealized PnL of this sub account for cross margin|
??? info "[MarginType](/../../schemas/margin_type)"
|Value| Description |
|-|-|
diff --git a/artifacts/apidocs/schemas/api_sub_account_summary_response.md b/artifacts/apidocs/schemas/api_sub_account_summary_response.md
index 69c0f37..6e4e176 100644
--- a/artifacts/apidocs/schemas/api_sub_account_summary_response.md
+++ b/artifacts/apidocs/schemas/api_sub_account_summary_response.md
@@ -23,6 +23,8 @@
|vault_im_additions
`vi` |string|False
`None`|Total amount of IM (reported in `settle_currency`) deducted from the vault due to redemptions nearing the end of their redemption period|
|derisk_margin
`dm` |string|True|The derisk margin of this sub account|
|derisk_to_maintenance_margin_ratio
`dt` |string|True|The derisk margin to maintenance margin ratio of this sub account|
+ |total_cross_equity
`tc` |string|True|The total equity of this sub account for cross margin|
+ |cross_unrealized_pnl
`cu` |string|True|The unrealized PnL of this sub account for cross margin|
??? info "[MarginType](/../../schemas/margin_type)"
|Value| Description |
|-|-|
diff --git a/artifacts/apidocs/schemas/api_transfer_history_response.md b/artifacts/apidocs/schemas/api_transfer_history_response.md
index 59ed3cf..9b6b4b3 100644
--- a/artifacts/apidocs/schemas/api_transfer_history_response.md
+++ b/artifacts/apidocs/schemas/api_transfer_history_response.md
@@ -25,7 +25,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[TransferType](/../../schemas/transfer_type)"
|Value| Description |
diff --git a/artifacts/apidocs/schemas/api_transfer_request.md b/artifacts/apidocs/schemas/api_transfer_request.md
index 4ec9f4e..a0c0ffe 100644
--- a/artifacts/apidocs/schemas/api_transfer_request.md
+++ b/artifacts/apidocs/schemas/api_transfer_request.md
@@ -20,7 +20,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[TransferType](/../../schemas/transfer_type)"
|Value| Description |
diff --git a/artifacts/apidocs/schemas/api_vault_burn_tokens_request.md b/artifacts/apidocs/schemas/api_vault_burn_tokens_request.md
index 0abfec2..1560816 100644
--- a/artifacts/apidocs/schemas/api_vault_burn_tokens_request.md
+++ b/artifacts/apidocs/schemas/api_vault_burn_tokens_request.md
@@ -15,5 +15,5 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
diff --git a/artifacts/apidocs/schemas/api_vault_invest_request.md b/artifacts/apidocs/schemas/api_vault_invest_request.md
index 8cc1408..be4cd74 100644
--- a/artifacts/apidocs/schemas/api_vault_invest_request.md
+++ b/artifacts/apidocs/schemas/api_vault_invest_request.md
@@ -15,5 +15,5 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
diff --git a/artifacts/apidocs/schemas/api_vault_redeem_request.md b/artifacts/apidocs/schemas/api_vault_redeem_request.md
index 86c6e0b..21a80b1 100644
--- a/artifacts/apidocs/schemas/api_vault_redeem_request.md
+++ b/artifacts/apidocs/schemas/api_vault_redeem_request.md
@@ -15,5 +15,5 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
diff --git a/artifacts/apidocs/schemas/api_withdrawal_history_response.md b/artifacts/apidocs/schemas/api_withdrawal_history_response.md
index 2393b37..a861d27 100644
--- a/artifacts/apidocs/schemas/api_withdrawal_history_response.md
+++ b/artifacts/apidocs/schemas/api_withdrawal_history_response.md
@@ -23,5 +23,5 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
diff --git a/artifacts/apidocs/schemas/api_withdrawal_request.md b/artifacts/apidocs/schemas/api_withdrawal_request.md
index f0d11bd..f4cc44b 100644
--- a/artifacts/apidocs/schemas/api_withdrawal_request.md
+++ b/artifacts/apidocs/schemas/api_withdrawal_request.md
@@ -16,5 +16,5 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
diff --git a/artifacts/apidocs/schemas/funding_account_summary.md b/artifacts/apidocs/schemas/funding_account_summary.md
index 4cd1faa..0192556 100644
--- a/artifacts/apidocs/schemas/funding_account_summary.md
+++ b/artifacts/apidocs/schemas/funding_account_summary.md
@@ -21,3 +21,4 @@
|vault_id
`vi` |string|True|The trading account ID of the vault invested in.|
|num_lp_tokens
`nl` |string|True|The number of shares held by the investor.|
|share_price
`sp` |string|True|The current share price (in USD) of this vault investment.|
+ |usd_notional_invested
`un` |string|True|The USD notional invested in this vault investment.|
diff --git a/artifacts/apidocs/schemas/jsonrpc_response.md b/artifacts/apidocs/schemas/jsonrpc_response.md
index 05dc32f..423fbfb 100644
--- a/artifacts/apidocs/schemas/jsonrpc_response.md
+++ b/artifacts/apidocs/schemas/jsonrpc_response.md
@@ -6,7 +6,7 @@
|jsonrpc
`j` |string|True|The JSON RPC version to use for the request|
|result
`r` |object|False
`null`|The result for the request|
|error
`e` |Error|False
`null`|The error for the request|
- |id
`i` |integer|False
`0`|Optional Field which is used to match the response by the client.
If not passed, this field will not be returned|
+ |id
`i` |integer|False
`0`|Optional Field which is used to match the response by the client.
If not passed, this field will not be returned.
Range: 0 to 4,294,967,295 (uint32)|
|method
`m` |string|True|The method used in the request for this response (eg: `subscribe` / `unsubscribe` / `v1/instrument` )|
??? info "[Error](/../../schemas/error)"
An error response
diff --git a/artifacts/apidocs/schemas/order.md b/artifacts/apidocs/schemas/order.md
index 320c520..3cb5e7f 100644
--- a/artifacts/apidocs/schemas/order.md
+++ b/artifacts/apidocs/schemas/order.md
@@ -42,7 +42,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
diff --git a/artifacts/apidocs/schemas/signature.md b/artifacts/apidocs/schemas/signature.md
index 0266257..ff2fced 100644
--- a/artifacts/apidocs/schemas/signature.md
+++ b/artifacts/apidocs/schemas/signature.md
@@ -6,5 +6,5 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
diff --git a/artifacts/apidocs/schemas/sub_account.md b/artifacts/apidocs/schemas/sub_account.md
index 28dc97c..e5dba25 100644
--- a/artifacts/apidocs/schemas/sub_account.md
+++ b/artifacts/apidocs/schemas/sub_account.md
@@ -17,6 +17,8 @@
|vault_im_additions
`vi` |string|False
`None`|Total amount of IM (reported in `settle_currency`) deducted from the vault due to redemptions nearing the end of their redemption period|
|derisk_margin
`dm` |string|True|The derisk margin of this sub account|
|derisk_to_maintenance_margin_ratio
`dt` |string|True|The derisk margin to maintenance margin ratio of this sub account|
+ |total_cross_equity
`tc` |string|True|The total equity of this sub account for cross margin|
+ |cross_unrealized_pnl
`cu` |string|True|The unrealized PnL of this sub account for cross margin|
??? info "[MarginType](/../../schemas/margin_type)"
|Value| Description |
|-|-|
diff --git a/artifacts/apidocs/schemas/transfer_history.md b/artifacts/apidocs/schemas/transfer_history.md
index 76438b5..c3d7603 100644
--- a/artifacts/apidocs/schemas/transfer_history.md
+++ b/artifacts/apidocs/schemas/transfer_history.md
@@ -20,7 +20,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[TransferType](/../../schemas/transfer_type)"
|Value| Description |
diff --git a/artifacts/apidocs/schemas/vault_investment.md b/artifacts/apidocs/schemas/vault_investment.md
index 7245b44..09bc2e0 100644
--- a/artifacts/apidocs/schemas/vault_investment.md
+++ b/artifacts/apidocs/schemas/vault_investment.md
@@ -6,3 +6,4 @@
|vault_id
`vi` |string|True|The trading account ID of the vault invested in.|
|num_lp_tokens
`nl` |string|True|The number of shares held by the investor.|
|share_price
`sp` |string|True|The current share price (in USD) of this vault investment.|
+ |usd_notional_invested
`un` |string|True|The USD notional invested in this vault investment.|
diff --git a/artifacts/apidocs/schemas/withdrawal.md b/artifacts/apidocs/schemas/withdrawal.md
index d0ee0ca..783e457 100644
--- a/artifacts/apidocs/schemas/withdrawal.md
+++ b/artifacts/apidocs/schemas/withdrawal.md
@@ -14,5 +14,5 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
diff --git a/artifacts/apidocs/schemas/withdrawal_history.md b/artifacts/apidocs/schemas/withdrawal_history.md
index ce9596c..eaa9632 100644
--- a/artifacts/apidocs/schemas/withdrawal_history.md
+++ b/artifacts/apidocs/schemas/withdrawal_history.md
@@ -18,5 +18,5 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
diff --git a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md
index 296767e..7b47e58 100644
--- a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md
+++ b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md
@@ -49,7 +49,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[OrderMetadata](/../../schemas/order_metadata)"
Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
diff --git a/artifacts/apidocs/schemas/ws_subscribe_request_v1_legacy.md b/artifacts/apidocs/schemas/ws_subscribe_request_v1_legacy.md
index 2e5924d..4cf4331 100644
--- a/artifacts/apidocs/schemas/ws_subscribe_request_v1_legacy.md
+++ b/artifacts/apidocs/schemas/ws_subscribe_request_v1_legacy.md
@@ -3,7 +3,7 @@
|Name
`Lite`|Type|Required
`Default`| Description |
|-|-|-|-|
- |request_id
`ri` |integer|False
`0`|Optional Field which is used to match the response by the client.
If not passed, this field will not be returned|
+ |request_id
`ri` |integer|False
`0`|Optional Field which is used to match the response by the client.
If not passed, this field will not be returned.
Range: 0 to 4,294,967,295 (uint32)|
|stream
`s` |string|True|The channel to subscribe to (eg: ticker.s / ticker.d)|
|feed
`f` |[string]|True|The list of feeds to subscribe to|
|method
`m` |string|True|The method to use for the request (eg: subscribe / unsubscribe)|
diff --git a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md
index 70de8a2..4c390db 100644
--- a/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md
+++ b/artifacts/apidocs/schemas/ws_transfer_feed_data_v1.md
@@ -29,7 +29,7 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
??? info "[TransferType](/../../schemas/transfer_type)"
|Value| Description |
diff --git a/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md b/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md
index 9277c50..48c8523 100644
--- a/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md
+++ b/artifacts/apidocs/schemas/ws_withdrawal_feed_data_v1.md
@@ -23,5 +23,5 @@
|s
`s1` |string|True|Signature S|
|v
`v` |integer|True|Signature V|
|expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days|
- |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.|
+ |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
Range: 0 to 4,294,967,295 (uint32)|
|chain_id
`ci` |string|True|Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.|
diff --git a/artifacts/apidocs/trading_api.md b/artifacts/apidocs/trading_api.md
index 4f6e568..3cb9d28 100644
--- a/artifacts/apidocs/trading_api.md
+++ b/artifacts/apidocs/trading_api.md
@@ -256,6 +256,7 @@ LITE ENDPOINT: lite/v1/create_order
|2114|400|Invalid position linked TPSL orders, position linked TPSL must be a reduce-only order|
|2115|400|Invalid position linked TPSL orders, position linked TPSL must not have smaller size than the position|
|2116|400|Position linked TPSL order for this asset already exists|
+ |2117|400|Position linked TPSL orders must be created from web or mobile clients|
|3004|500|Instrument does not have a valid maintenance margin configuration|
|3005|500|Instrument's underlying currency does not have a valid balance decimal configuration|
|3006|500|Instrument's quote currency does not have a valid balance decimal configuration|
@@ -7366,7 +7367,9 @@ LITE ENDPOINT: lite/v1/account_summary
"is_vault": null,
"vault_im_additions": "123456.78",
"derisk_margin": "185185.77",
- "derisk_to_maintenance_margin_ratio": "1.5"
+ "derisk_to_maintenance_margin_ratio": "1.5",
+ "total_cross_equity": "123456.78",
+ "cross_unrealized_pnl": "123456.78"
}
}
```
@@ -7411,7 +7414,9 @@ LITE ENDPOINT: lite/v1/account_summary
"iv": null,
"vi": "123456.78",
"dm": "185185.77",
- "dt": "1.5"
+ "dt": "1.5",
+ "tc": "123456.78",
+ "cu": "123456.78"
}
}
```
@@ -7760,7 +7765,9 @@ LITE ENDPOINT: lite/v1/account_history
"is_vault": null,
"vault_im_additions": "123456.78",
"derisk_margin": "185185.77",
- "derisk_to_maintenance_margin_ratio": "1.5"
+ "derisk_to_maintenance_margin_ratio": "1.5",
+ "total_cross_equity": "123456.78",
+ "cross_unrealized_pnl": "123456.78"
}],
"next": "Qw0918="
}
@@ -7806,7 +7813,9 @@ LITE ENDPOINT: lite/v1/account_history
"iv": null,
"vi": "123456.78",
"dm": "185185.77",
- "dt": "1.5"
+ "dt": "1.5",
+ "tc": "123456.78",
+ "cu": "123456.78"
}],
"n": "Qw0918="
}
@@ -8183,12 +8192,14 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
"vault_investments": [{
"vault_id": 123456789,
"num_lp_tokens": 1000000,
- "share_price": 1000000
+ "share_price": 1000000,
+ "usd_notional_invested": 1000000
}],
"total_sub_account_balance": "3945034.23",
"total_sub_account_equity": "3945034.23",
"total_vault_investments_balance": "3945034.23",
- "total_sub_account_available_balance": "3945034.23"
+ "total_sub_account_available_balance": "3945034.23",
+ "total_usd_notional_invested": "3945034.23"
}
}
```
@@ -8206,12 +8217,14 @@ LITE ENDPOINT: lite/v1/aggregated_account_summary
"vi": [{
"vi": 123456789,
"nl": 1000000,
- "sp": 1000000
+ "sp": 1000000,
+ "un": 1000000
}],
"ts": "3945034.23",
"ts1": "3945034.23",
"tv": "3945034.23",
- "ts2": "3945034.23"
+ "ts2": "3945034.23",
+ "tu": "3945034.23"
}
}
```
@@ -8506,7 +8519,8 @@ LITE ENDPOINT: lite/v1/funding_account_summary
"vault_investments": [{
"vault_id": 123456789,
"num_lp_tokens": 1000000,
- "share_price": 1000000
+ "share_price": 1000000,
+ "usd_notional_invested": 1000000
}]
},
"tier": {
@@ -8532,7 +8546,8 @@ LITE ENDPOINT: lite/v1/funding_account_summary
"vi": [{
"vi": 123456789,
"nl": 1000000,
- "sp": 1000000
+ "sp": 1000000,
+ "un": 1000000
}]
},
"t": {
diff --git a/artifacts/pysdk/grvt_raw_types.py b/artifacts/pysdk/grvt_raw_types.py
index 55afdf1..1e55674 100644
--- a/artifacts/pysdk/grvt_raw_types.py
+++ b/artifacts/pysdk/grvt_raw_types.py
@@ -611,6 +611,10 @@ class SubAccount:
derisk_margin: str
# The derisk margin to maintenance margin ratio of this sub account
derisk_to_maintenance_margin_ratio: str
+ # The total equity of this sub account for cross margin
+ total_cross_equity: str
+ # The unrealized PnL of this sub account for cross margin
+ cross_unrealized_pnl: str
# Whether this sub account is a vault
is_vault: bool | None = None
# Total amount of IM (reported in `settle_currency`) deducted from the vault due to redemptions nearing the end of their redemption period
@@ -662,6 +666,8 @@ class VaultInvestment:
num_lp_tokens: str
# The current share price (in USD) of this vault investment.
share_price: str
+ # The USD notional invested in this vault investment.
+ usd_notional_invested: str
@dataclass
@@ -682,6 +688,8 @@ class AggregatedAccountSummary:
total_vault_investments_balance: str
# Total available balance of the main account, denominated in USD
total_sub_account_available_balance: str
+ # Total entry (initial investment) amount of the open investments, denominated in USD
+ total_usd_notional_invested: str
@dataclass
@@ -776,6 +784,7 @@ class Signature:
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.
+ Range: 0 to 4,294,967,295 (uint32)
"""
nonce: int
# Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID.
@@ -833,192 +842,11 @@ class ApiGetMarginRulesResponse:
@dataclass
-class JSONRPCRequest:
- """
- All Websocket JSON RPC Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.
- If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).
- When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.
- """
-
- # The JSON RPC version to use for the request
- jsonrpc: str
- # The method to use for the request (eg: `subscribe` / `unsubscribe` / `v1/instrument` )
- method: str
- # The parameters for the request
- params: Any
- """
- Optional Field which is used to match the response by the client.
- If not passed, this field will not be returned
- """
- id: int | None = None
-
-
-@dataclass
-class Error:
- # The error code for the request
- code: int
- # The error message for the request
- message: str
-
-
-@dataclass
-class JSONRPCResponse:
- """
- All Websocket JSON RPC Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.
- If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response.
- """
-
- # The JSON RPC version to use for the request
- jsonrpc: str
- # The method used in the request for this response (eg: `subscribe` / `unsubscribe` / `v1/instrument` )
- method: str
- # The result for the request
- result: Any | None = None
- # The error for the request
- error: Error | None = None
- """
- Optional Field which is used to match the response by the client.
- If not passed, this field will not be returned
- """
- id: int | None = None
-
-
-@dataclass
-class WSSubscribeParams:
- """
- All V1 Websocket Subscription Requests are housed in this wrapper. You may specify a stream and a list of feeds to subscribe to.
- When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.
- Sequence numbers can be either gateway-specific or global:
- - **Gateway Unique Sequence Number**: Increments by one per stream, resets to 0 on gateway restart.
- - **Global Unique Sequence Number**: A cluster-wide unique number assigned to each cluster payload, does not reset on gateway restarts, and can be used to track and identify message order across streams using `sequence_number` and `prev_sequence_number` in the feed response.
- Set `useGlobalSequenceNumber = true` if you need a persistent, unique identifier across all streams or ordering across multiple feeds.
- """
-
- # The channel to subscribe to (eg: ticker.s / ticker.d)
- 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
-class WSSubscribeResult:
- """
- To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:
- All snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas
- Num snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots
- First sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots
- Sequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect
- Duplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.
- When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.
- """
-
- # The channel to subscribe to (eg: ticker.s / ticker.d)
- stream: str
- # The list of feeds subscribed to
- subs: list[str]
- # The list of feeds unsubscribed from
- unsubs: list[str]
- # The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`
- 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
-class WSUnsubscribeParams:
- # The channel to unsubscribe from (eg: ticker.s / ticker.d)
- 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
-class WSUnsubscribeResult:
- # The channel to subscribe to (eg: ticker.s / ticker.d)
- stream: str
- # The list of feeds unsubscribed from
- unsubs: list[str]
-
-
-@dataclass
-class WSSubscribeRequestV1Legacy:
- """
- All V1 Websocket Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.
- If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).
- When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.
- """
-
- # The channel to subscribe to (eg: ticker.s / ticker.d)
- stream: str
- # The list of feeds to subscribe to
- feed: list[str]
- # The method to use for the request (eg: subscribe / unsubscribe)
- method: str
- """
- Optional Field which is used to match the response by the client.
- If not passed, this field will not be returned
- """
- request_id: int | None = None
- # Whether the request is for full data or lite data
- is_full: bool | None = None
-
-
-@dataclass
-class WSSubscribeResponseV1Legacy:
- """
- All V1 Websocket Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.
- If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response.
- To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:- All snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas
- Num snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots
- First sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots
- Sequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect
- Duplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.
- When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.
- """
-
- # The channel to subscribe to (eg: ticker.s / ticker.d)
- stream: str
- # The list of feeds subscribed to
- subs: list[str]
- # The list of feeds unsubscribed from
- unsubs: list[str]
- # The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`
- 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
- """
- request_id: int | None = None
-
-
-@dataclass
-class WSOrderbookLevelsFeedSelectorV1:
- """
- Subscribes to aggregated orderbook updates for a single instrument. The `book.s` channel offers simpler integration. To experience higher publishing rates, please use the `book.d` channel.
- Unlike the `book.d` channel which publishes an initial snapshot, then only streams deltas after, the `book.s` channel publishes full snapshots at each feed.
-
- The Delta feed will work as follows:- On subscription, the server will send a full snapshot of all levels of the Orderbook.
- After the snapshot, the server will only send levels that have changed in value.
-
- Subscription Pattern:- Delta - `instrument@rate`
- Snapshot - `instrument@rate-depth`
-
- Field Semantics:- [DeltaOnly] If a level is not updated, level not published
- If a level is updated, {size: '123'}
- If a level is set to zero, {size: '0'}
- Incoming levels will be published as soon as price moves
- Outgoing levels will be published with `size = 0`
- """
-
+class ApiOrderbookLevelsRequest:
# The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
instrument: str
- """
- The minimal rate at which we publish feeds (in milliseconds)
- Delta (50, 100, 500, 1000)
- Snapshot (500, 1000)
- """
- rate: int
- """
- Depth of the order book to be retrieved
- Delta(0 - `unlimited`)
- Snapshot(10, 50, 100, 500)
- """
- depth: int | None = None
+ # Depth of the order book to be retrieved (10, 50, 100, 500)
+ depth: int
@dataclass
@@ -1044,45 +872,15 @@ class OrderbookLevels:
@dataclass
-class WSOrderbookLevelsFeedDataV1:
- # Stream name
- stream: str
- # Primary selector
- selector: str
- """
- A sequence number used to determine message order within a stream.
- - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
- - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
- - A single cluster payload can be multiplexed into multiple stream payloads.
- - To distinguish each stream payload, a `dedupCounter` is included.
- - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
- """
- sequence_number: str
- # An orderbook levels object matching the request filter
- feed: OrderbookLevels
- # The previous sequence number that determines the message order
- prev_sequence_number: str
+class ApiOrderbookLevelsResponse:
+ # The orderbook levels objects matching the request asset
+ result: OrderbookLevels
@dataclass
-class WSMiniTickerFeedSelectorV1:
- """
- Subscribes to a mini ticker feed for a single instrument. The `mini.s` channel offers simpler integration. To experience higher publishing rates, please use the `mini.d` channel.
- Unlike the `mini.d` channel which publishes an initial snapshot, then only streams deltas after, the `mini.s` channel publishes full snapshots at each feed.
-
- The Delta feed will work as follows:- On subscription, the server will send a full snapshot of the mini ticker.
- After the snapshot, the server will only send deltas of the mini ticker.
- The server will send a delta if any of the fields in the mini ticker have changed.
-
- Field Semantics:- [DeltaOnly] If a field is not updated, {}
- If a field is updated, {field: '123'}
- If a field is set to zero, {field: '0'}
- If a field is set to null, {field: ''}
- """
-
+class ApiMiniTickerRequest:
# The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
instrument: str
- """
- The minimal rate at which we publish feeds (in milliseconds)
- Delta (0 - `raw`, 50, 100, 200, 500, 1000, 5000)
- Snapshot (200, 500, 1000, 5000)
- """
- rate: int
@dataclass
@@ -1112,45 +910,15 @@ class MiniTicker:
@dataclass
-class WSMiniTickerFeedDataV1:
- # Stream name
- stream: str
- # Primary selector
- selector: str
- """
- A sequence number used to determine message order within a stream.
- - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
- - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
- - A single cluster payload can be multiplexed into multiple stream payloads.
- - To distinguish each stream payload, a `dedupCounter` is included.
- - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
- """
- sequence_number: str
- # A mini ticker matching the request filter
- feed: MiniTicker
- # The previous sequence number that determines the message order
- prev_sequence_number: str
+class ApiMiniTickerResponse:
+ # The mini ticker matching the request asset
+ result: MiniTicker
@dataclass
-class WSTickerFeedSelectorV1:
- """
- Subscribes to a ticker feed for a single instrument. The `ticker.s` channel offers simpler integration. To experience higher publishing rates, please use the `ticker.d` channel.
- Unlike the `ticker.d` channel which publishes an initial snapshot, then only streams deltas after, the `ticker.s` channel publishes full snapshots at each feed.
-
- The Delta feed will work as follows:- On subscription, the server will send a full snapshot of the ticker.
- After the snapshot, the server will only send deltas of the ticker.
- The server will send a delta if any of the fields in the ticker have changed.
-
- Field Semantics:- [DeltaOnly] If a field is not updated, {}
- If a field is updated, {field: '123'}
- If a field is set to zero, {field: '0'}
- If a field is set to null, {field: ''}
- """
-
- # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
- instrument: str
- """
- The minimal rate at which we publish feeds (in milliseconds)
- Delta (100, 200, 500, 1000, 5000)
- Snapshot (500, 1000, 5000)
- """
- rate: int
+class ApiTickerRequest:
+ # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
+ instrument: str
@dataclass
@@ -1225,31 +993,21 @@ class Ticker:
@dataclass
-class WSTickerFeedDataV1:
- # Stream name
- stream: str
- # Primary selector
- selector: str
- """
- A sequence number used to determine message order within a stream.
- - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
- - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
- - A single cluster payload can be multiplexed into multiple stream payloads.
- - To distinguish each stream payload, a `dedupCounter` is included.
- - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
- """
- sequence_number: str
- # A ticker matching the request filter
- feed: Ticker
- # The previous sequence number that determines the message order
- prev_sequence_number: str
+class ApiTickerResponse:
+ # The mini ticker matching the request asset
+ result: Ticker
@dataclass
-class WSTradeFeedSelectorV1:
+class ApiTradeRequest:
+ """
+ Retrieves up to 1000 of the most recent trades in any given instrument. Do not use this to poll for data -- a websocket subscription is much more performant, and useful.
+ This endpoint offers public trading data, use the Trading APIs instead to query for your personalized trade tape.
+ """
+
# The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
instrument: str
- # The limit to query for. Valid values are (50, 200, 500, 1000). Default is 50
+ # The limit to query for. Defaults to 500; Max 1000
limit: int
@@ -1285,168 +1043,6 @@ class Trade:
is_rpi: bool
-@dataclass
-class WSTradeFeedDataV1:
- # Stream name
- stream: str
- # Primary selector
- selector: str
- """
- A sequence number used to determine message order within a stream.
- - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
- - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
- - A single cluster payload can be multiplexed into multiple stream payloads.
- - To distinguish each stream payload, a `dedupCounter` is included.
- - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
- """
- sequence_number: str
- # A public trade matching the request filter
- feed: Trade
- # The previous sequence number that determines the message order
- prev_sequence_number: str
-
-
-@dataclass
-class WSCandlestickFeedSelectorV1:
- """
- Subscribes to a stream of Kline/Candlestick updates for an instrument. A Kline is uniquely identified by its open time.
- A new Kline is published every interval (if it exists). Upon subscription, the server will send the 5 most recent Kline for the requested interval.
- """
-
- # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
- instrument: str
- # The interval of each candlestick
- interval: CandlestickInterval
- # The type of candlestick data to retrieve
- type: CandlestickType
-
-
-@dataclass
-class Candlestick:
- # Open time of kline bar in unix nanoseconds
- open_time: str
- # Close time of kline bar in unix nanosecond
- close_time: str
- # The open price, expressed in underlying currency resolution units
- open: str
- # The close price, expressed in underlying currency resolution units
- close: str
- # The high price, expressed in underlying currency resolution units
- high: str
- # The low price, expressed in underlying currency resolution units
- low: str
- # The underlying volume transacted, expressed in base asset decimal units
- volume_b: str
- # The quote volume transacted, expressed in quote asset decimal units
- volume_q: str
- # The number of trades transacted
- trades: int
- # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
- instrument: str
-
-
-@dataclass
-class WSCandlestickFeedDataV1:
- # Stream name
- stream: str
- # Primary selector
- selector: str
- """
- A sequence number used to determine message order within a stream.
- - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
- - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
- - A single cluster payload can be multiplexed into multiple stream payloads.
- - To distinguish each stream payload, a `dedupCounter` is included.
- - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
- """
- sequence_number: str
- # A candlestick entry matching the request filters
- feed: Candlestick
- # The previous sequence number that determines the message order
- prev_sequence_number: str
-
-
-@dataclass
-class WSUnsubscribeAllParams:
- pass
-
-
-@dataclass
-class StreamReference:
- # The channel to subscribe to (eg: ticker.s / ticker.d)
- stream: str
- # The list of selectors for the stream
- selectors: list[str]
-
-
-@dataclass
-class WSUnsubscribeAllResult:
- # The list of stream references unsubscribed from
- stream_reference: list[StreamReference]
-
-
-@dataclass
-class WSListStreamsParams:
- pass
-
-
-@dataclass
-class WSListStreamsResult:
- # The list of stream references the connection is connected to
- stream_reference: list[StreamReference]
-
-
-@dataclass
-class ApiOrderbookLevelsRequest:
- # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
- instrument: str
- # Depth of the order book to be retrieved (10, 50, 100, 500)
- depth: int
-
-
-@dataclass
-class ApiOrderbookLevelsResponse:
- # The orderbook levels objects matching the request asset
- result: OrderbookLevels
-
-
-@dataclass
-class ApiMiniTickerRequest:
- # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
- instrument: str
-
-
-@dataclass
-class ApiMiniTickerResponse:
- # The mini ticker matching the request asset
- result: MiniTicker
-
-
-@dataclass
-class ApiTickerRequest:
- # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
- instrument: str
-
-
-@dataclass
-class ApiTickerResponse:
- # The mini ticker matching the request asset
- result: Ticker
-
-
-@dataclass
-class ApiTradeRequest:
- """
- Retrieves up to 1000 of the most recent trades in any given instrument. Do not use this to poll for data -- a websocket subscription is much more performant, and useful.
- This endpoint offers public trading data, use the Trading APIs instead to query for your personalized trade tape.
- """
-
- # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
- instrument: str
- # The limit to query for. Defaults to 500; Max 1000
- limit: int
-
-
@dataclass
class ApiTradeResponse:
# The public trades matching the request asset
@@ -1598,6 +1194,30 @@ class ApiCandlestickRequest:
cursor: str | None = None
+@dataclass
+class Candlestick:
+ # Open time of kline bar in unix nanoseconds
+ open_time: str
+ # Close time of kline bar in unix nanosecond
+ close_time: str
+ # The open price, expressed in underlying currency resolution units
+ open: str
+ # The close price, expressed in underlying currency resolution units
+ close: str
+ # The high price, expressed in underlying currency resolution units
+ high: str
+ # The low price, expressed in underlying currency resolution units
+ low: str
+ # The underlying volume transacted, expressed in base asset decimal units
+ volume_b: str
+ # The quote volume transacted, expressed in quote asset decimal units
+ volume_q: str
+ # The number of trades transacted
+ trades: int
+ # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
+ instrument: str
+
+
@dataclass
class ApiCandlestickResponse:
# The candlestick result set for given interval
@@ -1652,6 +1272,397 @@ class ApiFundingRateResponse:
next: str | None = None
+@dataclass
+class JSONRPCRequest:
+ """
+ All Websocket JSON RPC Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.
+ If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).
+ When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.
+ """
+
+ # The JSON RPC version to use for the request
+ jsonrpc: str
+ # The method to use for the request (eg: `subscribe` / `unsubscribe` / `v1/instrument` )
+ method: str
+ # The parameters for the request
+ params: Any
+ """
+ Optional Field which is used to match the response by the client.
+ If not passed, this field will not be returned
+ """
+ id: int | None = None
+
+
+@dataclass
+class Error:
+ # The error code for the request
+ code: int
+ # The error message for the request
+ message: str
+
+
+@dataclass
+class JSONRPCResponse:
+ """
+ All Websocket JSON RPC Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.
+ If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response.
+ """
+
+ # The JSON RPC version to use for the request
+ jsonrpc: str
+ # The method used in the request for this response (eg: `subscribe` / `unsubscribe` / `v1/instrument` )
+ method: str
+ # The result for the request
+ result: Any | None = None
+ # The error for the request
+ error: Error | None = None
+ """
+ Optional Field which is used to match the response by the client.
+ If not passed, this field will not be returned.
+ Range: 0 to 4,294,967,295 (uint32)
+ """
+ id: int | None = None
+
+
+@dataclass
+class WSSubscribeParams:
+ """
+ All V1 Websocket Subscription Requests are housed in this wrapper. You may specify a stream and a list of feeds to subscribe to.
+ When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.
+ Sequence numbers can be either gateway-specific or global:
+ - **Gateway Unique Sequence Number**: Increments by one per stream, resets to 0 on gateway restart.
+ - **Global Unique Sequence Number**: A cluster-wide unique number assigned to each cluster payload, does not reset on gateway restarts, and can be used to track and identify message order across streams using `sequence_number` and `prev_sequence_number` in the feed response.
+ Set `useGlobalSequenceNumber = true` if you need a persistent, unique identifier across all streams or ordering across multiple feeds.
+ """
+
+ # The channel to subscribe to (eg: ticker.s / ticker.d)
+ 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
+class WSSubscribeResult:
+ """
+ To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:- All snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas
- Num snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots
- First sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots
- Sequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect
- Duplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.
+ When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.
+ """
+
+ # The channel to subscribe to (eg: ticker.s / ticker.d)
+ stream: str
+ # The list of feeds subscribed to
+ subs: list[str]
+ # The list of feeds unsubscribed from
+ unsubs: list[str]
+ # The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`
+ 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
+class WSUnsubscribeParams:
+ # The channel to unsubscribe from (eg: ticker.s / ticker.d)
+ 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
+class WSUnsubscribeResult:
+ # The channel to subscribe to (eg: ticker.s / ticker.d)
+ stream: str
+ # The list of feeds unsubscribed from
+ unsubs: list[str]
+
+
+@dataclass
+class WSSubscribeRequestV1Legacy:
+ """
+ All V1 Websocket Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.
+ If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).
+ When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.
+ """
+
+ # The channel to subscribe to (eg: ticker.s / ticker.d)
+ stream: str
+ # The list of feeds to subscribe to
+ feed: list[str]
+ # The method to use for the request (eg: subscribe / unsubscribe)
+ method: str
+ """
+ Optional Field which is used to match the response by the client.
+ If not passed, this field will not be returned.
+ Range: 0 to 4,294,967,295 (uint32)
+ """
+ request_id: int | None = None
+ # Whether the request is for full data or lite data
+ is_full: bool | None = None
+
+
+@dataclass
+class WSSubscribeResponseV1Legacy:
+ """
+ All V1 Websocket Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.
+ If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response.
+ To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:- All snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas
- Num snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots
- First sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots
- Sequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect
- Duplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.
+ When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.
+ """
+
+ # The channel to subscribe to (eg: ticker.s / ticker.d)
+ stream: str
+ # The list of feeds subscribed to
+ subs: list[str]
+ # The list of feeds unsubscribed from
+ unsubs: list[str]
+ # The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`
+ 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
+ """
+ request_id: int | None = None
+
+
+@dataclass
+class WSOrderbookLevelsFeedSelectorV1:
+ """
+ Subscribes to aggregated orderbook updates for a single instrument. The `book.s` channel offers simpler integration. To experience higher publishing rates, please use the `book.d` channel.
+ Unlike the `book.d` channel which publishes an initial snapshot, then only streams deltas after, the `book.s` channel publishes full snapshots at each feed.
+
+ The Delta feed will work as follows:- On subscription, the server will send a full snapshot of all levels of the Orderbook.
- After the snapshot, the server will only send levels that have changed in value.
+
+ Subscription Pattern:- Delta - `instrument@rate`
- Snapshot - `instrument@rate-depth`
+
+ Field Semantics:- [DeltaOnly] If a level is not updated, level not published
- If a level is updated, {size: '123'}
- If a level is set to zero, {size: '0'}
- Incoming levels will be published as soon as price moves
- Outgoing levels will be published with `size = 0`
+ """
+
+ # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
+ instrument: str
+ """
+ The minimal rate at which we publish feeds (in milliseconds)
+ Delta (50, 100, 500, 1000)
+ Snapshot (500, 1000)
+ """
+ rate: int
+ """
+ Depth of the order book to be retrieved
+ Delta(0 - `unlimited`)
+ Snapshot(10, 50, 100, 500)
+ """
+ depth: int | None = None
+
+
+@dataclass
+class WSOrderbookLevelsFeedDataV1:
+ # Stream name
+ stream: str
+ # Primary selector
+ selector: str
+ """
+ A sequence number used to determine message order within a stream.
+ - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
+ - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
+ - A single cluster payload can be multiplexed into multiple stream payloads.
+ - To distinguish each stream payload, a `dedupCounter` is included.
+ - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
+ """
+ sequence_number: str
+ # An orderbook levels object matching the request filter
+ feed: OrderbookLevels
+ # The previous sequence number that determines the message order
+ prev_sequence_number: str
+
+
+@dataclass
+class WSMiniTickerFeedSelectorV1:
+ """
+ Subscribes to a mini ticker feed for a single instrument. The `mini.s` channel offers simpler integration. To experience higher publishing rates, please use the `mini.d` channel.
+ Unlike the `mini.d` channel which publishes an initial snapshot, then only streams deltas after, the `mini.s` channel publishes full snapshots at each feed.
+
+ The Delta feed will work as follows:- On subscription, the server will send a full snapshot of the mini ticker.
- After the snapshot, the server will only send deltas of the mini ticker.
- The server will send a delta if any of the fields in the mini ticker have changed.
+
+ Field Semantics:- [DeltaOnly] If a field is not updated, {}
- If a field is updated, {field: '123'}
- If a field is set to zero, {field: '0'}
- If a field is set to null, {field: ''}
+ """
+
+ # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
+ instrument: str
+ """
+ The minimal rate at which we publish feeds (in milliseconds)
+ Delta (0 - `raw`, 50, 100, 200, 500, 1000, 5000)
+ Snapshot (200, 500, 1000, 5000)
+ """
+ rate: int
+
+
+@dataclass
+class WSMiniTickerFeedDataV1:
+ # Stream name
+ stream: str
+ # Primary selector
+ selector: str
+ """
+ A sequence number used to determine message order within a stream.
+ - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
+ - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
+ - A single cluster payload can be multiplexed into multiple stream payloads.
+ - To distinguish each stream payload, a `dedupCounter` is included.
+ - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
+ """
+ sequence_number: str
+ # A mini ticker matching the request filter
+ feed: MiniTicker
+ # The previous sequence number that determines the message order
+ prev_sequence_number: str
+
+
+@dataclass
+class WSTickerFeedSelectorV1:
+ """
+ Subscribes to a ticker feed for a single instrument. The `ticker.s` channel offers simpler integration. To experience higher publishing rates, please use the `ticker.d` channel.
+ Unlike the `ticker.d` channel which publishes an initial snapshot, then only streams deltas after, the `ticker.s` channel publishes full snapshots at each feed.
+
+ The Delta feed will work as follows:- On subscription, the server will send a full snapshot of the ticker.
- After the snapshot, the server will only send deltas of the ticker.
- The server will send a delta if any of the fields in the ticker have changed.
+
+ Field Semantics:- [DeltaOnly] If a field is not updated, {}
- If a field is updated, {field: '123'}
- If a field is set to zero, {field: '0'}
- If a field is set to null, {field: ''}
+ """
+
+ # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
+ instrument: str
+ """
+ The minimal rate at which we publish feeds (in milliseconds)
+ Delta (100, 200, 500, 1000, 5000)
+ Snapshot (500, 1000, 5000)
+ """
+ rate: int
+
+
+@dataclass
+class WSTickerFeedDataV1:
+ # Stream name
+ stream: str
+ # Primary selector
+ selector: str
+ """
+ A sequence number used to determine message order within a stream.
+ - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
+ - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
+ - A single cluster payload can be multiplexed into multiple stream payloads.
+ - To distinguish each stream payload, a `dedupCounter` is included.
+ - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
+ """
+ sequence_number: str
+ # A ticker matching the request filter
+ feed: Ticker
+ # The previous sequence number that determines the message order
+ prev_sequence_number: str
+
+
+@dataclass
+class WSTradeFeedSelectorV1:
+ # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
+ instrument: str
+ # The limit to query for. Valid values are (50, 200, 500, 1000). Default is 50
+ limit: int
+
+
+@dataclass
+class WSTradeFeedDataV1:
+ # Stream name
+ stream: str
+ # Primary selector
+ selector: str
+ """
+ A sequence number used to determine message order within a stream.
+ - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
+ - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
+ - A single cluster payload can be multiplexed into multiple stream payloads.
+ - To distinguish each stream payload, a `dedupCounter` is included.
+ - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
+ """
+ sequence_number: str
+ # A public trade matching the request filter
+ feed: Trade
+ # The previous sequence number that determines the message order
+ prev_sequence_number: str
+
+
+@dataclass
+class WSCandlestickFeedSelectorV1:
+ """
+ Subscribes to a stream of Kline/Candlestick updates for an instrument. A Kline is uniquely identified by its open time.
+ A new Kline is published every interval (if it exists). Upon subscription, the server will send the 5 most recent Kline for the requested interval.
+ """
+
+ # The readable instrument name:- Perpetual: `ETH_USDT_Perp`
- Future: `BTC_USDT_Fut_20Oct23`
- Call: `ETH_USDT_Call_20Oct23_2800`
- Put: `ETH_USDT_Put_20Oct23_2800`
+ instrument: str
+ # The interval of each candlestick
+ interval: CandlestickInterval
+ # The type of candlestick data to retrieve
+ type: CandlestickType
+
+
+@dataclass
+class WSCandlestickFeedDataV1:
+ # Stream name
+ stream: str
+ # Primary selector
+ selector: str
+ """
+ A sequence number used to determine message order within a stream.
+ - If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.
+ - If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.
+ - A single cluster payload can be multiplexed into multiple stream payloads.
+ - To distinguish each stream payload, a `dedupCounter` is included.
+ - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`.
+ """
+ sequence_number: str
+ # A candlestick entry matching the request filters
+ feed: Candlestick
+ # The previous sequence number that determines the message order
+ prev_sequence_number: str
+
+
+@dataclass
+class WSUnsubscribeAllParams:
+ pass
+
+
+@dataclass
+class StreamReference:
+ # The channel to subscribe to (eg: ticker.s / ticker.d)
+ stream: str
+ # The list of selectors for the stream
+ selectors: list[str]
+
+
+@dataclass
+class WSUnsubscribeAllResult:
+ # The list of stream references unsubscribed from
+ stream_reference: list[StreamReference]
+
+
+@dataclass
+class WSListStreamsParams:
+ pass
+
+
+@dataclass
+class WSListStreamsResult:
+ # The list of stream references the connection is connected to
+ stream_reference: list[StreamReference]
+
+
@dataclass
class ApiGetAllInstrumentsRequest:
# Fetch only active instruments
diff --git a/src/codegen/apispec.json b/src/codegen/apispec.json
index 2fdbdf4..57fb075 100644
--- a/src/codegen/apispec.json
+++ b/src/codegen/apispec.json
@@ -1032,6 +1032,11 @@
"message": "Position linked TPSL order for this asset already exists",
"status": 400
},
+ {
+ "code": 2117,
+ "message": "Position linked TPSL orders must be created from web or mobile clients",
+ "status": 400
+ },
{
"code": 3004,
"message": "Instrument does not have a valid maintenance margin configuration",
@@ -4117,6 +4122,32 @@
"comment": [
"The derisk margin to maintenance margin ratio of this sub account"
]
+ },
+ {
+ "name": "total_cross_equity",
+ "lite_name": "tc",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 16,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'123456.78'",
+ "comment": [
+ "The total equity of this sub account for cross margin"
+ ]
+ },
+ {
+ "name": "cross_unrealized_pnl",
+ "lite_name": "cu",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 17,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'123456.78'",
+ "comment": [
+ "The unrealized PnL of this sub account for cross margin"
+ ]
}
],
"comment": []
@@ -4299,6 +4330,19 @@
"comment": [
"The current share price (in USD) of this vault investment."
]
+ },
+ {
+ "name": "usd_notional_invested",
+ "lite_name": "un",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 3,
+ "array_depth": 0,
+ "optional": false,
+ "example": "1000000",
+ "comment": [
+ "The USD notional invested in this vault investment."
+ ]
}
],
"comment": [
@@ -4410,6 +4454,19 @@
"comment": [
"Total available balance of the main account, denominated in USD"
]
+ },
+ {
+ "name": "total_usd_notional_invested",
+ "lite_name": "tu",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 8,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'3945034.23'",
+ "comment": [
+ "Total entry (initial investment) amount of the open investments, denominated in USD"
+ ]
}
],
"comment": []
@@ -4838,7 +4895,8 @@
"Users can randomly generate this value, used as a signature deconflicting key.",
"ie. You can send the same exact instruction twice with different nonces.",
"When the same nonce is used, the same payload will generate the same signature.",
- "Our system will consider the payload a duplicate, and ignore it."
+ "Our system will consider the payload a duplicate, and ignore it.",
+ "Range: 0 to 4,294,967,295 (uint32)"
]
},
{
@@ -5094,835 +5152,754 @@
]
},
{
- "name": "JSONRPCRequest",
+ "name": "ApiOrderbookLevelsRequest",
"is_root": true,
"fields": [
{
- "name": "jsonrpc",
- "lite_name": "j",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'2.0'",
- "comment": [
- "The JSON RPC version to use for the request"
- ]
- },
- {
- "name": "method",
- "lite_name": "m",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'subscribe'",
- "comment": [
- "The method to use for the request (eg: `subscribe` / `unsubscribe` / `v1/instrument` )"
- ]
- },
- {
- "name": "params",
- "lite_name": "p",
- "semantic_type": "any",
- "json_type": "object",
- "index": 2,
- "array_depth": 0,
- "optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The parameters for the request"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "id",
- "lite_name": "i",
+ "name": "depth",
+ "lite_name": "d",
"semantic_type": "uint32",
"json_type": "integer",
- "index": 3,
+ "index": 1,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "123",
+ "optional": false,
+ "example": "50",
"comment": [
- "Optional Field which is used to match the response by the client.",
- "If not passed, this field will not be returned"
+ "Depth of the order book to be retrieved (10, 50, 100, 500)"
]
}
],
"comment": [
- "All Websocket JSON RPC Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.",
- "If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).",
- "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
+ "Retrieves aggregated price depth for a single instrument, with a maximum depth of 10 levels. Do not use this to poll for data -- a websocket subscription is much more performant, and useful."
]
},
{
- "name": "Error",
- "is_root": true,
+ "name": "OrderbookLevel",
+ "is_root": false,
"fields": [
{
- "name": "code",
- "lite_name": "c",
- "semantic_type": "uint16",
- "json_type": "integer",
+ "name": "price",
+ "lite_name": "p",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "123",
+ "example": "'65038.01'",
"comment": [
- "The error code for the request"
+ "The price of the level, expressed in `9` decimals"
]
},
{
- "name": "message",
- "lite_name": "m",
+ "name": "size",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'An error occurred'",
+ "example": "'3456.78'",
"comment": [
- "The error message for the request"
+ "The number of assets offered, expressed in base asset decimal units"
+ ]
+ },
+ {
+ "name": "num_orders",
+ "lite_name": "no",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 2,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'123'",
+ "comment": [
+ "The number of open orders at this level"
]
}
],
- "comment": [
- "An error response"
- ]
+ "comment": []
},
{
- "name": "JSONRPCResponse",
- "is_root": true,
+ "name": "OrderbookLevels",
+ "is_root": false,
"fields": [
{
- "name": "jsonrpc",
- "lite_name": "j",
- "semantic_type": "string",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'2.0'",
+ "example": "'1697788800000000000'",
"comment": [
- "The JSON RPC version to use for the request"
+ "Time at which the event was emitted in unix nanoseconds"
]
},
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "any",
- "json_type": "object",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": true,
- "default": "null",
+ "optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The result for the request"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "error",
- "lite_name": "e",
- "semantic_type": "Error",
- "json_type": "Error",
+ "name": "bids",
+ "lite_name": "b",
+ "semantic_type": "OrderbookLevel",
+ "json_type": "OrderbookLevel",
"index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "null",
+ "array_depth": 1,
+ "optional": false,
"comment": [
- "The error for the request"
+ "The list of best bids up till query depth"
]
},
{
- "name": "id",
- "lite_name": "i",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "asks",
+ "lite_name": "a",
+ "semantic_type": "OrderbookLevel",
+ "json_type": "OrderbookLevel",
"index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "123",
+ "array_depth": 1,
+ "optional": false,
"comment": [
- "Optional Field which is used to match the response by the client.",
- "If not passed, this field will not be returned"
+ "The list of best asks up till query depth"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiOrderbookLevelsResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "method",
- "lite_name": "m",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "OrderbookLevels",
+ "json_type": "OrderbookLevels",
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'subscribe'",
"comment": [
- "The method used in the request for this response (eg: `subscribe` / `unsubscribe` / `v1/instrument` )"
+ "The orderbook levels objects matching the request asset"
]
}
],
- "comment": [
- "All Websocket JSON RPC Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.",
- "If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response."
- ]
+ "comment": []
},
{
- "name": "WSSubscribeParams",
+ "name": "ApiMiniTickerRequest",
"is_root": true,
"fields": [
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.ticker.d'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
- },
+ }
+ ],
+ "comment": [
+ "Retrieves a single mini ticker value for a single instrument. Please do not use this to repeatedly poll for data -- a websocket subscription is much more performant, and useful."
+ ]
+ },
+ {
+ "name": "MiniTicker",
+ "is_root": false,
+ "fields": [
{
- "name": "selectors",
- "lite_name": "s1",
- "semantic_type": "string",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
"json_type": "string",
- "index": 1,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
+ "index": 0,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'1697788800000000000'",
"comment": [
- "The list of feeds to subscribe to"
+ "Time at which the event was emitted in unix nanoseconds"
]
},
{
- "name": "use_global_sequence_number",
- "lite_name": "ug",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 2,
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
+ "index": 1,
"array_depth": 0,
"optional": true,
- "default": "false",
- "example": "true",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Whether to use the global sequence number for the stream"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
- }
- ],
- "comment": [
- "All V1 Websocket Subscription Requests are housed in this wrapper. You may specify a stream and a list of feeds to subscribe to.",
- "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.",
- "Sequence numbers can be either gateway-specific or global:",
- "- **Gateway Unique Sequence Number**: Increments by one per stream, resets to 0 on gateway restart.",
- "- **Global Unique Sequence Number**: A cluster-wide unique number assigned to each cluster payload, does not reset on gateway restarts, and can be used to track and identify message order across streams using `sequence_number` and `prev_sequence_number` in the feed response.",
- "Set `useGlobalSequenceNumber = true` if you need a persistent, unique identifier across all streams or ordering across multiple feeds."
- ]
- },
- {
- "name": "WSSubscribeResult",
- "is_root": true,
- "fields": [
+ },
{
- "name": "stream",
- "lite_name": "s",
+ "name": "mark_price",
+ "lite_name": "mp",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 2,
"array_depth": 0,
- "optional": false,
- "example": "'v1.ticker.d'",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
+ "The mark price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "subs",
- "lite_name": "s1",
+ "name": "index_price",
+ "lite_name": "ip",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
+ "index": 3,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The list of feeds subscribed to"
+ "The index price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "unsubs",
- "lite_name": "u",
+ "name": "last_price",
+ "lite_name": "lp",
"semantic_type": "string",
"json_type": "string",
- "index": 2,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
+ "index": 4,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The list of feeds unsubscribed from"
+ "The last traded price of the instrument (also close price), expressed in `9` decimals"
]
},
{
- "name": "num_snapshots",
- "lite_name": "ns",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 3,
- "array_depth": 1,
- "optional": false,
- "example": "10",
+ "name": "last_size",
+ "lite_name": "ls",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 5,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`"
+ "The number of assets traded in the last trade, expressed in base asset decimal units"
]
},
{
- "name": "first_sequence_number",
- "lite_name": "fs",
- "semantic_type": "uint64",
+ "name": "mid_price",
+ "lite_name": "mp1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 4,
- "array_depth": 1,
- "optional": false,
- "example": "872634876",
+ "index": 6,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The first sequence number to expect for each subscribed feed. Returned in same order as `subs`"
+ "The mid price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "latest_sequence_number",
- "lite_name": "ls",
- "semantic_type": "uint64",
+ "name": "best_bid_price",
+ "lite_name": "bb",
+ "semantic_type": "string",
"json_type": "string",
- "index": 5,
- "array_depth": 1,
- "optional": false,
- "example": "872634875",
+ "index": 7,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"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`"
+ "The best bid price of the instrument, expressed in `9` decimals"
]
- }
- ],
- "comment": [
- "To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:\u003cul\u003e\u003cli\u003eAll snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas\u003c/li\u003e\u003cli\u003eNum snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots\u003c/li\u003e\u003cli\u003eFirst sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots\u003c/li\u003e\u003cli\u003eSequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect\u003c/li\u003e\u003cli\u003eDuplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.\u003c/li\u003e\u003c/ul\u003e",
- "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
- ]
- },
- {
- "name": "WSUnsubscribeParams",
- "is_root": true,
- "fields": [
+ },
{
- "name": "stream",
- "lite_name": "s",
+ "name": "best_bid_size",
+ "lite_name": "bb1",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 8,
"array_depth": 0,
- "optional": false,
- "example": "'v1.ticker.d'",
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The channel to unsubscribe from (eg: ticker.s / ticker.d)"
+ "The number of assets offered on the best bid price of the instrument, expressed in base asset decimal units"
]
},
{
- "name": "selectors",
- "lite_name": "s1",
+ "name": "best_ask_price",
+ "lite_name": "ba",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
+ "index": 9,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The list of feeds to unsubscribe from"
+ "The best ask price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "use_global_sequence_number",
- "lite_name": "ug",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 2,
+ "name": "best_ask_size",
+ "lite_name": "ba1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 10,
"array_depth": 0,
"optional": true,
- "default": "false",
- "example": "true",
+ "example": "'123456.78'",
"comment": [
- "Whether to use the global sequence number for the stream"
+ "The number of assets offered on the best ask price of the instrument, expressed in base asset decimal units"
]
}
],
- "comment": [
- "All V1 Websocket Unsubscription Requests are housed in this wrapper. You may specify a stream, a list of feeds and whether those feeds use global sequence numbers to unsubscribe from."
- ]
+ "comment": []
},
{
- "name": "WSUnsubscribeResult",
+ "name": "ApiMiniTickerResponse",
"is_root": true,
"fields": [
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "MiniTicker",
+ "json_type": "MiniTicker",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.ticker.d'",
"comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
+ "The mini ticker matching the request asset"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiTickerRequest",
+ "is_root": true,
+ "fields": [
{
- "name": "unsubs",
- "lite_name": "u",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
- "index": 1,
- "array_depth": 1,
+ "index": 0,
+ "array_depth": 0,
"optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The list of feeds unsubscribed from"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
}
],
"comment": [
- "Returns a confirmation of all unsubscribes"
+ "Retrieves a single ticker value for a single instrument. Please do not use this to repeatedly poll for data -- a websocket subscription is much more performant, and useful."
]
},
{
- "name": "WSSubscribeRequestV1Legacy",
- "is_root": true,
+ "name": "Ticker",
+ "is_root": false,
"fields": [
{
- "name": "request_id",
- "lite_name": "ri",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "event_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": true,
- "default": "0",
- "example": "123",
+ "example": "'1697788800000000000'",
"comment": [
- "Optional Field which is used to match the response by the client.",
- "If not passed, this field will not be returned"
+ "Time at which the event was emitted in unix nanoseconds"
]
},
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": false,
- "example": "'v1.ticker.d'",
+ "optional": true,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "feed",
- "lite_name": "f",
+ "name": "mark_price",
+ "lite_name": "mp",
"semantic_type": "string",
"json_type": "string",
"index": 2,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The list of feeds to subscribe to"
+ "The mark price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "method",
- "lite_name": "m",
+ "name": "index_price",
+ "lite_name": "ip",
"semantic_type": "string",
"json_type": "string",
"index": 3,
"array_depth": 0,
- "optional": false,
- "example": "'subscribe'",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The method to use for the request (eg: subscribe / unsubscribe)"
+ "The index price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "is_full",
- "lite_name": "if",
- "semantic_type": "bool",
- "json_type": "boolean",
+ "name": "last_price",
+ "lite_name": "lp",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 4,
"array_depth": 0,
"optional": true,
- "default": "false",
- "example": "true",
+ "example": "'65038.01'",
"comment": [
- "Whether the request is for full data or lite data"
+ "The last traded price of the instrument (also close price), expressed in `9` decimals"
]
- }
- ],
- "comment": [
- "All V1 Websocket Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.",
- "If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).",
- "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
- ]
- },
- {
- "name": "WSSubscribeResponseV1Legacy",
- "is_root": true,
- "fields": [
+ },
{
- "name": "request_id",
- "lite_name": "ri",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 0,
+ "name": "last_size",
+ "lite_name": "ls",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 5,
"array_depth": 0,
"optional": true,
- "default": "0",
- "example": "123",
+ "example": "'123456.78'",
"comment": [
- "Optional Field which is used to match the response by the client.",
- "If not passed, this field will not be returned"
+ "The number of assets traded in the last trade, expressed in base asset decimal units"
]
},
{
- "name": "stream",
- "lite_name": "s",
+ "name": "mid_price",
+ "lite_name": "mp1",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 6,
"array_depth": 0,
- "optional": false,
- "example": "'v1.ticker.d'",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The channel to subscribe to (eg: ticker.s / ticker.d)"
+ "The mid price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "subs",
- "lite_name": "s1",
+ "name": "best_bid_price",
+ "lite_name": "bb",
"semantic_type": "string",
"json_type": "string",
- "index": 2,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
+ "index": 7,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The list of feeds subscribed to"
+ "The best bid price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "unsubs",
- "lite_name": "u",
+ "name": "best_bid_size",
+ "lite_name": "bb1",
"semantic_type": "string",
"json_type": "string",
- "index": 3,
- "array_depth": 1,
- "optional": false,
- "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
- "comment": [
- "The list of feeds unsubscribed from"
- ]
- },
- {
- "name": "num_snapshots",
- "lite_name": "ns",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 4,
- "array_depth": 1,
- "optional": false,
- "example": "10",
+ "index": 8,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`"
+ "The number of assets offered on the best bid price of the instrument, expressed in base asset decimal units"
]
},
{
- "name": "first_sequence_number",
- "lite_name": "fs",
- "semantic_type": "uint64",
+ "name": "best_ask_price",
+ "lite_name": "ba",
+ "semantic_type": "string",
"json_type": "string",
- "index": 5,
- "array_depth": 1,
- "optional": false,
- "example": "872634876",
+ "index": 9,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The first sequence number to expect for each subscribed feed. Returned in same order as `subs`"
+ "The best ask price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "latest_sequence_number",
- "lite_name": "ls",
- "semantic_type": "uint64",
+ "name": "best_ask_size",
+ "lite_name": "ba1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 6,
- "array_depth": 1,
- "optional": false,
- "example": "872634875",
+ "index": 10,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'123456.78'",
"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`"
+ "The number of assets offered on the best ask price of the instrument, expressed in base asset decimal units"
]
- }
- ],
- "comment": [
- "All V1 Websocket Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.",
- "If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response.",
- "To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:\u003cul\u003e\u003cli\u003eAll snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas\u003c/li\u003e\u003cli\u003eNum snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots\u003c/li\u003e\u003cli\u003eFirst sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots\u003c/li\u003e\u003cli\u003eSequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect\u003c/li\u003e\u003cli\u003eDuplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.\u003c/li\u003e\u003c/ul\u003e",
- "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
- ]
- },
- {
- "name": "WSOrderbookLevelsFeedSelectorV1",
- "is_root": true,
- "fields": [
+ },
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "funding_rate_8h_curr",
+ "lite_name": "fr",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 11,
"array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "optional": true,
+ "example": "0.0003",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ],
- "selector": "primary"
+ "DEPRECATED: To be removed in a future release. Please refer to the field `funding_rate` instead, for the funding rate being applied over `funding_interval_hours` (interval ending at `next_funding_time`)."
+ ]
},
{
- "name": "rate",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
+ "name": "funding_rate_8h_avg",
+ "lite_name": "fr1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 12,
"array_depth": 0,
- "optional": false,
- "example": "500",
+ "optional": true,
+ "example": "0.0003",
"comment": [
- "The minimal rate at which we publish feeds (in milliseconds)",
- "Delta (50, 100, 500, 1000)",
- "Snapshot (500, 1000)"
- ],
- "selector": "secondary"
+ "DEPRECATED: To be removed in a future release. Please refer to the field `funding_rate` instead, for the funding rate being applied over `funding_interval_hours` (interval ending at `next_funding_time`)."
+ ]
},
{
- "name": "depth",
- "lite_name": "d",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 2,
+ "name": "interest_rate",
+ "lite_name": "ir",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 13,
"array_depth": 0,
"optional": true,
- "default": "'0'",
- "example": "50",
+ "example": "0.0003",
"comment": [
- "Depth of the order book to be retrieved",
- "Delta(0 - `unlimited`)",
- "Snapshot(10, 50, 100, 500)"
- ],
- "selector": "secondary"
- }
- ],
- "comment": [
- "Subscribes to aggregated orderbook updates for a single instrument. The `book.s` channel offers simpler integration. To experience higher publishing rates, please use the `book.d` channel.",
- "Unlike the `book.d` channel which publishes an initial snapshot, then only streams deltas after, the `book.s` channel publishes full snapshots at each feed.",
- "",
- "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of all levels of the Orderbook.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send levels that have changed in value.\u003c/li\u003e\u003c/ul\u003e",
- "",
- "Subscription Pattern:\u003cul\u003e\u003cli\u003eDelta - `instrument@rate`\u003c/li\u003e\u003cli\u003eSnapshot - `instrument@rate-depth`\u003c/li\u003e\u003c/ul\u003e",
- "",
- "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a level is not updated, level not published\u003c/li\u003e\u003cli\u003eIf a level is updated, {size: '123'}\u003c/li\u003e\u003cli\u003eIf a level is set to zero, {size: '0'}\u003c/li\u003e\u003cli\u003eIncoming levels will be published as soon as price moves\u003c/li\u003e\u003cli\u003eOutgoing levels will be published with `size = 0`\u003c/li\u003e\u003c/ul\u003e"
- ]
- },
- {
- "name": "OrderbookLevel",
- "is_root": false,
- "fields": [
+ "The interest rate of the underlying, expressed in centibeeps (1/100th of a basis point)"
+ ]
+ },
{
- "name": "price",
- "lite_name": "p",
+ "name": "forward_price",
+ "lite_name": "fp",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 14,
"array_depth": 0,
- "optional": false,
+ "optional": true,
"example": "'65038.01'",
"comment": [
- "The price of the level, expressed in `9` decimals"
+ "[Options] The forward price of the option, expressed in `9` decimals"
]
},
{
- "name": "size",
- "lite_name": "s",
+ "name": "buy_volume_24h_b",
+ "lite_name": "bv",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 15,
"array_depth": 0,
- "optional": false,
- "example": "'3456.78'",
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The number of assets offered, expressed in base asset decimal units"
+ "The 24 hour taker buy volume of the instrument, expressed in base asset decimal units"
]
},
{
- "name": "num_orders",
- "lite_name": "no",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 2,
+ "name": "sell_volume_24h_b",
+ "lite_name": "sv",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 16,
"array_depth": 0,
- "optional": false,
- "example": "'123'",
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The number of open orders at this level"
+ "The 24 hour taker sell volume of the instrument, expressed in base asset decimal units"
]
- }
- ],
- "comment": []
- },
- {
- "name": "OrderbookLevels",
- "is_root": false,
- "fields": [
+ },
{
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
+ "name": "buy_volume_24h_q",
+ "lite_name": "bv1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 17,
"array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "Time at which the event was emitted in unix nanoseconds"
+ "The 24 hour taker buy volume of the instrument, expressed in quote asset decimal units"
]
},
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "sell_volume_24h_q",
+ "lite_name": "sv1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 18,
"array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "The 24 hour taker sell volume of the instrument, expressed in quote asset decimal units"
]
},
{
- "name": "bids",
- "lite_name": "b",
- "semantic_type": "OrderbookLevel",
- "json_type": "OrderbookLevel",
- "index": 2,
- "array_depth": 1,
- "optional": false,
+ "name": "high_price",
+ "lite_name": "hp",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 19,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The list of best bids up till query depth"
+ "The 24 hour highest traded price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "asks",
- "lite_name": "a",
- "semantic_type": "OrderbookLevel",
- "json_type": "OrderbookLevel",
- "index": 3,
- "array_depth": 1,
- "optional": false,
+ "name": "low_price",
+ "lite_name": "lp1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 20,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "The list of best asks up till query depth"
+ "The 24 hour lowest traded price of the instrument, expressed in `9` decimals"
]
- }
- ],
- "comment": []
- },
- {
- "name": "WSOrderbookLevelsFeedDataV1",
- "is_root": true,
- "fields": [
+ },
{
- "name": "stream",
- "lite_name": "s",
+ "name": "open_price",
+ "lite_name": "op",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 21,
"array_depth": 0,
- "optional": false,
- "example": "'v1.book.s'",
+ "optional": true,
+ "example": "'65038.01'",
"comment": [
- "Stream name"
+ "The 24 hour first traded price of the instrument, expressed in `9` decimals"
]
},
{
- "name": "selector",
- "lite_name": "s1",
+ "name": "open_interest",
+ "lite_name": "oi",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 22,
"array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "optional": true,
+ "example": "'123456.78'",
"comment": [
- "Primary selector"
+ "The open interest in the instrument, expressed in base asset decimal units"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
+ "name": "long_short_ratio",
+ "lite_name": "ls1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 2,
+ "index": 23,
"array_depth": 0,
- "optional": false,
- "example": "'872634876'",
+ "optional": true,
+ "example": "'0.5'",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "The ratio of accounts that are net long vs net short on this instrument"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "OrderbookLevels",
- "json_type": "OrderbookLevels",
- "index": 3,
+ "name": "funding_rate",
+ "lite_name": "fr2",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 24,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "example": "0.0003",
"comment": [
- "An orderbook levels object matching the request filter"
+ "The current indicative funding rate for the active interval, expressed in centibeeps"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
+ "name": "next_funding_time",
+ "lite_name": "nf",
+ "semantic_type": "timestamp",
"json_type": "string",
- "index": 4,
+ "index": 26,
+ "array_depth": 0,
+ "optional": true,
+ "example": "'1697788800000000000'",
+ "comment": [
+ "Timestamp in nanoseconds when the current funding interval ends"
+ ]
+ }
+ ],
+ "comment": [
+ "Derived data such as the below, will not be included by default:",
+ " - 24 hour volume (`buyVolume + sellVolume`)",
+ " - 24 hour taker buy/sell ratio (`buyVolume / sellVolume`)",
+ " - 24 hour average trade price (`volumeQ / volumeU`)",
+ " - 24 hour average trade volume (`volume / trades`)",
+ " - 24 hour percentage change (`24hStatChange / 24hStat`)",
+ " - 48 hour statistics (`2 * 24hStat - 24hStatChange`)",
+ "",
+ "To query for an extended ticker payload, leverage the `greeks` and the `derived` flags.",
+ "Ticker extensions are currently under design to offer you more convenience.",
+ "These flags are only supported on the `Ticker Snapshot` WS endpoint, and on the `Ticker` API endpoint.",
+ ""
+ ]
+ },
+ {
+ "name": "ApiTickerResponse",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Ticker",
+ "json_type": "Ticker",
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'872634875'",
"comment": [
- "The previous sequence number that determines the message order"
+ "The mini ticker matching the request asset"
]
}
],
"comment": []
},
{
- "name": "WSMiniTickerFeedSelectorV1",
+ "name": "ApiTradeRequest",
"is_root": true,
"fields": [
{
@@ -5936,12 +5913,11 @@
"example": "'BTC_USDT_Perp'",
"comment": [
"The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ],
- "selector": "primary"
+ ]
},
{
- "name": "rate",
- "lite_name": "r",
+ "name": "limit",
+ "lite_name": "l",
"semantic_type": "uint32",
"json_type": "integer",
"index": 1,
@@ -5949,24 +5925,17 @@
"optional": false,
"example": "500",
"comment": [
- "The minimal rate at which we publish feeds (in milliseconds)",
- "Delta (0 - `raw`, 50, 100, 200, 500, 1000, 5000)",
- "Snapshot (200, 500, 1000, 5000)"
- ],
- "selector": "secondary"
+ "The limit to query for. Defaults to 500; Max 1000"
+ ]
}
],
"comment": [
- "Subscribes to a mini ticker feed for a single instrument. The `mini.s` channel offers simpler integration. To experience higher publishing rates, please use the `mini.d` channel.",
- "Unlike the `mini.d` channel which publishes an initial snapshot, then only streams deltas after, the `mini.s` channel publishes full snapshots at each feed.",
- "",
- "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of the mini ticker.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send deltas of the mini ticker.\u003c/li\u003e\u003cli\u003eThe server will send a delta if any of the fields in the mini ticker have changed.\u003c/li\u003e\u003c/ul\u003e",
- "",
- "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a field is not updated, {}\u003c/li\u003e\u003cli\u003eIf a field is updated, {field: '123'}\u003c/li\u003e\u003cli\u003eIf a field is set to zero, {field: '0'}\u003c/li\u003e\u003cli\u003eIf a field is set to null, {field: ''}\u003c/li\u003e\u003c/ul\u003e"
+ "Retrieves up to 1000 of the most recent trades in any given instrument. Do not use this to poll for data -- a websocket subscription is much more performant, and useful.",
+ "This endpoint offers public trading data, use the Trading APIs instead to query for your personalized trade tape."
]
},
{
- "name": "MiniTicker",
+ "name": "Trade",
"is_root": false,
"fields": [
{
@@ -5976,7 +5945,7 @@
"json_type": "string",
"index": 0,
"array_depth": 0,
- "optional": true,
+ "optional": false,
"example": "'1697788800000000000'",
"comment": [
"Time at which the event was emitted in unix nanoseconds"
@@ -5989,210 +5958,284 @@
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": true,
+ "optional": false,
"example": "'BTC_USDT_Perp'",
"comment": [
"The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "mark_price",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "is_taker_buyer",
+ "lite_name": "it",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 2,
"array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
+ "optional": false,
+ "example": "true",
"comment": [
- "The mark price of the instrument, expressed in `9` decimals"
+ "If taker was the buyer on the trade"
]
},
{
- "name": "index_price",
- "lite_name": "ip",
+ "name": "size",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
"index": 3,
"array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
+ "optional": false,
+ "example": "'123456.78'",
"comment": [
- "The index price of the instrument, expressed in `9` decimals"
+ "The number of assets being traded, expressed in base asset decimal units"
]
},
{
- "name": "last_price",
- "lite_name": "lp",
+ "name": "price",
+ "lite_name": "p",
"semantic_type": "string",
"json_type": "string",
"index": 4,
"array_depth": 0,
- "optional": true,
+ "optional": false,
"example": "'65038.01'",
"comment": [
- "The last traded price of the instrument (also close price), expressed in `9` decimals"
+ "The traded price, expressed in `9` decimals"
]
},
{
- "name": "last_size",
- "lite_name": "ls",
+ "name": "mark_price",
+ "lite_name": "mp",
"semantic_type": "string",
"json_type": "string",
"index": 5,
"array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
+ "optional": false,
+ "example": "'65038.01'",
"comment": [
- "The number of assets traded in the last trade, expressed in base asset decimal units"
+ "The mark price of the instrument at point of trade, expressed in `9` decimals"
]
},
{
- "name": "mid_price",
- "lite_name": "mp1",
+ "name": "index_price",
+ "lite_name": "ip",
"semantic_type": "string",
"json_type": "string",
"index": 6,
"array_depth": 0,
- "optional": true,
+ "optional": false,
"example": "'65038.01'",
"comment": [
- "The mid price of the instrument, expressed in `9` decimals"
+ "The index price of the instrument at point of trade, expressed in `9` decimals"
]
},
{
- "name": "best_bid_price",
- "lite_name": "bb",
+ "name": "interest_rate",
+ "lite_name": "ir",
"semantic_type": "string",
"json_type": "string",
"index": 7,
"array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
+ "optional": false,
+ "example": "0.0003",
"comment": [
- "The best bid price of the instrument, expressed in `9` decimals"
+ "The interest rate of the underlying at point of trade, expressed in centibeeps (1/100th of a basis point)"
]
},
{
- "name": "best_bid_size",
- "lite_name": "bb1",
+ "name": "forward_price",
+ "lite_name": "fp",
"semantic_type": "string",
"json_type": "string",
"index": 8,
"array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
+ "optional": false,
+ "example": "'65038.01'",
"comment": [
- "The number of assets offered on the best bid price of the instrument, expressed in base asset decimal units"
+ "[Options] The forward price of the option at point of trade, expressed in `9` decimals"
]
},
{
- "name": "best_ask_price",
- "lite_name": "ba",
+ "name": "trade_id",
+ "lite_name": "ti",
"semantic_type": "string",
"json_type": "string",
"index": 9,
"array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
+ "optional": false,
+ "example": "'209358-2'",
"comment": [
- "The best ask price of the instrument, expressed in `9` decimals"
+ "A trade identifier, globally unique, and monotonically increasing (not by `1`).",
+ "All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.",
+ "`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`."
]
},
{
- "name": "best_ask_size",
- "lite_name": "ba1",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "venue",
+ "lite_name": "v",
+ "semantic_type": "Venue",
+ "json_type": "Venue",
"index": 10,
"array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
+ "optional": false,
"comment": [
- "The number of assets offered on the best ask price of the instrument, expressed in base asset decimal units"
+ "The venue where the trade occurred"
+ ]
+ },
+ {
+ "name": "is_rpi",
+ "lite_name": "ir1",
+ "semantic_type": "bool",
+ "json_type": "boolean",
+ "index": 13,
+ "array_depth": 0,
+ "optional": false,
+ "example": "false",
+ "comment": [
+ "If the trade is a RPI trade"
+ ]
+ }
+ ],
+ "comment": [
+ "All private RFQs and Private AXEs will be filtered out from the responses"
+ ]
+ },
+ {
+ "name": "ApiTradeResponse",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Trade",
+ "json_type": "Trade",
+ "index": 0,
+ "array_depth": 1,
+ "optional": false,
+ "comment": [
+ "The public trades matching the request asset"
]
}
],
"comment": []
},
{
- "name": "WSMiniTickerFeedDataV1",
+ "name": "ApiTradeHistoryRequest",
"is_root": true,
"fields": [
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.mini.s'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Stream name"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "selector",
- "lite_name": "s1",
- "semantic_type": "string",
+ "name": "start_time",
+ "lite_name": "st",
+ "semantic_type": "int64",
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "optional": true,
+ "default": "0",
+ "example": "'1697788800000000000'",
"comment": [
- "Primary selector"
+ "The start time to apply in nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
+ "name": "end_time",
+ "lite_name": "et",
+ "semantic_type": "int64",
"json_type": "string",
"index": 2,
"array_depth": 0,
- "optional": false,
- "example": "'872634876'",
+ "optional": true,
+ "default": "now()",
+ "example": "'1697788800000000000'",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "The end time to apply in nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "MiniTicker",
- "json_type": "MiniTicker",
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
"index": 3,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "500",
+ "example": "500",
"comment": [
- "A mini ticker matching the request filter"
+ "The limit to query for. Defaults to 500; Max 1000"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
+ "name": "cursor",
+ "lite_name": "c",
+ "semantic_type": "string",
"json_type": "string",
"index": 4,
"array_depth": 0,
+ "optional": true,
+ "default": "''",
+ "example": "''",
+ "comment": [
+ "The cursor to indicate when to start the query from"
+ ]
+ }
+ ],
+ "comment": [
+ "Perform historical lookup of public trades in any given instrument.",
+ "This endpoint offers public trading data, use the Trading APIs instead to query for your personalized trade tape.",
+ "Only data from the last three months will be retained.",
+ "",
+ "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
+ ]
+ },
+ {
+ "name": "ApiTradeHistoryResponse",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Trade",
+ "json_type": "Trade",
+ "index": 0,
+ "array_depth": 1,
"optional": false,
- "example": "'872634875'",
"comment": [
- "The previous sequence number that determines the message order"
+ "The public trades matching the request asset"
+ ]
+ },
+ {
+ "name": "next",
+ "lite_name": "n",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": true,
+ "default": "''",
+ "example": "'Qw0918='",
+ "comment": [
+ "The cursor to indicate when to start the next query from"
]
}
],
"comment": []
},
{
- "name": "WSTickerFeedSelectorV1",
+ "name": "ApiGetInstrumentRequest",
"is_root": true,
"fields": [
{
@@ -6206,529 +6249,442 @@
"example": "'BTC_USDT_Perp'",
"comment": [
"The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ],
- "selector": "primary"
- },
- {
- "name": "rate",
- "lite_name": "r",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "500",
- "comment": [
- "The minimal rate at which we publish feeds (in milliseconds)",
- "Delta (100, 200, 500, 1000, 5000)",
- "Snapshot (500, 1000, 5000)"
- ],
- "selector": "secondary"
+ ]
}
],
"comment": [
- "Subscribes to a ticker feed for a single instrument. The `ticker.s` channel offers simpler integration. To experience higher publishing rates, please use the `ticker.d` channel.",
- "Unlike the `ticker.d` channel which publishes an initial snapshot, then only streams deltas after, the `ticker.s` channel publishes full snapshots at each feed.",
- "",
- "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of the ticker.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send deltas of the ticker.\u003c/li\u003e\u003cli\u003eThe server will send a delta if any of the fields in the ticker have changed.\u003c/li\u003e\u003c/ul\u003e",
- "",
- "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a field is not updated, {}\u003c/li\u003e\u003cli\u003eIf a field is updated, {field: '123'}\u003c/li\u003e\u003cli\u003eIf a field is set to zero, {field: '0'}\u003c/li\u003e\u003cli\u003eIf a field is set to null, {field: ''}\u003c/li\u003e\u003c/ul\u003e"
+ "Fetch a single instrument by supplying the asset or instrument name"
]
},
{
- "name": "Ticker",
+ "name": "InstrumentDisplay",
"is_root": false,
"fields": [
{
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 0,
"array_depth": 0,
- "optional": true,
- "example": "'1697788800000000000'",
+ "optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Time at which the event was emitted in unix nanoseconds"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "instrument_hash",
+ "lite_name": "ih",
+ "semantic_type": "uint256",
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": true,
- "example": "'BTC_USDT_Perp'",
+ "optional": false,
+ "example": "'0x030501'",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "The asset ID used for instrument signing."
]
},
{
- "name": "mark_price",
- "lite_name": "mp",
+ "name": "base",
+ "lite_name": "b",
"semantic_type": "string",
"json_type": "string",
"index": 2,
"array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
+ "optional": false,
+ "example": "'BTC'",
"comment": [
- "The mark price of the instrument, expressed in `9` decimals"
+ "The base currency"
]
},
{
- "name": "index_price",
- "lite_name": "ip",
+ "name": "quote",
+ "lite_name": "q",
"semantic_type": "string",
"json_type": "string",
"index": 3,
"array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
+ "optional": false,
+ "example": "'USDT'",
"comment": [
- "The index price of the instrument, expressed in `9` decimals"
+ "The quote currency"
]
},
{
- "name": "last_price",
- "lite_name": "lp",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "kind",
+ "lite_name": "k",
+ "semantic_type": "Kind",
+ "json_type": "Kind",
"index": 4,
"array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
+ "optional": false,
+ "example": "'PERPETUAL'",
"comment": [
- "The last traded price of the instrument (also close price), expressed in `9` decimals"
+ "The kind of instrument"
]
},
{
- "name": "last_size",
- "lite_name": "ls",
- "semantic_type": "string",
- "json_type": "string",
- "index": 5,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
+ "name": "venues",
+ "lite_name": "v",
+ "semantic_type": "Venue",
+ "json_type": "Venue",
+ "index": 7,
+ "array_depth": 1,
+ "optional": false,
+ "example": "['ORDERBOOK']",
"comment": [
- "The number of assets traded in the last trade, expressed in base asset decimal units"
+ "Venues that this instrument can be traded at"
]
},
{
- "name": "mid_price",
- "lite_name": "mp1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 6,
+ "name": "settlement_period",
+ "lite_name": "sp1",
+ "semantic_type": "InstrumentSettlementPeriod",
+ "json_type": "InstrumentSettlementPeriod",
+ "index": 8,
"array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
+ "optional": false,
+ "example": "'PERPETUAL'",
"comment": [
- "The mid price of the instrument, expressed in `9` decimals"
+ "The settlement period of the instrument"
]
},
{
- "name": "best_bid_price",
- "lite_name": "bb",
- "semantic_type": "string",
- "json_type": "string",
- "index": 7,
+ "name": "base_decimals",
+ "lite_name": "bd",
+ "semantic_type": "int8",
+ "json_type": "integer",
+ "index": 9,
"array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
+ "optional": false,
+ "example": "3",
"comment": [
- "The best bid price of the instrument, expressed in `9` decimals"
+ "The smallest denomination of the base asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)"
]
},
{
- "name": "best_bid_size",
- "lite_name": "bb1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 8,
+ "name": "quote_decimals",
+ "lite_name": "qd",
+ "semantic_type": "int8",
+ "json_type": "integer",
+ "index": 10,
"array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
+ "optional": false,
+ "example": "3",
"comment": [
- "The number of assets offered on the best bid price of the instrument, expressed in base asset decimal units"
+ "The smallest denomination of the quote asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)"
]
},
{
- "name": "best_ask_price",
- "lite_name": "ba",
+ "name": "tick_size",
+ "lite_name": "ts",
"semantic_type": "string",
"json_type": "string",
- "index": 9,
+ "index": 11,
"array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
+ "optional": false,
+ "example": "'0.01'",
"comment": [
- "The best ask price of the instrument, expressed in `9` decimals"
+ "The size of a single tick, expressed in price decimal units"
]
},
{
- "name": "best_ask_size",
- "lite_name": "ba1",
+ "name": "min_size",
+ "lite_name": "ms",
"semantic_type": "string",
"json_type": "string",
- "index": 10,
+ "index": 12,
"array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
+ "optional": false,
+ "example": "'0.01'",
"comment": [
- "The number of assets offered on the best ask price of the instrument, expressed in base asset decimal units"
+ "The minimum contract size, expressed in base asset decimal units"
]
},
{
- "name": "funding_rate_8h_curr",
- "lite_name": "fr",
- "semantic_type": "string",
+ "name": "create_time",
+ "lite_name": "ct",
+ "semantic_type": "timestamp",
"json_type": "string",
- "index": 11,
+ "index": 14,
"array_depth": 0,
- "optional": true,
- "example": "0.0003",
+ "optional": false,
+ "example": "'1697788800000000000'",
"comment": [
- "DEPRECATED: To be removed in a future release. Please refer to the field `funding_rate` instead, for the funding rate being applied over `funding_interval_hours` (interval ending at `next_funding_time`)."
+ "Creation time in unix nanoseconds"
]
},
{
- "name": "funding_rate_8h_avg",
- "lite_name": "fr1",
+ "name": "max_position_size",
+ "lite_name": "mp",
"semantic_type": "string",
"json_type": "string",
- "index": 12,
+ "index": 15,
"array_depth": 0,
- "optional": true,
- "example": "0.0003",
+ "optional": false,
+ "example": "'100.0'",
"comment": [
- "DEPRECATED: To be removed in a future release. Please refer to the field `funding_rate` instead, for the funding rate being applied over `funding_interval_hours` (interval ending at `next_funding_time`)."
+ "The maximum position size, expressed in base asset decimal units"
]
},
{
- "name": "interest_rate",
- "lite_name": "ir",
- "semantic_type": "string",
- "json_type": "string",
- "index": 13,
+ "name": "funding_interval_hours",
+ "lite_name": "fi",
+ "semantic_type": "uint8",
+ "json_type": "integer",
+ "index": 17,
"array_depth": 0,
"optional": true,
- "example": "0.0003",
"comment": [
- "The interest rate of the underlying, expressed in centibeeps (1/100th of a basis point)"
+ "Defines the funding interval to be applied."
]
},
{
- "name": "forward_price",
- "lite_name": "fp",
+ "name": "adjusted_funding_rate_cap",
+ "lite_name": "af",
"semantic_type": "string",
"json_type": "string",
- "index": 14,
+ "index": 18,
"array_depth": 0,
"optional": true,
- "example": "'65038.01'",
+ "example": "2.5",
"comment": [
- "[Options] The forward price of the option, expressed in `9` decimals"
+ "Funding rate cap over the defined `intervalHours`."
]
},
{
- "name": "buy_volume_24h_b",
- "lite_name": "bv",
+ "name": "adjusted_funding_rate_floor",
+ "lite_name": "af1",
"semantic_type": "string",
"json_type": "string",
- "index": 15,
+ "index": 19,
"array_depth": 0,
"optional": true,
- "example": "'123456.78'",
+ "example": "-2.5",
"comment": [
- "The 24 hour taker buy volume of the instrument, expressed in base asset decimal units"
+ "Funding rate floor over the defined `intervalHours`."
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiGetInstrumentResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "sell_volume_24h_b",
- "lite_name": "sv",
- "semantic_type": "string",
- "json_type": "string",
- "index": 16,
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "InstrumentDisplay",
+ "json_type": "InstrumentDisplay",
+ "index": 0,
"array_depth": 0,
+ "optional": false,
+ "comment": [
+ "The instrument matching the request asset"
+ ]
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiGetFilteredInstrumentsRequest",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "kind",
+ "lite_name": "k",
+ "semantic_type": "Kind",
+ "json_type": "Kind",
+ "index": 0,
+ "array_depth": 1,
"optional": true,
- "example": "'123456.78'",
+ "default": "all",
+ "example": "['PERPETUAL']",
"comment": [
- "The 24 hour taker sell volume of the instrument, expressed in base asset decimal units"
+ "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "buy_volume_24h_q",
- "lite_name": "bv1",
+ "name": "base",
+ "lite_name": "b",
"semantic_type": "string",
"json_type": "string",
- "index": 17,
- "array_depth": 0,
+ "index": 1,
+ "array_depth": 1,
"optional": true,
- "example": "'123456.78'",
+ "default": "all",
+ "example": "['BTC', 'ETH']",
"comment": [
- "The 24 hour taker buy volume of the instrument, expressed in quote asset decimal units"
+ "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "sell_volume_24h_q",
- "lite_name": "sv1",
+ "name": "quote",
+ "lite_name": "q",
"semantic_type": "string",
"json_type": "string",
- "index": 18,
- "array_depth": 0,
- "optional": true,
- "example": "'123456.78'",
- "comment": [
- "The 24 hour taker sell volume of the instrument, expressed in quote asset decimal units"
- ]
- },
- {
- "name": "high_price",
- "lite_name": "hp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 19,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The 24 hour highest traded price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "low_price",
- "lite_name": "lp1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 20,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The 24 hour lowest traded price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "open_price",
- "lite_name": "op",
- "semantic_type": "string",
- "json_type": "string",
- "index": 21,
- "array_depth": 0,
- "optional": true,
- "example": "'65038.01'",
- "comment": [
- "The 24 hour first traded price of the instrument, expressed in `9` decimals"
- ]
- },
- {
- "name": "open_interest",
- "lite_name": "oi",
- "semantic_type": "string",
- "json_type": "string",
- "index": 22,
- "array_depth": 0,
+ "index": 2,
+ "array_depth": 1,
"optional": true,
- "example": "'123456.78'",
+ "default": "all",
+ "example": "['USDT', 'USDC']",
"comment": [
- "The open interest in the instrument, expressed in base asset decimal units"
+ "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
]
},
{
- "name": "long_short_ratio",
- "lite_name": "ls1",
- "semantic_type": "string",
- "json_type": "string",
- "index": 23,
+ "name": "is_active",
+ "lite_name": "ia",
+ "semantic_type": "bool",
+ "json_type": "boolean",
+ "index": 3,
"array_depth": 0,
"optional": true,
- "example": "'0.5'",
+ "default": "false",
+ "example": "true",
"comment": [
- "The ratio of accounts that are net long vs net short on this instrument"
+ "Request for active instruments only"
]
},
{
- "name": "funding_rate",
- "lite_name": "fr2",
- "semantic_type": "string",
- "json_type": "string",
- "index": 24,
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 4,
"array_depth": 0,
"optional": true,
- "example": "0.0003",
+ "default": "500",
+ "example": "500",
"comment": [
- "The current indicative funding rate for the active interval, expressed in centibeeps"
+ "The limit to query for. Defaults to 500; Max 100000"
]
- },
+ }
+ ],
+ "comment": [
+ "Fetch a list of instruments based on the filters provided"
+ ]
+ },
+ {
+ "name": "ApiGetFilteredInstrumentsResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "next_funding_time",
- "lite_name": "nf",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 26,
- "array_depth": 0,
- "optional": true,
- "example": "'1697788800000000000'",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "InstrumentDisplay",
+ "json_type": "InstrumentDisplay",
+ "index": 0,
+ "array_depth": 1,
+ "optional": false,
"comment": [
- "Timestamp in nanoseconds when the current funding interval ends"
+ "The instruments matching the request filter"
]
}
],
+ "comment": []
+ },
+ {
+ "name": "ApiGetCurrencyRequest",
+ "is_root": true,
+ "fields": [],
"comment": [
- "Derived data such as the below, will not be included by default:",
- " - 24 hour volume (`buyVolume + sellVolume`)",
- " - 24 hour taker buy/sell ratio (`buyVolume / sellVolume`)",
- " - 24 hour average trade price (`volumeQ / volumeU`)",
- " - 24 hour average trade volume (`volume / trades`)",
- " - 24 hour percentage change (`24hStatChange / 24hStat`)",
- " - 48 hour statistics (`2 * 24hStat - 24hStatChange`)",
- "",
- "To query for an extended ticker payload, leverage the `greeks` and the `derived` flags.",
- "Ticker extensions are currently under design to offer you more convenience.",
- "These flags are only supported on the `Ticker Snapshot` WS endpoint, and on the `Ticker` API endpoint.",
- ""
+ "Fetch all currencies"
]
},
{
- "name": "WSTickerFeedDataV1",
- "is_root": true,
+ "name": "CurrencyDetail",
+ "is_root": false,
"fields": [
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "id",
+ "lite_name": "i",
+ "semantic_type": "uint16",
+ "json_type": "integer",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.ticker.s'",
+ "example": "3",
"comment": [
- "Stream name"
+ "The integer value of the currency"
]
},
{
- "name": "selector",
- "lite_name": "s1",
+ "name": "symbol",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'USDT'",
"comment": [
- "Primary selector"
+ "The name of the currency"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
- "json_type": "string",
+ "name": "balance_decimals",
+ "lite_name": "bd",
+ "semantic_type": "int8",
+ "json_type": "integer",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'872634876'",
- "comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
- ]
- },
- {
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "Ticker",
- "json_type": "Ticker",
- "index": 3,
- "array_depth": 0,
- "optional": false,
+ "example": "6",
"comment": [
- "A ticker matching the request filter"
+ "The balance decimals of the currency"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
+ "name": "quantity_multiplier",
+ "lite_name": "qm",
"semantic_type": "uint64",
"json_type": "string",
- "index": 4,
+ "index": 3,
"array_depth": 0,
"optional": false,
- "example": "'872634875'",
+ "example": "1000000",
"comment": [
- "The previous sequence number that determines the message order"
+ "The quantity multiplier of the currency"
]
}
],
"comment": []
},
{
- "name": "WSTradeFeedSelectorV1",
+ "name": "ApiGetCurrencyResponse",
"is_root": true,
"fields": [
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "CurrencyDetail",
+ "json_type": "CurrencyDetail",
"index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ],
- "selector": "primary"
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 1,
- "array_depth": 0,
+ "array_depth": 1,
"optional": false,
- "example": "500",
"comment": [
- "The limit to query for. Valid values are (50, 200, 500, 1000). Default is 50"
- ],
- "selector": "secondary"
+ "The list of currencies"
+ ]
}
],
"comment": [
- "Subscribes to a stream of Public Trades for an instrument."
+ "The list of currencies"
]
},
{
- "name": "Trade",
- "is_root": false,
+ "name": "ApiCandlestickRequest",
+ "is_root": true,
"fields": [
- {
- "name": "event_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'1697788800000000000'",
- "comment": [
- "Time at which the event was emitted in unix nanoseconds"
- ]
- },
{
"name": "instrument",
"lite_name": "i",
"semantic_type": "asset",
"json_type": "string",
- "index": 1,
+ "index": 0,
"array_depth": 0,
"optional": false,
"example": "'BTC_USDT_Perp'",
@@ -6737,219 +6693,266 @@
]
},
{
- "name": "is_taker_buyer",
- "lite_name": "it",
- "semantic_type": "bool",
- "json_type": "boolean",
+ "name": "interval",
+ "lite_name": "i1",
+ "semantic_type": "CandlestickInterval",
+ "json_type": "CandlestickInterval",
+ "index": 1,
+ "array_depth": 0,
+ "optional": false,
+ "comment": [
+ "The interval of each candlestick"
+ ]
+ },
+ {
+ "name": "type",
+ "lite_name": "t",
+ "semantic_type": "CandlestickType",
+ "json_type": "CandlestickType",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "true",
"comment": [
- "If taker was the buyer on the trade"
+ "The type of candlestick data to retrieve"
]
},
{
- "name": "size",
- "lite_name": "s",
- "semantic_type": "string",
+ "name": "start_time",
+ "lite_name": "st",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 3,
"array_depth": 0,
- "optional": false,
- "example": "'123456.78'",
+ "optional": true,
+ "default": "0",
+ "example": "'1697788800000000000'",
"comment": [
- "The number of assets being traded, expressed in base asset decimal units"
+ "Start time of kline data in unix nanoseconds"
]
},
{
- "name": "price",
- "lite_name": "p",
- "semantic_type": "string",
+ "name": "end_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 4,
"array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
+ "optional": true,
+ "default": "now()",
+ "example": "'1697788800000000000'",
"comment": [
- "The traded price, expressed in `9` decimals"
+ "End time of kline data in unix nanoseconds"
]
},
{
- "name": "mark_price",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
"index": 5,
"array_depth": 0,
- "optional": false,
- "example": "'65038.01'",
+ "optional": true,
+ "default": "500",
+ "example": "500",
"comment": [
- "The mark price of the instrument at point of trade, expressed in `9` decimals"
+ "The limit to query for. Defaults to 500; Max 1000"
]
},
{
- "name": "index_price",
- "lite_name": "ip",
+ "name": "cursor",
+ "lite_name": "c",
"semantic_type": "string",
"json_type": "string",
"index": 6,
"array_depth": 0,
+ "optional": true,
+ "default": "''",
+ "example": "''",
+ "comment": [
+ "The cursor to indicate when to start the query from"
+ ]
+ }
+ ],
+ "comment": [
+ "Kline/Candlestick bars for an instrument. Klines are uniquely identified by their instrument, type, interval, and open time.",
+ "",
+ "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
+ ]
+ },
+ {
+ "name": "Candlestick",
+ "is_root": false,
+ "fields": [
+ {
+ "name": "open_time",
+ "lite_name": "ot",
+ "semantic_type": "timestamp",
+ "json_type": "string",
+ "index": 0,
+ "array_depth": 0,
"optional": false,
- "example": "'65038.01'",
+ "example": "'1697788800000000000'",
"comment": [
- "The index price of the instrument at point of trade, expressed in `9` decimals"
+ "Open time of kline bar in unix nanoseconds"
]
},
{
- "name": "interest_rate",
- "lite_name": "ir",
- "semantic_type": "string",
+ "name": "close_time",
+ "lite_name": "ct",
+ "semantic_type": "timestamp",
"json_type": "string",
- "index": 7,
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "0.0003",
+ "example": "'1697788800000000000'",
"comment": [
- "The interest rate of the underlying at point of trade, expressed in centibeeps (1/100th of a basis point)"
+ "Close time of kline bar in unix nanosecond"
]
},
{
- "name": "forward_price",
- "lite_name": "fp",
+ "name": "open",
+ "lite_name": "o",
"semantic_type": "string",
"json_type": "string",
- "index": 8,
+ "index": 2,
"array_depth": 0,
"optional": false,
- "example": "'65038.01'",
+ "example": "'123456.78'",
"comment": [
- "[Options] The forward price of the option at point of trade, expressed in `9` decimals"
+ "The open price, expressed in underlying currency resolution units"
]
},
{
- "name": "trade_id",
- "lite_name": "ti",
+ "name": "close",
+ "lite_name": "c",
"semantic_type": "string",
"json_type": "string",
- "index": 9,
+ "index": 3,
"array_depth": 0,
"optional": false,
- "example": "'209358-2'",
+ "example": "'123456.78'",
"comment": [
- "A trade identifier, globally unique, and monotonically increasing (not by `1`).",
- "All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.",
- "`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`."
+ "The close price, expressed in underlying currency resolution units"
]
},
{
- "name": "venue",
- "lite_name": "v",
- "semantic_type": "Venue",
- "json_type": "Venue",
- "index": 10,
+ "name": "high",
+ "lite_name": "h",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 4,
"array_depth": 0,
"optional": false,
+ "example": "'123456.78'",
"comment": [
- "The venue where the trade occurred"
+ "The high price, expressed in underlying currency resolution units"
]
},
{
- "name": "is_rpi",
- "lite_name": "ir1",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 13,
+ "name": "low",
+ "lite_name": "l",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 5,
"array_depth": 0,
"optional": false,
- "example": "false",
+ "example": "'123456.78'",
"comment": [
- "If the trade is a RPI trade"
+ "The low price, expressed in underlying currency resolution units"
]
- }
- ],
- "comment": [
- "All private RFQs and Private AXEs will be filtered out from the responses"
- ]
- },
- {
- "name": "WSTradeFeedDataV1",
- "is_root": true,
- "fields": [
+ },
{
- "name": "stream",
- "lite_name": "s",
+ "name": "volume_b",
+ "lite_name": "vb",
"semantic_type": "string",
"json_type": "string",
- "index": 0,
+ "index": 6,
"array_depth": 0,
"optional": false,
- "example": "'v1.trade'",
+ "example": "'123456.78'",
"comment": [
- "Stream name"
+ "The underlying volume transacted, expressed in base asset decimal units"
]
},
{
- "name": "selector",
- "lite_name": "s1",
+ "name": "volume_q",
+ "lite_name": "vq",
"semantic_type": "string",
"json_type": "string",
- "index": 1,
+ "index": 7,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'123456.78'",
"comment": [
- "Primary selector"
+ "The quote volume transacted, expressed in quote asset decimal units"
]
},
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
- "json_type": "string",
- "index": 2,
+ "name": "trades",
+ "lite_name": "t",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 8,
"array_depth": 0,
"optional": false,
- "example": "'872634876'",
+ "example": "123456",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "The number of trades transacted"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "Trade",
- "json_type": "Trade",
- "index": 3,
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
+ "index": 9,
"array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "A public trade matching the request filter"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ]
+ }
+ ],
+ "comment": [
+ ""
+ ]
+ },
+ {
+ "name": "ApiCandlestickResponse",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "Candlestick",
+ "json_type": "Candlestick",
+ "index": 0,
+ "array_depth": 1,
+ "optional": false,
+ "comment": [
+ "The candlestick result set for given interval"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
+ "name": "next",
+ "lite_name": "n",
+ "semantic_type": "string",
"json_type": "string",
- "index": 4,
+ "index": 1,
"array_depth": 0,
- "optional": false,
- "example": "'872634875'",
+ "optional": true,
+ "default": "''",
+ "example": "'Qw0918='",
"comment": [
- "The previous sequence number that determines the message order"
+ "The cursor to indicate when to start the next query from"
]
}
],
"comment": []
},
{
- "name": "WSCandlestickFeedSelectorV1",
+ "name": "ApiFundingRateRequest",
"is_root": true,
"fields": [
{
@@ -6963,267 +6966,383 @@
"example": "'BTC_USDT_Perp'",
"comment": [
"The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ],
- "selector": "primary"
+ ]
},
{
- "name": "interval",
- "lite_name": "i1",
- "semantic_type": "CandlestickInterval",
- "json_type": "CandlestickInterval",
+ "name": "start_time",
+ "lite_name": "st",
+ "semantic_type": "timestamp",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "0",
+ "example": "'1697788800000000000'",
"comment": [
- "The interval of each candlestick"
- ],
- "selector": "secondary"
+ "Start time of funding rate in unix nanoseconds"
+ ]
},
{
- "name": "type",
- "lite_name": "t",
- "semantic_type": "CandlestickType",
- "json_type": "CandlestickType",
+ "name": "end_time",
+ "lite_name": "et",
+ "semantic_type": "timestamp",
+ "json_type": "string",
"index": 2,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "now()",
+ "example": "'1697788800000000000'",
"comment": [
- "The type of candlestick data to retrieve"
- ],
- "selector": "secondary"
+ "End time of funding rate in unix nanoseconds"
+ ]
+ },
+ {
+ "name": "limit",
+ "lite_name": "l",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 3,
+ "array_depth": 0,
+ "optional": true,
+ "default": "500",
+ "example": "500",
+ "comment": [
+ "The limit to query for. Defaults to 500; Max 1000"
+ ]
+ },
+ {
+ "name": "cursor",
+ "lite_name": "c",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 4,
+ "array_depth": 0,
+ "optional": true,
+ "default": "''",
+ "example": "''",
+ "comment": [
+ "The cursor to indicate when to start the query from"
+ ]
+ },
+ {
+ "name": "agg_type",
+ "lite_name": "at",
+ "semantic_type": "FundingRateAggregationType",
+ "json_type": "FundingRateAggregationType",
+ "index": 5,
+ "array_depth": 0,
+ "optional": true,
+ "default": "'FUNDING_INTERVAL'",
+ "example": "'FUNDING_INTERVAL'",
+ "comment": [
+ "Aggregation method for historical funding rate observations. Defaults to using the instrument-specific funding interval."
+ ]
}
],
"comment": [
- "Subscribes to a stream of Kline/Candlestick updates for an instrument. A Kline is uniquely identified by its open time.",
- "A new Kline is published every interval (if it exists). Upon subscription, the server will send the 5 most recent Kline for the requested interval."
+ "Lookup the historical funding rate of a perpetual future.",
+ "",
+ "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "Candlestick",
+ "name": "ApiFundingRate",
"is_root": false,
"fields": [
{
- "name": "open_time",
- "lite_name": "ot",
- "semantic_type": "timestamp",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Open time of kline bar in unix nanoseconds"
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "close_time",
- "lite_name": "ct",
- "semantic_type": "timestamp",
+ "name": "funding_rate",
+ "lite_name": "fr",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "0.0003",
"comment": [
- "Close time of kline bar in unix nanosecond"
+ "The funding rate of the instrument, expressed in percentage points"
]
},
{
- "name": "open",
- "lite_name": "o",
- "semantic_type": "string",
+ "name": "funding_time",
+ "lite_name": "ft",
+ "semantic_type": "timestamp",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'123456.78'",
+ "example": "'1697788800000000000'",
"comment": [
- "The open price, expressed in underlying currency resolution units"
+ "The funding timestamp of the funding rate, expressed in unix nanoseconds"
]
},
{
- "name": "close",
- "lite_name": "c",
+ "name": "mark_price",
+ "lite_name": "mp",
"semantic_type": "string",
"json_type": "string",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "'123456.78'",
+ "example": "'65038.01'",
"comment": [
- "The close price, expressed in underlying currency resolution units"
+ "The mark price of the instrument at funding timestamp, expressed in `9` decimals"
]
},
{
- "name": "high",
- "lite_name": "h",
+ "name": "funding_rate_8_h_avg",
+ "lite_name": "fr1",
"semantic_type": "string",
"json_type": "string",
"index": 4,
"array_depth": 0,
"optional": false,
- "example": "'123456.78'",
+ "example": "0.0003",
"comment": [
- "The high price, expressed in underlying currency resolution units"
+ "Deprecated: Refer to `funding_rate` instead. Will be removed in a future release."
]
},
{
- "name": "low",
- "lite_name": "l",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "funding_interval_hours",
+ "lite_name": "fi",
+ "semantic_type": "uint8",
+ "json_type": "integer",
"index": 5,
"array_depth": 0,
"optional": false,
- "example": "'123456.78'",
+ "example": "8",
"comment": [
- "The low price, expressed in underlying currency resolution units"
+ "Funding interval in hours (e.g. 1/4/8/etc)."
+ ]
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "ApiFundingRateResponse",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "ApiFundingRate",
+ "json_type": "ApiFundingRate",
+ "index": 0,
+ "array_depth": 1,
+ "optional": false,
+ "comment": [
+ "The funding rate result set for given interval"
]
},
{
- "name": "volume_b",
- "lite_name": "vb",
+ "name": "next",
+ "lite_name": "n",
"semantic_type": "string",
"json_type": "string",
- "index": 6,
+ "index": 1,
+ "array_depth": 0,
+ "optional": true,
+ "default": "''",
+ "example": "'Qw0918='",
+ "comment": [
+ "The cursor to indicate when to start the next query from"
+ ]
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "JSONRPCRequest",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "jsonrpc",
+ "lite_name": "j",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'123456.78'",
+ "example": "'2.0'",
"comment": [
- "The underlying volume transacted, expressed in base asset decimal units"
+ "The JSON RPC version to use for the request"
]
},
{
- "name": "volume_q",
- "lite_name": "vq",
+ "name": "method",
+ "lite_name": "m",
"semantic_type": "string",
"json_type": "string",
- "index": 7,
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "'123456.78'",
+ "example": "'subscribe'",
"comment": [
- "The quote volume transacted, expressed in quote asset decimal units"
+ "The method to use for the request (eg: `subscribe` / `unsubscribe` / `v1/instrument` )"
]
},
{
- "name": "trades",
- "lite_name": "t",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 8,
+ "name": "params",
+ "lite_name": "p",
+ "semantic_type": "any",
+ "json_type": "object",
+ "index": 2,
"array_depth": 0,
"optional": false,
- "example": "123456",
"comment": [
- "The number of trades transacted"
+ "The parameters for the request"
]
},
{
- "name": "instrument",
+ "name": "id",
"lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 9,
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 3,
"array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "optional": true,
+ "default": "0",
+ "example": "123",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "Optional Field which is used to match the response by the client.",
+ "If not passed, this field will not be returned"
]
}
],
"comment": [
- ""
+ "All Websocket JSON RPC Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.",
+ "If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).",
+ "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
]
},
{
- "name": "WSCandlestickFeedDataV1",
+ "name": "Error",
"is_root": true,
"fields": [
{
- "name": "stream",
- "lite_name": "s",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "code",
+ "lite_name": "c",
+ "semantic_type": "uint16",
+ "json_type": "integer",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'v1.candle'",
+ "example": "123",
"comment": [
- "Stream name"
+ "The error code for the request"
]
},
{
- "name": "selector",
- "lite_name": "s1",
+ "name": "message",
+ "lite_name": "m",
"semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'An error occurred'",
"comment": [
- "Primary selector"
+ "The error message for the request"
]
- },
+ }
+ ],
+ "comment": [
+ "An error response"
+ ]
+ },
+ {
+ "name": "JSONRPCResponse",
+ "is_root": true,
+ "fields": [
{
- "name": "sequence_number",
- "lite_name": "sn",
- "semantic_type": "uint64",
+ "name": "jsonrpc",
+ "lite_name": "j",
+ "semantic_type": "string",
"json_type": "string",
- "index": 2,
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'872634876'",
+ "example": "'2.0'",
"comment": [
- "A sequence number used to determine message order within a stream.",
- "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
- "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
- " - A single cluster payload can be multiplexed into multiple stream payloads.",
- " - To distinguish each stream payload, a `dedupCounter` is included.",
- " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ "The JSON RPC version to use for the request"
]
},
{
- "name": "feed",
- "lite_name": "f",
- "semantic_type": "Candlestick",
- "json_type": "Candlestick",
+ "name": "result",
+ "lite_name": "r",
+ "semantic_type": "any",
+ "json_type": "object",
+ "index": 1,
+ "array_depth": 0,
+ "optional": true,
+ "default": "null",
+ "comment": [
+ "The result for the request"
+ ]
+ },
+ {
+ "name": "error",
+ "lite_name": "e",
+ "semantic_type": "Error",
+ "json_type": "Error",
+ "index": 2,
+ "array_depth": 0,
+ "optional": true,
+ "default": "null",
+ "comment": [
+ "The error for the request"
+ ]
+ },
+ {
+ "name": "id",
+ "lite_name": "i",
+ "semantic_type": "uint32",
+ "json_type": "integer",
"index": 3,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "0",
+ "example": "123",
"comment": [
- "A candlestick entry matching the request filters"
+ "Optional Field which is used to match the response by the client.",
+ "If not passed, this field will not be returned.",
+ "Range: 0 to 4,294,967,295 (uint32)"
]
},
{
- "name": "prev_sequence_number",
- "lite_name": "ps",
- "semantic_type": "uint64",
+ "name": "method",
+ "lite_name": "m",
+ "semantic_type": "string",
"json_type": "string",
"index": 4,
"array_depth": 0,
"optional": false,
- "example": "'872634875'",
+ "example": "'subscribe'",
"comment": [
- "The previous sequence number that determines the message order"
+ "The method used in the request for this response (eg: `subscribe` / `unsubscribe` / `v1/instrument` )"
]
}
],
- "comment": []
- },
- {
- "name": "WSUnsubscribeAllParams",
- "is_root": true,
- "fields": [],
"comment": [
- "All V1 Websocket Unsubscription Request to unsubscribe from all active websocket streams."
+ "All Websocket JSON RPC Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.",
+ "If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response."
]
},
{
- "name": "StreamReference",
- "is_root": false,
+ "name": "WSSubscribeParams",
+ "is_root": true,
"fields": [
{
"name": "stream",
@@ -7246,950 +7365,886 @@
"index": 1,
"array_depth": 1,
"optional": false,
- "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "The list of selectors for the stream"
+ "The list of feeds to subscribe to"
]
- }
- ],
- "comment": []
- },
- {
- "name": "WSUnsubscribeAllResult",
- "is_root": true,
- "fields": [
+ },
{
- "name": "stream_reference",
- "lite_name": "sr",
- "semantic_type": "StreamReference",
- "json_type": "StreamReference",
- "index": 0,
- "array_depth": 1,
- "optional": false,
+ "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": [
- "The list of stream references unsubscribed from"
+ "Whether to use the global sequence number for the stream"
]
}
],
"comment": [
- "Returns a list of all rooms the client has unsubscribed from."
- ]
- },
- {
- "name": "WSListStreamsParams",
- "is_root": true,
- "fields": [],
- "comment": [
- "List down all the streams this connection has connected to."
+ "All V1 Websocket Subscription Requests are housed in this wrapper. You may specify a stream and a list of feeds to subscribe to.",
+ "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details.",
+ "Sequence numbers can be either gateway-specific or global:",
+ "- **Gateway Unique Sequence Number**: Increments by one per stream, resets to 0 on gateway restart.",
+ "- **Global Unique Sequence Number**: A cluster-wide unique number assigned to each cluster payload, does not reset on gateway restarts, and can be used to track and identify message order across streams using `sequence_number` and `prev_sequence_number` in the feed response.",
+ "Set `useGlobalSequenceNumber = true` if you need a persistent, unique identifier across all streams or ordering across multiple feeds."
]
},
{
- "name": "WSListStreamsResult",
+ "name": "WSSubscribeResult",
"is_root": true,
"fields": [
{
- "name": "stream_reference",
- "lite_name": "sr",
- "semantic_type": "StreamReference",
- "json_type": "StreamReference",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'v1.ticker.d'",
+ "comment": [
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
+ ]
+ },
+ {
+ "name": "subs",
+ "lite_name": "s1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 1,
"array_depth": 1,
"optional": false,
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "The list of stream references the connection is connected to"
+ "The list of feeds subscribed to"
]
- }
- ],
- "comment": [
- "Returns a list of all rooms the client has subscribed to."
- ]
- },
- {
- "name": "ApiOrderbookLevelsRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "unsubs",
+ "lite_name": "u",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
- "array_depth": 0,
+ "index": 2,
+ "array_depth": 1,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "The list of feeds unsubscribed from"
]
},
{
- "name": "depth",
- "lite_name": "d",
+ "name": "num_snapshots",
+ "lite_name": "ns",
"semantic_type": "uint32",
"json_type": "integer",
- "index": 1,
- "array_depth": 0,
+ "index": 3,
+ "array_depth": 1,
"optional": false,
- "example": "50",
+ "example": "10",
"comment": [
- "Depth of the order book to be retrieved (10, 50, 100, 500)"
+ "The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`"
]
- }
- ],
- "comment": [
- "Retrieves aggregated price depth for a single instrument, with a maximum depth of 10 levels. Do not use this to poll for data -- a websocket subscription is much more performant, and useful."
- ]
- },
- {
- "name": "ApiOrderbookLevelsResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "OrderbookLevels",
- "json_type": "OrderbookLevels",
- "index": 0,
- "array_depth": 0,
+ "name": "first_sequence_number",
+ "lite_name": "fs",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 4,
+ "array_depth": 1,
"optional": false,
+ "example": "872634876",
"comment": [
- "The orderbook levels objects matching the request asset"
+ "The first sequence number to expect for each subscribed feed. Returned in same order as `subs`"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiMiniTickerRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "latest_sequence_number",
+ "lite_name": "ls",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 0,
- "array_depth": 0,
+ "index": 5,
+ "array_depth": 1,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "872634875",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "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": [
- "Retrieves a single mini ticker value for a single instrument. Please do not use this to repeatedly poll for data -- a websocket subscription is much more performant, and useful."
+ "To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:\u003cul\u003e\u003cli\u003eAll snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas\u003c/li\u003e\u003cli\u003eNum snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots\u003c/li\u003e\u003cli\u003eFirst sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots\u003c/li\u003e\u003cli\u003eSequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect\u003c/li\u003e\u003cli\u003eDuplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.\u003c/li\u003e\u003c/ul\u003e",
+ "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
]
},
{
- "name": "ApiMiniTickerResponse",
+ "name": "WSUnsubscribeParams",
"is_root": true,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "MiniTicker",
- "json_type": "MiniTicker",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
+ "example": "'v1.ticker.d'",
"comment": [
- "The mini ticker matching the request asset"
+ "The channel to unsubscribe from (eg: ticker.s / ticker.d)"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiTickerRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "selectors",
+ "lite_name": "s1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
- "array_depth": 0,
+ "index": 1,
+ "array_depth": 1,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "The list of feeds to unsubscribe from"
]
- }
- ],
- "comment": [
- "Retrieves a single ticker value for a single instrument. Please do not use this to repeatedly poll for data -- a websocket subscription is much more performant, and useful."
- ]
- },
- {
- "name": "ApiTickerResponse",
- "is_root": true,
- "fields": [
+ },
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Ticker",
- "json_type": "Ticker",
- "index": 0,
+ "name": "use_global_sequence_number",
+ "lite_name": "ug",
+ "semantic_type": "bool",
+ "json_type": "boolean",
+ "index": 2,
"array_depth": 0,
- "optional": false,
+ "optional": true,
+ "default": "false",
+ "example": "true",
"comment": [
- "The mini ticker matching the request asset"
+ "Whether to use the global sequence number for the stream"
]
}
],
- "comment": []
+ "comment": [
+ "All V1 Websocket Unsubscription Requests are housed in this wrapper. You may specify a stream, a list of feeds and whether those feeds use global sequence numbers to unsubscribe from."
+ ]
},
{
- "name": "ApiTradeRequest",
+ "name": "WSUnsubscribeResult",
"is_root": true,
"fields": [
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'v1.ticker.d'",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
]
},
{
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "unsubs",
+ "lite_name": "u",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 1,
- "array_depth": 0,
+ "array_depth": 1,
"optional": false,
- "example": "500",
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "The limit to query for. Defaults to 500; Max 1000"
+ "The list of feeds unsubscribed from"
]
}
],
"comment": [
- "Retrieves up to 1000 of the most recent trades in any given instrument. Do not use this to poll for data -- a websocket subscription is much more performant, and useful.",
- "This endpoint offers public trading data, use the Trading APIs instead to query for your personalized trade tape."
+ "Returns a confirmation of all unsubscribes"
]
},
{
- "name": "ApiTradeResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Trade",
- "json_type": "Trade",
- "index": 0,
- "array_depth": 1,
- "optional": false,
- "comment": [
- "The public trades matching the request asset"
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiTradeHistoryRequest",
+ "name": "WSSubscribeRequestV1Legacy",
"is_root": true,
"fields": [
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
+ "name": "request_id",
+ "lite_name": "ri",
+ "semantic_type": "uint32",
+ "json_type": "integer",
"index": 0,
"array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
+ "optional": true,
+ "default": "0",
+ "example": "123",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "Optional Field which is used to match the response by the client.",
+ "If not passed, this field will not be returned.",
+ "Range: 0 to 4,294,967,295 (uint32)"
]
},
{
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "int64",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
+ "optional": false,
+ "example": "'v1.ticker.d'",
"comment": [
- "The start time to apply in nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned"
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
]
},
{
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "int64",
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "string",
"json_type": "string",
"index": 2,
- "array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
+ "array_depth": 1,
+ "optional": false,
+ "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
"comment": [
- "The end time to apply in nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned"
+ "The list of feeds to subscribe to"
]
},
{
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
+ "name": "method",
+ "lite_name": "m",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 3,
"array_depth": 0,
- "optional": true,
- "default": "500",
- "example": "500",
+ "optional": false,
+ "example": "'subscribe'",
"comment": [
- "The limit to query for. Defaults to 500; Max 1000"
+ "The method to use for the request (eg: subscribe / unsubscribe)"
]
},
{
- "name": "cursor",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "is_full",
+ "lite_name": "if",
+ "semantic_type": "bool",
+ "json_type": "boolean",
"index": 4,
"array_depth": 0,
"optional": true,
- "default": "''",
- "example": "''",
+ "default": "false",
+ "example": "true",
"comment": [
- "The cursor to indicate when to start the query from"
+ "Whether the request is for full data or lite data"
]
}
],
"comment": [
- "Perform historical lookup of public trades in any given instrument.",
- "This endpoint offers public trading data, use the Trading APIs instead to query for your personalized trade tape.",
- "Only data from the last three months will be retained.",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
+ "All V1 Websocket Requests are housed in this wrapper. You may specify a stream, and a list of feeds to subscribe to.",
+ "If a `request_id` is supplied in this JSON RPC request, it will be propagated back to any relevant JSON RPC responses (including error).",
+ "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
]
},
{
- "name": "ApiTradeHistoryResponse",
+ "name": "WSSubscribeResponseV1Legacy",
"is_root": true,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Trade",
- "json_type": "Trade",
+ "name": "request_id",
+ "lite_name": "ri",
+ "semantic_type": "uint32",
+ "json_type": "integer",
"index": 0,
- "array_depth": 1,
- "optional": false,
+ "array_depth": 0,
+ "optional": true,
+ "default": "0",
+ "example": "123",
"comment": [
- "The public trades matching the request asset"
+ "Optional Field which is used to match the response by the client.",
+ "If not passed, this field will not be returned"
]
},
{
- "name": "next",
- "lite_name": "n",
+ "name": "stream",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "'Qw0918='",
+ "optional": false,
+ "example": "'v1.ticker.d'",
"comment": [
- "The cursor to indicate when to start the next query from"
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetInstrumentRequest",
- "is_root": true,
- "fields": [
+ },
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "subs",
+ "lite_name": "s1",
+ "semantic_type": "string",
"json_type": "string",
- "index": 0,
- "array_depth": 0,
+ "index": 2,
+ "array_depth": 1,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
- }
- ],
- "comment": [
- "Fetch a single instrument by supplying the asset or instrument name"
- ]
- },
- {
- "name": "InstrumentDisplay",
- "is_root": false,
- "fields": [
- {
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
- "json_type": "string",
- "index": 0,
- "array_depth": 0,
- "optional": false,
- "example": "'BTC_USDT_Perp'",
- "comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "The list of feeds subscribed to"
]
},
{
- "name": "instrument_hash",
- "lite_name": "ih",
- "semantic_type": "uint256",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": false,
- "example": "'0x030501'",
- "comment": [
- "The asset ID used for instrument signing."
- ]
- },
- {
- "name": "base",
- "lite_name": "b",
+ "name": "unsubs",
+ "lite_name": "u",
"semantic_type": "string",
"json_type": "string",
- "index": 2,
- "array_depth": 0,
+ "index": 3,
+ "array_depth": 1,
"optional": false,
- "example": "'BTC'",
+ "example": "['BTC_USDT_Perp@500', 'ETH_USDT_Perp@500']",
"comment": [
- "The base currency"
+ "The list of feeds unsubscribed from"
]
},
{
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "string",
- "json_type": "string",
- "index": 3,
- "array_depth": 0,
+ "name": "num_snapshots",
+ "lite_name": "ns",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 4,
+ "array_depth": 1,
"optional": false,
- "example": "'USDT'",
+ "example": "10",
"comment": [
- "The quote currency"
+ "The number of snapshot payloads to expect for each subscribed feed. Returned in same order as `subs`"
]
},
{
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
- "index": 4,
- "array_depth": 0,
+ "name": "first_sequence_number",
+ "lite_name": "fs",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 5,
+ "array_depth": 1,
"optional": false,
- "example": "'PERPETUAL'",
+ "example": "872634876",
"comment": [
- "The kind of instrument"
+ "The first sequence number to expect for each subscribed feed. Returned in same order as `subs`"
]
},
{
- "name": "venues",
- "lite_name": "v",
- "semantic_type": "Venue",
- "json_type": "Venue",
- "index": 7,
+ "name": "latest_sequence_number",
+ "lite_name": "ls",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 6,
"array_depth": 1,
"optional": false,
- "example": "['ORDERBOOK']",
+ "example": "872634875",
"comment": [
- "Venues that this instrument can be traded at"
+ "The sequence number of the most recent message in the stream. Next received sequence number must be larger than this one. Returned in same order as `subs`"
]
- },
+ }
+ ],
+ "comment": [
+ "All V1 Websocket Responses are housed in this wrapper. It returns a confirmation of the JSON RPC subscribe request.",
+ "If a `request_id` is supplied in the JSON RPC request, it will be propagated back in this JSON RPC response.",
+ "To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:\u003cul\u003e\u003cli\u003eAll snapshot payloads will have a sequence number of `0`. All delta payloads will have a sequence number of `1+`. So its easy to distinguish between snapshots, and deltas\u003c/li\u003e\u003cli\u003eNum snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots\u003c/li\u003e\u003cli\u003eFirst sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots\u003c/li\u003e\u003cli\u003eSequence numbers should always monotonically increase by `1`. If it decreases, or increases by more than `1`. Please reconnect\u003c/li\u003e\u003cli\u003eDuplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.\u003c/li\u003e\u003c/ul\u003e",
+ "When subscribing to the same primary selector again, the previous secondary selector will be replaced. See `Overview` page for more details."
+ ]
+ },
+ {
+ "name": "WSOrderbookLevelsFeedSelectorV1",
+ "is_root": true,
+ "fields": [
{
- "name": "settlement_period",
- "lite_name": "sp1",
- "semantic_type": "InstrumentSettlementPeriod",
- "json_type": "InstrumentSettlementPeriod",
- "index": 8,
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'PERPETUAL'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The settlement period of the instrument"
- ]
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ],
+ "selector": "primary"
},
{
- "name": "base_decimals",
- "lite_name": "bd",
- "semantic_type": "int8",
+ "name": "rate",
+ "lite_name": "r",
+ "semantic_type": "uint32",
"json_type": "integer",
- "index": 9,
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "3",
+ "example": "500",
"comment": [
- "The smallest denomination of the base asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)"
- ]
+ "The minimal rate at which we publish feeds (in milliseconds)",
+ "Delta (50, 100, 500, 1000)",
+ "Snapshot (500, 1000)"
+ ],
+ "selector": "secondary"
},
{
- "name": "quote_decimals",
- "lite_name": "qd",
- "semantic_type": "int8",
+ "name": "depth",
+ "lite_name": "d",
+ "semantic_type": "uint32",
"json_type": "integer",
- "index": 10,
+ "index": 2,
"array_depth": 0,
- "optional": false,
- "example": "3",
+ "optional": true,
+ "default": "'0'",
+ "example": "50",
"comment": [
- "The smallest denomination of the quote asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)"
- ]
- },
+ "Depth of the order book to be retrieved",
+ "Delta(0 - `unlimited`)",
+ "Snapshot(10, 50, 100, 500)"
+ ],
+ "selector": "secondary"
+ }
+ ],
+ "comment": [
+ "Subscribes to aggregated orderbook updates for a single instrument. The `book.s` channel offers simpler integration. To experience higher publishing rates, please use the `book.d` channel.",
+ "Unlike the `book.d` channel which publishes an initial snapshot, then only streams deltas after, the `book.s` channel publishes full snapshots at each feed.",
+ "",
+ "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of all levels of the Orderbook.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send levels that have changed in value.\u003c/li\u003e\u003c/ul\u003e",
+ "",
+ "Subscription Pattern:\u003cul\u003e\u003cli\u003eDelta - `instrument@rate`\u003c/li\u003e\u003cli\u003eSnapshot - `instrument@rate-depth`\u003c/li\u003e\u003c/ul\u003e",
+ "",
+ "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a level is not updated, level not published\u003c/li\u003e\u003cli\u003eIf a level is updated, {size: '123'}\u003c/li\u003e\u003cli\u003eIf a level is set to zero, {size: '0'}\u003c/li\u003e\u003cli\u003eIncoming levels will be published as soon as price moves\u003c/li\u003e\u003cli\u003eOutgoing levels will be published with `size = 0`\u003c/li\u003e\u003c/ul\u003e"
+ ]
+ },
+ {
+ "name": "WSOrderbookLevelsFeedDataV1",
+ "is_root": true,
+ "fields": [
{
- "name": "tick_size",
- "lite_name": "ts",
+ "name": "stream",
+ "lite_name": "s",
"semantic_type": "string",
"json_type": "string",
- "index": 11,
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "'0.01'",
+ "example": "'v1.book.s'",
"comment": [
- "The size of a single tick, expressed in price decimal units"
+ "Stream name"
]
},
{
- "name": "min_size",
- "lite_name": "ms",
+ "name": "selector",
+ "lite_name": "s1",
"semantic_type": "string",
"json_type": "string",
- "index": 12,
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "'0.01'",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The minimum contract size, expressed in base asset decimal units"
+ "Primary selector"
]
},
{
- "name": "create_time",
- "lite_name": "ct",
- "semantic_type": "timestamp",
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 14,
+ "index": 2,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'872634876'",
"comment": [
- "Creation time in unix nanoseconds"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "max_position_size",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
- "index": 15,
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "OrderbookLevels",
+ "json_type": "OrderbookLevels",
+ "index": 3,
"array_depth": 0,
"optional": false,
- "example": "'100.0'",
"comment": [
- "The maximum position size, expressed in base asset decimal units"
- ]
- },
- {
- "name": "funding_interval_hours",
- "lite_name": "fi",
- "semantic_type": "uint8",
- "json_type": "integer",
- "index": 17,
- "array_depth": 0,
- "optional": true,
- "comment": [
- "Defines the funding interval to be applied."
- ]
- },
- {
- "name": "adjusted_funding_rate_cap",
- "lite_name": "af",
- "semantic_type": "string",
- "json_type": "string",
- "index": 18,
- "array_depth": 0,
- "optional": true,
- "example": "2.5",
- "comment": [
- "Funding rate cap over the defined `intervalHours`."
+ "An orderbook levels object matching the request filter"
]
},
{
- "name": "adjusted_funding_rate_floor",
- "lite_name": "af1",
- "semantic_type": "string",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 19,
- "array_depth": 0,
- "optional": true,
- "example": "-2.5",
- "comment": [
- "Funding rate floor over the defined `intervalHours`."
- ]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetInstrumentResponse",
- "is_root": true,
- "fields": [
- {
- "name": "result",
- "lite_name": "r",
- "semantic_type": "InstrumentDisplay",
- "json_type": "InstrumentDisplay",
- "index": 0,
+ "index": 4,
"array_depth": 0,
"optional": false,
+ "example": "'872634875'",
"comment": [
- "The instrument matching the request asset"
+ "The previous sequence number that determines the message order"
]
}
],
"comment": []
},
{
- "name": "ApiGetFilteredInstrumentsRequest",
+ "name": "WSMiniTickerFeedSelectorV1",
"is_root": true,
"fields": [
{
- "name": "kind",
- "lite_name": "k",
- "semantic_type": "Kind",
- "json_type": "Kind",
- "index": 0,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['PERPETUAL']",
- "comment": [
- "The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "base",
- "lite_name": "b",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['BTC', 'ETH']",
- "comment": [
- "The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "quote",
- "lite_name": "q",
- "semantic_type": "string",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
"json_type": "string",
- "index": 2,
- "array_depth": 1,
- "optional": true,
- "default": "all",
- "example": "['USDT', 'USDC']",
- "comment": [
- "The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned"
- ]
- },
- {
- "name": "is_active",
- "lite_name": "ia",
- "semantic_type": "bool",
- "json_type": "boolean",
- "index": 3,
+ "index": 0,
"array_depth": 0,
- "optional": true,
- "default": "false",
- "example": "true",
+ "optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "Request for active instruments only"
- ]
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ],
+ "selector": "primary"
},
{
- "name": "limit",
- "lite_name": "l",
+ "name": "rate",
+ "lite_name": "r",
"semantic_type": "uint32",
"json_type": "integer",
- "index": 4,
+ "index": 1,
"array_depth": 0,
- "optional": true,
- "default": "500",
+ "optional": false,
"example": "500",
"comment": [
- "The limit to query for. Defaults to 500; Max 100000"
- ]
+ "The minimal rate at which we publish feeds (in milliseconds)",
+ "Delta (0 - `raw`, 50, 100, 200, 500, 1000, 5000)",
+ "Snapshot (200, 500, 1000, 5000)"
+ ],
+ "selector": "secondary"
}
],
"comment": [
- "Fetch a list of instruments based on the filters provided"
+ "Subscribes to a mini ticker feed for a single instrument. The `mini.s` channel offers simpler integration. To experience higher publishing rates, please use the `mini.d` channel.",
+ "Unlike the `mini.d` channel which publishes an initial snapshot, then only streams deltas after, the `mini.s` channel publishes full snapshots at each feed.",
+ "",
+ "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of the mini ticker.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send deltas of the mini ticker.\u003c/li\u003e\u003cli\u003eThe server will send a delta if any of the fields in the mini ticker have changed.\u003c/li\u003e\u003c/ul\u003e",
+ "",
+ "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a field is not updated, {}\u003c/li\u003e\u003cli\u003eIf a field is updated, {field: '123'}\u003c/li\u003e\u003cli\u003eIf a field is set to zero, {field: '0'}\u003c/li\u003e\u003cli\u003eIf a field is set to null, {field: ''}\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "ApiGetFilteredInstrumentsResponse",
+ "name": "WSMiniTickerFeedDataV1",
"is_root": true,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "InstrumentDisplay",
- "json_type": "InstrumentDisplay",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'v1.mini.s'",
"comment": [
- "The instruments matching the request filter"
+ "Stream name"
]
- }
- ],
- "comment": []
- },
- {
- "name": "ApiGetCurrencyRequest",
- "is_root": true,
- "fields": [],
- "comment": [
- "Fetch all currencies"
- ]
- },
- {
- "name": "CurrencyDetail",
- "is_root": false,
- "fields": [
+ },
{
- "name": "id",
- "lite_name": "i",
- "semantic_type": "uint16",
- "json_type": "integer",
- "index": 0,
+ "name": "selector",
+ "lite_name": "s1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 1,
"array_depth": 0,
"optional": false,
- "example": "3",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The integer value of the currency"
+ "Primary selector"
]
},
{
- "name": "symbol",
- "lite_name": "s",
- "semantic_type": "string",
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 1,
+ "index": 2,
"array_depth": 0,
"optional": false,
- "example": "'USDT'",
+ "example": "'872634876'",
"comment": [
- "The name of the currency"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "balance_decimals",
- "lite_name": "bd",
- "semantic_type": "int8",
- "json_type": "integer",
- "index": 2,
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "MiniTicker",
+ "json_type": "MiniTicker",
+ "index": 3,
"array_depth": 0,
"optional": false,
- "example": "6",
"comment": [
- "The balance decimals of the currency"
+ "A mini ticker matching the request filter"
]
},
{
- "name": "quantity_multiplier",
- "lite_name": "qm",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
"semantic_type": "uint64",
"json_type": "string",
- "index": 3,
+ "index": 4,
"array_depth": 0,
"optional": false,
- "example": "1000000",
+ "example": "'872634875'",
"comment": [
- "The quantity multiplier of the currency"
+ "The previous sequence number that determines the message order"
]
}
],
"comment": []
},
{
- "name": "ApiGetCurrencyResponse",
+ "name": "WSTickerFeedSelectorV1",
"is_root": true,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "CurrencyDetail",
- "json_type": "CurrencyDetail",
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The list of currencies"
- ]
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ],
+ "selector": "primary"
+ },
+ {
+ "name": "rate",
+ "lite_name": "r",
+ "semantic_type": "uint32",
+ "json_type": "integer",
+ "index": 1,
+ "array_depth": 0,
+ "optional": false,
+ "example": "500",
+ "comment": [
+ "The minimal rate at which we publish feeds (in milliseconds)",
+ "Delta (100, 200, 500, 1000, 5000)",
+ "Snapshot (500, 1000, 5000)"
+ ],
+ "selector": "secondary"
}
],
"comment": [
- "The list of currencies"
+ "Subscribes to a ticker feed for a single instrument. The `ticker.s` channel offers simpler integration. To experience higher publishing rates, please use the `ticker.d` channel.",
+ "Unlike the `ticker.d` channel which publishes an initial snapshot, then only streams deltas after, the `ticker.s` channel publishes full snapshots at each feed.",
+ "",
+ "The Delta feed will work as follows:\u003cul\u003e\u003cli\u003eOn subscription, the server will send a full snapshot of the ticker.\u003c/li\u003e\u003cli\u003eAfter the snapshot, the server will only send deltas of the ticker.\u003c/li\u003e\u003cli\u003eThe server will send a delta if any of the fields in the ticker have changed.\u003c/li\u003e\u003c/ul\u003e",
+ "",
+ "Field Semantics:\u003cul\u003e\u003cli\u003e[DeltaOnly] If a field is not updated, {}\u003c/li\u003e\u003cli\u003eIf a field is updated, {field: '123'}\u003c/li\u003e\u003cli\u003eIf a field is set to zero, {field: '0'}\u003c/li\u003e\u003cli\u003eIf a field is set to null, {field: ''}\u003c/li\u003e\u003c/ul\u003e"
]
},
{
- "name": "ApiCandlestickRequest",
+ "name": "WSTickerFeedDataV1",
"is_root": true,
"fields": [
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'v1.ticker.s'",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "Stream name"
]
},
{
- "name": "interval",
- "lite_name": "i1",
- "semantic_type": "CandlestickInterval",
- "json_type": "CandlestickInterval",
+ "name": "selector",
+ "lite_name": "s1",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The interval of each candlestick"
+ "Primary selector"
]
},
{
- "name": "type",
- "lite_name": "t",
- "semantic_type": "CandlestickType",
- "json_type": "CandlestickType",
+ "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 candlestick data to retrieve"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
- "json_type": "string",
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "Ticker",
+ "json_type": "Ticker",
"index": 3,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
+ "optional": false,
"comment": [
- "Start time of kline data in unix nanoseconds"
+ "A ticker matching the request filter"
]
},
{
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 4,
"array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
+ "optional": false,
+ "example": "'872634875'",
"comment": [
- "End time of kline data in unix nanoseconds"
+ "The previous sequence number that determines the message order"
]
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "WSTradeFeedSelectorV1",
+ "is_root": true,
+ "fields": [
+ {
+ "name": "instrument",
+ "lite_name": "i",
+ "semantic_type": "asset",
+ "json_type": "string",
+ "index": 0,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'BTC_USDT_Perp'",
+ "comment": [
+ "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ ],
+ "selector": "primary"
},
{
"name": "limit",
"lite_name": "l",
"semantic_type": "uint32",
"json_type": "integer",
- "index": 5,
+ "index": 1,
"array_depth": 0,
- "optional": true,
- "default": "500",
+ "optional": false,
"example": "500",
"comment": [
- "The limit to query for. Defaults to 500; Max 1000"
- ]
- },
- {
- "name": "cursor",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
- "index": 6,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "''",
- "comment": [
- "The cursor to indicate when to start the query from"
- ]
+ "The limit to query for. Valid values are (50, 200, 500, 1000). Default is 50"
+ ],
+ "selector": "secondary"
}
],
"comment": [
- "Kline/Candlestick bars for an instrument. Klines are uniquely identified by their instrument, type, interval, and open time.",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
+ "Subscribes to a stream of Public Trades for an instrument."
]
},
{
- "name": "ApiCandlestickResponse",
+ "name": "WSTradeFeedDataV1",
"is_root": true,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "Candlestick",
- "json_type": "Candlestick",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
"index": 0,
- "array_depth": 1,
+ "array_depth": 0,
"optional": false,
+ "example": "'v1.trade'",
"comment": [
- "The candlestick result set for given interval"
+ "Stream name"
+ ]
+ },
+ {
+ "name": "selector",
+ "lite_name": "s1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'BTC_USDT_Perp'",
+ "comment": [
+ "Primary selector"
+ ]
+ },
+ {
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
+ "json_type": "string",
+ "index": 2,
+ "array_depth": 0,
+ "optional": false,
+ "example": "'872634876'",
+ "comment": [
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
+ ]
+ },
+ {
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "Trade",
+ "json_type": "Trade",
+ "index": 3,
+ "array_depth": 0,
+ "optional": false,
+ "comment": [
+ "A public trade matching the request filter"
]
},
{
- "name": "next",
- "lite_name": "n",
- "semantic_type": "string",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
"json_type": "string",
- "index": 1,
+ "index": 4,
"array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "'Qw0918='",
+ "optional": false,
+ "example": "'872634875'",
"comment": [
- "The cursor to indicate when to start the next query from"
+ "The previous sequence number that determines the message order"
]
}
],
"comment": []
},
{
- "name": "ApiFundingRateRequest",
+ "name": "WSCandlestickFeedSelectorV1",
"is_root": true,
"fields": [
{
@@ -8203,202 +8258,207 @@
"example": "'BTC_USDT_Perp'",
"comment": [
"The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
- ]
+ ],
+ "selector": "primary"
},
{
- "name": "start_time",
- "lite_name": "st",
- "semantic_type": "timestamp",
- "json_type": "string",
+ "name": "interval",
+ "lite_name": "i1",
+ "semantic_type": "CandlestickInterval",
+ "json_type": "CandlestickInterval",
"index": 1,
"array_depth": 0,
- "optional": true,
- "default": "0",
- "example": "'1697788800000000000'",
+ "optional": false,
"comment": [
- "Start time of funding rate in unix nanoseconds"
- ]
+ "The interval of each candlestick"
+ ],
+ "selector": "secondary"
},
{
- "name": "end_time",
- "lite_name": "et",
- "semantic_type": "timestamp",
- "json_type": "string",
+ "name": "type",
+ "lite_name": "t",
+ "semantic_type": "CandlestickType",
+ "json_type": "CandlestickType",
"index": 2,
"array_depth": 0,
- "optional": true,
- "default": "now()",
- "example": "'1697788800000000000'",
- "comment": [
- "End time of funding rate in unix nanoseconds"
- ]
- },
- {
- "name": "limit",
- "lite_name": "l",
- "semantic_type": "uint32",
- "json_type": "integer",
- "index": 3,
- "array_depth": 0,
- "optional": true,
- "default": "500",
- "example": "500",
- "comment": [
- "The limit to query for. Defaults to 500; Max 1000"
- ]
- },
- {
- "name": "cursor",
- "lite_name": "c",
- "semantic_type": "string",
- "json_type": "string",
- "index": 4,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "''",
- "comment": [
- "The cursor to indicate when to start the query from"
- ]
- },
- {
- "name": "agg_type",
- "lite_name": "at",
- "semantic_type": "FundingRateAggregationType",
- "json_type": "FundingRateAggregationType",
- "index": 5,
- "array_depth": 0,
- "optional": true,
- "default": "'FUNDING_INTERVAL'",
- "example": "'FUNDING_INTERVAL'",
+ "optional": false,
"comment": [
- "Aggregation method for historical funding rate observations. Defaults to using the instrument-specific funding interval."
- ]
+ "The type of candlestick data to retrieve"
+ ],
+ "selector": "secondary"
}
],
"comment": [
- "Lookup the historical funding rate of a perpetual future.",
- "",
- "Pagination works as follows:\u003cul\u003e\u003cli\u003eWe perform a reverse chronological lookup, starting from `end_time`. If `end_time` is not set, we start from the most recent data.\u003c/li\u003e\u003cli\u003eThe lookup is limited to `limit` records. If more data is requested, the response will contain a `next` cursor for you to query the next page.\u003c/li\u003e\u003cli\u003eIf a `cursor` is provided, it will be used to fetch results from that point onwards.\u003c/li\u003e\u003cli\u003ePagination will continue until the `start_time` is reached. If `start_time` is not set, pagination will continue as far back as our data retention policy allows.\u003c/li\u003e\u003c/ul\u003e"
+ "Subscribes to a stream of Kline/Candlestick updates for an instrument. A Kline is uniquely identified by its open time.",
+ "A new Kline is published every interval (if it exists). Upon subscription, the server will send the 5 most recent Kline for the requested interval."
]
},
{
- "name": "ApiFundingRate",
- "is_root": false,
+ "name": "WSCandlestickFeedDataV1",
+ "is_root": true,
"fields": [
{
- "name": "instrument",
- "lite_name": "i",
- "semantic_type": "asset",
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
"json_type": "string",
"index": 0,
"array_depth": 0,
"optional": false,
- "example": "'BTC_USDT_Perp'",
+ "example": "'v1.candle'",
"comment": [
- "The readable instrument name:\u003cul\u003e\u003cli\u003ePerpetual: `ETH_USDT_Perp`\u003c/li\u003e\u003cli\u003eFuture: `BTC_USDT_Fut_20Oct23`\u003c/li\u003e\u003cli\u003eCall: `ETH_USDT_Call_20Oct23_2800`\u003c/li\u003e\u003cli\u003ePut: `ETH_USDT_Put_20Oct23_2800`\u003c/li\u003e\u003c/ul\u003e"
+ "Stream name"
]
},
{
- "name": "funding_rate",
- "lite_name": "fr",
+ "name": "selector",
+ "lite_name": "s1",
"semantic_type": "string",
"json_type": "string",
"index": 1,
"array_depth": 0,
"optional": false,
- "example": "0.0003",
+ "example": "'BTC_USDT_Perp'",
"comment": [
- "The funding rate of the instrument, expressed in percentage points"
+ "Primary selector"
]
},
{
- "name": "funding_time",
- "lite_name": "ft",
- "semantic_type": "timestamp",
+ "name": "sequence_number",
+ "lite_name": "sn",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 2,
"array_depth": 0,
"optional": false,
- "example": "'1697788800000000000'",
+ "example": "'872634876'",
"comment": [
- "The funding timestamp of the funding rate, expressed in unix nanoseconds"
+ "A sequence number used to determine message order within a stream.",
+ "- If `useGlobalSequenceNumber` is **false**, this returns the gateway sequence number, which increments by one locally within each stream and resets on gateway restarts.",
+ "- If `useGlobalSequenceNumber` is **true**, this returns the global sequence number, which uniquely identifies messages across the cluster.",
+ " - A single cluster payload can be multiplexed into multiple stream payloads.",
+ " - To distinguish each stream payload, a `dedupCounter` is included.",
+ " - The returned sequence number is computed as: `cluster_sequence_number * 10^5 + dedupCounter`."
]
},
{
- "name": "mark_price",
- "lite_name": "mp",
- "semantic_type": "string",
- "json_type": "string",
+ "name": "feed",
+ "lite_name": "f",
+ "semantic_type": "Candlestick",
+ "json_type": "Candlestick",
"index": 3,
"array_depth": 0,
"optional": false,
- "example": "'65038.01'",
"comment": [
- "The mark price of the instrument at funding timestamp, expressed in `9` decimals"
+ "A candlestick entry matching the request filters"
]
},
{
- "name": "funding_rate_8_h_avg",
- "lite_name": "fr1",
- "semantic_type": "string",
+ "name": "prev_sequence_number",
+ "lite_name": "ps",
+ "semantic_type": "uint64",
"json_type": "string",
"index": 4,
"array_depth": 0,
"optional": false,
- "example": "0.0003",
+ "example": "'872634875'",
"comment": [
- "Deprecated: Refer to `funding_rate` instead. Will be removed in a future release."
+ "The previous sequence number that determines the message order"
]
- },
+ }
+ ],
+ "comment": []
+ },
+ {
+ "name": "WSUnsubscribeAllParams",
+ "is_root": true,
+ "fields": [],
+ "comment": [
+ "All V1 Websocket Unsubscription Request to unsubscribe from all active websocket streams."
+ ]
+ },
+ {
+ "name": "StreamReference",
+ "is_root": false,
+ "fields": [
{
- "name": "funding_interval_hours",
- "lite_name": "fi",
- "semantic_type": "uint8",
- "json_type": "integer",
- "index": 5,
+ "name": "stream",
+ "lite_name": "s",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 0,
"array_depth": 0,
"optional": false,
- "example": "8",
+ "example": "'v1.ticker.d'",
"comment": [
- "Funding interval in hours (e.g. 1/4/8/etc)."
+ "The channel to subscribe to (eg: ticker.s / ticker.d)"
+ ]
+ },
+ {
+ "name": "selectors",
+ "lite_name": "s1",
+ "semantic_type": "string",
+ "json_type": "string",
+ "index": 1,
+ "array_depth": 1,
+ "optional": false,
+ "example": "['BTC_USDT_Perp', 'ETH_USDT_Perp']",
+ "comment": [
+ "The list of selectors for the stream"
]
}
],
"comment": []
},
{
- "name": "ApiFundingRateResponse",
+ "name": "WSUnsubscribeAllResult",
"is_root": true,
"fields": [
{
- "name": "result",
- "lite_name": "r",
- "semantic_type": "ApiFundingRate",
- "json_type": "ApiFundingRate",
+ "name": "stream_reference",
+ "lite_name": "sr",
+ "semantic_type": "StreamReference",
+ "json_type": "StreamReference",
"index": 0,
"array_depth": 1,
"optional": false,
"comment": [
- "The funding rate result set for given interval"
+ "The list of stream references unsubscribed from"
]
- },
+ }
+ ],
+ "comment": [
+ "Returns a list of all rooms the client has unsubscribed from."
+ ]
+ },
+ {
+ "name": "WSListStreamsParams",
+ "is_root": true,
+ "fields": [],
+ "comment": [
+ "List down all the streams this connection has connected to."
+ ]
+ },
+ {
+ "name": "WSListStreamsResult",
+ "is_root": true,
+ "fields": [
{
- "name": "next",
- "lite_name": "n",
- "semantic_type": "string",
- "json_type": "string",
- "index": 1,
- "array_depth": 0,
- "optional": true,
- "default": "''",
- "example": "'Qw0918='",
+ "name": "stream_reference",
+ "lite_name": "sr",
+ "semantic_type": "StreamReference",
+ "json_type": "StreamReference",
+ "index": 0,
+ "array_depth": 1,
+ "optional": false,
"comment": [
- "The cursor to indicate when to start the next query from"
+ "The list of stream references the connection is connected to"
]
}
],
- "comment": []
+ "comment": [
+ "Returns a list of all rooms the client has subscribed to."
+ ]
},
{
"name": "ApiGetAllInstrumentsRequest",