Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit 27bed54

Browse files
committed
fix
1 parent 9e0752a commit 27bed54

3 files changed

Lines changed: 10 additions & 13 deletions

File tree

dydx/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def _make_solo_order(
105105
baseMarket, quoteMarket = utils.pair_to_base_quote_markets(market)
106106
isBuy = utils.get_is_buy(side)
107107
if limitFee is None:
108-
limitFee = utils.get_limit_fee(baseMarket, amount, postOnly)
108+
limitFee = utils.get_limit_fee(baseMarket, amount)
109109

110110
order = {
111111
'salt': random.randint(0, 2**256),
@@ -167,7 +167,7 @@ def _make_perp_order(
167167
baseMarket, _ = utils.pair_to_base_quote_markets(market)
168168
isBuy = utils.get_is_buy(side)
169169
if limitFee is None:
170-
limitFee = utils.get_limit_fee(baseMarket, amount, postOnly)
170+
limitFee = utils.get_limit_fee(baseMarket, amount)
171171

172172
order = {
173173
'salt': random.randint(0, 2**256),

dydx/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
MARKET_USDC = 2
3434
MARKET_DAI = 3
3535
MARKET_PBTC = 'PBTC'
36+
MARKET_PUSD = 'PUSD'
3637
MARKET_INVALID = 4
3738

3839
# ------------ Pairs ------------
@@ -57,6 +58,7 @@
5758
SMALL_TRADE_SIZE_WETH = 20 * (10 ** DECIMALS_WETH)
5859
SMALL_TRADE_SIZE_DAI = 10000 * (10 ** DECIMALS_DAI)
5960
SMALL_TRADE_SIZE_PBTC = 0.5 * (10 ** DECIMALS_PBTC)
61+
SMALL_TRADE_SIZE_PUSD = 200 * (10 ** DECIMALS_USDC)
6062
FEE_SMALL_WETH = Decimal(100) * FROM_BIPS
6163
FEE_LARGE_WETH = Decimal(100) * FROM_BIPS
6264
FEE_SMALL_DAI = Decimal(100) * FROM_BIPS
@@ -66,8 +68,6 @@
6668
FEE_MAKER_PBTC = Decimal(100) * FROM_BIPS
6769
FEE_LARGE_WETH_PUSD = Decimal(100) * FROM_BIPS
6870
FEE_SMALL_WETH_PUSD = Decimal(100) * FROM_BIPS
69-
FEE_MAKER_WETH_PUSD = Decimal(100) * FROM_BIPS
70-
FEE_ZERO = Decimal(0)
7171

7272
# ------------ Transaction Constants ------------
7373
DEFAULT_GAS_AMOUNT = 250000

dydx/util.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,7 @@ def get_is_buy(side):
106106
raise ValueError('Invalid side')
107107

108108

109-
def get_limit_fee(base_market, amount, postOnly):
110-
if postOnly:
111-
if base_market == consts.MARKET_PBTC:
112-
if (amount < consts.SMALL_TRADE_SIZE_PBTC):
113-
return consts.FEE_ZERO
114-
else:
115-
return consts.FEE_MAKER_PBTC
116-
else:
117-
return consts.FEE_ZERO
109+
def get_limit_fee(base_market, amount):
118110
if base_market == consts.MARKET_WETH:
119111
if (amount < consts.SMALL_TRADE_SIZE_WETH):
120112
return consts.FEE_SMALL_WETH
@@ -130,6 +122,11 @@ def get_limit_fee(base_market, amount, postOnly):
130122
return consts.FEE_SMALL_PBTC
131123
else:
132124
return consts.FEE_LARGE_PBTC
125+
elif base_market == consts.MARKET_PUSD:
126+
if (amount < consts.SMALL_TRADE_SIZE_PUSD):
127+
return consts.FEE_SMALL_WETH_PUSD
128+
else:
129+
return consts.FEE_LARGE_WETH_PUSD
133130
raise ValueError('Invalid base_market')
134131

135132

0 commit comments

Comments
 (0)