From a4c6278d66fd0f0320486923640524baa181d8a8 Mon Sep 17 00:00:00 2001 From: viet-nv Date: Tue, 1 Aug 2023 11:56:40 +0700 Subject: [PATCH] fix: lp collect fee --- .../MyEarnings/ElasticPools/SinglePosition/PositionView.tsx | 2 +- src/services/earning/index.ts | 2 ++ src/services/earning/types.ts | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/MyEarnings/ElasticPools/SinglePosition/PositionView.tsx b/src/pages/MyEarnings/ElasticPools/SinglePosition/PositionView.tsx index 183b8754d4..87d0b21586 100644 --- a/src/pages/MyEarnings/ElasticPools/SinglePosition/PositionView.tsx +++ b/src/pages/MyEarnings/ElasticPools/SinglePosition/PositionView.tsx @@ -256,7 +256,7 @@ const PositionView: React.FC = props => { feeValue0={feeReward0} feeValue1={feeReward1} hasUserDepositedInFarm={positionEarning.owner !== positionEarning.ownerOriginal} - farmAddress={positionEarning.joinedPositions?.[0]?.farmId} + farmAddress={positionEarning.depositedPosition?.farm || positionEarning.joinedPositions?.[0]?.farmId} poolAddress={positionEarning.pool.id} position={position} isLegacy={isLegacyPosition} diff --git a/src/services/earning/index.ts b/src/services/earning/index.ts index 01466ec56a..d8e77c9d4b 100644 --- a/src/services/earning/index.ts +++ b/src/services/earning/index.ts @@ -34,6 +34,7 @@ const earningApi = createApi({ includeMyFarmApr: true, perPage: 1000, page: 1, + includeHistorical: true, } const [positionsRes, earningRes] = await Promise.all([ @@ -88,6 +89,7 @@ const earningApi = createApi({ includeMyFarmApr: true, perPage: 1000, page: 1, + includeHistorical: true, } const [positionsRes, earningRes] = await Promise.all([ diff --git a/src/services/earning/types.ts b/src/services/earning/types.ts index 4e70be1899..1d3f25eec4 100644 --- a/src/services/earning/types.ts +++ b/src/services/earning/types.ts @@ -70,6 +70,9 @@ export type ElasticPositionEarningWithDetails = { pendingRewardUSD: string myPoolApr?: string myFarmApr?: string + depositedPosition?: { + farm: string + } joinedPositions?: { farmId: string farmingPool: {