Skip to content

Commit

Permalink
Merge pull request #10 from Polymarket/fix/market-order-price
Browse files Browse the repository at this point in the history
Fix: bug fix on market order creation
  • Loading branch information
JonathanAmenechi authored Mar 15, 2022
2 parents 216d7d1 + 268baf7 commit d1072bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions py_clob_client/orders/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="py_clob_client",
version="0.0.8",
version="0.0.9",
author="Jonathan Amenechi",
author_email="[email protected]",
description="Python client for the Polymarket CLOB",
Expand Down

0 comments on commit d1072bc

Please sign in to comment.