Closed shaunsurfing closed 4 months ago
Not sure what Linear is, but unable to read the BOT reply:
Hi @shaunsurfing,
I'm reviewing this now and will get back to you soon.
Hey, we're currently implementing chain helpers to make placing market orders more intuitive, similar to the deprecated Python and the current TypeScript version that has OrderType
.
You can follow its progress in PR #201
Hi @shaunsurfing, I've updated the SDK so place order accepts order_type
as a parameter. There's an example in examples/market_order_example.py
and new documentation will be published soon.
Here's the current approach:
new_order = market.order(
order_id=order_id,
order_type=OrderType.MARKET,
side=Order.Side.SIDE_SELL,
size=size,
price=0, # Set to 0 for market orders
time_in_force=Order.TimeInForce.TIME_IN_FORCE_UNSPECIFIED,
reduce_only=False,
good_til_block=current_block + 10,
)
transaction = await node.place_order(
wallet=wallet,
order=new_order,
)
I'm closing this issue but let me know if you face any other issues
Thank you @samtin0x - the orders are going through.
place = await node.place_order( wallet, market.order( order_id, side = Order.Side.SIDE_BUY if side == "BUY" else Order.Side.SIDE_SELL, size = size, price = price, time_in_force = Order.TIME_IN_FORCE_UNSPECIFIED, reduce_only = reduce_only, good_til_block = good_til_block ), )
What is the code to place a MARKET (not limit order). This is in depreciated V1 .py but unable to find in V2?