Skip to content

STP orders actually reach CCXT venues — round-3 dogfood catch#332

Merged
luokerenx4 merged 1 commit into
masterfrom
UTA-issue
Jun 12, 2026
Merged

STP orders actually reach CCXT venues — round-3 dogfood catch#332
luokerenx4 merged 1 commit into
masterfrom
UTA-issue

Conversation

@luokerenx4

Copy link
Copy Markdown
Contributor

Summary

  • There was no working stop-loss route on okx at all: ibkrOrderTypeToCcxt lowercased STP into a literal ordType "stp" → okx 51000 — so the "place a separate stop" path that the TPSL refusal gate recommends was also broken. Caught by a multi-op commit dogfood (entry + protective stop in one approval): entry filled, stop rejected, loud mixed-result narration (the state machine behaved exactly as designed).
  • Fix per CCXT's real convention: conditional orders keep the base type + params.triggerPrice; ccxt routes per-venue. STP → market+trigger, STP LMT → limit+trigger. Live-verified on okx demo: accepted into the algo namespace, tracked as submitted across poller passes (the {stop:true} getOrder fallback finds it — absence from the regular listing does not mis-terminal it), and cancellable through the TaG flow.
  • TRAIL / TRAIL LIMIT now refuse loudly until venue-verified (same rule as attached TP/SL).
  • Bonus observation for ANG-103: okx algo orders are invisible even to fetchOpenOrders({trigger:true}) with default params — the trigger-namespace listing work is confirmed necessary.

Test plan

  • pnpm test 1895 passing
  • Live okx demo: STP place → track (2+ poller passes, stays working) → cancel via TaG; account left flat, 0 staged

Boundary touch

CCXT order-type mapping (order entry path).

🤖 Generated with Claude Code

Round-3 dogfood (multi-op commit: entry + separate protective stop)
caught the next layer: ibkrOrderTypeToCcxt lowercased STP into a
literal ordType "stp" — okx rejected it with 51000, which meant the
"place a separate stop" path recommended by the TPSL refusal gate
didn't work either. There was NO functioning stop-loss route on okx.

CCXT's actual convention: conditional orders keep the BASE type
(market/limit) and carry params.triggerPrice; ccxt routes each venue
to its algo endpoint. STP → market+trigger, STP LMT → limit+trigger.
Live-verified on okx demo: accepted (algo namespace), tracked as
working across poller passes (the {stop:true} getOrder fallback finds
it; absence from the regular listing does NOT mis-terminal it), and
cancellable through trading-as-git. TRAIL/TRAIL LIMIT now refuse
loudly until venue-verified — same rule as attached TP/SL.

Also observed: okx algo orders are invisible even to
fetchOpenOrders({trigger:true}) with default params — reinforces the
ANG-103 trigger-namespace work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openalice-demo Ready Ready Preview, Comment Jun 12, 2026 1:18am

Request Review

@luokerenx4 luokerenx4 merged commit caf9aaa into master Jun 12, 2026
5 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.

1 participant