pmxt icon indicating copy to clipboard operation
pmxt copied to clipboard

createOrder: object params instead of CCXT positional (symbol, type, side, amount, price, params)

Open realfishsam opened this issue 6 months ago • 1 comments

Inconsistency

createOrder takes a single CreateOrderParams object instead of CCXT's six positional arguments (symbol, type, side, amount, price, params).

Current (PMXT)

core/src/BaseExchange.ts:

async createOrder(params: CreateOrderParams): Promise<Order>
// CreateOrderParams is an object containing outcomeId, side, type, amount, price, etc.

sdks/python/pmxt/client.py — similarly uses a dict/object-based approach.

Expected (CCXT convention)

/tmp/ccxt/ts/src/base/Exchange.ts:

async createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price: Num = undefined, params = {}): Promise<Order>
  • Six positional args: symbol, type, side, amount, price, params
  • price defaults to undefined for market orders
  • Trailing params = {} for exchange-specific options (e.g. timeInForce, postOnly)

Impact

This is the single most-called method in any trading library. No CCXT-compatible bot or strategy can call createOrder on a PMXT exchange instance without complete rewriting. The positional signature is intentional in CCXT to enforce a minimal canonical order representation.

Found by automated PMXT ↔ CCXT API consistency audit

realfishsam avatar May 22 '26 12:05 realfishsam

Additional context from duplicate #504 — SDK-level file locations and extended scope:

  • TypeScript createOrder: sdks/typescript/pmxt/client.ts line 1969 — async createOrder(params: any) (fully untyped)
  • TypeScript buildOrder: sdks/typescript/pmxt/client.ts line 1824 — async buildOrder(params: CreateOrderParams & { outcome?: MarketOutcome })
  • Python create_order: sdks/python/pmxt/client.py line 2324 — uses explicit keyword args (market_id, outcome_id, side, type, amount, price, etc.)

Note: buildOrder/build_order has the same calling-convention problem as createOrder/create_order and should be fixed together.


Generated by Claude Code

realfishsam avatar Jun 16 '26 21:06 realfishsam