Skip to content

Commit

Permalink
Hide zero fees
Browse files Browse the repository at this point in the history
  • Loading branch information
kuznetsov-m committed Jun 2, 2022
1 parent 7eecc87 commit 62f97f8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def build_notification_text(order_obj) -> str:

if order_state == 'SUBMITTED':
text += '🆕 '
elif 'FILL' in order_state:
elif order_state == 'FILLED':
text += '✅ '
elif order_state == 'CANCELED':
text += '🚫 '
Expand All @@ -41,7 +41,10 @@ def build_notification_text(order_obj) -> str:
text += f'Price: {"%.8f" % float(order_obj.price)}\n'
text += f'Amount: {"%.8f" % float(order_obj.amount)}\n'
text += f'Order Id: #ID{order_obj.id}\n'
text += f'Filled Fees: {order_obj.filled_fees}\n'

if float(order_obj.filled_fees):
text += f'Filled Fees: {"%.8f" % float(order_obj.filled_fees)}\n'

text += f'Created at: {datetime.fromtimestamp(order_obj.created_at / 1e3).strftime(dt_str_format)}'

if order_obj.canceled_at:
Expand Down Expand Up @@ -80,6 +83,8 @@ def subscribe():
symbols = ','.join([list_obj.symbol for list_obj in generic_client.get_exchange_symbols()])
trade_client.sub_order_update(symbols=symbols, callback=callback)

print('subscribed')

if __name__ == "__main__":
telegram_bot.send_text(TELEGRAM_USER_ID, 'Bot restarted')

Expand Down

0 comments on commit 62f97f8

Please sign in to comment.