Fix Usdc.Value to amount

This commit is contained in:
2025-10-05 01:53:50 +07:00
parent de0d042254
commit 3581607375
2 changed files with 2 additions and 2 deletions

View File

@@ -418,7 +418,7 @@ namespace Managing.Application.ManageBot
} }
} }
var usdcValue = usdcBalance?.Value ?? 0m; var usdcValue = usdcBalance?.Amount ?? 0m;
var available = usdcValue - totalAllocatedForAccount; var available = usdcValue - totalAllocatedForAccount;
return available < 0m ? 0m : available; return available < 0m ? 0m : available;
}); });

View File

@@ -80,7 +80,7 @@ namespace Managing.Application.ManageBot
if (request.Config.BotTradingBalance > availableAllocation) if (request.Config.BotTradingBalance > availableAllocation)
{ {
throw new InvalidOperationException( throw new InvalidOperationException(
$"Insufficient available allocation on account '{account.Name}'. Requested: {request.Config.BotTradingBalance:F2} USDC, " + $"Insufficient available allocation. Requested: {request.Config.BotTradingBalance:F2} USDC, " +
$"Balance : {usdcBalance?.Value:F2 ?? 0} Available: {availableAllocation:F2} USDC."); $"Balance : {usdcBalance?.Value:F2 ?? 0} Available: {availableAllocation:F2} USDC.");
} }