Skip to content

Commit

Permalink
Merge pull request #840 from mominafiz/fix/add-missing-coinbase-to-te…
Browse files Browse the repository at this point in the history
…legram-bot

Fix: missing Coinbase exchange in Telegram Bot and minimum quote order
  • Loading branch information
whittlem authored Mar 4, 2024
2 parents 828f950 + 8d13a0e commit 5be74cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions models/AppState.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,19 @@ def minimum_order_quote(self, quote: float = 0.0, balancechk: bool = False):
raise Exception(f"Market not found! ({self.app.market})")

elif self.app.exchange == Exchange.COINBASE:
product = self.api.auth_api("GET", f"api/v3/brokerage/products/{self.app.market}")
if len(product) == 0:
sys.tracebacklimit = 0
raise Exception(f"Market not found! ({self.app.market})")

ticker = self.api.get_ticker(self.app.market, None)
price = float(ticker[1])

quote = float(quote)
base_min = self.api.market_quote_increment(self.app.market, quote)

try:
base_min = float(product[["base_min_size"]].values[0])
except Exception:
base_min = 0.0

elif self.app.exchange == Exchange.COINBASEPRO:
product = self.api.auth_api("GET", f"products/{self.app.market}")
Expand Down
2 changes: 1 addition & 1 deletion telegram_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
EXCHANGE, MARKET, ANYOVERRIDES, OVERRIDES, SAVE, START = range(6)
EXCEPT_EXCHANGE, EXCEPT_MARKET = range(2)

replykeyboard = [["Coinbase Pro", "Binance", "Kucoin"]]
replykeyboard = [["Coinbase", "Coinbase Pro", "Binance", "Kucoin"]]

markup = ReplyKeyboardMarkup(replykeyboard, one_time_keyboard=True)

Expand Down

0 comments on commit 5be74cf

Please sign in to comment.