Skip to content

Commit

Permalink
Add misc corrections from #204 and #280 which are blocked due to merg…
Browse files Browse the repository at this point in the history
…e conflicts (#286)

* Fix composite client python import example (closes #204)

* Update FNS docs (closes #280)
  • Loading branch information
matthewdowney authored Nov 12, 2024
1 parent 17fbba9 commit c9a7dad
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
23 changes: 13 additions & 10 deletions pages/api_integration-clients/composite_client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ 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

<Tabs items={["TypeScript", "Python"]}>
<Tab>
```bash copy
pnpm install @dydxprotocol/v4-client-js
pnpm install @dydxprotocol/v4-client-js
```
</Tab>
<Tab>
```bash copy
pip install v4-client-py
pip install v4-client-py
```
</Tab>
</Tabs>
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -119,9 +119,9 @@ and call ValidatorClient with the correct quantums and subticks for you.
</Tab>
</Tabs>
## Placing Orders
## Placing Orders
### Placing an Order
### Placing an Order
<Tabs items={["TypeScript", "Python"]}>
<Tab>
Expand Down Expand Up @@ -161,9 +161,12 @@ and call ValidatorClient with the correct quantums and subticks for you.
</Tab>
<Tab>
```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
Expand Down
8 changes: 4 additions & 4 deletions pages/api_integration-full-node-streaming.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

1 comment on commit c9a7dad

@vercel
Copy link

@vercel vercel bot commented on c9a7dad Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.