Skip to content

Commit

Permalink
Morpho borrowish base rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
piekczyk committed Nov 22, 2024
1 parent 77a4017 commit 02344b5
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { MorphoCloseClaimRewardsPayload, Network } from '@oasisdex/dma-libr
import { strategies } from '@oasisdex/dma-library'
import BigNumber from 'bignumber.js'
import { getNetworkContracts } from 'blockchain/contracts'
import { getRpcProvider, NetworkIds } from 'blockchain/networks'
import { getRpcProvider } from 'blockchain/networks'
import { getTokenGuarded, getTokenSymbolBasedOnAddress } from 'blockchain/tokensMetadata'
import { amountFromWei } from 'blockchain/utils'
import { omniNetworkMap } from 'features/omni-kit/constants'
Expand Down Expand Up @@ -67,8 +67,8 @@ export async function getMetaMorphoClaims({
),
{
network: omniNetworkMap[networkId] as Network,
operationExecutor: getNetworkContracts(NetworkIds.MAINNET).operationExecutor.address,
provider: getRpcProvider(NetworkIds.MAINNET),
operationExecutor: getNetworkContracts(networkId).operationExecutor.address,
provider: getRpcProvider(networkId),
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ export const useMorphoMetadata: GetOmniMetadata = (productContext) => {
faq: productType === OmniProductType.Borrow ? faqBorrow : faqMultiply,
overviewContent: <MorphoDetailsSectionContentWrapper />,
overviewFooter: <MorphoDetailsSectionFooter />,
overviewBanner: !isOpening && networkId === NetworkIds.MAINNET && (
<MorphoDetailsSectionContentRewards />
),
overviewBanner: !isOpening && <MorphoDetailsSectionContentRewards />,
overviewWithSimulation: isYieldLoopWithData,
renderOverviewBanner: refinanceBanner?.renderOverviewBanner,
},
Expand Down
9 changes: 8 additions & 1 deletion features/omni-kit/protocols/morpho-blue/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,14 @@ export const morphoBorrowishRewards: NetworkIdsWithValues<{
rewards: [morphoRewards, legacyMorphoRewards, usdcRewards],
rewardsType: Erc4626RewardsType.MetaMorpho,
},
[NetworkIds.BASEMAINNET]: {
rewards: [morphoRewards, legacyMorphoRewards, usdcRewards],
rewardsType: Erc4626RewardsType.MetaMorpho,
},
}

// in general there are more, but we currently don't support these markets
export const morphoBorrowishRewardTokens = ['MORPHO', 'MORPHO_LEGACY', 'USDC']
export const morphoBorrowishRewardTokens: NetworkIdsWithValues<string[]> = {
[NetworkIds.MAINNET]: ['MORPHO', 'MORPHO_LEGACY', 'USDC'],
[NetworkIds.BASEMAINNET]: ['MORPHO', 'USDC'],
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"@lifi/wallet-management": "^2.6.1",
"@lifi/widget": "^2.10.2",
"@metamask/eth-sig-util": "^5.0.2",
"@oasisdex/addresses": "0.1.89",
"@oasisdex/addresses": "0.1.90",
"@oasisdex/automation": "1.6.5-morpho.6",
"@oasisdex/dma-library": "0.6.79",
"@oasisdex/dma-library": "0.6.80",
"@oasisdex/multiply": "^0.2.11",
"@oasisdex/transactions": "0.1.4-alpha.0",
"@oasisdex/utils": "^0.0.8",
Expand Down
2 changes: 1 addition & 1 deletion pages/[networkOrProduct]/morphoblue/[...position].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function MorphoPositionPage(props: MorphoPositionPageProps) {
useTxHandler: useMorphoTxHandler,
})
}
extraTokens={morphoBorrowishRewardTokens}
extraTokens={morphoBorrowishRewardTokens[props.networkId]}
protocol={LendingProtocol.MorphoBlue}
protocolHook={useMorphoData}
seoTags={morphoSeoTags}
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2502,10 +2502,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@oasisdex/[email protected].89":
version "0.1.89"
resolved "https://registry.yarnpkg.com/@oasisdex/addresses/-/addresses-0.1.89.tgz#650951335e469e2123d09474bf0f9daa74041621"
integrity sha512-dhJDiJqd3UVc4KUzDRK0QxgoBeIj9CgxDXMXaRKNo6e6/96U00RNLebDegb2WXtTXU1QP+W7RpolbLvZbXDD6g==
"@oasisdex/[email protected].90":
version "0.1.90"
resolved "https://registry.yarnpkg.com/@oasisdex/addresses/-/addresses-0.1.90.tgz#51feb4a7e2759b9a53ab14dca04205a2c542c8fb"
integrity sha512-CIfNieXCcIdAM04Se35XtI9CWGvozMj7gYn/6EOMdURfeehtUqWLYyDSFfDgRBX24rIO/0rQ7ukb5Zx1grD+rQ==

"@oasisdex/[email protected]":
version "1.6.5-morpho.6"
Expand All @@ -2514,10 +2514,10 @@
dependencies:
ethers "^5.6.2"

"@oasisdex/[email protected].79":
version "0.6.79"
resolved "https://registry.yarnpkg.com/@oasisdex/dma-library/-/dma-library-0.6.79.tgz#cecd0c4ed8edac0a6995c5ca1fe4140f0535af55"
integrity sha512-vxkFZoJiplthJHuBgga+iYAffofevO9vf3HrDeeRmP0Wrtg+nEdVns1KOnQ/saeAhrL8+7BxQ9ZjR/n5l/J66A==
"@oasisdex/[email protected].80":
version "0.6.80"
resolved "https://registry.yarnpkg.com/@oasisdex/dma-library/-/dma-library-0.6.80.tgz#f790213da10f67184d293a583b8558d542456db9"
integrity sha512-eHuhALD1AzKDYBdUXJWPTg5OqxO5AmapG4VmE39U4VFR6QuOTC52wK3OTVx0tixV18uPHMioe7GlpgWKHQUyNQ==
dependencies:
bignumber.js "9.0.1"
ethers "^5.7.2"
Expand Down

0 comments on commit 02344b5

Please sign in to comment.