Skip to content

Commit

Permalink
πŸ’΅ fix(order): account for fees πŸ’΅ (#126)
Browse files Browse the repository at this point in the history
* Update Exchange.py

* #patch
  • Loading branch information
alkalescent authored Nov 16, 2021
1 parent ab59dce commit 7ae80a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def __init__(self, key=None, secret=None, testnet=False):
self.secret = os.environ['BINANCE_SECRET']
self.client = Client(self.key, self.secret, testnet=testnet, tld='us')

def order(self, base, quote, side, spend_ratio=1, test=False):
def order(self, base, quote, side, spend_ratio=0.999, test=False):
# fee is 0.1%, so max spend_ratio is 99.9%
pair = f'{base}{quote}'
side = side.upper()
order_type = self.client.ORDER_TYPE_MARKET
Expand Down

0 comments on commit 7ae80a2

Please sign in to comment.