Skip to content

Commit

Permalink
fix: get minimum quote order from the product API
Browse files Browse the repository at this point in the history
  • Loading branch information
mominafiz committed Mar 3, 2024
1 parent 9ca6b31 commit 8d13a0e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ Follow my Medium publication for PyCryptoBot articles
For information about installing, using, and getting the most out of the bot... please refer to the articles on Medium!

Install and Setup of PyCryptoBot 7
https://trading-data-analysis.pro/install-and-setup-of-pycryptobot-7-f1b2c832e795
<https://trading-data-analysis.pro/install-and-setup-of-pycryptobot-7-f1b2c832e795>

PyCryptoBot 7 Live Test Results
https://trading-data-analysis.pro/pycryptobot-7-live-test-results-b56316e0995c
<https://trading-data-analysis.pro/pycryptobot-7-live-test-results-b56316e0995c>

PyCryptoBot 7 Configuration
https://trading-data-analysis.pro/pycryptobot-7-configuration-e314931f94
<https://trading-data-analysis.pro/pycryptobot-7-configuration-e314931f94>
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

0 comments on commit 8d13a0e

Please sign in to comment.