diff --git a/src/trade_server.py b/src/trade_server.py index a82d384..f225522 100644 --- a/src/trade_server.py +++ b/src/trade_server.py @@ -280,7 +280,7 @@ def buy(): raise ValueError("Missing required parameters") price = float(price_str) - amount = int(amount_str) + amount = int(float(amount_str)) if order_type == ORDER_TYPE_LIMIT and (price <= 0 or amount <= 0): raise ValueError("Price and amount must be positive") @@ -351,7 +351,7 @@ def sell(): raise ValueError("Missing required parameters") price = float(price_str) - amount = int(amount_str) + amount = int(float(amount_str)) if order_type == ORDER_TYPE_LIMIT and (price <= 0 or amount <= 0): raise ValueError("Price and amount must be positive")