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