24 Commits

Author SHA1 Message Date
tinkle-community
d008ccc6ab fix(market): route Hyperliquid USDC perps correctly + symbol fuzzy match
A single-symbol QNT-USDC trader produced 0 candidate coins, 500 errors
from Hyperliquid, and "🚫 Dropped AI decision" warnings — the agent had
no market data to reason about, so it sat in `wait` forever. Three
chained bugs:

1. provider/hyperliquid/kline.go (IsXYZAsset / FormatCoinForAPI):
   asset detection required the base symbol to appear in the hardcoded
   StockPerpsSymbols / XYZOtherSymbols / display-alias lists. QNT, ARM,
   and every other newly-listed Hyperliquid USDC perp wasn't in the
   list, so the code routed them to the crypto path (CoinAnk) which
   doesn't have them. Now the `-USDC` suffix and `xyz:` prefix are
   trusted as definitive Hyperliquid signals — these tokens are
   Hyperliquid-specific and new listings don't require a code change.
   The hardcoded lists are kept as fallbacks for bare base symbols.

2. market/data_klines.go (getKlinesFromHyperliquid): the function
   stripped the `xyz:` prefix before calling GetCandles, defeating
   GetCandles's own FormatCoinForAPI logic. With the hardcoded list
   missing the new ticker, FormatCoinForAPI couldn't re-add the prefix
   and the request hit Hyperliquid's crypto perp endpoint — which
   returns 500 for stock-only tickers. Pass the symbol through as-is.

3. trader/auto_trader_loop.go (filterDecisionsToStrategyUniverse): the
   AI sometimes echoes a candidate as "QNTUSDC" / "QNT-USDC" / "QNTUSDT"
   / bare "QNT" instead of the canonical "xyz:QNT" we supplied. Strict
   exact-match was dropping all of them. Added a base-level key
   (strips xyz:, -USDC, -USDT, USDC, USDT, USD; normalizes display
   aliases like ROBINHOOD → HOOD) and rewrites the matched decision's
   symbol to the canonical form so the order pipeline downstream sees
   the format it expects.

After this, a single-symbol stock trader fetches real K-line data from
Hyperliquid, the AI sees real candidates, and decisions get executed
on-chain instead of silently filtered.
2026-05-29 22:14:41 +08:00
tinklefund
f37fc9f887 feat(hyperliquid): add stock symbol market data support
- Add Hyperliquid/XYZ symbol normalization tests and backend coverage

- Extend kline and market data lookup paths for US stock symbols

- Wire frontend data API types for stock-oriented market requests
2026-05-25 01:24:49 +08:00
lky-spec
b536265f93 Propagate MCP request context to HTTP calls 2026-04-28 12:22:45 +08:00
shinchan-zhai
2d68b48f52 feat: route nofxos data API calls through claw402 x402 payment
When CLAW402_WALLET_KEY env var is set, all nofxos.ai data API calls
(AI500, OI rankings, NetFlow, price rankings) are automatically routed
through claw402.ai with x402 USDC micropayment.

- provider/nofxos/claw402.go: x402 GET request client for data APIs
- provider/nofxos/client.go: claw402 mode support in doRequest()
- kernel/engine.go: auto-detect CLAW402_WALLET_KEY and enable routing
- mcp/payment/x402.go: MakeClaw402SignFunc helper

Without CLAW402_WALLET_KEY, falls back to direct nofxos.ai (backward compat).
2026-03-25 09:58:24 +08:00
tinkle-community
736d2d385d refactor: optimize codebase encoding 2026-03-12 16:14:56 +08:00
tinkle-community
cb31782be4 refactor: split large files and clean up project structure
- Rename experience/ to telemetry/ for clarity
- Split 15+ large Go files (800-2200 lines) into focused modules:
  kernel/engine.go, backtest/runner.go, market/data.go, store/position.go,
  api/handler_trader.go, trader/auto_trader_grid.go, and 9 exchange traders
- Split frontend monoliths: types.ts, api.ts, AITradersPage.tsx, BacktestPage.tsx
  into domain-specific modules with barrel re-exports
