calculate_position_size
Compute position size based on risk percentage, account balance, entry, and stop-loss, applying exchange filters and fee deductions. Rejects invalid inputs and returns FILTER_VIOLATION when exchange requirements aren't met.
Instructions
Risk-bazlı pozisyon boyutu hesaplar (base asset): account_balance * risk_pct risk tutarı, |entry - stop| risk-per-unit'e bölünür; fee düşülür; LOT_SIZE/MIN_NOTIONAL/PRICE_FILTER'e göre aşağı yuvarlanır. Borsa filtreleri karşılanamıyorsa FILTER_VIOLATION döner (fail-closed). Temel doğruluk kontrolleri her zaman aktiftir: stale fiyat / yanlış stop yönü / bilinmeyen sembol / yetersiz bakiye reddedilir.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | No | BUY | |
| entry | Yes | ||
| symbol | Yes | Spot USDT çifti, örn. BTCUSDT | |
| fee_rate | No | Komisyon oranı | |
| risk_pct | Yes | Hesap equity yüzdesi (0.02 = %2) | |
| stop_loss | Yes | ||
| request_id | No | ||
| account_balance | Yes | Kotasyon (USDT) bakiyesi | |
| idempotency_key | No |