Merge branch 'main' into chore/sync-main
This commit is contained in:
commit
bc13f1b359
@ -310,16 +310,25 @@ export const CurrentVolume = ({
|
|||||||
const t = useT();
|
const t = useT();
|
||||||
const nextTier = tiers[tierIndex + 1];
|
const nextTier = tiers[tierIndex + 1];
|
||||||
const requiredForNextTier = nextTier
|
const requiredForNextTier = nextTier
|
||||||
? Number(nextTier.minimumRunningNotionalTakerVolume) - windowLengthVolume
|
? new BigNumber(nextTier.minimumRunningNotionalTakerVolume).minus(
|
||||||
: 0;
|
windowLengthVolume
|
||||||
|
)
|
||||||
|
: new BigNumber(0);
|
||||||
|
const currentVolume = new BigNumber(windowLengthVolume);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-3 pt-4">
|
<div className="flex flex-col gap-3 pt-4">
|
||||||
<CardStat
|
<CardStat
|
||||||
value={formatNumberRounded(new BigNumber(windowLengthVolume))}
|
value={
|
||||||
text={t('pastEpochs', 'Past {{count}} epochs', { count: windowLength })}
|
currentVolume.isZero()
|
||||||
|
? `<${formatNumberRounded(requiredForNextTier)}`
|
||||||
|
: formatNumberRounded(currentVolume)
|
||||||
|
}
|
||||||
|
text={t('pastEpochs', 'Past {{count}} epochs', {
|
||||||
|
count: windowLength,
|
||||||
|
})}
|
||||||
/>
|
/>
|
||||||
{requiredForNextTier > 0 && (
|
{requiredForNextTier.isGreaterThan(0) && (
|
||||||
<CardStat
|
<CardStat
|
||||||
value={formatNumber(requiredForNextTier)}
|
value={formatNumber(requiredForNextTier)}
|
||||||
text={t('Required for next tier')}
|
text={t('Required for next tier')}
|
||||||
|
@ -119,6 +119,8 @@ describe('getLiquidityProvision', () => {
|
|||||||
createdAt: '2022-12-16T09:28:29.071781Z',
|
createdAt: '2022-12-16T09:28:29.071781Z',
|
||||||
id: 'dde288688af2aeb5feb349dd72d3679a7a9be34c7375f6a4a48ef2f6140e7e59',
|
id: 'dde288688af2aeb5feb349dd72d3679a7a9be34c7375f6a4a48ef2f6140e7e59',
|
||||||
fee: '0.001',
|
fee: '0.001',
|
||||||
|
partyId:
|
||||||
|
'dde288688af2aeb5feb349dd72d3679a7a9be34c7375f6a4a48ef2f6140e7e59',
|
||||||
party: {
|
party: {
|
||||||
__typename: 'Party',
|
__typename: 'Party',
|
||||||
accountsConnection: {
|
accountsConnection: {
|
||||||
|
@ -159,7 +159,14 @@ export const getLiquidityProvision = (
|
|||||||
const liquidityProvider = liquidityProviders.find(
|
const liquidityProvider = liquidityProviders.find(
|
||||||
(f) => liquidityProvision.party.id === f.partyId
|
(f) => liquidityProvision.party.id === f.partyId
|
||||||
);
|
);
|
||||||
if (!liquidityProvider) return liquidityProvision;
|
|
||||||
|
if (!liquidityProvider) {
|
||||||
|
return {
|
||||||
|
...liquidityProvision,
|
||||||
|
partyId: liquidityProvision.party.id,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const accounts = compact(
|
const accounts = compact(
|
||||||
liquidityProvision.party.accountsConnection?.edges
|
liquidityProvision.party.accountsConnection?.edges
|
||||||
).map((e) => e.node);
|
).map((e) => e.node);
|
||||||
|
Loading…
Reference in New Issue
Block a user