Commit Graph

821 Commits

Author SHA1 Message Date
tinkle-community
e4d9ea032d fix: position sizing guidance and Lighter sub-accounts support
- Fix hardcoded 5x position ratio in AI prompt example, now uses configured ratio
- Add position sizing guidance section for AI to calculate proper position size
- Add sub_accounts support for Lighter account API
2025-12-16 00:00:07 +08:00
tinkle-community
05c480d3f0 fix: Lighter stop/take-profit orders must use TimeInForce=0 (ImmediateOrCancel)
Lighter SDK validates that StopLossOrder (type=2) and TakeProfitOrder (type=4)
must have TimeInForce=0 (ImmediateOrCancel), not TimeInForce=1 (GoodTillTime).

This was causing stop-loss and take-profit orders to fail validation and not
be submitted to Lighter exchange.
2025-12-15 22:34:29 +08:00
tinkle-community
3f084005e4 feat: upgrade Binance to Algo Order API and improve trading flow
- Upgrade go-binance to v2.8.9 with new Algo Order API
- Migrate SetStopLoss/SetTakeProfit to use AlgoOrderTypeStopMarket/TakeProfitMarket
- Update cancel functions to handle both legacy and Algo orders
- Fix Lighter stop orders using correct order types (type=2/4) with TriggerPrice
- Add CancelAllOrders before opening positions for Bybit and Lighter
- Fix decision limit selector in API handler
- Add stop_loss/take_profit/confidence fields to DecisionAction
- Store decisions array in database with proper serialization
- Redesign DecisionCard with beautiful entry/SL/TP display
2025-12-15 21:22:22 +08:00
tinkle-community
aeede956e6 docs: add bilingual module documentation (EN/ZH) 2025-12-15 18:07:52 +08:00
tinkle-community
62df4a46f5 docs: add documentation section with architecture links to README 2025-12-15 16:05:33 +08:00
tinkle-community
0e4978002b docs: rewrite architecture README with module references 2025-12-15 16:02:05 +08:00
tinkle-community
85cf8c4986 docs: add backtest and debate module technical documentation 2025-12-15 15:55:07 +08:00
tinkle-community
7532d09dfb docs: add strategy module technical documentation
- Complete data flow from coin selection to execution
- System/user prompt construction details
- AI response parsing and validation
- Risk control enforcement
- Code file references with line numbers
2025-12-15 15:33:40 +08:00
tinkle-community
57a9cc2930 fix: competition chart showing only one line
- Normalize timestamps to nearest minute for proper alignment
- Forward-fill missing values to ensure continuous lines
- Use actual data range for Y-axis instead of forcing zero
2025-12-15 11:55:00 +08:00
tinkle-community
acd549e272 chore: remove unused Lighter integration docs and migration
- Schema already handles lighter_api_key_private_key field
- Migration script is redundant
2025-12-14 23:20:16 +08:00
tinkle-community
f901f954d9 feat: comprehensive FAQ rewrite with navigation fix
- Add HeaderBar to FAQ page for proper navigation
- Rewrite FAQ with 9 categories and ~50 Q&A items
- Add EN/ZH translations for all FAQ content
- Remove China-specific references
- Update AI model names (GPT-5.2)
- Update description to include crypto and US stock markets
2025-12-14 23:12:09 +08:00
tinkle-community
da1d905a31 fix: replace localhost with 127.0.0.1 and auto-detect server IP
- Install script now auto-detects server IP for remote deployments
- Changed all localhost:3000 references to 127.0.0.1:3000 for local access
- Updated README (EN/ZH) and frontend translations
2025-12-14 22:30:06 +08:00
tinkle-community
1785184481 docs: add Windows installation guide 2025-12-14 22:26:10 +08:00
tinkle-community
3bb516e469 docs: update documentation 2025-12-14 22:21:50 +08:00
tinkle-community
4725548a55 feat: fix Lighter V2 integration and improve error handling
- Fix Lighter API field name mismatches (position/size, avg_entry_price/entry_price, sign/side)
- Fix GetBalance return format to match standard fields (totalWalletBalance, totalUnrealizedProfit)
- Fix GetPositions return format to match standard fields (positionAmt, markPrice, unRealizedProfit)
- Add API Key Index field to frontend with explanation
- Update Lighter referral link
- Disable Lighter testnet (mainnet only)
- Add load error tracking for better error messages
- Remove old Lighter V1 implementation files
- Remove test credentials from test files
2025-12-14 20:50:10 +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
48084f50cf docs: update README screenshots with backtest lab
- Rename img.png to backtest-lab.png
- Arrange 12 screenshots in 6 pairs (2 per row)
- Add Backtest Lab to Web Interface Features section
2025-12-14 00:42:26 +08:00
tinkle-community
1e135ea9c3 feat: redesign backtest module UI and fix 404 issue
- Fix backtest API 404 by registering routes in setupRoutes()
- Redesign BacktestPage with 3-step wizard configuration
- Add progress ring visualization with animation
- Add equity chart with trade markers using Recharts
- Add trade timeline with card-style display
- Add stats cards for equity, return, drawdown, sharpe
- Add tab navigation for overview/chart/trades/decisions
- Improve run history list with status icons
- Add lightweight-charts dependency (for future use)
2025-12-14 00:23:51 +08:00
tinkle-community
4aa612f397 refactor: rename pool to provider (Data Provider) 2025-12-13 21:43:43 +08:00
tinkle-community
c4363f3bc7 fix: use strategy config for position value ratio validation instead of hardcoded 1.5x 2025-12-13 20:47:15 +08:00
tinkle-community
0381815a13 feat: add dropdown selector for Recent Decisions count (5/10/20/50/100) 2025-12-13 00:13:29 +08:00
tinkle-community
7806749297 fix: use max_completion_tokens for OpenAI newer models 2025-12-12 23:32:32 +08:00
tinkle-community
5391f39749 chore: upgrade OpenAI default model to gpt-5.2 2025-12-12 23:30:24 +08:00
Ember
ed041b9183 refactor: replace inline SVG exchange icons with local image files (#1224) 2025-12-12 21:09:57 +08:00
tinkle-community
dcc16fec82 feat: add Bitget futures trading support
- Add BitgetTrader with full trading implementation
- Support one-way position mode with proper API parameters
- Add Bitget to all exchange switch statements
- Update exchange icons (Bybit, OKX, Bitget, Lighter)
- Add Bitget to frontend exchange config modal
2025-12-12 18:59:09 +08:00
tinkle-community
76574aacb2 docs: add debate arena screenshots to README 2025-12-12 16:58:44 +08:00
tinkle-community
cc390706d0 feat: add OI ranking data support and fix trader config update issues
- Add OI ranking data fetching and formatting for AI prompts
- Fix trader update not saving strategy_id, ai_model_id, initial_balance
- Fix AI API key not set for non-qwen/deepseek providers
- Add strategy_id to trader config API response
- Remove old trader from memory before reloading on update
- Clean up unused useTraderActions.ts
2025-12-12 16:08:21 +08:00
tinkle-community
f5ae22d85c feat: add debate arena and fix multiple issues
- Add AI debate arena for multi-AI trading decisions
- Fix debate consensus calculation and display
- Fix vote parsing to support both <decision> and <final_vote> tags
- Fix JSON field name compatibility (stop_loss/stop_loss_pct)
- Fix symbol validation to prevent AI hallucinating invalid symbols
- Fix Bybit position side display (was uppercase, now lowercase for consistency)
- Fix NOFX logo navigation to home page
- Add detailed logging for debugging trade execution
2025-12-12 11:24:32 +08:00
tinkle-community
e5703ffab6 feat: add Grok, OpenAI, Claude, Gemini, Kimi AI providers
- Add new MCP clients for Grok (xAI), OpenAI, Claude, Gemini, Kimi
- Update auto_trader, backtest, and strategy to support all providers
- Add provider icons and fix SVG gradient conflicts
- Add API application links and hints in model config modal
- Show model version in AI model list cards
- Add Chinese/English translations for provider hints
- Remove deprecated traders component files
2025-12-11 15:16:59 +08:00
tinkle-community
78b5e73966 fix: competition chart data sync and display issues
- Add real-time data point to equity history API for chart/leaderboard consistency
- Fix chart legend showing 0% by finding each trader's last available data point
- Use consistent timestamp for all real-time data points in batch requests
- Increase chart trader limit from 5 to 10
- Remove Mini Stats Bar trader limit
2025-12-11 12:32:04 +08:00
tinkle-community
438f55bc30 fix: OKX contract size conversion issues
- Fix OpenLong/OpenShort: use quantity/ctVal instead of quantity*price/ctVal
- Fix GetPositions: convert contract count to base asset (posAmt = contracts * ctVal)
- Fix CloseLong/CloseShort: convert base asset to contracts before sending order
- Fix GetOrderStatus: convert executedQty from contracts to base asset
- Fix SetStopLoss/SetTakeProfit/FormatQuantity: same contract conversion fix
2025-12-11 11:17:43 +08:00
tinkle-community
19937ee260 fix: improve trading and UI 2025-12-11 00:47:53 +08:00
tinkle-community
e9e60c82cb fix: further reduce competition screenshot size 2025-12-10 22:05:54 +08:00
tinkle-community
b1664d4178 fix: reduce competition screenshot size 2025-12-10 22:05:19 +08:00
tinkle-community
ecbedc6525 fix: OKX trading issues and improve position tracking
- Add maxMktSz check for OKX market orders to prevent exceeding limits
- Increase margin safety buffer (0.1% fee + 1% buffer) for all exchanges
- Fix Binance position closure detection with direct trade queries
- Move Recent Completed Trades before Current Positions in AI prompt
- Update README screenshots with table layout for better alignment
2025-12-10 22:01:57 +08:00
tinkle-community
870faa0843 fix: only main branch should create latest docker tag 2025-12-10 15:10:18 +08:00
tinkle-community
f6869a3d30 fix: handle zero entry_time in position sync and update gitignore
- Add fallback for zero/invalid entry_time when syncing positions
- Update .gitignore to ignore data/ directory and all .db files
- Remove accidentally committed nofx.db and image files
2025-12-10 15:06:06 +08:00
Maximilian Ford
8f07869d74 docs: complete ja and ko READMEs (#1206) 2025-12-10 14:45:46 +08:00
tinkle-community
319ccb8ca3 fix: initial balance calculation and UI improvements
- Fix initial balance using available_balance instead of total_equity
- Fix WSMonitor nil pointer by starting market monitor before loading traders
- Add strategy name display on traders list and dashboard pages
- Various position sync and trading improvements
2025-12-10 14:40:08 +08:00
tinkle-community
c19ee51dee fix: update docker-compose.yml to use data directory
Changed volume mount from ./data.db:/app/data.db to ./data:/app/data
Removed decision_logs mount (logs now stored in data directory)
2025-12-09 21:32:40 +08:00
tinkle-community
8be44cdf6e fix: return default models and exchanges when database is empty
API now returns default AI models (deepseek, qwen, openai, claude, gemini, grok) and exchanges (binance, bybit, okx, hyperliquid, aster, lighter) when database has no data.
2025-12-09 21:11:51 +08:00
tinkle-community
fa88bac812 feat: write logs to data directory
- Log files are saved to data/nofx_YYYY-MM-DD.log
- Removed decision_logs mount from docker-compose
2025-12-09 20:50:00 +08:00
tinkle-community
94abf1d491 fix: remove problematic volume mount that caused 502 error
The ./data:/app mount was overwriting the entire /app directory
including application binaries, causing the backend to fail.
2025-12-09 20:34:48 +08:00
tinkle-community
0c744c4954 fix: use bind mount instead of named volume for data persistence
- Changed from Docker named volume to bind mount (./data:/app/data)
- Data files now visible in deployment directory (/root/nofx/data/)
- Easier to backup, inspect, and manage data files directly
2025-12-09 20:09:48 +08:00
tinkle-community
32d420dace fix: change database path to data/data.db for Docker volume persistence
- Changed default dbPath from 'data.db' to 'data/data.db'
- This ensures database is stored in /app/data/ which is mounted as Docker volume
- Added automatic creation of data directory if it doesn't exist
- Fixes issue where database was lost on container restart
2025-12-09 20:01:45 +08:00
tinkle-community
e6f4c9a0ef fix: remove FOREIGN KEY constraint from traders table
- Remove FK constraint that was causing 'FOREIGN KEY constraint failed' error
- Add migration to automatically remove FK from existing databases
- FK constraint was problematic when database is reset while user has cached JWT token
2025-12-09 19:52:27 +08:00
tinkle-community
6546264df9 fix: backend respect TRANSPORT_ENCRYPTION config for model/exchange updates 2025-12-09 19:30:00 +08:00
tinkle-community
23277fc39f chore: remove tweets from community section 2025-12-09 19:19:06 +08:00
tinkle-community
8b1cf2e6fe fix: respect transport_encryption setting in API config functions
When TRANSPORT_ENCRYPTION=false, updateModelConfigs and
updateExchangeConfigsEncrypted now send plain JSON instead of
attempting encryption which would fail with an empty public key.
2025-12-09 19:08:04 +08:00
tinkle-community
c720d663f1 feat: add TRANSPORT_ENCRYPTION toggle for easier deployment
- Add TRANSPORT_ENCRYPTION env config (default: false)
- Allow HTTP/IP access when transport encryption is disabled
- Add /api/crypto/config endpoint to expose encryption status
- Update WebCryptoEnvironmentCheck with 'disabled' status
- Update ExchangeConfigModal and AITradersPage to allow form submission when disabled
- Add i18n translations for disabled status (EN/CN)
- Update README with two deployment modes documentation
2025-12-09 18:04:42 +08:00