From aea216e959d93ddff51b897f087edc0ca948471f Mon Sep 17 00:00:00 2001 From: thangnguyen-19 Date: Tue, 25 Feb 2025 09:33:32 +0700 Subject: [PATCH 1/3] [RFC] Update API docs and specs --- .../schemas/api_cancel_order_response.md | 1 + .../schemas/api_create_order_request.md | 1 + .../schemas/api_create_order_response.md | 1 + .../schemas/api_fill_history_response.md | 1 + .../apidocs/schemas/api_get_order_response.md | 1 + .../schemas/api_open_orders_response.md | 1 + .../schemas/api_order_history_response.md | 1 + .../schemas/api_pre_order_check_request.md | 1 + artifacts/apidocs/schemas/fill.md | 1 + artifacts/apidocs/schemas/order.md | 1 + artifacts/apidocs/schemas/order_metadata.md | 1 + .../apidocs/schemas/ws_fill_feed_data_v1.md | 1 + .../apidocs/schemas/ws_order_feed_data_v1.md | 1 + artifacts/apidocs/trading_api.md | 138 ++++++++++++------ artifacts/apidocs/trading_streams.md | 12 +- src/codegen/apidocs/apidocs.py | 1 - 16 files changed, 113 insertions(+), 51 deletions(-) diff --git a/artifacts/apidocs/schemas/api_cancel_order_response.md b/artifacts/apidocs/schemas/api_cancel_order_response.md index e967957..4f80371 100644 --- a/artifacts/apidocs/schemas/api_cancel_order_response.md +++ b/artifacts/apidocs/schemas/api_cancel_order_response.md @@ -53,6 +53,7 @@ |-|-|-|-| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_create_order_request.md b/artifacts/apidocs/schemas/api_create_order_request.md index 3f557d4..a0225f9 100644 --- a/artifacts/apidocs/schemas/api_create_order_request.md +++ b/artifacts/apidocs/schemas/api_create_order_request.md @@ -55,6 +55,7 @@ |-|-|-|-| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_create_order_response.md b/artifacts/apidocs/schemas/api_create_order_response.md index 362e43b..3091ff4 100644 --- a/artifacts/apidocs/schemas/api_create_order_response.md +++ b/artifacts/apidocs/schemas/api_create_order_response.md @@ -53,6 +53,7 @@ |-|-|-|-| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_fill_history_response.md b/artifacts/apidocs/schemas/api_fill_history_response.md index 324b7c7..ba1203f 100644 --- a/artifacts/apidocs/schemas/api_fill_history_response.md +++ b/artifacts/apidocs/schemas/api_fill_history_response.md @@ -25,6 +25,7 @@ |venue
`v` |Venue|True|The venue where the trade occurred| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |signer
`s1` |string|True|The address (public key) of the wallet signing the payload| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[Venue](/../../schemas/venue)" The list of Trading Venues that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/api_get_order_response.md b/artifacts/apidocs/schemas/api_get_order_response.md index d859544..e2617b1 100644 --- a/artifacts/apidocs/schemas/api_get_order_response.md +++ b/artifacts/apidocs/schemas/api_get_order_response.md @@ -53,6 +53,7 @@ |-|-|-|-| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_open_orders_response.md b/artifacts/apidocs/schemas/api_open_orders_response.md index c36cd86..198464f 100644 --- a/artifacts/apidocs/schemas/api_open_orders_response.md +++ b/artifacts/apidocs/schemas/api_open_orders_response.md @@ -55,6 +55,7 @@ |-|-|-|-| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_order_history_response.md b/artifacts/apidocs/schemas/api_order_history_response.md index 153d886..e5def3f 100644 --- a/artifacts/apidocs/schemas/api_order_history_response.md +++ b/artifacts/apidocs/schemas/api_order_history_response.md @@ -54,6 +54,7 @@ |-|-|-|-| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_pre_order_check_request.md b/artifacts/apidocs/schemas/api_pre_order_check_request.md index 2065c6a..4234167 100644 --- a/artifacts/apidocs/schemas/api_pre_order_check_request.md +++ b/artifacts/apidocs/schemas/api_pre_order_check_request.md @@ -56,6 +56,7 @@ |-|-|-|-| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/fill.md b/artifacts/apidocs/schemas/fill.md index a6f4359..b8ba9ed 100644 --- a/artifacts/apidocs/schemas/fill.md +++ b/artifacts/apidocs/schemas/fill.md @@ -20,6 +20,7 @@ |venue
`v` |Venue|True|The venue where the trade occurred| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |signer
`s1` |string|True|The address (public key) of the wallet signing the payload| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[Venue](/../../schemas/venue)" The list of Trading Venues that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/order.md b/artifacts/apidocs/schemas/order.md index 094afb7..f5d50a3 100644 --- a/artifacts/apidocs/schemas/order.md +++ b/artifacts/apidocs/schemas/order.md @@ -49,6 +49,7 @@ |-|-|-|-| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/order_metadata.md b/artifacts/apidocs/schemas/order_metadata.md index 9ddd4b7..08f00ea 100644 --- a/artifacts/apidocs/schemas/order_metadata.md +++ b/artifacts/apidocs/schemas/order_metadata.md @@ -5,3 +5,4 @@ |-|-|-|-| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| diff --git a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md index bb1c270..a56abd9 100644 --- a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md @@ -27,6 +27,7 @@ |venue
`v` |Venue|True|The venue where the trade occurred| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |signer
`s1` |string|True|The address (public key) of the wallet signing the payload| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[Venue](/../../schemas/venue)" The list of Trading Venues that are supported on the GRVT exchange
diff --git a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md index 63252a8..eae959f 100644 --- a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md @@ -56,6 +56,7 @@ |-|-|-|-| |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/trading_api.md b/artifacts/apidocs/trading_api.md index dde1684..f790b72 100644 --- a/artifacts/apidocs/trading_api.md +++ b/artifacts/apidocs/trading_api.md @@ -39,7 +39,8 @@ LITE ENDPOINT: lite/v1/create_order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" } } } @@ -69,7 +70,8 @@ LITE ENDPOINT: lite/v1/create_order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" } } } @@ -107,7 +109,8 @@ LITE ENDPOINT: lite/v1/create_order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -146,7 +149,8 @@ LITE ENDPOINT: lite/v1/create_order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -265,7 +269,8 @@ LITE ENDPOINT: lite/v1/create_order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" } } } @@ -303,7 +308,8 @@ LITE ENDPOINT: lite/v1/create_order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" } } }, @@ -341,7 +347,8 @@ LITE ENDPOINT: lite/v1/create_order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" } } } @@ -379,7 +386,8 @@ LITE ENDPOINT: lite/v1/create_order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" } } }, @@ -418,7 +426,8 @@ LITE ENDPOINT: lite/v1/create_order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" } } } @@ -456,7 +465,8 @@ LITE ENDPOINT: lite/v1/create_order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" } } }, @@ -494,7 +504,8 @@ LITE ENDPOINT: lite/v1/create_order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" } } } @@ -532,7 +543,8 @@ LITE ENDPOINT: lite/v1/create_order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" } } }, @@ -571,7 +583,8 @@ LITE ENDPOINT: lite/v1/create_order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" } } } @@ -609,7 +622,8 @@ LITE ENDPOINT: lite/v1/create_order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" } } }, @@ -647,7 +661,8 @@ LITE ENDPOINT: lite/v1/create_order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" } } } @@ -685,7 +700,8 @@ LITE ENDPOINT: lite/v1/create_order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" } } }, @@ -724,7 +740,8 @@ LITE ENDPOINT: lite/v1/create_order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" } } } @@ -762,7 +779,8 @@ LITE ENDPOINT: lite/v1/create_order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" } } }, @@ -800,7 +818,8 @@ LITE ENDPOINT: lite/v1/create_order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" } } } @@ -838,7 +857,8 @@ LITE ENDPOINT: lite/v1/create_order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" } } }, @@ -1644,7 +1664,8 @@ LITE ENDPOINT: lite/v1/order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -1683,7 +1704,8 @@ LITE ENDPOINT: lite/v1/order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -2058,7 +2080,8 @@ LITE ENDPOINT: lite/v1/open_orders }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -2097,7 +2120,8 @@ LITE ENDPOINT: lite/v1/open_orders }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -2494,7 +2518,8 @@ LITE ENDPOINT: lite/v1/order_history }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -2534,7 +2559,8 @@ LITE ENDPOINT: lite/v1/order_history }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -2964,7 +2990,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -3004,7 +3031,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -3124,7 +3152,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -3172,7 +3201,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -3220,7 +3250,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -3268,7 +3299,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -3317,7 +3349,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -3365,7 +3398,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -3413,7 +3447,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -3461,7 +3496,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -3510,7 +3546,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -3558,7 +3595,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -3606,7 +3644,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -3654,7 +3693,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -3703,7 +3743,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -3751,7 +3792,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -3799,7 +3841,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -3847,7 +3890,8 @@ LITE ENDPOINT: lite/v1/pre_order_check }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -4264,7 +4308,8 @@ LITE ENDPOINT: lite/v1/fill_history "order_id": "0x10000101000203040506", "venue": "ORDERBOOK", "client_order_id": "23042", - "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0" + "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "broker": "COIN_ROUTES" }], "next": "Qw0918=" } @@ -4291,7 +4336,8 @@ LITE ENDPOINT: lite/v1/fill_history "oi": "0x10000101000203040506", "v": "ORDERBOOK", "co": "23042", - "s1": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0" + "s1": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "b": "COIN_ROUTES" }], "n": "Qw0918=" } diff --git a/artifacts/apidocs/trading_streams.md b/artifacts/apidocs/trading_streams.md index 82a6364..651a726 100644 --- a/artifacts/apidocs/trading_streams.md +++ b/artifacts/apidocs/trading_streams.md @@ -131,7 +131,8 @@ STREAM: v1.order }, "metadata": { "client_order_id": "23042", - "create_time": "1697788800000000000" + "create_time": "1697788800000000000", + "broker": "COIN_ROUTES" }, "state": { "status": "PENDING", @@ -173,7 +174,8 @@ STREAM: v1.order }, "m": { "co": "23042", - "ct": "1697788800000000000" + "ct": "1697788800000000000", + "b": "COIN_ROUTES" }, "s1": { "s": "PENDING", @@ -1988,7 +1990,8 @@ STREAM: v1.fill "order_id": "0x10000101000203040506", "venue": "ORDERBOOK", "client_order_id": "23042", - "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0" + "signer": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "broker": "COIN_ROUTES" } } ``` @@ -2017,7 +2020,8 @@ STREAM: v1.fill "oi": "0x10000101000203040506", "v": "ORDERBOOK", "co": "23042", - "s1": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0" + "s1": "0xc73c0c2538fd9b833d20933ccc88fdaa74fcb0d0", + "b": "COIN_ROUTES" } } ``` diff --git a/src/codegen/apidocs/apidocs.py b/src/codegen/apidocs/apidocs.py index b4ad87b..170510e 100644 --- a/src/codegen/apidocs/apidocs.py +++ b/src/codegen/apidocs/apidocs.py @@ -37,7 +37,6 @@ "latest_sequence_number", "use_global_sequence_number", "trigger", - "broker", ] IGNORE_RPCS: list[str] = [ From cd4f10dc99cea9571ff598c36ecde08503ad4393 Mon Sep 17 00:00:00 2001 From: thangnguyen-19 Date: Tue, 25 Feb 2025 09:41:23 +0700 Subject: [PATCH 2/3] [RFC] Update API docs and specs --- artifacts/apidocs/schemas/tpsl_order_metadata.md | 7 ------- src/codegen/apidocs/apidocs.py | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/artifacts/apidocs/schemas/tpsl_order_metadata.md b/artifacts/apidocs/schemas/tpsl_order_metadata.md index 5de5d5e..e69de29 100644 --- a/artifacts/apidocs/schemas/tpsl_order_metadata.md +++ b/artifacts/apidocs/schemas/tpsl_order_metadata.md @@ -1,7 +0,0 @@ -!!! info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)" - Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

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


