From 268baf7259c20c20c116bc772360171f8c489d0a Mon Sep 17 00:00:00 2001 From: JonathanAmenechi <7217608+JonathanAmenechi@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:36:10 -0400 Subject: [PATCH] fix: bug fix on market order creation --- py_clob_client/orders/builder.py | 10 ++-------- setup.py | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/py_clob_client/orders/builder.py b/py_clob_client/orders/builder.py index adf31e8..43b0a97 100644 --- a/py_clob_client/orders/builder.py +++ b/py_clob_client/orders/builder.py @@ -28,10 +28,6 @@ def __init__(self, signer: Signer, sig_type=None, funder=None): def _get_contract_config(self, chain_id: int): return get_contract_config(chain_id) - def _create_limit_order_builder(self): - return LimitOrderBuilder(self.contract_config.exchange, self.signer.chain_id, self.signer) - - def create_limit_order(self, order_args: LimitOrderArgs): """ Creates and signs a limit order @@ -79,16 +75,14 @@ def create_market_order(self, order_args: MarketOrderArgs): maker_asset_id = None taker_asset_id = int(order_args.token_id) - size_normalized = round_down(order_args.size, 2) - maker_amount = to_token_decimals(round_down(order_args.price * size_normalized, 2)) + maker_amount = to_token_decimals(round_down(order_args.size, 2)) else: maker_asset = self.contract_config.get_conditional() taker_asset = self.contract_config.get_collateral() maker_asset_id = int(order_args.token_id) taker_asset_id = None - size_normalized = round_down(order_args.size, 2) - maker_amount = to_token_decimals(size_normalized) + maker_amount = to_token_decimals(round_down(order_args.size, 2)) data = MarketOrderData( exchange_address=self.contract_config.get_exchange(), diff --git a/setup.py b/setup.py index f54cba7..be9e49f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="py_clob_client", - version="0.0.8", + version="0.0.9", author="Jonathan Amenechi", author_email="jonathanamenechi@gmail.com", description="Python client for the Polymarket CLOB",