Commit Graph
4 Commits
Author SHA1 Message Date
eezd 5b7490ac48 Report open interest window min and max in get_derivatives 2026-10-14 19:19:23 +08:00
eezd 3e5db79d4e Use live Binance klines in chat and add support/resistance zones
- get_klines always fetches from Binance REST: the stored last open
  candle is a snapshot from the sync and never updates, so 1d/4h data
  read from the database was stale. Mark whether the last bar is closed.
- Cluster swing highs/lows within 0.5 ATR into support/resistance zones
  with touch counts, returning the nearest 5 on each side instead of the
  last 5 raw swing points.
2026-10-14 19:15:19 +08:00
eezd 61486d0c5b Add derivatives tool, trim provider fields, widen model call retries
- New chat tool get_derivatives: funding rate (next estimate and recent
  settlements), premium, open interest change vs price, global and top
  trader long/short ratios, taker buy/sell ratio from Binance public
  endpoints. Each part fails independently.
- Strip whitespace from provider name and model; a leading space in the
  model name made the upstream return 404.
- Retry connection failures and mid-stream disconnects (raw httpx /
  httpx2 errors are not wrapped by the SDKs) up to 3 times while no
  output has been emitted, and surface them as chat errors.
- Return 30 recent bars from get_klines instead of 60 to cut tokens.
2026-10-14 18:16:54 +08:00
eezd 5db3ead883 Add AI chat with skills management and model provider settings
- Model providers for OpenAI and Anthropic message formats (e.g. via
  Sub2API), with API keys encrypted at rest and never returned
- Skills tree with markdown editing, priorities, drafts, publishing and
  rollback; only published skills enter the chat prompt
- Chat page with tool calls over collected news and Binance USD-M
  klines, a persisted CONTEXT.md, reset, and stop-generation support
- Chat may only create skill drafts and update CONTEXT.md; publishing,
  deleting, moving and priority changes stay with the user
2026-10-14 13:11:45 +08:00