feat: Add FARTCOIN-PERP market support with percentage-based sizing

- Added FARTCOIN-PERP to SUPPORTED_MARKETS (market index 22)
- Updated TradingConfig interface with fartcoin symbol settings
- Added default config: 20% portfolio, 10x leverage, disabled by default
- Updated normalizeTradingViewSymbol to detect FARTCOIN
- Enhanced getPositionSizeForSymbol for FARTCOIN-PERP handling
- Enhanced getActualPositionSizeForSymbol for percentage-based sizing
- Added FARTCOIN ENV variable loading in getConfigFromEnv
- Updated Settings UI with FARTCOIN section and percentage badge
- Added FARTCOIN fields to settings API endpoints (GET/POST)
- Created comprehensive documentation in docs/markets/FARTCOIN-PERP.md
- Build successful: TypeScript compilation and static generation complete

Co-authored-by: mindesbunister <32161838+mindesbunister@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-06 17:44:19 +00:00
parent d3b83ae95a
commit 2df6c69b92
4 changed files with 274 additions and 0 deletions

View File

@@ -85,6 +85,9 @@ export async function GET() {
ETHEREUM_POSITION_SIZE: parseFloat(env.ETHEREUM_POSITION_SIZE || '4'),
ETHEREUM_LEVERAGE: parseFloat(env.ETHEREUM_LEVERAGE || '1'),
ETHEREUM_USE_PERCENTAGE_SIZE: env.ETHEREUM_USE_PERCENTAGE_SIZE === 'true',
FARTCOIN_ENABLED: env.FARTCOIN_ENABLED === 'true',
FARTCOIN_POSITION_SIZE: parseFloat(env.FARTCOIN_POSITION_SIZE || '20'),
FARTCOIN_LEVERAGE: parseFloat(env.FARTCOIN_LEVERAGE || '10'),
// Risk management
STOP_LOSS_PERCENT: parseFloat(env.STOP_LOSS_PERCENT || '-1.5'),
@@ -161,6 +164,9 @@ export async function POST(request: NextRequest) {
ETHEREUM_ENABLED: settings.ETHEREUM_ENABLED.toString(),
ETHEREUM_POSITION_SIZE: settings.ETHEREUM_POSITION_SIZE.toString(),
ETHEREUM_LEVERAGE: settings.ETHEREUM_LEVERAGE.toString(),
FARTCOIN_ENABLED: settings.FARTCOIN_ENABLED.toString(),
FARTCOIN_POSITION_SIZE: settings.FARTCOIN_POSITION_SIZE.toString(),
FARTCOIN_LEVERAGE: settings.FARTCOIN_LEVERAGE.toString(),
// Risk management
STOP_LOSS_PERCENT: settings.STOP_LOSS_PERCENT.toString(),