Fix .First Position update + add more details when position rejected
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user