- 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>
4.9 KiB
4.9 KiB
FARTCOIN-PERP Market Configuration
Market Details
- Market Index: 22
- Symbol: FARTCOIN-PERP
- Oracle:
2sZomfWMDuQLcFak3nuharXorHrZ3hK8iaML6ZGSHtso - Min Order Size: 1 FARTCOIN
- Tick Size: $0.0001 (price precision)
- Initial Margin Ratio: 10% (max 10x leverage)
- Maintenance Margin Ratio: 5%
Configuration Mode
- Mode: PROFIT GENERATION 💰
- Position Sizing: Percentage-based (20% of portfolio default)
- Default Leverage: 10x
- Status: Disabled by default
Environment Variables
FARTCOIN_ENABLED=false # Enable/disable FARTCOIN trading
FARTCOIN_POSITION_SIZE=20 # 20% of portfolio (not fixed USD)
FARTCOIN_LEVERAGE=10 # Max 10x leverage
FARTCOIN_USE_PERCENTAGE_SIZE=true # Always true for FARTCOIN
Enabling FARTCOIN Trading
Via Settings UI (Recommended)
- Navigate to Settings page:
http://localhost:3001/settings - Scroll to "🎈 Fartcoin (FARTCOIN-PERP)" section
- Toggle "Enable Fartcoin Trading" to ON
- Adjust position size percentage (recommended: 10-20%)
- Set leverage (recommended: 10x for max profit potential)
- Click "Save Settings"
Via Environment Variables
- Edit
.envfile - Set
FARTCOIN_ENABLED=true - Adjust
FARTCOIN_POSITION_SIZE(1-100%) - Adjust
FARTCOIN_LEVERAGE(1-10x) - Restart container:
docker restart trading-bot-v4
Via TradingView Alert
Ensure your TradingView alert includes FARTCOIN symbol:
{
"symbol": "FARTCOINUSDT", // or "FARTCOIN"
"direction": "long",
// ... other fields
}
The bot will automatically normalize FARTCOINUSDT to FARTCOIN-PERP.
Position Size Calculation
Percentage-based sizing formula:
Base Capital = Portfolio × Position Size %
Notional Position = Base Capital × Leverage
Example with $1000 portfolio:
- Position Size: 20% → Base = $200
- Leverage: 10x → Notional = $2000
- Risk Exposure: $200 (max loss is your base capital)
Risk/Reward Example:
- Portfolio: $1000
- Position: 20% ($200) × 10x = $2000 notional
- Max Loss (1.5% SL): $30 (1.5% of $2000)
- Target Win (1.8% TP): $36 (1.8% of $2000)
- R:R Ratio: 1:1.2
Key Differences from SOL/ETH
| Feature | FARTCOIN | SOL | ETH |
|---|---|---|---|
| Position Sizing | Percentage-based | Fixed USD | Fixed USD |
| Default Enabled | ❌ Disabled | ✅ Enabled | ✅ Enabled |
| Purpose | Profit generation | Profit generation | Data collection |
| Default Size | 20% portfolio | $210 fixed | $4 fixed |
| Default Leverage | 10x | 10x | 1x |
| Max Leverage | 10x | 20x | 20x |
Risk Management
Important Notes:
- Disabled by default - Safe to deploy, enable when ready
- Max 10x leverage - Based on Drift Protocol margin requirements
- Percentage sizing - Automatically scales with portfolio size
- Quality thresholds - Uses same signal quality filters as SOL/ETH
- Adaptive leverage - Quality score determines actual leverage used
TradingView Setup
Your indicator should include FARTCOIN detection logic. The bot will:
- Receive webhook with
"symbol": "FARTCOINUSDT" - Normalize to
FARTCOIN-PERPvianormalizeTradingViewSymbol() - Check if
FARTCOIN_ENABLED=true - Calculate position size as percentage of free collateral
- Apply max 10x leverage
- Execute trade on Drift Protocol market index 22
Testing Checklist
Before enabling FARTCOIN trading in production:
- Settings UI shows FARTCOIN section correctly
- Toggle switch works (enabled/disabled state)
- Position size slider adjusts (1-100%)
- Leverage slider adjusts (1-10x)
- Risk calculator shows correct values
- Percentage calculation: 20% of $1000 = $200 base
- Notional calculation: $200 × 10x = $2000
- Settings save successfully to .env
- Container restart applies new settings
- Symbol detection works: "FARTCOINUSDT" → "FARTCOIN-PERP"
- Test trade executes with correct position size
Monitoring
Watch for these log messages when FARTCOIN trading is active:
📊 Percentage sizing: 20% of $1000.00 = $200.00
📊 Adaptive leverage: Quality 92 → 10x leverage
🎯 Opening position: FARTCOIN-PERP LONG $2000.00 (10x leverage)
✅ Position opened successfully
Troubleshooting
FARTCOIN trades not executing:
- Check
FARTCOIN_ENABLED=truein settings - Verify symbol normalization in logs
- Check quality score meets threshold (90+ for LONG, 95+ for SHORT)
- Ensure TradingView alert includes correct symbol
- Verify free collateral > required amount
Position size incorrect:
- Check
FARTCOIN_USE_PERCENTAGE_SIZE=true(should always be true) - Verify percentage calculation in logs
- Check free collateral value
- Ensure leverage is between 1-10x
Settings not saving:
- Check .env file permissions (should be writable)
- Verify container has access to .env file
- Check logs for "Settings updated" message
- Restart container after manual .env changes