Skip to content

Releases

bytx 0.2.7

Choose a tag to compare

@byttrade byttrade released this 24 Nov 07:39

New

  • ex.assert_demo(): raises ConfigError unless REST requests of the instance really go to the exchange demo/testnet. It checks the transport, not the demo flag: no REST address of the instance may equal a production address of the exchange, and on OKX and Bitget, where the demo uses the production host, the demo header (x-simulated-trading: 1, paptrading: 1) must be set. No network. Market WS streams are not checked (some demos use production ones).

Docs

  • ex.ccxt is an escape hatch, not the recommended path. Exchange id → symbol: ex.symbol('BTCUSDT'); symbol → id: (await ex.market(symbol)).id; demo check: ex.assert_demo().

bytx 0.2.6

Choose a tag to compare

@byttrade byttrade released this 23 Nov 21:35

Fixes

  • OKX: WebSocket orders. ws_place_order, ws_amend_order and ws_cancel_order now send the market instIdCode. Before this fix OKX rejected all three with 50014 Parameter instIdCode can not be empty. A market without a code goes via REST.
  • Cancel over WebSocket. A rejected WS cancel (other than "no such order") is now retried via REST. Cancel is idempotent, so the order no longer stays on the book.

New

  • candles(symbol, tf, since=, until=, limit=): page history backwards with until (ms, inclusive).
  • funding_intervals(symbols=None) -> {symbol: hours}, and FundingRate.interval_hours.
  • OrderTracker.track(order): show a just-sent order in the tracker before its WS event.

Docs

  • OKX and Bitget perpetuals need margin_mode in create_exchange.

bytx 0.2.6b1

bytx 0.2.6b1 Pre-release
Pre-release

Choose a tag to compare

@byttrade byttrade released this 23 Nov 21:28

Fixes

  • OKX: WebSocket orders. ws_place_order, ws_amend_order and ws_cancel_order now send the market instIdCode. Before this fix OKX rejected all three with 50014 Parameter instIdCode can not be empty. A market without a code goes via REST.
  • Cancel over WebSocket. A rejected WS cancel (other than "no such order") is now retried via REST. Cancel is idempotent, so the order no longer stays on the book.

New

  • candles(symbol, tf, since=, until=, limit=): page history backwards with until (ms, inclusive).
  • funding_intervals(symbols=None) -> {symbol: hours}, and FundingRate.interval_hours.
  • OrderTracker.track(order): show a just-sent order in the tracker before its WS event.

Docs

  • OKX and Bitget perpetuals need margin_mode in create_exchange.

bytx 0.2.5

Choose a tag to compare

@byttrade byttrade released this 23 Nov 20:02

bytx 0.2.5

BingX: a rate limit without an unblock moment no longer pauses for 60 s. BingX codes 100410 / 109429 that come without the unblock moment in the text («Please try again later», «rate limited») are a rate limit, not a ban window: the pause is now 2 s (BINGX_SOFT_PAUSE) instead of 60 s. Before, such a response could hold order requests for a minute — the first stop-loss of a position was placed after ~66 s. A real ban still comes with its unblock moment and is held until then.

BingX: no «Task exception was never retrieved» on shutdown. The background balance subscription that watch_positions starts now has its error retrieved, so a connection closed on shutdown no longer prints the asyncio warning.

Package metadata: more keywords (mcp, ai-agents, bingx, bitget, kucoin, perpetual-futures, async, sdk), classifiers and a Changelog link.

bytx 0.2.4

Choose a tag to compare

@byttrade byttrade released this 23 Nov 10:22

bytx 0.2.4

BingX: the configured margin_mode is now applied to the symbol. On BingX the margin mode is a per-symbol exchange setting (isolated by default) and is not part of the order, so a client created with margin_mode='cross' could still open isolated positions. An opening order now reads the symbol's margin mode once per symbol (Query Margin Type) and switches it if it differs (Change Margin Type). If the exchange refuses the switch (a position or an order is open on the symbol, code 104103), the order is not sent and ConfigError is raised. Closing orders are not checked; paper exchanges are not affected. bytx.testing emulates both requests.

bytx 0.2.3

Choose a tag to compare

@byttrade byttrade released this 22 Nov 06:37
  • BingX: error 109429 ("Too many invalid requests in a short period; temporarily restricted") is now raised as
    RateLimited (ccxt.RateLimitExceeded) instead of a bare ExchangeError, with retry_after taken from the
    "can retry after time" stamp in the response (60 s when the stamp is missing).
  • The limiter pauses only that method of that account until the restriction ends; other accounts on the same IP are
    not paused. No automatic retries are made during the restriction.

bytx 0.2.2

Choose a tag to compare

@byttrade byttrade released this 18 Nov 15:24
  • TP/SL that stay after the position is closed: new bytx.exchanges.tp_sl_cancel_on_flat(ccxt_id) says whether the
    exchange cancels the remaining TP/SL itself once the position is flat. Binance does not (demo 2026-11-18: both legs
    stay after close_position, the SL stays after the TP fires); Bybit, OKX, BingX, Bitget, BloFin, Gate and
    Hyperliquid do; KuCoin, MEXC, HTX — unknown.
  • open_position with SL and TP adds a warning to warnings on those exchanges: cancel the other leg with flatten,
    cancel_tp_sl or recover(). Orders are unchanged.
  • Docs: close_position does not cancel TP/SL (use flatten); paper cancels them on close, gentler than Binance.

bytx 0.2.1

Choose a tag to compare

@byttrade byttrade released this 14 Nov 06:55
  • Bybit: remaining of a canceled/rejected/expired order is now amount − filled (ccxt returned 0 from leavesQty, so a partially filled canceled order looked fully filled). No API changes.

bytx 0.2.0

Choose a tag to compare

@byttrade byttrade released this 13 Nov 20:38
  • Rollup maintenance release. No breaking API changes.

bytx 0.1.11

Choose a tag to compare

@byttrade byttrade released this 10 Nov 11:15
  • BloFin spot
  • my_trades: filters order_id, client_id_prefix, until; whole time windows
  • classify_close, funding_paid helpers
  • Hyperliquid: order lookup fixes (canceled orders)