From c9a7dad31fe52a23fe27beea6620cdc469cb0ea9 Mon Sep 17 00:00:00 2001 From: Matthew Downey Date: Tue, 12 Nov 2024 11:25:29 -0800 Subject: [PATCH] Add misc corrections from #204 and #280 which are blocked due to merge conflicts (#286) * Fix composite client python import example (closes #204) * Update FNS docs (closes #280) --- .../composite_client.mdx | 23 +++++++++++-------- pages/api_integration-full-node-streaming.md | 8 +++---- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pages/api_integration-clients/composite_client.mdx b/pages/api_integration-clients/composite_client.mdx index 379a65e5..4d487366 100644 --- a/pages/api_integration-clients/composite_client.mdx +++ b/pages/api_integration-clients/composite_client.mdx @@ -8,8 +8,8 @@ CompositeClient simplifies the transactions by transforming human readable param For example, Placing an order with ValidatorClient requires parameters such as quantums and subticks, which are calculated based on ClobPair settings. -CompositeClient would take regular human readable parameters such as price and size, -make the neccesory calculations and conversions, +CompositeClient would take regular human readable parameters such as price and size, +make the neccesory calculations and conversions, and call ValidatorClient with the correct quantums and subticks for you. ### Installation @@ -17,12 +17,12 @@ and call ValidatorClient with the correct quantums and subticks for you. ```bash copy - pnpm install @dydxprotocol/v4-client-js + pnpm install @dydxprotocol/v4-client-js ``` ```bash copy - pip install v4-client-py + pip install v4-client-py ``` @@ -76,7 +76,7 @@ and call ValidatorClient with the correct quantums and subticks for you. env='mainnet', validator_config=ValidatorConfig( grpc_endpoint='https://dydx-ops-rpc.kingnodes.com', # or other node URL - chain_id='dydx-mainnet-1', + chain_id='dydx-mainnet-1', ssl_enabled=True ), indexer_config=IndexerConfig( @@ -119,9 +119,9 @@ and call ValidatorClient with the correct quantums and subticks for you. -## Placing Orders +## Placing Orders -### Placing an Order +### Placing an Order @@ -161,9 +161,12 @@ and call ValidatorClient with the correct quantums and subticks for you. ```python copy - from v4_client_py import { - OrderExecution, OrderSide, OrderTimeInForce, OrderType - } + from v4_client_py.clients.helpers.chain_helpers import ( + OrderExecution, + OrderSide, + OrderTimeInForce, + OrderType, + ) subaccount = SubaccountClient(wallet, 0) clientId = 123 # set to a number, can be used by the client to identify the order diff --git a/pages/api_integration-full-node-streaming.md b/pages/api_integration-full-node-streaming.md index fd265577..df38e06a 100644 --- a/pages/api_integration-full-node-streaming.md +++ b/pages/api_integration-full-node-streaming.md @@ -1,6 +1,6 @@ # Full Node gRPC Streaming -Last updated for: `v6.0.6` +Last updated for: `v6.0.8` Enable full node streaming to expose a stream of orderbook updates (L3), fills, taker orders, and subaccount updates, allowing clients to maintain a full view of the orderbook and various exchange activities. Note that the orderbook state can vary slightly between nodes due to dYdX's offchain orderbook design. @@ -235,8 +235,8 @@ message StreamSubaccountUpdate { message SubaccountPerpetualPosition { // The `Id` of the `Perpetual`. uint32 perpetual_id = 1; - // The size of the position in base quantums. - uint64 quantums = 2; + // The size of the position in base quantums. Negative means short. + int64 quantums = 2; } // SubaccountAssetPosition provides information on a subaccount's updated asset @@ -712,7 +712,7 @@ Q: Is there a sample client? ## Changelog -### v6.0.6 +### v6.0.8 - added taker order message to stream - added subaccount update message to stream - Finalized DeliverTx updates are all batched together in a single message