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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"symbol": "<symbol>",
"account_balance": "<account_balance>",
"risk_pct": "<risk_pct>",
"entry": "<entry>",
"stop_loss": "<stop_loss>"
},
"name": "calculate_position_size"
}
}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 |