Skip to content

Commit

Permalink
Fix omni aave/spark earn/borrow/multiply switching (#3752)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinciarka authored Apr 3, 2024
1 parent 60be01b commit a0f1548
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions features/omni-kit/controllers/OmniProductController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ import {
import type {
GetOmniMetadata,
OmniFormDefaults,
OmniProductType,
OmniProtocolHookProps,
OmniProtocolSettings,
OmniSupportedNetworkIds,
OmniSupportedProtocols,
} from 'features/omni-kit/types'
import { OmniSidebarAutomationStep } from 'features/omni-kit/types'
import { OmniProductType, OmniSidebarAutomationStep } from 'features/omni-kit/types'
import type { PositionHistoryEvent } from 'features/positionHistory/types'
import { WithTermsOfService } from 'features/termsOfService/TermsOfService'
import { WithWalletAssociatedRisk } from 'features/walletAssociatedRisk/WalletAssociatedRisk'
Expand Down Expand Up @@ -161,9 +160,9 @@ export const OmniProductController = <Auction, History, Position>({
const isYieldLoop = getOmniIsOmniYieldLoop({ collateralToken, pseudoProtocol, quoteToken })

// Flag to determine whether full yield-loop UI experience is available for given protocol & pair
const isYieldLoopWithData = !!settings.yieldLoopPairsWithData?.[networkId]?.includes(
`${collateralToken}-${quoteToken}`,
)
const isYieldLoopWithData =
!!settings.yieldLoopPairsWithData?.[networkId]?.includes(`${collateralToken}-${quoteToken}`) &&
dpmPositionData?.product === OmniProductType.Multiply

return (
<WithConnection>
Expand Down
2 changes: 1 addition & 1 deletion features/omni-kit/observables/getDpmPositionData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const mapAaveYieldLoopToMultiply = ({
isCorrelatedPosition(collateralToken, quoteToken) &&
[LendingProtocol.SparkV3, LendingProtocol.AaveV3, LendingProtocol.AaveV2].includes(protocol)
) {
return 'Multiply'
return 'Multiply' as PositionType
}

return positionType
Expand Down

0 comments on commit a0f1548

Please sign in to comment.