From eaf64971c62e8f619caf53050f73ed72c0c2a29d Mon Sep 17 00:00:00 2001 From: Paul Schultz Date: Sat, 16 Jul 2022 12:17:34 -0700 Subject: [PATCH 1/3] add stop market and reduce-only --- dydx3/constants.py | 1 + dydx3/modules/private.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/dydx3/constants.py b/dydx3/constants.py index e643ee2..037809c 100644 --- a/dydx3/constants.py +++ b/dydx3/constants.py @@ -22,6 +22,7 @@ ORDER_TYPE_LIMIT = 'LIMIT' ORDER_TYPE_MARKET = 'MARKET' ORDER_TYPE_STOP = 'STOP_LIMIT' +ORDER_TYPE_STOP_MARKET = 'STOP_MARKET' ORDER_TYPE_TRAILING_STOP = 'TRAILING_STOP' ORDER_TYPE_TAKE_PROFIT = 'TAKE_PROFIT' diff --git a/dydx3/modules/private.py b/dydx3/modules/private.py index 3bb2628..61b7f93 100644 --- a/dydx3/modules/private.py +++ b/dydx3/modules/private.py @@ -456,6 +456,7 @@ def create_order( expiration=None, expiration_epoch_seconds=None, signature=None, + reduce_only=False, ): ''' Post an order @@ -575,6 +576,7 @@ def create_order( 'triggerPrice': trigger_price, 'trailingPercent': trailing_percent, 'postOnly': post_only, + 'reduceOnly': reduce_only, 'clientId': client_id, 'signature': order_signature, } From e7711f80cfcaee4ec2e5e77b196e501b82358f60 Mon Sep 17 00:00:00 2001 From: Paul Schultz Date: Mon, 8 Aug 2022 17:11:34 -0700 Subject: [PATCH 2/3] Support Take Profit Market --- dydx3/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/dydx3/constants.py b/dydx3/constants.py index 3761355..c0672fd 100644 --- a/dydx3/constants.py +++ b/dydx3/constants.py @@ -25,6 +25,7 @@ ORDER_TYPE_STOP_MARKET = 'STOP_MARKET' ORDER_TYPE_TRAILING_STOP = 'TRAILING_STOP' ORDER_TYPE_TAKE_PROFIT = 'TAKE_PROFIT' +ORDER_TYPE_TAKE_PROFIT_MARKET = 'TAKE_PROFIT_MARKET' # ------------ Order Side ------------ ORDER_SIDE_BUY = 'BUY' From 6823683dca4e39091601abbf9156a1828c25646f Mon Sep 17 00:00:00 2001 From: Paul Schultz Date: Mon, 8 Aug 2022 17:19:45 -0700 Subject: [PATCH 3/3] Full Stop Market / TP Market Support --- dydx3/modules/private.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dydx3/modules/private.py b/dydx3/modules/private.py index d6846c1..7433b18 100644 --- a/dydx3/modules/private.py +++ b/dydx3/modules/private.py @@ -487,11 +487,16 @@ def create_order( "STOP", "TRAILING_STOP", "TAKE_PROFIT", + "STOP_MARKET", + "TAKE_PROFIT_MARKET", ] :param post_only: required :type post_only: bool + :param reduce_only: optional + :type reduce_only: bool + :param size: required :type size: str