Fix Usdc.Value to amount
This commit is contained in:
@@ -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;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user