- - |Name
`Lite`|Type|Required
`Default`| Description | - |-|-|-|-| - |trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order| - |trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.| diff --git a/src/codegen/apidocs/apidocs.py b/src/codegen/apidocs/apidocs.py index 170510e..6e6d5a7 100644 --- a/src/codegen/apidocs/apidocs.py +++ b/src/codegen/apidocs/apidocs.py @@ -28,7 +28,7 @@ "TriggerOrderMetadata", "TriggerBy", "TriggerType", - "TPSLOrderMetadata" "BrokerTag", + "TPSLOrderMetadata", ] # skip these fields for all structs, at all levels of nesting From 79d3aa312d79c63073fd797b07fcc29a75c59879 Mon Sep 17 00:00:00 2001 From: thangnguyen-19 Date: Tue, 25 Feb 2025 09:56:26 +0700 Subject: [PATCH 3/3] [RFC] Update API docs and specs --- artifacts/apidocs/schemas/api_cancel_order_response.md | 8 ++++++++ artifacts/apidocs/schemas/api_create_order_request.md | 8 ++++++++ artifacts/apidocs/schemas/api_create_order_response.md | 8 ++++++++ artifacts/apidocs/schemas/api_fill_history_response.md | 8 ++++++++ artifacts/apidocs/schemas/api_get_order_response.md | 8 ++++++++ artifacts/apidocs/schemas/api_open_orders_response.md | 8 ++++++++ artifacts/apidocs/schemas/api_order_history_response.md | 8 ++++++++ artifacts/apidocs/schemas/api_pre_order_check_request.md | 8 ++++++++ artifacts/apidocs/schemas/broker_tag.md | 5 +++++ artifacts/apidocs/schemas/fill.md | 8 ++++++++ artifacts/apidocs/schemas/order.md | 8 ++++++++ artifacts/apidocs/schemas/order_metadata.md | 8 ++++++++ artifacts/apidocs/schemas/ws_fill_feed_data_v1.md | 8 ++++++++ artifacts/apidocs/schemas/ws_order_feed_data_v1.md | 8 ++++++++ src/codegen/apidocs/apidocs.py | 1 - 15 files changed, 109 insertions(+), 1 deletion(-) diff --git a/artifacts/apidocs/schemas/api_cancel_order_response.md b/artifacts/apidocs/schemas/api_cancel_order_response.md index 4f80371..5c63bc2 100644 --- a/artifacts/apidocs/schemas/api_cancel_order_response.md +++ b/artifacts/apidocs/schemas/api_cancel_order_response.md @@ -54,6 +54,14 @@ |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_create_order_request.md b/artifacts/apidocs/schemas/api_create_order_request.md index a0225f9..ca6aa2c 100644 --- a/artifacts/apidocs/schemas/api_create_order_request.md +++ b/artifacts/apidocs/schemas/api_create_order_request.md @@ -56,6 +56,14 @@ |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_create_order_response.md b/artifacts/apidocs/schemas/api_create_order_response.md index 3091ff4..e4b482c 100644 --- a/artifacts/apidocs/schemas/api_create_order_response.md +++ b/artifacts/apidocs/schemas/api_create_order_response.md @@ -54,6 +54,14 @@ |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_fill_history_response.md b/artifacts/apidocs/schemas/api_fill_history_response.md index ba1203f..89dcb83 100644 --- a/artifacts/apidocs/schemas/api_fill_history_response.md +++ b/artifacts/apidocs/schemas/api_fill_history_response.md @@ -33,3 +33,11 @@ |-|-| |`ORDERBOOK` = 1|the trade is cleared on the orderbook venue| |`RFQ` = 2|the trade is cleared on the RFQ venue| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| diff --git a/artifacts/apidocs/schemas/api_get_order_response.md b/artifacts/apidocs/schemas/api_get_order_response.md index e2617b1..7f4879e 100644 --- a/artifacts/apidocs/schemas/api_get_order_response.md +++ b/artifacts/apidocs/schemas/api_get_order_response.md @@ -54,6 +54,14 @@ |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_open_orders_response.md b/artifacts/apidocs/schemas/api_open_orders_response.md index 198464f..d69e185 100644 --- a/artifacts/apidocs/schemas/api_open_orders_response.md +++ b/artifacts/apidocs/schemas/api_open_orders_response.md @@ -56,6 +56,14 @@ |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_order_history_response.md b/artifacts/apidocs/schemas/api_order_history_response.md index e5def3f..a1f83d1 100644 --- a/artifacts/apidocs/schemas/api_order_history_response.md +++ b/artifacts/apidocs/schemas/api_order_history_response.md @@ -55,6 +55,14 @@ |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/api_pre_order_check_request.md b/artifacts/apidocs/schemas/api_pre_order_check_request.md index 4234167..e0570e9 100644 --- a/artifacts/apidocs/schemas/api_pre_order_check_request.md +++ b/artifacts/apidocs/schemas/api_pre_order_check_request.md @@ -57,6 +57,14 @@ |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/broker_tag.md b/artifacts/apidocs/schemas/broker_tag.md index c5532c0..a57cd82 100644 --- a/artifacts/apidocs/schemas/broker_tag.md +++ b/artifacts/apidocs/schemas/broker_tag.md @@ -1,3 +1,8 @@ !!! info "[BrokerTag](/../../schemas/broker_tag)" BrokerTag is a tag for the broker that the order is sent from.
+ |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| diff --git a/artifacts/apidocs/schemas/fill.md b/artifacts/apidocs/schemas/fill.md index b8ba9ed..157972d 100644 --- a/artifacts/apidocs/schemas/fill.md +++ b/artifacts/apidocs/schemas/fill.md @@ -28,3 +28,11 @@ |-|-| |`ORDERBOOK` = 1|the trade is cleared on the orderbook venue| |`RFQ` = 2|the trade is cleared on the RFQ venue| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| diff --git a/artifacts/apidocs/schemas/order.md b/artifacts/apidocs/schemas/order.md index f5d50a3..c142948 100644 --- a/artifacts/apidocs/schemas/order.md +++ b/artifacts/apidocs/schemas/order.md @@ -50,6 +50,14 @@ |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/artifacts/apidocs/schemas/order_metadata.md b/artifacts/apidocs/schemas/order_metadata.md index 08f00ea..0e99d11 100644 --- a/artifacts/apidocs/schemas/order_metadata.md +++ b/artifacts/apidocs/schemas/order_metadata.md @@ -6,3 +6,11 @@ |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| diff --git a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md index a56abd9..0d46e7a 100644 --- a/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_fill_feed_data_v1.md @@ -35,3 +35,11 @@ |-|-| |`ORDERBOOK` = 1|the trade is cleared on the orderbook venue| |`RFQ` = 2|the trade is cleared on the RFQ venue| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| diff --git a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md index eae959f..57c8769 100644 --- a/artifacts/apidocs/schemas/ws_order_feed_data_v1.md +++ b/artifacts/apidocs/schemas/ws_order_feed_data_v1.md @@ -57,6 +57,14 @@ |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| ??? info "[OrderState](/../../schemas/order_state)" |Name
`Lite`|Type|Required
`Default`| Description | |-|-|-|-| diff --git a/src/codegen/apidocs/apidocs.py b/src/codegen/apidocs/apidocs.py index 6e6d5a7..fe97993 100644 --- a/src/codegen/apidocs/apidocs.py +++ b/src/codegen/apidocs/apidocs.py @@ -67,7 +67,6 @@ "PENDLE", "UXLINK", ], - "BrokerTag": ["*"], "TriggerType": ["*"], }