Skip to content

Frequently Asked Questions ​

New here? Start with Configuring OKX API keys — it's the most common stumbling block, walked through step by step.

On this page ​

Login & Wallet ​

Login signature failed — MetaMask shows an error

Possible causes:

  1. MetaMask is locked → unlock it
  2. Wrong wallet selected → switch to the one you registered with
  3. Large local time skew → correct your system clock
  4. Other browser extensions interfering → disable other Web3 extensions

Try this: disconnect MetaMask, reload the page, and reconnect. If the error persists, try a different browser (Chrome → Firefox) to isolate extension conflicts.

Logged out immediately after sign-in

Your browser is probably blocking third-party cookies. TodoAI uses the qt_session httpOnly cookie; if disabled, set-cookie has no effect.

Fix (Chrome): Settings → Privacy and security → Cookies and other site data → Block third-party cookies → toggle off for app.totodo.icu.

Fix (Safari): the default "Prevent cross-site tracking" blocks our cookie. Either disable it globally or add app.totodo.icu as an exception.

"Too many requests" / IP rate-limited on login

/api/user/login is rate-limited to 5/minute/IP to prevent signature brute-force. Wait one minute, then retry.

If you keep hitting this without actually logging in, your wallet's auto-sign flow may be spamming. Disconnect the wallet fully, refresh, then click "Connect Wallet" exactly once.

API Key configuration ​

Test connection failed: Invalid Api-Key
  1. Re-copy the API Key from OKX (it may have been renamed/deleted)
  2. Confirm you chose API Trading type at creation
  3. If you enabled IP whitelist, confirm the current server IP is in it
  4. Check that the API key isn't expired (OKX allows setting an expiration)
Test connection failed: Passphrase is wrong

90% of connection failures are this. The Passphrase is the field you set yourself when creating the API — not your OKX login password, not your funds password.

If you forgot it, you must delete the API key and create a new one. OKX cannot recover a lost Passphrase.

Test connection failed: Server IP not in OKX whitelist

You enabled IP whitelist when creating the API on OKX. The server's outbound IP needs to be added.

  • Self-hosted: run curl ifconfig.me on the server to get the public IP
  • Vercel/hosted: check your provider's egress IP documentation
  • Not sure? the simplest fix is to disable IP whitelist in the OKX API settings (it's enabled by default but not required)
Test connection failed: API Key lacks required permissions

OKX API doesn't have Read and Trade checked.

  1. Delete the API key on OKX
  2. Recreate it, this time ticking Read + Trade
  3. Do NOT enable Withdraw — that's the single most important security step
  4. Re-paste into TodoAI's Configure modal
Paper key fails but OKX shows the key as fine

Paper API keys must be created at OKX Demo Trading, NOT the main OKX site. The two are not interchangeable — mainnet keys won't work against the demo endpoint, and vice versa.

Strategy & Backtest ​

Strategy keeps showing HOLD — no trades ever fire

Usually the rules didn't trigger. Run /backtest with the same parameters to check. If backtest also doesn't trigger:

  • Are indicator thresholds too extreme? (e.g. RSI < 10 is rarely hit)
  • Is the timeframe too short to see the trigger?
  • Is the symbol's volatility too low?

Loosen the conditions or change the timeframe to test.

Backtest shows 0 trades
  1. Thresholds are too extreme
  2. Timeframe too short, can't see the trigger
  3. Symbol liquidity is weak, price barely moves

Try a longer backtest period (3 months+) and a more liquid symbol (BTC/USDT) first to verify the system works, then refine.

AI-generated strategy doesn't work
  1. Look at the reasoning chain — does each step match your intent?
  2. Try editing a step (e.g. adjust RSI from 30 to 25) and click regenerate
  3. Edit rules directly in the DSL editor
  4. Simplify the prompt and start over

The AI is a model, not a magic wand — clearer inputs produce better strategies.

Backtest is great, but live loses money

Paper → live has several differences:

  1. Slippage — paper assumes zero, live has some
  2. Matching — paper assumes instant fill, live has delay
  3. Funding rates — overnight fees in futures mode
  4. Liquidity — paper assumes infinite, real markets don't

Recommendations:

  • Run on Paper for 1+ week and compare to backtest
  • Watch if max drawdown is deeper than backtest predicted
  • Tighten SL if needed
  • Use the panic close all button if things go wrong

Trading & Positions ​

Strategy stopped but positions are still open

Stopping a strategy does not auto-close positions. You need to:

  1. Manually close on /trade, OR
  2. Use the Panic close all button (closes everything immediately)

This is by design — you may want to stop a strategy's future signals while keeping existing positions open to ride out the move.

Some positions remain after Panic close

Panic sends a market order per position independently. If one fails (insufficient balance, network error, exchange rate limit), it stays in the errors[] array of the response. Check the response payload for failed positions and close them manually.

Position PnL shows incorrectly

Check Position.side:

  • LONG profit = closePrice - averagePrice (price went up)
  • SHORT profit = averagePrice - closePrice (price went down)

If it shows the wrong sign, it may be legacy PnL data from before version 0.3.4.0 (the PnL formula changed when we added SHORT support). The scripts/backfill-pnl-side.js backfill script handles this.

SSE & Real-time data ​

SSE keeps dropping
  1. Check the reverse proxy (Nginx/Caddy) — it may be buffering SSE responses. Set X-Accel-Buffering: no for the relevant paths
  2. Browser DevTools → Network → EventStream — check connection state
  3. Some NAT/firewalls have aggressive idle timeouts (60s+). Our default heartbeat is 15s, which usually keeps connections alive
  4. VPN — corporate VPNs sometimes block long-lived connections
Real-time data is 30s+ behind
  1. The engine cron tick is 30s by default — that's the floor for new trade events
  2. SSE poll cadence: 2.5s (events) / 800ms (reasoning) — worst case ~3s combined
  3. For sub-30s engine ticks, edit scripts/systemd/quantokx-cron.timer and reduce OnCalendar
HeroMetrics winStreak / winRate stuck

The metrics update on profit_record_created events, which only fire when a position closes with PnL. Open positions don't affect win rate.

If you haven't closed any trades yet, the values stay at 0 (or initial state).

Performance & Deployment ​

Production build fails: db_check.ts module not found

db_check.ts is a temporary debug script at the repo root. Next.js TypeScript includes **/*.ts so root-level scripts end up in the type check. Fix: delete the file or move it under scripts/.

Multi-instance deploy: tier cache inconsistent

You must configure Upstash Redis:

env
UPSTASH_REDIS_REST_URL=https://...
UPSTASH_REDIS_REST_TOKEN=...

Without these, the in-process Map cache is used, where each instance caches independently for 5 minutes. A PRO user on instance A may appear FREE on instance B until the cache expires.

profit-broadcaster doesn't work across instances

Currently a per-process Map. Single-instance works fine. Multi-instance needs Redis pub/sub (on the roadmap — until then, scale vertically or use sticky sessions on the load balancer).

Engine tick is slow / cron timer overlapping

The inflight + DB lock prevents concurrent execution of the same strategy, but if a single tick takes >30s, the next one starts before the previous finishes. Solutions:

  1. Increase timer interval in scripts/systemd/quantokx-cron.timer
  2. Set STRATEGY_LIMIT=N to cap strategies per tick
  3. Check OKX API rate-limit headers — you may be hitting throttling

Still stuck? ​

  • Search the Concepts docs — system architecture, error normalization, and other internals are documented
  • Open an issue on GitHub with: error message, what you tried, and (anonymized) screenshots
  • Email: support@totodo.icu

TodoAI · Turn trading ideas into automated strategies