Skip to content

Support MARKET order type#82

Merged
ex10ded merged 13 commits intostarknetfrom
task/add-market-order-type-support
Mar 27, 2026
Merged

Support MARKET order type#82
ex10ded merged 13 commits intostarknetfrom
task/add-market-order-type-support

Conversation

@alexex10
Copy link
Copy Markdown
Contributor

@alexex10 alexex10 commented Mar 27, 2026

Changes

  • Add support for MARKET order type (order_type=OrderType.MARKET)

(next one is CONDITIONAL, then iteration on refactoring the entire code/SDK API structure)

[2026-03-27 17:14:47,951 81025 8490803776 DEBUG] Sending GET https://api.starknet.sepolia.extended.exchange/api/v1/info/markets?
[2026-03-27 17:14:49,235 81025 8490803776 DEBUG] Sending GET https://api.starknet.sepolia.extended.exchange/api/v1/info/markets/BTC-USD/stats
[2026-03-27 17:14:49,443 81025 8490803776 INFO] Creating MARKET order object for market: BTC-USD
[2026-03-27 17:14:49,443 81025 8490803776 INFO] Placing order...
[2026-03-27 17:14:49,443 81025 8490803776 DEBUG] Placing an order: id=1596207797214642833122240413721618736308962126210297969523593614700790259509
[2026-03-27 17:14:49,443 81025 8490803776 DEBUG] Sending POST https://api.starknet.sepolia.extended.exchange/api/v1/user/order, headers={<RequestHeader.ACCEPT: 'Accept'>: 'application/json', <RequestHeader.CONTENT_TYPE: 'Content-Type'>: 'application/json', <RequestHeader.USER_AGENT: 'User-Agent'>: 'X10PythonTradingClient/1.0.0', <RequestHeader.API_KEY: 'X-Api-Key'>: '6c9a7ffba37265164ee37e6ccf78cd85'}
[2026-03-27 17:14:50,253 81025 8490803776 INFO] Order is placed: {
    "status": "OK",
    "data": {
        "id": 2037518709813129216,
        "external_id": "1596207797214642833122240413721618736308962126210297969523593614700790259509"
    },
    "error": null,
    "pagination": null
}

@alexex10 alexex10 marked this pull request as ready for review March 27, 2026 13:19
order_size = market.trading_config.min_order_size

best_market_price = market_stats.data.ask_price if order_side == OrderSide.BUY else market_stats.data.bid_price
order_price = get_price_with_slippage(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explicit for now

@ex10ded ex10ded merged commit 724826f into starknet Mar 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants