feat(1355): lp dashboard adding equity like share (#2017)
* refactor: use the lpAggregatedDataProvider rather than liquidityProvisionsDataProvider The lpAggregatedDataProvider seems to provide the same data as the liquidityProvisionsDataProvider, but also contains further details that we'll need for other fields on the liquitidy provider details page. * feat: replace GALPS with equity-like share and fetch value from LiquidityProviderFeeShare Updates the type for LiquidityProviders prop to more accurately reflect that we're using the data from lpAggregatedDataProvider, which includes the fee share data. We use the fee share data to display equity-like share % for each LP, and have replaced GALPS, which was previously empty, with this value.
This commit is contained in:
parent
dccc750154
commit
045454b484
@ -11,7 +11,7 @@ import {
|
||||
getFeeLevels,
|
||||
sumLiquidityCommitted,
|
||||
marketLiquidityDataProvider,
|
||||
liquidityProvisionsDataProvider,
|
||||
lpAggregatedDataProvider,
|
||||
} from '@vegaprotocol/liquidity';
|
||||
import type { MarketLpQuery } from '@vegaprotocol/liquidity';
|
||||
|
||||
@ -34,10 +34,10 @@ const formatMarket = (data: MarketLpQuery) => {
|
||||
};
|
||||
|
||||
export const lpDataProvider = makeDerivedDataProvider(
|
||||
[marketLiquidityDataProvider, liquidityProvisionsDataProvider],
|
||||
([market, providers]) => ({
|
||||
[marketLiquidityDataProvider, lpAggregatedDataProvider],
|
||||
([market, lpAggregatedData]) => ({
|
||||
market: { ...formatMarket(market) },
|
||||
liquidityProviders: providers || [],
|
||||
liquidityProviders: lpAggregatedData || [],
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -4,7 +4,10 @@ import { AgGridColumn } from 'ag-grid-react';
|
||||
import type { GetRowIdParams } from 'ag-grid-community';
|
||||
import { t } from '@vegaprotocol/react-helpers';
|
||||
|
||||
import type { LiquidityProvisionFieldsFragment } from '@vegaprotocol/liquidity';
|
||||
import type {
|
||||
LiquidityProviderFeeShareFieldsFragment,
|
||||
LiquidityProvisionFieldsFragment,
|
||||
} from '@vegaprotocol/liquidity';
|
||||
import { formatWithAsset } from '@vegaprotocol/liquidity';
|
||||
|
||||
import { Grid } from '../../grid';
|
||||
@ -24,7 +27,8 @@ export const LPProvidersGrid = ({
|
||||
liquidityProviders,
|
||||
settlementAsset,
|
||||
}: {
|
||||
liquidityProviders: LiquidityProvisionFieldsFragment[];
|
||||
liquidityProviders: LiquidityProvisionFieldsFragment &
|
||||
LiquidityProviderFeeShareFieldsFragment[];
|
||||
settlementAsset: {
|
||||
decimals?: number;
|
||||
symbol?: string;
|
||||
@ -55,7 +59,14 @@ export const LPProvidersGrid = ({
|
||||
valueFormatter={formatToHours}
|
||||
field="createdAt"
|
||||
/>
|
||||
<AgGridColumn headerName={t('Galps')} field="Galps" />
|
||||
<AgGridColumn
|
||||
headerName={t('Equity-like share')}
|
||||
field="equityLikeShare"
|
||||
valueFormatter={({ value }: { value?: string | null }) => {
|
||||
const valueOr0 = value ? value : '';
|
||||
return `${parseInt(valueOr0) * 100}%`;
|
||||
}}
|
||||
/>
|
||||
<AgGridColumn
|
||||
headerName={t('committed bond/stake')}
|
||||
field="commitmentAmount"
|
||||
|
Loading…
Reference in New Issue
Block a user