Skip to content

fix(uta): CCXT-custom boolean create bug + demoTrading guard + Binance preset#357

Merged
luokerenx4 merged 3 commits into
masterfrom
UTA-issue
Jun 17, 2026
Merged

fix(uta): CCXT-custom boolean create bug + demoTrading guard + Binance preset#357
luokerenx4 merged 3 commits into
masterfrom
UTA-issue

Conversation

@luokerenx4

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the user-reported CCXT-custom create bug. The wizard sent sandbox/demoTrading as the strings "true"/"false" — the schema-form renderer had no boolean field type, so they fell through to a text input and the backend z.boolean() rejected them ("expected boolean, received string"). Boolean preset fields now render as the existing themed <Toggle> and convert to a real boolean at the submit boundary.
  • Guards the CCXT demoTrading/sandbox footgun. On an exchange without a demo endpoint (e.g. okx, whose demo is the sandbox header — not a domain), enableDemoTrading left urls.api undefined and the next request crashed deep in ccxt with a cryptic Cannot read properties of undefined (reading 'rest'). Now it fails fast with a clear CONFIG error; setSandboxMode wrapped symmetrically.
  • Adds a Binance preset (live + Demo Trading via the unified demo-*.binance.com simulator). Legacy testnet deliberately omitted (futures testnet deprecated; spot-only needs a scoped-account engine change).

Test plan

  • npx tsc --noEmit (Alice) clean
  • pnpm -F @traderalice/uta-protocol typecheck clean
  • cd ui && npx tsc -b clean
  • pnpm test — 1990 pass (new useSchemaForm, CcxtBroker.guard, Binance preset specs)
  • Live dogfood on a real Binance demo account via alice-uta: create → connect → spot buy fill → perp open → spot + perp coexist in portfolio, reads aggregate (no silent slice-drop)

Boundary touch

Touches trading / broker config (UTA preset catalog + CcxtBroker). Demo/paper accounts only in testing. Follow-up tracked in ANG-111: getAccount netLiquidation only reads the spot wallet and counts perp notional as equity — a pre-existing, venue-general issue surfaced during this dogfood, intentionally NOT fixed here.

🤖 Generated with Claude Code

Ame and others added 3 commits June 17, 2026 12:59
…leans

The CCXT Custom create wizard sent sandbox/demoTrading as the strings
"true"/"false" because the schema-form renderer had no boolean field type —
they fell through to a text input. The backend z.boolean() then rejected
them ("expected boolean, received string"), breaking every CCXT-custom
create (the user-reported Binance bug). Add a 'boolean' field type that
renders the existing themed <Toggle> and converts to a real boolean at the
submit boundary — z.coerce.boolean() can't be used backend-side because
Boolean("false") === true. Booleans seed unconditionally so a required
boolean with no .default() still submits.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e endpoint

CCXT's base enableDemoTrading sets urls.api = urls.demo; on an exchange with
no demo domain (e.g. okx, whose demo IS the sandbox x-simulated-trading
header) urls.api becomes undefined and the next request crashes deep in
sign() with a cryptic "Cannot read properties of undefined (reading 'rest')".
Detect the broken post-state and throw a clear CONFIG error instead, and wrap
setSandboxMode symmetrically. Real-ccxt construct-time regression spec.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Binance — the world's largest crypto exchange — gets a dedicated preset.
Modes: live + Demo Trading (the unified demo-*.binance.com simulator via
enableDemoTrading, spot + futures). Legacy Testnet is deliberately omitted:
futures testnet is deprecated (CCXT hard-throws) and spot-only testnet would
need a market-type-scoped account (tracked in ANG-111's sibling work).
Verified end-to-end on a real Binance demo account via the alice-uta CLI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 17, 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 17, 2026 5:00am

Request Review

@luokerenx4 luokerenx4 merged commit 1fa4a8d into master Jun 17, 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