fix(trading): add obligation back
This commit is contained in:
@@ -51,6 +51,7 @@ describe('LiquidityTable', () => {
|
||||
'Party',
|
||||
'Status',
|
||||
'Commitment ()',
|
||||
'Obligation',
|
||||
'Fee',
|
||||
'Adjusted stake share',
|
||||
'Share',
|
||||
|
||||
@@ -220,6 +220,57 @@ export const LiquidityTable = ({
|
||||
headerTooltip: t(
|
||||
'The amount committed to the market by this liquidity provider.'
|
||||
),
|
||||
cellRenderer: ({
|
||||
data,
|
||||
value,
|
||||
}: VegaICellRendererParams<
|
||||
LiquidityProvisionData,
|
||||
'commitmentAmount'
|
||||
>) => {
|
||||
if (!value) return '-';
|
||||
const currentCommitmentAmount = data?.currentCommitmentAmount;
|
||||
const pendingCommitmentAmount = value;
|
||||
|
||||
const formattedPendingCommitmentAmount =
|
||||
addDecimalsFormatNumberQuantum(
|
||||
pendingCommitmentAmount,
|
||||
assetDecimalPlaces ?? 0,
|
||||
quantum ?? 0
|
||||
);
|
||||
|
||||
if (
|
||||
currentCommitmentAmount &&
|
||||
currentCommitmentAmount !== pendingCommitmentAmount
|
||||
) {
|
||||
const formattedCurrentCommitmentAmount =
|
||||
addDecimalsFormatNumberQuantum(
|
||||
currentCommitmentAmount,
|
||||
assetDecimalPlaces ?? 0,
|
||||
quantum ?? 0
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<span>{formattedCurrentCommitmentAmount}</span> (
|
||||
<span className="text-warning">
|
||||
{formattedPendingCommitmentAmount}
|
||||
</span>
|
||||
)
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
return formattedPendingCommitmentAmount;
|
||||
}
|
||||
},
|
||||
tooltipValueGetter: assetDecimalsFormatter,
|
||||
},
|
||||
{
|
||||
headerName: t('Obligation'),
|
||||
field: 'commitmentAmount',
|
||||
type: 'rightAligned',
|
||||
headerTooltip: t(
|
||||
`The liquidity provider's obligation to the market, calculated as the liquidity commitment amount multiplied by the value of the stake_to_ccy_volume network parameter to convert into units of liquidity volume.`
|
||||
),
|
||||
cellRenderer: ({
|
||||
data,
|
||||
value,
|
||||
|
||||
Reference in New Issue
Block a user