- Remove stale files: screenshots, .yml.old, pyproject.toml
- Remove unused scripts/ and cmd/ directories
- Remove broken/outdated test files (network-dependent, stale expectations)
2026-03-12 12:53:57 +08:00
Hao Fu
64935b9d47 feat(strategy): Add Hyperliquid coin sources (hyper_all, hyper_main) (#1388)
Add two new coin source options for Hyperliquid trading:

- hyper_all: All available Hyperliquid perpetual coins (229 coins)
- hyper_main: Top N coins by 24h volume (default 20)

Changes:
- Add CoinSourceConfig fields: UseHyperAll, UseHyperMain, HyperMainLimit
- Add provider/hyperliquid/coins.go with caching (24h) and volume-based sorting
- Add source types 'hyper_all' and 'hyper_main' to GetCandidateCoins()
- Support mixing with other sources in 'mixed' mode
- Add source tag formatting for UI display

This ensures traders using Hyperliquid can select coins that are actually
available on the exchange, avoiding 'symbol not found' errors.
2026-02-22 17:03:05 +08:00
tinkle-community
ca92b849cd fix: KuCoin timestamp sync, improve no-coins handling, update README icons
- Add server time synchronization for KuCoin API to fix timestamp error (400002)
- Return empty list instead of error when no available coins (ai500.go)
- Save cycle record even when no candidate coins (show in frontend without red error)
- Update Claude icon to Anthropic dark brand color (#141413)
- Add exchange and AI model icons to README.md and README.ja.md
2026-02-04 02:41:37 +08:00
wqqqqqq
9dbc861cdf feat: add depth websocket from coinank (#1362) 2026-01-27 22:07:38 +08:00
tinkle-community
c9150e8273 feat: add OI Low coin source and improve Mixed mode UI
- Add oi_low as independent source_type for short opportunities
- Redesign Mixed mode with card-based selector (2x2 grid)
- Show combination summary with total coin limit
- Support both Chinese and English languages
- Change default limits to 10 for OI Top and OI Low
2026-01-23 20:50:23 +08:00
tinkle-community
fcaabea6cb feat: add oi_low coin source for short opportunities
- Add GetOILowPositions/GetOILowSymbols in oi.go
- Add UseOILow/OILowLimit config fields
- Add oi_low case in GetCandidateCoins
- Support oi_low in mixed mode
- Update source tag formatting
2026-01-23 20:16:30 +08:00
tinkle-community
b5716ff3cb fix: handle empty AI500 coin list gracefully instead of error 2026-01-23 20:12:11 +08:00
tinkle-community
0275e23b7e feat: unify NofxOS data provider and fix language consistency
- Add unified NofxOS API key configuration in IndicatorEditor
- Add language field to StrategyConfig for consistent prompt generation
- Auto-update prompt sections when interface language changes
- Remove scattered URL inputs from CoinSourceEditor and IndicatorEditor
- Create nofxos provider package with formatted data output
- Update kernel engine to use config-based language setting
2026-01-04 00:59:07 +08:00
wqqqqqq
04e0cbad83 feat: implement coinank free base coin interface (#1293)
- implement coinank free base coin interface in coinank_api.BaseCoinSymbols
2025-12-30 23:25:08 +08:00
tinkle-community
47bff87966 feat: add xyz dex balance calculation, market data providers, and UI improvements
- Fix xyz dex balance calculation (use marginSummary for isolated margin)
- Add Alpaca provider for US stocks market data
- Add TwelveData provider for forex & metals market data
- Add Hyperliquid kline provider
- Centralize API keys in config system
- Add builder fee for order routing
- Improve chart UI with compact design
- Fix position history fee display precision
- Add comprehensive balance calculation tests
2025-12-29 22:16:48 +08:00
wqqqqqq
24cd329f3d feat: implement coinank free kline api and kline websocket (#1281)
- implement coinank free kline api in coinank_api.Kline
- implement coinank free kline ws in coinank_api.KlineWs. if needKline is true, kline data read from KlineCh. if needTicker is true, tickers data  read from TickersCh.
2025-12-27 01:54:44 +08:00
wqqqqqq
54b24167a7 feat: implement coinank openapi kline interface (#1275)
- implement kline interface
2025-12-25 14:24:35 +08:00
wqqqqqq
c328e23278 feat: implement coinank openapi netPositions interface (#1258)
- implement Net long & Net short interface
2025-12-23 00:06:14 +08:00
wqqqqqq
7baa07738a feat: implement coinank openapi rank interface (#1250)
- implement VisualScreener Rank
- implement More Instrument Agg Rank
- rank interface can help user to choose a coin
2025-12-20 01:12:50 +08:00
wqqqqqq
c81e6b0094 feat: implement coinank openapi liquidation interface (#1247)
- implement LiquidationExchangeStatistics,LiquidationCoinAggHistory in provider/coinank/liquidation.go
- implement LiquidationHistory,LiquidationOrders in provider/coinank/liquidation.go
2025-12-18 21:44:43 +08:00
wqqqqqq
182265c1d0 feat: implement coinank openapi Instruments interface (#1243)
- implement OpenInterestAll,OpenInterestChartV2,OpenInterestSymbolChart,OpenInterestKline in provider/coinank/open_interest.go
- implement OpenInterestAggKline,TickersTopOIByEx,InstrumentsOiVsMc in provider/coinank/open_interest.go
2025-12-17 18:55:31 +08:00
wqqqqqq
612e25db66 feat: init coinank openapi http request framework (#1240) 2025-12-17 10:22:02 +08:00
tinkle-community
abaffaddb9 fix: add SSRF protection for user-controlled URLs
- Add security/url_validator.go with ValidateURL, SafeHTTPClient, SafeGet
- Block private IP ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16)
- Block cloud metadata endpoints (169.254.169.254, metadata.google.internal)
- Validate DNS resolution to prevent DNS rebinding attacks
- Check redirect destinations for SSRF
- Fix FetchQuantData, FetchOIRanking, fetchAI500, fetchOITop, fetchSingleExternalSource
2025-12-14 12:01:23 +08:00
tinkle-community
4aa612f397 refactor: rename pool to provider (Data Provider) 2025-12-13 21:43:43 +08:00