Fix .First Position update + add more details when position rejected

This commit is contained in:
2025-10-11 12:27:54 +07:00
parent 3b3e383781
commit 04df72a6bd
4 changed files with 13 additions and 19 deletions

View File

@@ -51,20 +51,6 @@ namespace Managing.Infrastructure.Exchanges
reduceOnly ? TradeStatus.PendingOpen : TradeStatus.Filled);
}
// Check gas fees for EVM exchanges before opening position
if (IsEvmExchange(account))
{
var gasFeeUsd = await GetFee(account);
if (gasFeeUsd > 0.5m)
{
_logger.LogWarning(
$"Gas fee too high for position opening: {gasFeeUsd:F2} USD (threshold: 0.5 USD). Cancelling position opening.");
// Return a cancelled trade
return BuildEmptyTrade(ticker, price, quantity, direction, leverage, tradeType, currentDate.Value,
TradeStatus.Cancelled);
}
}
var processor = GetProcessor(account);
return await processor.OpenTrade(account, ticker, direction, price, quantity, leverage, tradeType,