Fix depth chart borked and premium precision

This commit is contained in:
Reckless_Satoshi 2024-03-17 13:18:54 +00:00
parent f12e242453
commit bedbe1d3f9
No known key found for this signature in database
GPG Key ID: 9C4585B561315571

View File

@ -74,8 +74,8 @@ const DepthChart: React.FC<DepthChartProps> = ({
// simple rule of three
if (order.coordinatorShortAlias != null) {
const limits = federation.getCoordinator(order.coordinatorShortAlias).limits;
order.base_amount =
(order.price * limits[currencyCode].price) / limits[order.currency].price;
const price = limits[currencyCode] ? limits[currencyCode].price : 0;
order.base_amount = (order.price * price) / price;
}
return order;
});
@ -309,7 +309,7 @@ const DepthChart: React.FC<DepthChartProps> = ({
<Box justifyContent='center'>
{xType === 'base_amount'
? `${center} ${String(currencyDict[currencyCode])}`
: `${center}%`}
: `${String(center.toPrecision(3))}%`}
</Box>
</Grid>
<Grid item>