- Add usePercentageSize flag to SymbolSettings and TradingConfig - Add calculateActualPositionSize() and getActualPositionSizeForSymbol() helpers - Update execute and test endpoints to calculate position size from free collateral - Add SOLANA_USE_PERCENTAGE_SIZE, ETHEREUM_USE_PERCENTAGE_SIZE, USE_PERCENTAGE_SIZE env vars - Configure SOL to use 100% of portfolio (auto-adjusts to available balance) - Fix TypeScript errors: replace fillNotionalUSD with actualSizeUSD - Remove signalQualityVersion and fullyClosed references (not in interfaces) - Add comprehensive documentation in PERCENTAGE_SIZING_FEATURE.md Benefits: - Prevents insufficient collateral errors by using available balance - Auto-scales positions as account grows/shrinks - Maintains risk proportional to capital - Flexible per-symbol configuration (SOL percentage, ETH fixed)
9.4 KiB
9.4 KiB