Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-dydx committed Sep 29, 2023
1 parent 742698f commit 883f5a6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ async def main() -> None:
)
subaccount = Subaccount(wallet, 0)

# place a long term order.
"""
Note this example places a stateful order.
Programmatic traders should generally not use stateful orders for following reasons:
- Stateful orders received out of order by validators will fail sequence number validation
and be dropped.
- Stateful orders have worse time priority since they are only matched after they are included
on the block.
- Stateful order rate limits are more restrictive than Short-Term orders, specifically max 2 per
block / 20 per 100 blocks.
- Stateful orders can only be canceled after they’ve been included in a block.
"""
long_term_order_client_id = randrange(0, MAX_CLIENT_ID)
try:
tx = client.place_order(
Expand Down Expand Up @@ -70,4 +80,4 @@ async def main() -> None:

if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
asyncio.get_event_loop().run_until_complete(main())
asyncio.get_event_loop().run_until_complete(main())
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
from v4_client_py.clients.constants import BECH32_PREFIX, Network

from v4_client_py.clients.helpers.chain_helpers import (
Order_TimeInForce,
OrderType,
OrderSide,
OrderTimeInForce,
OrderExecution,
)
from examples.utils import loadJson, orderExecutionToTimeInForce

Expand Down
2 changes: 1 addition & 1 deletion v4-client-py/v4_client_py/clients/dydx_composite_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def cancel_short_term_order(
:param clob_pair_id: required
:type clob_pair_id: int
:param good_til_block: optional
:param good_til_block: required
:type good_til_block: int
:returns: Tx information
Expand Down
2 changes: 1 addition & 1 deletion v4-client-py/v4_client_py/clients/modules/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,4 @@ def default_broadcast_mode(self, msg: _message.Message) -> BroadcastMode:
return BroadcastMode.BroadcastTxCommit
else:
return BroadcastMode.BroadcastTxCommit
return BroadcastMode.BroadcastTxSync
return BroadcastMode.BroadcastTxSync

0 comments on commit 883f5a6

Please sign in to comment.