{"version":3,"sources":["contexts/ExternalMetadataContext.tsx","chain-interaction/wrapper.ts","chain-interaction/tokens.ts","contexts/UserAddressContext.tsx","contexts/WalletBalancesContext.tsx","utils/index.ts","chain-interaction/contracts.ts","constants/platypus-pool.ts","assets/logo/logo.png","components/account/AccountModal.tsx","assets/img/color_dot.svg","contexts/MakeMostOfMoneyContext.tsx","components/account/UserAddressComponent.tsx","assets/img/horizontal-dots.svg","components/navigation/MenuOptions.tsx","components/navigation/NavigationBar.tsx","components/notifications/GlobalDebtCeilingMessage.tsx","components/notifications/MigratePositionsComponent.tsx","components/notifications/NetworkNotSupported.tsx","components/notifications/PhishingAlertComponent.tsx","components/notifications/TransactionToasts.tsx","contexts/LiquidationFeesContext.tsx","contexts/StrategyMetadataContext.tsx","theme.ts","App.tsx","contexts/LiquidatablePositionsContext.tsx","pages/Admin/components/CopyClipboard/CopyClipboard.tsx","pages/Admin/components/AllAddresses.tsx","constants/deprecated-token-list.ts","components/tokens/TokenDescription.tsx","chain-interaction/transactions.ts","components/notifications/TransactionErrorDialog.tsx","pages/Admin/components/AllContracts/components/UpdatePriceOracle.tsx","pages/Admin/components/AllContracts/components/WithdrawFees.tsx","pages/Admin/components/AllContracts/AllContracts.tsx","pages/Admin/components/AllOpenPositions/components/PositionsRow.tsx","pages/Admin/components/AllOpenPositions/components/PositionsTable.tsx","pages/Admin/components/AllOpenPositions/AllOpenPositions.tsx","pages/Admin/index.tsx","pages/Analytics/AnalyticsBox.tsx","pages/Analytics/index.tsx","constants/hidden-strategies.ts","pages/Dashboard/components/TableSearch.tsx","pages/Dashboard/components/TableTabs.tsx","pages/Dashboard/components/AllSupportedCollateral.tsx","pages/Dashboard/index.tsx","pages/ErrorBoundary/ErrorBoundary.js","pages/Farm/FarmCard.tsx","pages/Farm/FarmRow.tsx","pages/Farm/FarmItem.tsx","pages/Farm/index.tsx","pages/iMoney/edit/ClaimiMoney.tsx","components/tokens/TokenAmountInputField.tsx","pages/iMoney/edit/StakeMoreiMoney.tsx","pages/iMoney/edit/UnstakeMoreiMoney.tsx","pages/iMoney/edit/EditMoreiMoney.tsx","pages/iMoney/metadata/MoreBalanceiMoney.tsx","assets/img/lines.svg","pages/iMoney/metadata/StakingAPRiMoney.tsx","pages/iMoney/index.tsx","pages/LiquidatablePositions/index.tsx","pages/Loans/index.tsx","pages/Positions/TrancheCard.tsx","pages/Positions/TrancheRow.tsx","pages/Positions/TrancheTable.tsx","pages/Positions/CurrentlyOpenPositions.tsx","pages/Positions/index.tsx","pages/Stake/components/StakeBox.tsx","pages/Stake/index.tsx","components/navigation/BackButton.tsx","components/notifications/DeprecatedTokenMessage.tsx","pages/TokenPage/components/change-strategy/ChangeStrategyButton.tsx","pages/TokenPage/components/change-strategy/ChangeStrategyTable.tsx","pages/TokenPage/components/change-strategy/ChangeStrategyModal.tsx","pages/TokenPage/components/change-strategy/StrategyNameAndSwitch.tsx","components/account/EnsureWalletConnected.tsx","components/notifications/WarningMessage.tsx","constants/addresses.ts","pages/TokenPage/components/edit/ConfirmPositionModal.tsx","pages/TokenPage/components/edit/DepositBorrow.tsx","pages/TokenPage/components/edit/RepayWithdraw.tsx","pages/TokenPage/components/edit/EditPosition.tsx","pages/TokenPage/components/metadata/CollateralAPY.tsx","components/data-display/TitleValue.tsx","pages/TokenPage/components/PositionData.tsx","pages/TokenPage/components/StrategyTokenInformation.tsx","pages/TokenPage/components/PositionBody.tsx","pages/TokenPage/components/TokenPageBody.tsx","pages/TokenPage/index.tsx","pages/vMore/edit/ClaimVeMore.tsx","pages/vMore/edit/StakeMoreVeMore.tsx","pages/vMore/edit/UnstakeMoreVeMore.tsx","pages/vMore/edit/EditMoreVeMore.tsx","pages/vMore/metadata/MoreBalanceVeMore.tsx","pages/vMore/metadata/StakingAPRVeMore.tsx","pages/vMore/index.tsx","pages/XMore/edit/StakeMore.tsx","pages/XMore/edit/UnstakeMore.tsx","pages/XMore/edit/EditMore.tsx","pages/XMore/metadata/MoreBalance.tsx","pages/XMore/metadata/StakingAPR.tsx","pages/XMore/index.tsx","reportWebVitals.ts","serviceWorker.ts","index.tsx"],"names":["ExternalMetadataContext","React","createContext","yieldFarmingData","yyMetadata","yieldMonitor","xMoreData","additionalYieldData","underlyingStrategyNames","Map","ExternalMetadataCtxProvider","children","useState","setXMoreData","setYieldFarmingData","setYYMeta","setYieldMonitor","setAdditionalYieldData","useEffect","fetch","then","response","json","catch","err","console","error","ymData","r","a","getAddress","lpAddress","totalApy","Provider","value","handleCallResultDefault","result","defaultResult","description","raw","undefined","message","addressToken","Object","fromEntries","values","ChainId","map","key","addressIcons","addressAuxIcon","getTokenFromAddress","chainId","address","Avalanche","get","getIconsFromTokenAddress","tokenAmount","tokenAddress","amount","token","CurrencyValue","getTokensInQuestion","_chainId","Array","from","entries","filter","aT","LiquidationType","tokenlist","tokens","decimals","name","symbol","logoURI","set","Token","liquidationParams","chainIds","Hardhat","exchangeIcons","JPL","PGL","exchangeRouters","router","liqType","Direct","lptokens","lpTokensPerChain","exchange","records","longTicker","record","pairAddress","ticker","split","slice","join","icons","push","addresses","LPT","deployAddresses","Stablecoin","CurvePool","StableLending2InterestForwarder","nativeCurrency","NativeCurrency","wrappedNativeCurrency","UserAddressContext","UserAddressCtxProvider","account","useEthers","search","useLocation","userAddress","URLSearchParams","WalletBalancesContext","WalletBalancesCtxProvider","useContext","tokenBalances","tokensInQuestion","calls","contract","Contract","ERC20Interface","method","args","results","useCalls","x","forEach","index","useWalletBalance","ctxAccount","balancesCtx","parseFloatNoNaN","input","parsed","parseFloat","isNaN","parseFloatCurrencyValue","format","significantDigits","Infinity","suffix","thousandSeparator","decimalSeparator","formatNumber","toLocaleString","useConnectWallet","activate","providerOptions","injected","package","walletconnect","WalletConnectProvider","options","infuraId","web3Modal","Web3Modal","theme","connect","provider","onConnect","underlyingAddresses","log","names","ContractName","spacecamel","replace","s","TxStatus","YieldType","masterPlatypusPool","require","useAddresses","chainIdStr","toString","parseStratMeta","row","stable","globalMoneyAvailable","additionalYield","underlyingStrategyName","tvlInToken","tvl","balance","BigNumber","strategyAddress","strategy","underlyingAddress","underlyingStrategy","APY","LiquidYieldStrategy","apy","selfRepayingAPY","yieldType","compoundingAPY","YieldYakStrategy","YieldYakAVAXStrategy","syntheticDebtCeil","add","totalDebt","trueOne","parseUnits","valPerOne","mul","valuePer1e18","div","parseEther","debtCeiling","gt","stabilityFeePercent","stabilityFee","toNumber","mintingFeePercent","mintingFee","totalCollateral","borrowablePercent","borrowablePer10k","usdPrice","formatEther","strategyName","parseBytes32String","tvlInPeg","harvestBalance2Tally","REPAYING","COMPOUNDING","NOYIELD","useInterestRate","abi","Interface","InterestRateController","useCall","useStable","requestedStrategyNames","Set","useIsolatedStrategyMetadata","stratMeta","setStratMeta","globalDebtCeiling","useGlobalDebtCeiling","totalSupply","useTotalSupply","token2Strat","YieldYakStrategy2","YieldYakAVAXStrategy2","keys","strats","AltYieldYakAVAXStrategy2","OldYieldYakAVAXStrategy2","sub","flatMap","rowsPerToken","extant","delete","size","newAddress","getContractNames","newUnderlyingNames","t","rows","ethers","providers","JsonRpcProvider","stratViewer","StrategyViewer","viewMetadata","StableLending2","normalResults","reduceFn","parsedRow","reduce","length","getData","calcLiquidationPrice","debt","collateral","calcLiqPriceFromNum","debtNum","colNum","parsePositionMeta","trancheContract","posYield","yield","trancheId","collateralValue","owner","liquidationPrice","useIsolatedPositionMetadata","legacy","current","useIsolatedLendingView","list","useCustomTotalSupply","useBalanceOfToken","usePlatypusAPR","tokenPerSecUsdc","useTokenPerSecPlatypus","tokenPerSecMoney","ptpPerSec","inputs","outputs","type","stateMutability","usePtpPerSec","totalAllocPoints","useTotalAllocPoints","ptpPerSecMoney","useTokenPerSecPoolInfo","ptpPerSecUsdc","morePrice","useCoingeckoPrice","ptpPrice","MoneyTVL","usdcTVL","formatUnits","APR_USDC_MORE","calculatePlatypusAPR","APR_MONEY_MORE","APR_USDC_PTP","APR_MONEY","APR_USDC","tokenPrice","poolId","baseAllocPoint","useIMoneyAPR","useTotalDebt","totalSupplyIMoney","useTotalSupplyIMoney","currentRate","boostedShare","iMoney","useBoostedSharePer10k","accountInfo","res","depositAmount","lastCumulRewardSimple","lastCumulRewardWeighted","factor","useIMoneyAccountInfo","weight","ONE","TWO","z","y","isNegative","sqrt","isZero","totalWeights","useIMoneyTotalWeights","ratio","baseRate","boostedRate","Math","round","avgBoostedRate","useTotalSupplyToken","ERC20","useUpdatedPositions","timeStart","endPeriod","Date","now","startPeriod","floor","currentRows","fill","i","parseRows","useParsedStakingMetadata","stakingContracts","VestingStakingRewards","userAccount","constants","AddressZero","useStakingMetadata","stakingMeta","stakingToken","rewardsToken","earned","rewards","totalRewards","aprPercent","aprPer10k","vestingCliff","timestamp2Date","periodFinish","stakedBalance","vestingStart","vested","tstamp","AccountModal","isOpen","onClose","deactivate","balanceCtx","moreToken","MoreToken","walletBalance","moreBalance","explorerLink","getExplorerAddressLink","isCentered","background","color","px","fontSize","fontWeight","_hover","pt","borderRadius","border","borderColor","pb","mb","justifyContent","alignItems","variant","height","textDecoration","onClick","mt","lineHeight","ml","shortenAddress","alignContent","m","navigator","clipboard","writeText","mr","display","href","isExternal","p","textAlign","MakeMostOfMoneyContext","MakeMostOfMoneyCtxProvider","useDisclosure","onToggle","MostOfMoneyPopover","returnFocusOnClose","placement","closeOnBlur","boundary","computePositionOnMount","matchWidth","width","paddingLeft","paddingRight","padding","target","rel","as","to","UserAddressComponent","handleOpenModal","useMediaQuery","isLargerThan1280","spacing","bg","src","colorDot","h","Links","title","link","MenuOptions","IconButton","icon","dots","alt","zIndex","NavigationBar","onOpen","isOpenAccount","onOpenAccount","onCloseAccount","location","position","md","logo","base","pathname","flexDirection","GlobalDebtCeilingMessage","hasMaxedOut","status","MigratePositionsComponent","w","style","NetworkNotSupported","motionPreset","leastDestructiveRef","colorScheme","PhishingAlertComponent","TransactionToasts","notifications","useNotifications","toast","useToast","showToast","notification","hash","transaction","getExplorerTransactionLink","id","duration","isClosable","LiquidationFeesContext","LiquidationFeesCtxProvider","StableLending2Liquidation","tokenFees","IsolatedLendingLiquidation","StrategyMetadataContext","StrategyMetadataCtxProvider","isIndeterminate","extendTheme","config","initialColorMode","fonts","heading","body","colors","white","black","brand","bgOpacity","active","accent","gradientBg","accent_color","whiteAlpha","gray","blue","zIndices","header","styles","global","components","Button","baseStyle","_active","backgroundColor","variants","action","primary","_disabled","secondary","submit","Text","gradient","WebkitBackgroundClip","WebkitTextFillColor","h200","fontFamily","h300","h400","bodyExtraSmall","bodySmall","bodyMedium","bodyLarge","bodyHuge","bodyExtraLarge","Tabs","tablist","borderBottom","tabpanel","tab","_selected","_after","content","bottom","Input","rounded","percentage","field","percentage_inactive","Table","dashboard","table","borderCollapse","borderSpacing","thead","tr","td","textTransform","paddingTop","paddingBottom","borderTop","_first","transform","tbody","boxSizing","backgroundClip","backgroundOrigin","backgroundImage","top","left","right","borderLeftRadius","_last","borderRightRadius","Link","footer","headerActive","Container","maxWidth","_before","App","params","activateBrowserWallet","chainIdsList","useConfig","networks","network","requestedSwitch","setRequestedSwitch","wallet","Web3Provider","window","ethereum","getNetwork","walletChainId","listAccounts","accounts","includes","request","chainName","rpcUrls","blockExplorerUrls","alert","scrollTo","margin","minHeight","opacity","pointerEvents","bgGradient","LiquidatablePositionsContext","LiquidatablePositionsCtxProvider","tokenPrices","positions","cachedPositions","setCachedPosition","parsedCachePositions","pos","updatedPositions","jointUpdatedPositions","updatedMetadata","positionCalls","useUpdatedMetadataLiquidatablePositions","updatedPositionMetadata","updatedDataMap","acc","parsedPositions","posUpdatedData","dollar","stableTickers","liquidatablePositions","posMeta","collateralVal","totalPercentage","liquidatableZone","criticalZone","riskyZone","healthyZone","positionHealthColor","lt","positionHealth","green","orange","red","liquidateButton","parsedPositionHealth","toFixed","positionHealthOrder","sort","b","CopyClipboard","label","useClipboard","hasCopied","onCopy","AllAddresses","props","allowMultiple","flex","deprecatedTokenList","TokenDescription","iconSize","textSize","targetSize","auxIcon","isDeprecated","max","iconUrl","showBorder","isTruncated","useGetStakedMoreVeMoreToken","VeMoreStaking","useClaimableVeMoreToken","useViewPendingReward","prepRepayAmount","repayAmount","parsedNumber","abs","useApproveTrans","tokenContract","IERC20","useContractFunction","send","sendApprove","spender","MaxUint256","approveState","state","PNG","JOE","USDCe","USDTe","path","useLiquidationTrans","contractAddress","liquidationContract","DirectFlashLiquidation","sendLiquidation","liquidationState","TransactionErrorDialog","errorMessage","UpdatePriceOracle","inAmount","OracleRegistry","sendUpdateOraclePrice","updateOraclePriceState","useUpdateOraclePrice","WithdrawFees","contractsABI","isYY","feesContract","sendWithdrawFees","withdrawState","useWithdrawFees","AllContracts","strat","PositionsRow","actionArgs","callback","PositionsTable","allStratMeta","data","AllOpenPositions","AdminPage","useParams","AnalyticsBox","subtitle","Analytics","legacyStratMeta","setLegacyStratMeta","legacyToken2Strat","TraderJoeMasterChefStrategy","SimpleHoldingStrategy","MultiTraderJoeMasterChef3Strategy","legacyTokens","legacyStrats","sJoeStrategy","LegacyStrategyViewer","StableLending","useLegacyIsolatedStrategyMetadata","stakeMeta","CurvePoolRewards","flat","feeContractNames","blacklist","contracts","tvlsFarm","tvlNoFarm","legacyTvlNoFarm","supply","curvePoolSL","addressCurvePool","CurvePoolSL","addressCurvePool2","CurvePoolSL2","balance1","balance2","useCurvePoolSLDeposited","colRatio","fees","IFeeReporter","useAllFeesEver","totalFees","fee","total","circulatingBlacklist","VestingLaunchReward","balances","holder","agg","curr","circulatingSupply","useFixedPrecision","fixedPrecisionDigits","templateColumns","gap","hiddenStrategies","TableSearch","setSearchString","marginTop","placeholder","onChange","event","stripped","trim","toLowerCase","TableTabs","setTableTabFilter","lpTickers","meta","singleAssetTickers","deprecatedTickers","AllSupportedCollateral","hiddenTokens","stratRows","has","optionsFiltered","aggStrat","nextStrat","tableTabFilter","searchString","asset","MONEYavailable","minColRatio","ltv","tvlPeg","totalBorrowed","liquidationFee","tooltip","colName","hasArrow","columns","Header","accessor","useTable","getTableProps","getTableBodyProps","headerGroups","prepareRow","wrap","headers","headerGroup","column","render","cells","cell","original","getHeaderGroupProps","getHeaderProps","getRowProps","getCellProps","Dashboard","ErrorBoundary","hasError","errorMsg","errorInfo","this","setState","Component","FarmCard","stake","reward","apr","acquire","allowToggle","defaultIndex","FarmRow","verticalAlign","FarmItem","FarmPage","avaxMorePayload","item","externalData","rewardsCoin","getTokenURL","stakeTokenURL","iMoneyAddress","iMoneyBalance","iMoneyTVL","iMoneyTotalSupply","RouterLink","ClaimIMoney","cprAddress","cprContract","sendClaim","claimState","useClaimIMoney","pendingRewards","marginBottom","direction","marginLeft","TokenAmountInputField","registerForm","setValueForm","errorsForm","isDisabled","isInvalid","required","inputMode","step","autoComplete","autoCorrect","defaultValue","minLength","maxLength","spellCheck","pattern","prefix","shouldDirty","shouldTouch","StakeMoreIMoney","moneyToken","sendDepositIMoney","stakeToken","sAmount","depositState","useStakeIMoney","sendStake","stakeState","useForm","handleSubmitDepForm","handleSubmit","registerDepForm","register","setValueDepForm","setValue","formState","errorsDepForm","errors","isSubmittingDepForm","isSubmitting","watch","moreStakeInput","stakeMoreDisabled","stakeMoreButtonDisabled","onSubmit","justify","isLoading","UnstakeMoreIMoney","iMoneyToken","VeMoreToken","sendWithdrawIMoney","withdrawToken","wAmount","useWithdrawIMoney","sendUnstake","unstakeState","veMoreTokenUnstakeInput","unstakeMoreButtonDisabled","EditMoreIMoney","rowSpan","colSpan","MoreBalanceIMoney","StakingAPRIMoney","lines","IMoneyPage","templateRows","LiquidatablePositions","sendDirectLiquidationCurrent","DirectFlashStable2Liquidation","sendLPTLiquidationCurrent","LPTFlashStable2Liquidation","sendWsMaxiLiquidation","wsMAXIStableLiquidation","sendXJoeLiquidation","xJoeStableLiquidation","LiquidationProtectedLoans","TrancheCard","TrancheRow","stratLabel","TrancheTable","CurrentlyOpenPositions","allPositionMeta","contractName","PositionsPage","align","StakeBox","img","totalStaked","yourStake","buttonLabel","navigate","useNavigate","StakePage","totalStakedXMore","xMore","yourStakeXMore","totalSupplyStakedXMore","totalStakedVeMore","yourStakeVeMore","totalSupplyStakedVeMore","inputStyle","BackButton","cursor","DeprecatedTokenMessage","ChangeStrategyButton","chooseStrategy","ChangeStrategyTable","currentStrategy","ChangeStrategyModal","StrategyNameAndSwitch","chosenStrategy","multipleOptions","stratFilter","textVariant","mx","EnsureWalletConnected","WarningMessage","autoFocus","WNATIVE_ADDRESS","Mainnet","Ropsten","Rinkeby","Goerli","Kovan","Fantom","xDai","BSC","Harmony","Palm","Moonriver","ConfirmPositionModal","confirm","dangerous","DepositBorrow","setData","onClosePopover","isNativeToken","allowResult","useTokenAllowance","allowCV","allowance","etherBalance","useEtherBalance","nativeTokenBalance","lendingContract","sendDepositBorrow","collateralToken","collateralAmount","borrowAmount","cAmount","bAmount","depositBorrowState","useDepositBorrowTrans","WrapNativeStableLending2","useNativeDepositBorrowTrans","sendNativeDepositBorrow","nativeDepositBorrowState","collateralInput","borrowInput","customPercentageInput","extantCollateral","extantDebt","currentPercentage","percentageRange","percentageStep","percentageSteps","percentageLabel","percentages","showWarning","wait","depositBorrowResult","nativeDepositBorrowResult","setTimeout","waitTransactionResult","depositBorrowDisabled","isJoeToken","depositBorrowButtonDisabledForJoe","depositBorrowButtonDisabled","dangerousPosition","marginRight","MINING","RepayWithdraw","handleSubmitRepayForm","registerRepayForm","setValueRepayForm","errorsRepayForm","isSubmittingRepayForm","sendRepayWithdraw","repayWithdrawState","useRepayWithdrawTrans","useNativeRepayWithdrawTrans","sendNativeRepayWithdraw","sendNativeWithdrawState","repayWithdrawDisabled","repayInput","farmInfoIdx","curveLink","farminfo","curvePoolIdx","repayingMoreThanBalance","repayWithdrawButtonDisabled","warningMsgText","residualDebt","EditPosition","CollateralAPY","TitleValue","PositionData","effectiveDebt","currency","StrategyTokenInformation","interestRate","PositionBody","inputPos","highestAPYStrategy","highestAPY","setChosenStrategy","lendingContractAddress","lendingAddress","sendMigrateStrategy","targetStrategy","migrateStrategyState","useMigrateStrategy","strategyToChoose","TokenPageBody","positionMeta","TokenPage","ClaimVeMore","veMoreTokenToken","stakedMore","claimableVeMoreToken","stakedMoreBalance","claimableVeMoreTokenBalance","useClaimVeMore","disabledButton","disabled","StakeMoreVeMore","veMoreTokenContract","useStakeMoreForVeMoreToken","SUCCESS","UnstakeMoreVeMore","veMoreTokenStaked","veMoreTokenBalance","unstakeToken","useUnstakeVeMoreTokenForMore","EditMoreVeMoreToken","MoreBalanceVeMoreToken","veMoreToken","veMoreTokenBalanceOf","useBalanceOfVeMoreToken","StakingAPRVeMoreToken","veMorePage","StakeMore","xMoreContract","stakeMoreToken","useStakeMore","UnstakeMore","xMoreToken","leaveMoreTokenToken","useUnstakeMore","xmoreUnstakeInput","EditMore","MoreBalance","xMoreBalance","StakingAPR","cachedAPR","currentRatio","XMorePage","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","Boolean","hostname","match","ReactDOM","DAppProvider","Localhost","readOnlyChainId","readOnlyUrls","multicallAddresses","bufferGasLimitPercentage","element","document","getElementById","serviceWorker","ready","registration","unregister"],"mappings":"o26wBA0DaA,EACXC,IAAMC,cAAoC,CACxCC,iBAAkB,GAClBC,WAAY,GACZC,aAAc,GACdC,UAAW,GACXC,oBAAqB,GACrBC,wBAAyB,IAAIC,MAG1B,SAASC,EAAT,GAE2B,IADhCC,EAC+B,EAD/BA,SAEA,EAAkCC,mBAChC,IADF,mBAAON,EAAP,KAAkBO,EAAlB,KAGA,EAAgDD,qBAAhD,mBAAOT,EAAP,KAAyBW,EAAzB,KACA,EAAgCF,mBAAqB,IAArD,mBAAOR,EAAP,KAAmBW,EAAnB,KACA,EAAwCH,mBAEtC,IAFF,mBAAOP,EAAP,KAAqBW,EAArB,KAIA,EAAsDJ,mBAEpD,IAFF,mBAAOL,EAAP,KAA4BU,EAA5B,KA4DA,OAxDAC,qBAAU,WACRC,MAAM,yCACHC,MAAK,SAACC,GAAD,OAAcA,EAASC,UAC5BF,KAAKL,GACLQ,OAAM,SAACC,GACNC,QAAQC,MAAM,uBACdD,QAA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AC,IAAD,CAAOpZ,KAAK,QAAQgd,QAAS,cAACnT,GAAD,MAC7B,cAAC,IAAD,CAAO7J,KAAK,aAAagd,QAAS,cAAC1M,GAAD,MAClC,cAAC,IAAD,CACEtQ,KAAK,0BACLgd,QACE,cAACjiB,GAAD,UACE,cAACsU,GAAD,QAIN,cAAC,IAAD,CAAOrP,KAAK,SAASgd,QAAS,cAAClN,GAAD,MAC9B,cAAC,IAAD,CAAO9P,KAAK,aAAagd,QAAS,cAAC7a,GAAD,MAClC,cAAC,IAAD,CAAOnC,KAAK,SAASgd,QAAS,cAACjM,GAAD,MAC9B,cAAC,IAAD,CAAO/Q,KAAK,SAASgd,QAAS,cAACnB,GAAD,MAC9B,cAAC,IAAD,CAAO7b,KAAK,UAAUgd,QAAS,cAAC7N,GAAD,MAC/B,cAAC,IAAD,CAAOnP,KAAK,UAAUgd,QAAS,cAAC,GAAD,MAC/B,cAAC,IAAD,CAAOhd,KAAK,SAASgd,QAAS,cAACjb,GAAD,MAC9B,cAAC,IAAD,CAAO/B,KAAK,oBAAoBgd,QAAS,cAACjb,GAAD,kBAMnDkb,SAASC,eAAe,SDqDpB,kBAAmBvvB,WACrBA,UAAUwvB,cAAcC,MACrBnpC,MAAK,SAACopC,GACLA,EAAaC,gBAEdlpC,OAAM,SAACG,GACND,QAAQC,MAAMA,EAAMe,YChD5BwmC,M","file":"static/js/main.dbadc346.chunk.js","sourcesContent":["import { getAddress } from 'ethers/lib/utils';\nimport React, { useEffect, useState } from 'react';\n\nexport type YYMetadata = Record<\n string,\n { apr: number; apy: number; lastReinvest: { timestamp: number } }\n>;\n\nexport type xMoreMetadata = {\n timestamp: number;\n totalSupply: number;\n moreBalance: number;\n cachedAPR: number;\n currentRatio: number;\n};\n\nexport type YieldFarmingData = {\n asset: string;\n stake: string;\n tvl: number;\n reward: string;\n apr: number;\n getTokenURL: string;\n stakeTokenURL: string;\n};\n\nexport type YieldMonitorMetadata = {\n poolNumber: string;\n symbol0Name: string;\n symbol1Name: string;\n symbol0address: string;\n symbol0price: string;\n symbol1address: string;\n symbol1price: string;\n network: string;\n lpAddress: string;\n coinsASec: number;\n tvl: number;\n apy: number;\n apyDaily: number;\n apyMonthly: number;\n totalApy: number;\n totalApyDaily: number;\n totalApyMonthly: number;\n extraRewards: string;\n isActive: boolean;\n rewardsCoin: string;\n};\n\nexport type ExternalMetadataType = {\n yieldFarmingData: YieldFarmingData[];\n yyMetadata: YYMetadata;\n yieldMonitor: Record;\n xMoreData: xMoreMetadata;\n additionalYieldData: Record>;\n underlyingStrategyNames: Map;\n};\n\nexport const ExternalMetadataContext =\n React.createContext({\n yieldFarmingData: [],\n yyMetadata: {},\n yieldMonitor: {},\n xMoreData: {} as xMoreMetadata,\n additionalYieldData: {},\n underlyingStrategyNames: new Map()\n });\n\nexport function ExternalMetadataCtxProvider({\n children,\n}: React.PropsWithChildren) {\n const [xMoreData, setXMoreData] = useState(\n {} as xMoreMetadata\n );\n const [yieldFarmingData, setYieldFarmingData] = useState();\n const [yyMetadata, setYYMeta] = useState({});\n const [yieldMonitor, setYieldMonitor] = useState<\n Record\n >({});\n\n const [additionalYieldData, setAdditionalYieldData] = useState<\n Record>\n >({});\n\n useEffect(() => {\n fetch('https://staging-api.yieldyak.com/apys')\n .then((response) => response.json())\n .then(setYYMeta)\n .catch((err) => {\n console.error('Failed to fetch URL');\n console.error(err);\n });\n\n fetch(\n 'https://raw.githubusercontent.com/MoreMoney-Finance/craptastic-api/main/src/yield-monitor.json'\n )\n .then((response) => response.json())\n .then((response) => {\n const ymData: Record = {};\n for (const r of response) {\n const a = getAddress(r.lpAddress);\n if (!(a in ymData) || r.totalApy > ymData[a].totalApy) {\n ymData[a] = r;\n }\n }\n setYieldMonitor(ymData);\n })\n .catch((err) => {\n console.error('Failed to fetch URL');\n console.error(err);\n });\n fetch(\n 'https://raw.githubusercontent.com/MoreMoney-Finance/craptastic-api/main/src/yield-farming.json'\n )\n .then((response) => response.json())\n .then((response) => setYieldFarmingData(response))\n .catch((err) => {\n console.error('Failed to fetch URL');\n console.error(err);\n });\n\n fetch(\n 'https://raw.githubusercontent.com/MoreMoney-Finance/craptastic-api/main/src/xmore-data.json'\n )\n .then((response) => response.json())\n .then((response) => setXMoreData(response))\n .catch((err) => {\n console.error('Failed to fetch URL');\n console.error(err);\n });\n fetch(\n 'https://raw.githubusercontent.com/MoreMoney-Finance/craptastic-api/main/src/additional-yield.json'\n )\n .then((response) => response.json())\n .then((response) => setAdditionalYieldData(response))\n .catch((err) => {\n console.error('Failed to fetch URL');\n console.error(err);\n });\n }, []);\n return (\n \n {children}\n \n );\n}\n","import { CallResult } from '@usedapp/core';\nimport {\n ContractMethodNames,\n TypedContract,\n} from '@usedapp/core/dist/esm/src/model/types';\n\nexport function handleCallResultDefault(\n result: CallResult>,\n defaultResult: any,\n description: string,\n raw = false\n) {\n if (result === undefined) {\n return defaultResult;\n } else if (result?.error) {\n console.error(`${description}: ${result.error.message}`);\n return defaultResult;\n }\n return raw ? result?.value : result?.value?.[0];\n}\n","import { BigNumber } from '@ethersproject/bignumber';\nimport {\n ChainId,\n CurrencyValue,\n NativeCurrency,\n Token,\n useCall,\n} from '@usedapp/core';\nimport { getAddress, Interface, parseUnits } from 'ethers/lib/utils';\nimport tokenlist from '../constants/tokenlist.json';\nimport deployAddresses from '../contracts/addresses.json';\nimport lptokens from '../contracts/lptokens.json';\nimport { ParsedPositionMetaRow, useAddresses, useStable } from './contracts';\nimport OracleRegistry from '../contracts/artifacts/contracts/OracleRegistry.sol/OracleRegistry.json';\nimport { Contract } from 'ethers';\nimport { handleCallResultDefault } from './wrapper';\n\nconst addressToken: Record> = Object.fromEntries(\n Object.values(ChainId).map((key) => [key, new Map()])\n) as any;\nconst addressIcons: Map = new Map();\nconst addressAuxIcon: Map = new Map();\n\nexport function getTokenFromAddress(\n chainId: ChainId | undefined,\n address: string\n): Token {\n return addressToken[chainId ?? ChainId.Avalanche].get(getAddress(address))!;\n}\n\nexport function getIconsFromTokenAddress(address: string): string[] {\n return addressIcons.get(getAddress(address)) ?? [];\n}\n\nexport function getAuxIconFromTokenAddress(\n address: string\n): string | undefined {\n return addressAuxIcon.get(getAddress(address));\n}\n\nexport function tokenAmount(\n chainId: ChainId,\n tokenAddress: string,\n amount: BigNumber\n) {\n const token = addressToken[chainId].get(getAddress(tokenAddress));\n if (token) {\n return new CurrencyValue(token, amount);\n }\n}\n\nexport function getTokensInQuestion(_chainId: ChainId): [string, Token][] {\n if (_chainId === undefined) {\n return [];\n }\n const tokensInQuestion = Array.from(addressToken[_chainId].entries()).filter(\n (aT) => aT[1].chainId === _chainId\n );\n // console.log('tokens in question');\n // console.log(Array.from(addressToken[_chainId].entries()));\n // console.log(tokensInQuestion);\n\n return tokensInQuestion;\n}\n\nfor (const {\n address,\n chainId,\n decimals,\n name,\n symbol,\n logoURI,\n} of tokenlist.tokens) {\n addressToken[chainId as ChainId].set(\n getAddress(address),\n new Token(name, symbol, chainId, getAddress(address), decimals)\n );\n addressIcons.set(getAddress(address), [logoURI]);\n}\n\nexport enum LiquidationType {\n LPT,\n Direct,\n}\n\nexport type LiquidationParams = {\n liqType: LiquidationType;\n router: string;\n};\n\nconst liquidationParams = new Map();\n\n// TODO make this more complete\nconst chainIds: Record = {\n 31337: ChainId.Hardhat,\n 43114: ChainId.Avalanche,\n};\n\nconst exchangeIcons: Record = {\n JPL: 'https://raw.githubusercontent.com/pangolindex/tokens/main/assets/0x6e84a6216eA6dACC71eE8E6b0a5B7322EEbC0fDd/logo.png',\n PGL: 'https://raw.githubusercontent.com/pangolindex/tokens/main/assets/0x60781C2586D68229fde47564546784ab3fACA982/logo.png',\n};\n\nconst exchangeRouters: Record = {\n JPL: '0x60aE616a2155Ee3d9A68541Ba4544862310933d4',\n PGL: '0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106',\n};\n\nliquidationParams.set('0x60781C2586D68229fde47564546784ab3fACA982', {\n router: exchangeRouters.PGL,\n liqType: LiquidationType.Direct,\n});\nliquidationParams.set('0x59414b3089ce2AF0010e7523Dea7E2b35d776ec7', {\n router: exchangeRouters.PGL,\n liqType: LiquidationType.Direct,\n});\n\nfor (const [chainId, lpTokensPerChain] of Object.entries(lptokens) as [\n string,\n Record>\n][]) {\n for (const [exchange, records] of Object.entries(lpTokensPerChain)) {\n for (const [longTicker, record] of Object.entries(records)) {\n if (\n 'pairAddress' in record &&\n record.pairAddress &&\n longTicker !== 'JPL-WAVAX-WBTCe'\n ) {\n const ticker = longTicker.split('-').slice(1).join('/');\n addressToken[chainIds[chainId]].set(\n getAddress(record.pairAddress),\n new Token(\n longTicker,\n ticker,\n chainIds[chainId],\n getAddress(record.pairAddress),\n 18\n )\n );\n const icons: string[] = [];\n icons.push(\n ...(addressIcons.get(getAddress(record.addresses[0])) ?? [])\n );\n icons.push(\n ...(addressIcons.get(getAddress(record.addresses[1])) ?? [])\n );\n\n addressIcons.set(getAddress(record.pairAddress), icons);\n addressAuxIcon.set(\n getAddress(record.pairAddress),\n exchangeIcons[exchange]\n );\n\n liquidationParams.set(getAddress(record.pairAddress), {\n router: exchangeRouters[exchange],\n liqType: LiquidationType.LPT,\n });\n }\n }\n }\n}\n\nexport function getLiquidationParams(\n pos: ParsedPositionMetaRow\n): LiquidationParams {\n return (\n liquidationParams.get(getAddress(pos.token.address)) ?? {\n router: exchangeRouters.JPL,\n liqType: LiquidationType.Direct,\n }\n );\n}\n\nfor (const [chainId, addresses] of Object.entries(deployAddresses)) {\n addressToken[chainIds[chainId]].set(\n getAddress(addresses.Stablecoin),\n new Token(\n 'Moremoney USD',\n 'MONEY',\n chainIds[chainId],\n getAddress(addresses.Stablecoin),\n 18\n )\n );\n addressIcons.set(getAddress(addresses.Stablecoin), [\n 'https://raw.githubusercontent.com/MoreMoney-Finance/logos/main/Coin-Logo-FINAL.jpg',\n ]);\n\n if ('CurvePool' in addresses) {\n addressToken[chainIds[chainId]].set(\n getAddress(addresses.CurvePool),\n new Token(\n 'Money Curve MetaPool Token',\n 'MONEYCRV',\n chainIds[chainId],\n getAddress(addresses.CurvePool)\n )\n );\n }\n\n if ('StableLending2InterestForwarder' in addresses) {\n addressToken[chainIds[chainId]].set(\n getAddress(addresses.StableLending2InterestForwarder),\n new Token(\n 'iMoney',\n 'iMoney',\n chainIds[chainId],\n getAddress(addresses.StableLending2InterestForwarder),\n 18\n )\n );\n addressIcons.set(getAddress(addresses.StableLending2InterestForwarder), [\n 'https://raw.githubusercontent.com/MoreMoney-Finance/logos/main/Coin-Logo-FINAL.jpg',\n ]);\n }\n\n if ('MoreToken' in addresses) {\n addressToken[chainIds[chainId]].set(\n getAddress(addresses['MoreToken']),\n new Token(\n 'More Token',\n 'MORE',\n chainIds[chainId],\n getAddress(addresses['MoreToken'])\n )\n );\n addressIcons.set(getAddress(addresses['MoreToken']), [\n 'https://raw.githubusercontent.com/MoreMoney-Finance/logos/main/Moremoney_05.jpg',\n ]);\n }\n\n if ('VeMoreToken' in addresses) {\n addressToken[chainIds[chainId]].set(\n getAddress(addresses['VeMoreToken']),\n new Token(\n 'veMore Token',\n 'veMore',\n chainIds[chainId],\n getAddress(addresses['VeMoreToken'])\n )\n );\n addressIcons.set(getAddress(addresses['VeMoreToken']), [\n 'https://raw.githubusercontent.com/MoreMoney-Finance/logos/main/Moremoney_05.jpg',\n ]);\n }\n\n if ('xMore' in addresses) {\n addressToken[chainIds[chainId]].set(\n getAddress(addresses['xMore']),\n new Token(\n 'xMore Token',\n 'xMORE',\n chainIds[chainId],\n getAddress(addresses['xMore'])\n )\n );\n addressIcons.set(getAddress(addresses['xMore']), [\n 'https://raw.githubusercontent.com/MoreMoney-Finance/logos/main/xMORE%20logo.png',\n ]);\n }\n}\n\nexport const nativeCurrency: Map = new Map();\n\nnativeCurrency.set(\n ChainId.Hardhat,\n new NativeCurrency('Avalanche', 'AVAX', ChainId.Hardhat)\n);\nnativeCurrency.set(\n ChainId.Avalanche,\n new NativeCurrency('Avalanche', 'AVAX', ChainId.Avalanche)\n);\n\nexport const wrappedNativeCurrency: Map = new Map();\n\nwrappedNativeCurrency.set(\n ChainId.Hardhat,\n addressToken[ChainId.Hardhat].get(\n '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7'\n )!\n);\nwrappedNativeCurrency.set(\n ChainId.Avalanche,\n addressToken[ChainId.Avalanche].get(\n '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7'\n )!\n);\n\nexport function useOraclePrices(\n tokens: Token[]\n): Record {\n const addresses = useAddresses();\n\n const address = addresses.OracleRegistry;\n const abi = new Interface(OracleRegistry.abi);\n const tokenAddresses = tokens.map((token) => token.address);\n const tokenInAmounts = tokens.map((token) => parseUnits('1', token.decimals));\n const stable = useStable();\n const method = 'viewAmountsInPeg';\n const args = [tokenAddresses, tokenInAmounts, stable.address];\n const contract = new Contract(address, abi);\n\n const pegValues = handleCallResultDefault(\n useCall({\n contract,\n method,\n args,\n }),\n [],\n 'OracleRegistry'\n );\n\n return Object.fromEntries(\n pegValues.map((v: BigNumber, i: number) => [\n tokens[i].address,\n new CurrencyValue(stable, v),\n ])\n );\n}\n","import { useEthers } from '@usedapp/core';\nimport React from 'react';\nimport { useLocation } from 'react-router-dom';\n\nexport const UserAddressContext = React.createContext<\n string | null | undefined\n>(undefined);\n\nexport function UserAddressCtxProvider({\n children,\n}: React.PropsWithChildren) {\n const { account } = useEthers();\n const { search } = useLocation();\n const userAddress = new URLSearchParams(search).get('account');\n\n return (\n \n {children}\n \n );\n}\n","import {\n Call,\n CurrencyValue,\n ERC20Interface,\n Token,\n useCalls,\n useEthers,\n} from '@usedapp/core';\nimport { Contract } from 'ethers';\nimport { getAddress } from 'ethers/lib/utils';\nimport React, { useContext } from 'react';\nimport { getTokensInQuestion } from '../chain-interaction/tokens';\nimport { UserAddressContext } from './UserAddressContext';\n\nexport const WalletBalancesContext = React.createContext<\n Map\n>(new Map());\n\nexport function WalletBalancesCtxProvider({\n children,\n}: React.PropsWithChildren) {\n const { chainId } = useEthers();\n const account = useContext(UserAddressContext);\n\n const tokenBalances = new Map();\n\n function convert2ContractCall(aT: [string, Token]) {\n return {\n contract: new Contract(aT[0], ERC20Interface),\n method: 'balanceOf',\n args: [account],\n };\n }\n const tokensInQuestion = getTokensInQuestion(chainId!);\n const calls: Call[] = account\n ? tokensInQuestion.map(convert2ContractCall)\n : [];\n const results = (useCalls(calls) ?? []).map((x) => (x ?? { value: undefined }).value);\n results?.forEach((result: any[] | undefined, index: number) => {\n if (result) {\n const [tokenAddress, token] = tokensInQuestion[index];\n tokenBalances.set(\n getAddress(tokenAddress),\n new CurrencyValue(token, result[0])\n );\n // console.log(\n // `Set balance for ${token.name}: ${result[0]} (${tokenAddress})`\n // );\n // } else {\n // const [tokenAddress, token] = tokensInQuestion[index];\n // console.log(`No result for ${token.name} at ${tokenAddress}`);\n }\n });\n\n return (\n \n {children}\n \n );\n}\n\nexport function useWalletBalance(tokenAddress: string | undefined | null) {\n const account = useContext(UserAddressContext);\n const ctxAccount = useContext(UserAddressContext);\n const balancesCtx = useContext(WalletBalancesContext);\n\n return tokenAddress && account === ctxAccount\n ? balancesCtx.get(getAddress(tokenAddress))\n : undefined;\n}\n","import { CurrencyValue, useEthers } from '@usedapp/core';\nimport WalletConnectProvider from '@walletconnect/web3-provider';\nimport { BigNumber, ethers } from 'ethers';\nimport { useEffect, useState } from 'react';\nimport Web3Modal from 'web3modal';\n\nexport function sqrt(value: BigNumber): BigNumber {\n const ONE = ethers.BigNumber.from(1);\n const TWO = ethers.BigNumber.from(2);\n const x = ethers.BigNumber.from(value);\n let z = x.add(ONE).div(TWO);\n let y = x;\n while (z.sub(y).isNegative()) {\n y = z;\n z = x.div(z).add(z).div(TWO);\n }\n return y;\n}\n\nexport function parseFloatNoNaN(input: string) {\n const parsed = parseFloat(input);\n return isNaN(parsed) ? 0 : parsed;\n}\nexport function parseFloatCurrencyValue(input: CurrencyValue) {\n const parsed = parseFloatNoNaN(\n input.format({\n significantDigits: Infinity,\n suffix: '',\n thousandSeparator: '',\n decimalSeparator: '.',\n })\n );\n return isNaN(parsed) ? 0 : parsed;\n}\nexport function formatNumber(input: number) {\n if (input) {\n return input.toLocaleString('en-US', {});\n } else {\n return (0).toLocaleString('en-US', {});\n }\n}\n\nexport function useConnectWallet() {\n const { activate } = useEthers();\n const providerOptions = {\n injected: {\n package: 'metamask',\n },\n walletconnect: {\n package: WalletConnectProvider,\n options: {\n infuraId: '27e484dcd9e3efcfd25a83a78777cdf1', // required\n },\n },\n };\n async function onConnect() {\n try {\n const web3Modal = new Web3Modal({\n providerOptions, // required\n theme: 'dark',\n });\n\n const provider = await web3Modal.connect();\n await activate(provider);\n } catch (error) {\n console.error(error);\n }\n }\n return { onConnect };\n}\n\nexport function useContractName(address: string | undefined) {\n const [name, setName] = useState(undefined);\n useEffect(() => {\n if (address) {\n fetch(`https://api.snowtrace.io/api?module=contract&action=getsourcecode&address=${address}`)\n .then(response => response.json())\n .then(data => setName(data.result[0].ContractName));\n }\n }, [address]);\n\n return name;\n}\n\nexport async function getContractNames(underlyingAddresses: Set) {\n console.log('Getting contract names');\n\n const names = new Map();\n\n for (const address of underlyingAddresses) {\n const result = await (await fetch(`https://api.snowtrace.io/api?module=contract&action=getsourcecode&address=${address}`)).json();\n console.log(`Setting contract name ${address}: ${result.result[0].ContractName}`);\n const name = result.result[0].ContractName;\n if (!name) {\n console.log(`Trying to query for ${address}`, result);\n }\n names.set(address, name && spacecamel(name.replace('Strategy', '')));\n }\n\n console.log('Finished getting contract names');\n return names;\n}\n\nfunction spacecamel(s:string){\n return s.replace(/([a-z])([A-Z])/g, '$1 $2');\n}","import {\n formatEther,\n formatUnits,\n parseEther,\n parseUnits,\n} from '@ethersproject/units';\nimport {\n Call,\n ChainId,\n CurrencyValue,\n ERC20Interface,\n Token,\n useCall,\n useCalls,\n useEthers,\n} from '@usedapp/core';\nimport { BigNumber, Contract, ethers } from 'ethers';\nimport { getAddress, Interface, parseBytes32String } from 'ethers/lib/utils';\nimport React, { useContext, useState } from 'react';\nimport {\n ExternalMetadataContext,\n YieldMonitorMetadata,\n YYMetadata,\n} from '../contexts/ExternalMetadataContext';\nimport { WalletBalancesContext } from '../contexts/WalletBalancesContext';\nimport ERC20 from '../contracts/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json';\nimport xMore from '../contracts/artifacts/contracts/governance/xMore.sol/xMore.json';\nimport InterestRateController from '../contracts/artifacts/contracts/InterestRateController.sol/InterestRateController.json';\nimport OracleRegistry from '../contracts/artifacts/contracts/OracleRegistry.sol/OracleRegistry.json';\nimport iMoney from '../contracts/artifacts/contracts/rewards/iMoney.sol/iMoney.json';\nimport VestingLaunchReward from '../contracts/artifacts/contracts/rewards/VestingLaunchReward.sol/VestingLaunchReward.json';\nimport VestingStakingRewards from '../contracts/artifacts/contracts/rewards/VestingStakingRewards.sol/VestingStakingRewards.json';\nimport Stablecoin from '../contracts/artifacts/contracts/Stablecoin.sol/Stablecoin.json';\nimport StableLending2 from '../contracts/artifacts/contracts/StableLending2.sol/StableLending2.json';\nimport YieldConversionStrategy from '../contracts/artifacts/contracts/strategies/YieldConversionStrategy.sol/YieldConversionStrategy.json';\nimport StrategyViewer from '../contracts/artifacts/contracts/StrategyViewer.sol/StrategyViewer.json';\nimport IFeeReporter from '../contracts/artifacts/interfaces/IFeeReporter.sol/IFeeReporter.json';\nimport IStrategy from '../contracts/artifacts/interfaces/IStrategy.sol/IStrategy.json';\nimport { getContractNames, parseFloatCurrencyValue, sqrt } from '../utils';\nimport { getTokenFromAddress, tokenAmount } from './tokens';\nimport { useCoingeckoPrice } from '@usedapp/coingecko';\nimport {\n masterPlatypusPool,\n tokenPerSecMoneyAddress,\n tokenPerSecUSDCAddress,\n tvlMoneyAddress,\n tvlUSDCAddress,\n} from '../constants/platypus-pool';\nimport { handleCallResultDefault } from './wrapper';\n// import earnedRewards from '../constants/earned-rewards.json';\n// import rewardsRewards from '../constants/rewards-rewards.json';\n/* eslint-disable */\nexport const addresses: Record<\n string,\n DeploymentAddresses\n> = require('../contracts/addresses.json');\n\nexport type DeploymentAddresses = {\n Fund: string;\n Roles: string;\n IsolatedLendingLiquidation: string;\n DependencyController: string;\n OracleRegistry: string;\n Stablecoin: string;\n StrategyRegistry: string;\n TrancheIDService: string;\n TraderJoeMasterChefStrategy: string;\n TraderJoeMasterChef2Strategy: string;\n YieldYakAVAXStrategy: string;\n SimpleHoldingStrategy: string;\n YieldYakStrategy: string;\n PangolinMiniChefStrategy: string;\n AMMYieldConverter: string;\n WrapNativeIsolatedLending: string;\n DirectFlashLiquidation: string;\n LPTFlashLiquidation: string;\n\n MoreToken: string;\n xMore: string;\n\n StableLendingLiquidation: string;\n DirectFlashStableLiquidation: string;\n DirectFlashStable2Liquidation: string;\n LPTFlashStableLiquidation: string;\n LPTFlashStable2Liquidation: string;\n wsMAXIStableLiquidation: string;\n xJoeStableLiquidation: string;\n WrapNativeStableLending: string;\n sJoeStrategy: string;\n\n VestingLaunchReward: string;\n\n CurvePool: string;\n CurvePoolSL: string;\n CurvePoolSL2: string;\n StrategyViewer: string;\n LegacyStrategyViewer: string;\n\n LiquidYieldStrategy: string;\n MultiTraderJoeMasterChef3Strategy: string;\n InterestRateController: string;\n VeMoreToken: string;\n VeMoreStaking: string;\n StableLending2: string;\n YieldYakAVAXStrategy2: string;\n AltYieldYakAVAXStrategy2: string;\n YieldYakStrategy2: string;\n WrapNativeStableLending2: string;\n StableLending2Liquidation: string;\n StableLending2InterestForwarder: string;\n iMoney: string;\n OldYieldYakAVAXStrategy2: string;\n CurvePoolRewards: string;\n StableLending: string;\n};\n\nexport function useAddresses() {\n const { chainId } = useEthers();\n\n // TODO make the default avalanche once it's supported by useDApp\n const chainIdStr = chainId ? chainId.toString() : '43114';\n return addresses[chainIdStr];\n}\n\nexport function useIsolatedLendingView(\n method: string,\n args: any[],\n defaultResult: any\n) {\n const addresses = useAddresses();\n\n const abi = new Interface(StableLending2.abi);\n const contract = new Contract(addresses.StableLending2, abi);\n return {\n legacy: handleCallResultDefault(\n useCall({\n contract,\n method,\n args,\n }),\n defaultResult,\n 'legacy isolated lending view'\n ),\n current: handleCallResultDefault(\n useCall({\n contract,\n method,\n args,\n }),\n defaultResult,\n 'current isolated lending view'\n ),\n };\n}\n\ntype RawStratMetaRow = {\n debtCeiling: BigNumber;\n APF: BigNumber;\n borrowablePer10k: BigNumber;\n mintingFee: BigNumber;\n stabilityFee: BigNumber;\n strategy: string;\n strategyName: string;\n token: string;\n totalCollateral: BigNumber;\n totalDebt: BigNumber;\n valuePer1e18: BigNumber;\n tvl: BigNumber;\n harvestBalance2Tally: BigNumber;\n yieldType: number;\n underlyingStrategy?: string;\n};\n\nexport enum TxStatus {\n NONE = 'None',\n MINING = 'Mining',\n SUCCESS = 'Success',\n}\n\nexport enum YieldType {\n REPAYING = 'REPAYING',\n COMPOUNDING = 'COMPOUNDING',\n NOYIELD = 'NO YIELD',\n}\n\nexport type ParsedStratMetaRow = {\n debtCeiling: CurrencyValue;\n totalDebt: CurrencyValue;\n stabilityFeePercent: number;\n mintingFeePercent: number;\n strategyAddress: string;\n token: Token;\n APY: number;\n totalCollateral: CurrencyValue;\n borrowablePercent: number;\n usdPrice: number;\n strategyName: string;\n tvlInToken: CurrencyValue;\n tvlInPeg: CurrencyValue;\n harvestBalance2Tally: CurrencyValue;\n yieldType: YieldType;\n balance: number;\n selfRepayingAPY: number;\n compoundingAPY: number;\n underlyingStrategy: string;\n underlyingStrategyName: string | undefined;\n};\n\nfunction parseStratMeta(\n chainId: ChainId,\n row: RawStratMetaRow,\n stable: Token,\n balancesCtx: Map,\n yyMetadata: YYMetadata,\n globalMoneyAvailable: BigNumber,\n yieldMonitor: Record,\n additionalYield: Record>,\n underlyingStrategyName: string | undefined\n): ParsedStratMetaRow | undefined {\n const token = getTokenFromAddress(chainId, row.token);\n if (token) {\n const tvlInToken = tokenAmount(chainId, row.token, row.tvl)!;\n const balance =\n balancesCtx.get(token!.address) ??\n new CurrencyValue(token, BigNumber.from('0'));\n\n const strategyAddress = getAddress(row.strategy);\n const underlyingAddress = row.underlyingStrategy\n ? getAddress(row.underlyingStrategy)\n : strategyAddress;\n\n const APY =\n strategyAddress === addresses[chainId].LiquidYieldStrategy\n ? token.address === '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7'\n ? (yieldMonitor['0x4b946c91C2B1a7d7C40FB3C130CdfBaf8389094d']\n ?.totalApy *\n 0.65 *\n 0.8) /\n 0.5\n : (yieldMonitor['0x4b946c91C2B1a7d7C40FB3C130CdfBaf8389094d']\n ?.totalApy *\n 0.3 *\n 0.2) /\n 0.5 +\n 7.2\n : underlyingAddress in yyMetadata\n ? yyMetadata[underlyingAddress]?.apy * 0.9\n : token.address in yieldMonitor\n ? yieldMonitor[token.address]?.totalApy\n : token.address in additionalYield &&\n strategyAddress in additionalYield[token.address]\n ? additionalYield[token.address][strategyAddress]\n : 0;\n const selfRepayingAPY =\n row.yieldType === 0\n ? strategyAddress === addresses[chainId].LiquidYieldStrategy\n ? token.address === '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7'\n ? ((yieldMonitor['0x4b946c91C2B1a7d7C40FB3C130CdfBaf8389094d']\n ?.totalApy -\n parseFloat(\n yieldMonitor[\n '0x4b946c91C2B1a7d7C40FB3C130CdfBaf8389094d'\n ]?.apy.toString()\n )) *\n 0.65 *\n 0.8) /\n 0.5\n : ((yieldMonitor['0x4b946c91C2B1a7d7C40FB3C130CdfBaf8389094d']\n ?.totalApy -\n parseFloat(\n yieldMonitor[\n '0x4b946c91C2B1a7d7C40FB3C130CdfBaf8389094d'\n ]?.apy.toString()\n )) *\n 0.3 *\n 0.2) /\n 0.5\n : token.address in yieldMonitor\n ? yieldMonitor[token.address]?.totalApy -\n parseFloat(yieldMonitor[token.address]?.apy.toString())\n : token.address in additionalYield &&\n strategyAddress in additionalYield[token.address]\n ? additionalYield[token.address][strategyAddress]\n : 0\n : 0;\n\n const compoundingAPY =\n strategyAddress === addresses[chainId].LiquidYieldStrategy &&\n token.address !== '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7'\n ? 7.2\n : row.yieldType === 0 && token.address in yieldMonitor\n ? parseFloat(yieldMonitor[token.address]?.apy.toString())\n : strategyAddress === addresses[chainId].YieldYakStrategy ||\n strategyAddress === addresses[chainId].YieldYakAVAXStrategy\n ? APY\n : 0;\n\n let syntheticDebtCeil = globalMoneyAvailable.add(row.totalDebt);\n\n const trueOne = parseUnits('1', token.decimals);\n const valPerOne = trueOne.mul(row.valuePer1e18).div(parseEther('1'));\n\n return {\n debtCeiling: new CurrencyValue(\n stable,\n row.debtCeiling.gt(syntheticDebtCeil)\n ? syntheticDebtCeil\n : row.debtCeiling\n ),\n totalDebt: new CurrencyValue(stable, row.totalDebt),\n stabilityFeePercent: row.stabilityFee.toNumber() / 100,\n mintingFeePercent: row.mintingFee.toNumber() / 100,\n strategyAddress,\n token,\n APY,\n totalCollateral: tokenAmount(chainId, row.token, row.totalCollateral)!,\n borrowablePercent: row.borrowablePer10k.toNumber() / 100,\n usdPrice:\n parseFloat(formatEther(row.valuePer1e18)) / 10 ** (18 - token.decimals),\n strategyName: parseBytes32String(row.strategyName),\n tvlInToken,\n tvlInPeg: new CurrencyValue(stable, row.tvl.mul(valPerOne).div(trueOne)),\n harvestBalance2Tally: new CurrencyValue(stable, row.harvestBalance2Tally),\n yieldType: [YieldType.REPAYING, YieldType.COMPOUNDING, YieldType.NOYIELD][\n row.yieldType\n ],\n balance: parseFloatCurrencyValue(balance),\n selfRepayingAPY: selfRepayingAPY,\n compoundingAPY: compoundingAPY,\n underlyingStrategy: underlyingAddress,\n underlyingStrategyName,\n };\n }\n}\n\nexport function useTotalDebt(defaultResult: any) {\n const addresses = useAddresses();\n const abi = new Interface(StableLending2.abi);\n const contract = new Contract(addresses.StableLending2, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'totalDebt',\n args: [],\n }),\n defaultResult,\n 'useTotalDebt'\n );\n}\n\nexport type IMoneyAccountInfo = {\n depositAmount: BigNumber;\n lastCumulRewardSimple: number;\n lastCumulRewardWeighted: number;\n factor: BigNumber;\n};\nexport function useIMoneyAccountInfo(account: string): IMoneyAccountInfo {\n const addresses = useAddresses();\n const abi = new Interface(iMoney.abi);\n const contract = new Contract(addresses.iMoney, abi);\n const res = handleCallResultDefault(\n useCall({\n contract,\n method: 'accounts',\n args: [account],\n }),\n {},\n 'useIMoneyAccountInfo',\n true\n );\n\n return {\n depositAmount: res?.depositAmount ?? BigNumber.from(0),\n lastCumulRewardSimple: res?.lastCumulRewardSimple ?? 0,\n lastCumulRewardWeighted: res?.lastCumulRewardWeighted ?? 0,\n factor: res?.factor ?? BigNumber.from(0),\n };\n}\n\nexport function useIMoneyTotalWeights(defaultResult: any) {\n const addresses = useAddresses();\n const abi = new Interface(iMoney.abi);\n const contract = new Contract(addresses.iMoney, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'totalWeights',\n args: [],\n }),\n defaultResult,\n 'useIMoneyTotalWeights'\n );\n}\n\nexport function useBoostedSharePer10k(defaultResult: any) {\n const addresses = useAddresses();\n const abi = new Interface(iMoney.abi);\n const contract = new Contract(addresses.iMoney, abi);\n return (\n handleCallResultDefault(\n useCall({\n contract,\n method: 'boostedSharePer10k',\n args: [],\n }),\n defaultResult,\n 'useBoostedSharePer10k'\n ) / 100\n );\n}\n\nexport function useInterestRate(defaultResult: any) {\n const addresses = useAddresses();\n const abi = new Interface(InterestRateController.abi);\n const contract = new Contract(addresses.InterestRateController, abi);\n return (\n handleCallResultDefault(\n useCall({\n contract,\n method: 'currentRatePer10k',\n args: [],\n }),\n defaultResult,\n 'useInterestRate'\n ) / 100\n );\n}\n\nconst COMPOUNDING = 52;\n\nfunction convertAPF2APY(APF: BigNumber): number {\n const apf = APF.toNumber();\n return 100 * ((1 + (apf / 10000 - 1) / COMPOUNDING) ** COMPOUNDING - 1);\n}\n\nexport function useStable() {\n const { chainId } = useEthers();\n const addresses = useAddresses();\n return getTokenFromAddress(\n chainId ? (chainId as unknown as ChainId) : ChainId.Avalanche,\n addresses.Stablecoin\n )!;\n}\n\nexport type StrategyMetadata = Record<\n string,\n Record\n>;\n\n// export async function queryStratMeta(library: any) {\n// const wsm = (await new ethers.Contract('0x21c971d78e1a398710d964ed1ac4c80e5940ed25', new Interface(IStrategy.abi), library).viewStrategyMetadata(\n// '0x2148D1B21Faa7eb251789a51B404fc063cA6AAd6'\n// ));\n\n// console.log('wsm', wsm);\n\n// for (let contract of [\n// '0xdfa3bcda5f954a1e6cef247bdfa89f15702a7473',\n// // '0x21c971d78e1a398710d964ed1ac4c80e5940ed25',\n// // '0x0db20d1643112fa00c4d3ddb58369ad26c1f7c1d',\n// '0xaa3ea561a656cbe310f2e10981085da2d989f17e',\n// '0x888fc8d90177a4097e196ef6bbdc7d2e8cffdb17',\n// '0x10d71115360f9129623096e8108bc6856cf86d3a',\n// ]) {\n// const contrac = new ethers.Contract(\n// contract,\n// new Interface(IsolatedLending.abi),\n// library\n// );\n// console.log('querying', contract);\n// const result = await contrac.viewAllStrategyMetadata();\n// console.log('Returened strat meta', contract, result);\n// }\n// return undefined;\n// }\n\nconst requestedStrategyNames = new Set();\nlet underlyingStrategyNames = new Map();\n\nexport function useIsolatedStrategyMetadata(): StrategyMetadata {\n const [stratMeta, setStratMeta] = useState({});\n const stable = useStable();\n const { chainId } = useEthers();\n\n const globalDebtCeiling = useGlobalDebtCeiling(\n 'globalDebtCeiling',\n [],\n BigNumber.from(0)\n );\n const totalSupply = useTotalSupply('totalSupply', [], BigNumber.from(0));\n\n const balancesCtx = useContext(WalletBalancesContext);\n const { yyMetadata, yieldMonitor, additionalYieldData } = useContext(\n ExternalMetadataContext\n );\n\n const addresses = useAddresses();\n\n const token2Strat = {\n ['0x2b2C81e08f1Af8835a78Bb2A90AE924ACE0eA4bE']: addresses.YieldYakStrategy2,\n ['0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7']:\n addresses.YieldYakAVAXStrategy2,\n };\n\n // const masterChef2Tokens = [\n // '0x57319d41f71e81f3c65f2a47ca4e001ebafd4f33',\n // '0xa389f9430876455c36478deea9769b7ca4e3ddb1',\n // '0xed8cbd9f0ce3c6986b22002f03c6475ceb7a6256',\n // ].map(getAddress);\n\n const tokens = Object.keys(token2Strat);\n const strats = Object.values(token2Strat);\n\n tokens.push('0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7');\n strats.push(addresses.AltYieldYakAVAXStrategy2);\n tokens.push('0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7');\n strats.push(addresses.OldYieldYakAVAXStrategy2);\n\n const globalMoneyAvailable = globalDebtCeiling.sub(totalSupply);\n\n React.useEffect(() => {\n const underlyingAddresses = new Set(\n Object.values(stratMeta)\n .flatMap((rowsPerToken) =>\n Object.values(rowsPerToken).map((row) => row.underlyingStrategy)\n )\n .filter((x) => x)\n );\n\n for (const extant of requestedStrategyNames) {\n underlyingAddresses.delete(extant);\n }\n\n if (underlyingAddresses.size > 0) {\n for (const newAddress of underlyingAddresses) {\n requestedStrategyNames.add(newAddress);\n }\n getContractNames(underlyingAddresses).then((names) => {\n const newUnderlyingNames = new Map([\n ...underlyingStrategyNames,\n ...names,\n ]);\n underlyingStrategyNames = newUnderlyingNames;\n setStratMeta(\n Object.fromEntries(\n Object.entries(stratMeta).map(([t, rows]) => [\n t,\n Object.fromEntries(\n Object.entries(rows).map(([s, row]) => [\n s,\n {\n ...row,\n underlyingStrategyName: newUnderlyingNames.get(\n row.underlyingStrategy\n ),\n },\n ])\n ),\n ])\n )\n );\n });\n }\n }, [stratMeta]);\n\n React.useEffect(() => {\n async function getData() {\n const provider = new ethers.providers.JsonRpcProvider(\n 'https://api.avax.network/ext/bc/C/rpc'\n );\n\n const stratViewer = new ethers.Contract(\n addresses.StrategyViewer,\n new Interface(StrategyViewer.abi),\n provider\n );\n const normalResults = await stratViewer.viewMetadata(\n addresses.StableLending2,\n tokens,\n strats\n );\n // const noHarvestBalanceResults =\n // await stratViewer.viewMetadataNoHarvestBalance(\n // addresses.StableLending2,\n // addresses.OracleRegistry,\n // addresses.Stablecoin, const [underlyingStrategyNames, setUnderLyingStrategyNames] = React.useState(new Map());\n // masterChef2Tokens,\n // []\n // // Array(masterChef2Tokens.length).fill(\n // // addresses.TraderJoeMasterChef2Strategy\n // // )\n // );\n\n // const results = [...normalResults, ...noHarvestBalanceResults];\n const results = [...normalResults];\n\n const reduceFn = (result: StrategyMetadata, row: RawStratMetaRow) => {\n const parsedRow = parseStratMeta(\n chainId ?? 43114,\n row,\n stable,\n balancesCtx,\n yyMetadata,\n globalMoneyAvailable,\n yieldMonitor,\n additionalYieldData,\n row.underlyingStrategy &&\n underlyingStrategyNames.get(row.underlyingStrategy)\n );\n\n return parsedRow\n ? {\n ...result,\n [parsedRow.token.address]: {\n [parsedRow.strategyAddress]: parsedRow,\n ...(result[parsedRow.token.address] || {}),\n },\n }\n : result;\n };\n\n setStratMeta(results?.reduce(reduceFn, {}) ?? {});\n }\n if (\n chainId &&\n stable &&\n balancesCtx &&\n yyMetadata &&\n globalMoneyAvailable != 0 &&\n yieldMonitor &&\n Object.values(stratMeta).length === 0\n ) {\n getData();\n }\n }, [\n chainId,\n stable,\n balancesCtx,\n yyMetadata,\n globalMoneyAvailable,\n yieldMonitor,\n stratMeta,\n underlyingStrategyNames,\n ]);\n\n return stratMeta;\n}\n\nexport function useLegacyIsolatedStrategyMetadata(): StrategyMetadata {\n const [legacyStratMeta, setLegacyStratMeta] = useState({});\n const stable = useStable();\n const { chainId } = useEthers();\n\n const globalDebtCeiling = useGlobalDebtCeiling(\n 'globalDebtCeiling',\n [],\n BigNumber.from(0)\n );\n const totalSupply = useTotalSupply('totalSupply', [], BigNumber.from(0));\n\n const balancesCtx = useContext(WalletBalancesContext);\n const { yyMetadata, yieldMonitor, additionalYieldData } = useContext(\n ExternalMetadataContext\n );\n\n const addresses = useAddresses();\n\n //legacy\n const legacyToken2Strat = {\n ['0x60781C2586D68229fde47564546784ab3fACA982']: addresses.YieldYakStrategy,\n ['0x59414b3089ce2AF0010e7523Dea7E2b35d776ec7']: addresses.YieldYakStrategy,\n ['0x6e84a6216ea6dacc71ee8e6b0a5b7322eebc0fdd']: addresses.YieldYakStrategy,\n ['0xd586e7f844cea2f87f50152665bcbc2c279d8d70']: addresses.YieldYakStrategy,\n ['0x8729438EB15e2C8B576fCc6AeCdA6A148776C0F5']: addresses.YieldYakStrategy,\n ['0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664']: addresses.YieldYakStrategy,\n ['0xA389f9430876455C36478DeEa9769B7Ca4E3DDB1']: addresses.YieldYakStrategy,\n ['0xeD8CBD9F0cE3C6986b22002F03c6475CEb7a6256']: addresses.YieldYakStrategy,\n ['0x454E67025631C065d3cFAD6d71E6892f74487a15']:\n addresses.TraderJoeMasterChefStrategy,\n ['0x2148D1B21Faa7eb251789a51B404fc063cA6AAd6']:\n addresses.SimpleHoldingStrategy,\n ['0xCDFD91eEa657cc2701117fe9711C9a4F61FEED23']:\n addresses.MultiTraderJoeMasterChef3Strategy,\n };\n // const masterChef2Tokens = [\n // '0x57319d41f71e81f3c65f2a47ca4e001ebafd4f33',\n // '0xa389f9430876455c36478deea9769b7ca4e3ddb1',\n // '0xed8cbd9f0ce3c6986b22002f03c6475ceb7a6256',\n // ].map(getAddress);\n\n const legacyTokens = Object.keys(legacyToken2Strat);\n const legacyStrats = Object.values(legacyToken2Strat);\n\n //legacy\n legacyTokens.push('0x454E67025631C065d3cFAD6d71E6892f74487a15');\n legacyStrats.push(addresses.YieldYakStrategy);\n legacyTokens.push('0x6e84a6216eA6dACC71eE8E6b0a5B7322EEbC0fDd');\n legacyStrats.push(addresses.sJoeStrategy);\n\n const globalMoneyAvailable = globalDebtCeiling.sub(totalSupply);\n\n React.useEffect(() => {\n async function getData() {\n const provider = new ethers.providers.JsonRpcProvider(\n 'https://api.avax.network/ext/bc/C/rpc'\n );\n\n const stratViewer = new ethers.Contract(\n addresses.LegacyStrategyViewer,\n new Interface(StrategyViewer.abi),\n provider\n );\n const normalResults = await stratViewer.viewMetadata(\n addresses.StableLending,\n legacyTokens,\n legacyStrats\n );\n\n const results = [...normalResults];\n\n const reduceFn = (result: StrategyMetadata, row: RawStratMetaRow) => {\n const parsedRow = parseStratMeta(\n chainId ?? 43114,\n row,\n stable,\n balancesCtx,\n yyMetadata,\n globalMoneyAvailable,\n yieldMonitor,\n additionalYieldData,\n '0x0000000000000000000000000000000000000000'\n );\n\n return parsedRow\n ? {\n ...result,\n [parsedRow.token.address]: {\n [parsedRow.strategyAddress]: parsedRow,\n ...(result[parsedRow.token.address] || {}),\n },\n }\n : result;\n };\n\n setLegacyStratMeta(results?.reduce(reduceFn, {}) ?? {});\n }\n if (\n chainId &&\n stable &&\n balancesCtx &&\n yyMetadata &&\n globalMoneyAvailable != 0 &&\n yieldMonitor &&\n Object.values(legacyStratMeta).length === 0\n ) {\n getData();\n }\n }, [\n chainId,\n stable,\n balancesCtx,\n yyMetadata,\n globalMoneyAvailable,\n yieldMonitor,\n legacyStratMeta,\n underlyingStrategyNames,\n ]);\n\n return legacyStratMeta;\n}\n\nexport type ParsedPositionMetaRow = {\n trancheId: number;\n strategy: string;\n collateral: CurrencyValue | undefined;\n debt: CurrencyValue;\n token: Token;\n yield: CurrencyValue;\n collateralValue: CurrencyValue;\n borrowablePercent: number;\n owner: string;\n liquidationPrice: number;\n trancheContract: string;\n liquidateButton?: boolean;\n positionHealth?: string;\n positionHealthColor?: string;\n parsedPositionHealth?: string;\n positionHealthOrder?: number;\n};\n\nexport type RawPositionMetaRow = {\n trancheId: BigNumber;\n strategy: string;\n collateral: BigNumber;\n debt: BigNumber;\n token: string;\n yield: BigNumber;\n collateralValue: BigNumber;\n borrowablePer10k: BigNumber;\n owner: string;\n};\n\nexport function calcLiquidationPrice(\n borrowablePercent: number,\n debt: CurrencyValue,\n collateral: CurrencyValue\n) {\n const debtNum = parseFloatCurrencyValue(debt);\n const colNum = parseFloatCurrencyValue(collateral);\n\n return calcLiqPriceFromNum(borrowablePercent, debtNum, colNum);\n}\n\nexport function calcLiqPriceFromNum(\n borrowablePercent: number,\n debtNum: number,\n colNum: number\n): number {\n if (colNum > 0) {\n return (100 * debtNum) / (colNum * borrowablePercent);\n } else {\n return 0;\n }\n}\n\nexport function parsePositionMeta(\n row: RawPositionMetaRow,\n stable: Token,\n trancheContract: string\n): ParsedPositionMetaRow {\n const debt = new CurrencyValue(stable, row.debt);\n const posYield = new CurrencyValue(stable, row.yield);\n const collateral =\n tokenAmount(stable.chainId, row.token, row.collateral) ??\n new CurrencyValue(\n new Token('', '', stable.chainId, row.token),\n row.collateral\n );\n\n const borrowablePercent = row.borrowablePer10k.toNumber() / 100;\n\n return {\n trancheContract,\n trancheId: row.trancheId.toNumber(),\n strategy: row.strategy,\n debt,\n collateral,\n token: getTokenFromAddress(stable.chainId, row.token)!,\n yield: posYield,\n collateralValue: new CurrencyValue(stable, row.collateralValue),\n borrowablePercent,\n owner: row.owner,\n liquidationPrice: debt.gt(posYield)\n ? calcLiquidationPrice(borrowablePercent, debt.sub(posYield), collateral!)\n : 0,\n };\n}\n\nexport type TokenStratPositionMetadata = Record<\n string,\n ParsedPositionMetaRow[]\n>;\nexport function useIsolatedPositionMetadata(\n account: string\n): TokenStratPositionMetadata {\n const { legacy, current } = useIsolatedLendingView(\n 'viewPositionsByOwner',\n [account],\n []\n );\n const stable = useStable();\n\n function reduceFn(trancheContract: string) {\n return (result: TokenStratPositionMetadata, row: RawPositionMetaRow) => {\n const parsedRow = parsePositionMeta(row, stable, trancheContract);\n const tokenAddress = parsedRow.token?.address;\n const list = result[tokenAddress] || [];\n return {\n ...result,\n [tokenAddress]: [...list, parsedRow],\n };\n };\n }\n\n const addresses = useAddresses();\n const legacyResults = {};\n return current.reduce(reduceFn(addresses.StableLending2), legacyResults);\n}\nexport function useCustomTotalSupply(address: string, defaultResult: any) {\n const contract = new Contract(address, ERC20Interface);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'totalSupply',\n args: [],\n }),\n defaultResult,\n 'useCustomTotalSupply'\n );\n}\nexport function iMoneyTotalSupply(defaultResult: any) {\n const address = useAddresses().iMoney;\n const abi = new Interface(iMoney.abi);\n const contract = new Contract(address, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'totalSupply',\n args: [],\n }),\n defaultResult,\n 'iMoneyTotalSupply'\n );\n}\n\nexport function xMoreTotalSupply(\n method: string,\n args: any[],\n defaultResult: any\n) {\n const address = useAddresses().xMore;\n const abi = new Interface(xMore.abi);\n const contract = new Contract(address, abi);\n return (\n useCall({\n contract,\n method,\n args,\n }) ?? { value: [defaultResult] }\n ).value[0];\n}\n\nexport function useGlobalDebtCeiling(\n method: string,\n args: any[],\n defaultResult: any\n) {\n const address = useAddresses().Stablecoin;\n const abi = new Interface(Stablecoin.abi);\n const contract = new Contract(address, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method,\n args,\n }),\n defaultResult,\n 'useGlobalDebtCeiling'\n );\n}\n\nexport function useBalanceOfToken(\n address: string,\n args: any[],\n defaultResult: any\n) {\n return handleCallResultDefault(\n useCall({\n contract: new Contract(address, ERC20Interface),\n method: 'balanceOf',\n args,\n }),\n defaultResult,\n 'useBalanceOfToken'\n );\n}\n\nexport function usePlatypusAPR(account: string) {\n /*\n APR = (rewarder tokenPerSec * MORE price * 606024365 / (TVL in MONEY or USDC MONEY or USDC price) - 1 )* 100%\n tokenPerSec: from rewarder contract. \n USDC rewarder: 0x032e09C819ed14314eD62Ea91c41151A228BdAb4 \n MONEY rewarder: 0x77286ac09F4e0b7E6D37B4B77cd2D0Fb6b49323D\n token price: from coingecko\n TVL: check balance from these contracts. \n USDC: 0x551C259Bf4D88edFdAbb04179342a73dAa759583 \n MONEY: 0xE08947eE864Af325D9F98743B3b905875Ae0Ec99 \n */\n /*\n MasterPlatypus.ptpPerSec() * MasterPlatypus.poolInfo(pid).baseAllocPoint / MasterPlatypus.totalAllocPoints()\n our PIDs are:\n USDC: 5\n MONEY: 4\n MasterPlatypus is at: 0x7125b4211357d7c3a90f796c956c12c681146ebb\n you need to replace tokensPerSec with morePerSec and ptpPerSec and morePrice with ptpPrice (in the case of ptpPerSec), run the same formula on both and add them up \n*/\n const tokenPerSecUsdc = formatEther(\n useTokenPerSecPlatypus(tokenPerSecUSDCAddress, BigNumber.from(0))\n );\n const tokenPerSecMoney = formatEther(\n useTokenPerSecPlatypus(tokenPerSecMoneyAddress, BigNumber.from(0))\n );\n const ptpPerSec = formatEther(usePtpPerSec(BigNumber.from(0)));\n const totalAllocPoints = useTotalAllocPoints(BigNumber.from(0));\n const ptpPerSecMoney = useTokenPerSecPoolInfo(\n parseFloat(ptpPerSec.toString()),\n 4,\n BigNumber.from(0),\n parseFloat(totalAllocPoints.toString())\n );\n const ptpPerSecUsdc = useTokenPerSecPoolInfo(\n parseFloat(ptpPerSec.toString()),\n 5,\n BigNumber.from(0),\n parseFloat(totalAllocPoints.toString())\n );\n\n const morePrice = useCoingeckoPrice('more-token', 'usd');\n const ptpPrice = useCoingeckoPrice('platypus-finance', 'usd');\n const MoneyTVL = formatEther(\n useCustomTotalSupply(tvlMoneyAddress, BigNumber.from('0'))\n );\n const usdcTVL = formatUnits(\n useCustomTotalSupply(tvlUSDCAddress, BigNumber.from('0')),\n 6\n ).toString();\n const APR_USDC_MORE = calculatePlatypusAPR(\n tokenPerSecUsdc,\n morePrice ?? '1',\n usdcTVL\n );\n const APR_MONEY_MORE = calculatePlatypusAPR(\n tokenPerSecMoney,\n morePrice ?? '1',\n MoneyTVL\n );\n\n const APR_USDC_PTP = calculatePlatypusAPR(\n ptpPerSecUsdc.toString(),\n ptpPrice ?? '1',\n usdcTVL\n );\n const APR_MONEY_PTP = calculatePlatypusAPR(\n ptpPerSecMoney.toString(),\n ptpPrice ?? '1',\n MoneyTVL\n );\n\n return {\n APR_MONEY: APR_MONEY_MORE + APR_MONEY_PTP,\n APR_USDC: APR_USDC_MORE + APR_USDC_PTP,\n MoneyTVL,\n usdcTVL,\n };\n}\nfunction calculatePlatypusAPR(\n tokenPerSecMoney: string,\n tokenPrice: string,\n tvl: string\n) {\n return (\n ((parseFloat(tokenPerSecMoney.toString()) *\n parseFloat(tokenPrice.toString() ?? '1') *\n 60 *\n 60 *\n 24 *\n 365) /\n parseFloat(tvl)) *\n 100\n );\n}\n\nfunction useTokenPerSecPoolInfo(\n ptpPerSec: number,\n poolId: number,\n defaultResult: any,\n totalAllocPoints: number\n) {\n const abi = new Interface([\n {\n inputs: [{ name: '', type: 'uint256' }],\n name: 'poolInfo',\n outputs: [\n {\n name: 'lpToken',\n type: 'address',\n },\n {\n name: 'baseAllocPoint',\n type: 'uint256',\n },\n {\n name: 'lastRewardTimestamp',\n type: 'uint256',\n },\n {\n name: 'accPtpPerShare',\n type: 'uint256',\n },\n {\n name: 'rewarder',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n ]);\n const contract = new Contract(masterPlatypusPool, abi);\n const res = handleCallResultDefault(\n useCall({\n contract,\n method: 'poolInfo',\n args: [poolId],\n }),\n {\n baseAllocPoint: defaultResult,\n },\n 'useTokenPerSecPoolInfo',\n true\n );\n return (ptpPerSec * res.baseAllocPoint) / totalAllocPoints;\n}\n\nfunction useTotalAllocPoints(defaultResult: any) {\n const abi = new Interface([\n {\n inputs: [],\n name: 'totalBaseAllocPoint',\n outputs: [{ name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n ]);\n const contract = new Contract(masterPlatypusPool, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'totalBaseAllocPoint',\n args: [],\n }),\n defaultResult,\n 'useTotalAllocPoints'\n );\n}\n\nfunction usePtpPerSec(defaultResult: any) {\n const abi = new Interface([\n {\n inputs: [],\n name: 'ptpPerSec',\n outputs: [{ name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n ]);\n const contract = new Contract(masterPlatypusPool, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'ptpPerSec',\n args: [],\n }),\n defaultResult,\n 'usePtpPerSec'\n );\n}\n\nfunction useTokenPerSecPlatypus(address: string, defaultResult: any) {\n const abi = new Interface([\n {\n inputs: [],\n name: 'tokenPerSec',\n outputs: [{ name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n ]);\n const contract = new Contract(address, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'tokenPerSec',\n args: [],\n }),\n defaultResult,\n 'useTokenPerSecPlatypus'\n );\n}\n\nexport function useIMoneyAPR(account: string) {\n const totalDebt = useTotalDebt(BigNumber.from(0));\n const totalSupplyIMoney = useTotalSupplyIMoney(BigNumber.from(1));\n const currentRate = useInterestRate(BigNumber.from(0));\n const boostedShare = useBoostedSharePer10k(BigNumber.from(0));\n const accountInfo = useIMoneyAccountInfo(account!);\n const weight = sqrt(\n accountInfo.factor.mul(\n accountInfo.depositAmount.isZero()\n ? parseEther('100')\n : accountInfo.depositAmount\n )\n );\n const totalWeights = useIMoneyTotalWeights(parseEther('100'));\n\n const ratio = totalDebt.mul(currentRate).div(totalSupplyIMoney).toNumber();\n const baseRate = (ratio * (100 - boostedShare)) / 100;\n const boostedRate =\n weight\n .mul(Math.round(ratio * boostedShare))\n .div(totalWeights)\n .toNumber() / 100;\n\n const avgBoostedRate = (ratio * boostedShare) / 100;\n return { baseRate, boostedRate, avgBoostedRate };\n}\n\nexport function useTotalSupplyIMoney(defaultResult: any) {\n const abi = new Interface(iMoney.abi);\n const contract = new Contract(useAddresses().iMoney, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'totalSupply',\n args: [],\n }),\n defaultResult,\n 'useTotalSupplyIMoney'\n );\n}\n\nexport function useTotalSupplyToken(\n address: string,\n method: string,\n args: any[],\n defaultResult: any\n) {\n const abi = new Interface(ERC20.abi);\n const contract = new Contract(address, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method,\n args,\n }),\n defaultResult,\n 'useTotalSupplyToken'\n );\n}\n\nexport function useTotalSupply(\n method: string,\n args: any[],\n defaultResult: any\n) {\n const address = useAddresses().Stablecoin;\n const abi = new Interface(ERC20.abi);\n const contract = new Contract(address, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method,\n args,\n }),\n defaultResult,\n 'useTotalSupply'\n );\n}\n\nexport function useYieldConversionStrategyView(\n strategyAddress: string,\n method: string,\n args: any[],\n defaultResult: any\n) {\n const abi = new Interface(YieldConversionStrategy.abi);\n const contract = new Contract(strategyAddress, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method,\n args,\n }),\n defaultResult,\n 'useYieldConversionStrategyView'\n );\n}\n\nconst TWELVE_HOURS_SECONDS = 43200;\nexport function useUpdatedPositions(timeStart: number) {\n const endPeriod = 1 + Math.round(Date.now() / 1000 / TWELVE_HOURS_SECONDS);\n const startPeriod = Math.floor(timeStart / 1000 / TWELVE_HOURS_SECONDS) - 2;\n // console.log('endPeriod', endPeriod);\n // console.log('startPeriod', startPeriod);\n const stable = useStable();\n const addresses = useAddresses();\n const contract = new Contract(\n addresses.StableLending2,\n new Interface(StableLending2.abi)\n );\n\n function args(trancheContract: string) {\n return Array(endPeriod - startPeriod)\n .fill(startPeriod)\n .map((x, i) => ({\n contract,\n address: trancheContract,\n method: 'viewPositionsByTrackingPeriod',\n args: [x + i],\n }));\n }\n\n const currentRows =\n (useCalls(args(addresses.StableLending2)).map(\n (x) => (x ?? { value: undefined }).value\n ) as RawPositionMetaRow[][][]) || [];\n\n function parseRows(rows: RawPositionMetaRow[][][], trancheContract: string) {\n return rows\n .flatMap((x) => x)\n .flatMap((x) => x)\n .filter((x) => x)\n .map((row) => parsePositionMeta(row, stable, trancheContract));\n }\n return [\n ...((currentRows.length > 0 &&\n parseRows(currentRows, addresses.StableLending2)) ||\n []),\n ];\n}\n\nexport function useUpdatedMetadataLiquidatablePositions(\n positions?: ParsedPositionMetaRow[]\n) {\n const abi = {\n [useAddresses().StableLending2]: new Interface(StableLending2.abi),\n };\n\n const positionCalls: Call[] = positions!.map((pos) => {\n return {\n contract: new Contract(pos.trancheContract, abi[pos.trancheContract]),\n method: 'viewPositionMetadata',\n args: [pos.trancheId],\n };\n });\n\n const updatedData = useCalls(positionCalls).map(\n (x) => (x ?? { value: undefined }).value\n );\n\n return updatedData.filter((x) => x !== undefined);\n}\n\nexport function useRegisteredOracle(tokenAddress?: string) {\n const address = useAddresses().OracleRegistry;\n const abi = new Interface(OracleRegistry.abi);\n const contract = new Contract(address, abi);\n const stable = useStable();\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'tokenOracle',\n args: [tokenAddress, stable.address],\n }),\n undefined,\n 'useRegisteredOracle'\n );\n}\n\nexport function useAllFeesEver(contracts: string[]) {\n function convert2ContractCall(contract: string) {\n return {\n contract: new Contract(contract, new Interface(IFeeReporter.abi)),\n method: 'viewAllFeesEver',\n args: [],\n };\n }\n\n const calls: Call[] = contracts.map(convert2ContractCall);\n // console.log('calls', calls);\n const results =\n useCalls(calls).map((x) => (x ?? { value: undefined }).value) ?? [];\n\n return results;\n}\n\nexport function useEstimatedHarvestable(\n strategyAddress: string,\n tokenAddress: string\n) {\n const abi = new Interface(IStrategy.abi);\n const contract = new Contract(strategyAddress, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'viewEstimatedHarvestable',\n args: [tokenAddress],\n }),\n undefined,\n 'useEstimatedHarvestable'\n );\n}\n\nexport function useStakingMetadata(\n stakingContracts: string[],\n account?: string\n): [RawStakingMetadata][] {\n const abi = new Interface(VestingStakingRewards.abi);\n const userAccount = account ?? ethers.constants.AddressZero;\n\n const calls: Call[] = stakingContracts.map((address) => ({\n contract: new Contract(address, abi),\n method: 'stakingMetadata',\n args: [userAccount],\n }));\n\n let contractCalls2 = useCalls(calls);\n const results = (contractCalls2.map(\n (x) => (x ?? { value: undefined }).value\n ) ?? []) as unknown as [RawStakingMetadata][];\n return results;\n}\n\ntype RawStakingMetadata = {\n stakingToken: string;\n rewardsToken: string;\n totalSupply: BigNumber;\n tvl: BigNumber;\n aprPer10k: BigNumber;\n vestingCliff: BigNumber;\n periodFinish: BigNumber;\n stakedBalance: BigNumber;\n vestingStart: BigNumber;\n earned: BigNumber;\n vested: BigNumber;\n rewards: BigNumber;\n};\n\nexport type ParsedStakingMetadata = {\n stakingToken: Token;\n rewardsToken: Token;\n totalSupply: CurrencyValue;\n tvl: CurrencyValue;\n aprPercent: number;\n vestingCliff: Date;\n periodFinish: Date;\n stakedBalance: CurrencyValue;\n vestingStart: Date;\n earned: CurrencyValue;\n vested: CurrencyValue;\n rewards: CurrencyValue;\n totalRewards: CurrencyValue;\n};\n\n// function unifyRewards(account?: string): BigNumber {\n// const lcAccount = account ? account.toLowerCase() : undefined;\n// const earned =\n// lcAccount && lcAccount in earnedRewards\n// ? BigNumber.from(earnedRewards[lcAccount as keyof typeof earnedRewards])\n// : BigNumber.from(0);\n\n// const rewards =\n// lcAccount && lcAccount in rewardsRewards\n// ? BigNumber.from(rewardsRewards[lcAccount as keyof typeof rewardsRewards])\n// : BigNumber.from(0);\n\n// // console.log('unifying', formatEther(earned), formatEther(rewards));\n\n// return earned.add(rewards);\n// }\n\nexport function useParsedStakingMetadata(\n stakingContracts: string[],\n account?: string\n): ParsedStakingMetadata[] {\n const { chainId } = useEthers();\n const stable = useStable();\n return useStakingMetadata(stakingContracts, account)\n .filter((x) => x)\n .filter(([x]) => x)\n .map(([stakingMeta]: [RawStakingMetadata], i) => {\n const stakingToken = getTokenFromAddress(\n chainId,\n stakingMeta.stakingToken\n )!;\n const rewardsToken = getTokenFromAddress(\n chainId,\n stakingMeta.rewardsToken\n )!;\n\n const earned = new CurrencyValue(rewardsToken, stakingMeta.earned);\n const rewards = new CurrencyValue(rewardsToken, stakingMeta.rewards);\n // console.log('unifying with earned', formatEther(earned.value));\n\n const rawTotalRewards = earned.add(rewards);\n const totalRewards = rawTotalRewards;\n // i === 0\n // ? new CurrencyValue(\n // rewardsToken,\n // rawTotalRewards.value.add(\n // rawTotalRewards.value.sub(unifyRewards(account)).mul(4)\n // )\n // )\n // : rawTotalRewards;\n\n const rawAprPercent = (100 * stakingMeta.aprPer10k.toNumber()) / 10000;\n const aprPercent = rawAprPercent; //i === 0 ? rawAprPercent * 5 : rawAprPercent;\n\n return {\n stakingToken,\n rewardsToken,\n totalSupply: new CurrencyValue(stakingToken, stakingMeta.totalSupply),\n tvl: new CurrencyValue(stable, stakingMeta.tvl),\n aprPercent,\n vestingCliff: timestamp2Date(stakingMeta.vestingCliff),\n periodFinish: timestamp2Date(stakingMeta.periodFinish),\n stakedBalance: new CurrencyValue(\n stakingToken,\n stakingMeta.stakedBalance\n ),\n vestingStart: timestamp2Date(stakingMeta.vestingStart),\n earned,\n vested: new CurrencyValue(rewardsToken, stakingMeta.vested),\n rewards,\n totalRewards,\n };\n });\n}\n\nexport function useSpecialRewardsData(account: string) {\n const addresses = useAddresses();\n const address = addresses.VestingLaunchReward;\n const abi = new Interface(VestingLaunchReward.abi);\n const { chainId } = useEthers();\n const moreToken = getTokenFromAddress(chainId, addresses.MoreToken);\n const contract = new Contract(address, abi);\n\n const balance = handleCallResultDefault(\n useCall({\n contract,\n method: 'balanceOf',\n args: [account],\n }),\n BigNumber.from(0),\n 'useSpecialRewardsData | balance'\n );\n\n const vested = handleCallResultDefault(\n useCall({\n contract,\n method: 'burnableByAccount',\n args: [account],\n }),\n BigNumber.from(0),\n 'useSpecialRewardsData | vested'\n );\n\n return {\n balance: new CurrencyValue(moreToken, balance),\n vested: new CurrencyValue(moreToken, vested),\n };\n}\n\nfunction timestamp2Date(tstamp: BigNumber) {\n return new Date(tstamp.toNumber() * 1000);\n}\n\nexport function useCurvePoolSLDeposited() {\n const addressCurvePool = useAddresses().CurvePoolSL;\n const addressCurvePool2 = useAddresses().CurvePoolSL2;\n const contract = new Contract(\n useAddresses().CurvePool,\n new Interface(ERC20.abi)\n );\n const balance1 = handleCallResultDefault(\n useCall({\n contract,\n method: 'balanceOf',\n args: [addressCurvePool],\n }),\n BigNumber.from(0),\n 'useCurvePoolSLDeposited | balance1'\n );\n\n const balance2 = handleCallResultDefault(\n useCall({\n contract,\n method: 'balanceOf',\n args: [addressCurvePool2],\n }),\n BigNumber.from(0),\n 'useCurvePoolSLDeposited | balance2'\n );\n\n return balance1.add(balance2);\n}\n","export const masterPlatypusPool = '0x7125b4211357d7c3a90f796c956c12c681146ebb';\nexport const tokenPerSecUSDCAddress =\n '0x032e09C819ed14314eD62Ea91c41151A228BdAb4';\nexport const tokenPerSecMoneyAddress =\n '0x77286ac09F4e0b7E6D37B4B77cd2D0Fb6b49323D';\n\nexport const tvlUSDCAddress = '0x551C259Bf4D88edFdAbb04179342a73dAa759583';\nexport const tvlMoneyAddress = '0xE08947eE864Af325D9F98743B3b905875Ae0Ec99';\n","export default __webpack_public_path__ + \"static/media/logo.6d503a67.png\";","import * as React from 'react';\nimport {\n Box,\n Button,\n Flex,\n Link,\n Modal,\n ModalOverlay,\n ModalContent,\n ModalHeader,\n ModalFooter,\n ModalBody,\n ModalCloseButton,\n Text,\n} from '@chakra-ui/react';\nimport { ExternalLinkIcon, CopyIcon } from '@chakra-ui/icons';\nimport {\n ChainId,\n CurrencyValue,\n getExplorerAddressLink,\n shortenAddress,\n useEthers,\n} from '@usedapp/core';\nimport { useContext } from 'react';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\nimport { BigNumber } from 'ethers';\nimport { useStable, useAddresses } from '../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../chain-interaction/tokens';\nimport { WalletBalancesContext } from '../../contexts/WalletBalancesContext';\n\ntype Props = {\n isOpen: any;\n onClose: any;\n};\n\nexport default function AccountModal({ isOpen, onClose }: Props) {\n const { deactivate } = useEthers();\n const account = useContext(UserAddressContext);\n const { chainId } = useEthers();\n const _chainId = chainId === ChainId.Hardhat ? ChainId.Avalanche : chainId;\n const stable = useStable();\n const balanceCtx = React.useContext(WalletBalancesContext);\n const moreToken = getTokenFromAddress(chainId, useAddresses().MoreToken);\n\n const walletBalance =\n balanceCtx.get(stable.address) ||\n new CurrencyValue(stable, BigNumber.from('0'));\n\n const moreBalance =\n balanceCtx.get(moreToken.address) ||\n new CurrencyValue(moreToken, BigNumber.from('0'));\n\n const explorerLink = account\n ? getExplorerAddressLink(account, _chainId!)\n : '';\n\n function handleDeactivateAccount() {\n deactivate();\n onClose();\n }\n\n return (\n \n \n \n \n \n Account\n \n \n \n \n \n \n Connected with MetaMask\n \n \n Change\n \n \n \n \n {account && `${shortenAddress(account)}`}\n \n \n \n {walletBalance?.format({ significantDigits: 2 })} /{' '}\n {moreBalance?.format({ significantDigits: 2 })}\n \n \n navigator.clipboard.writeText(account ?? '')}\n _hover={{\n textDecoration: 'none',\n }}\n >\n \n Copy Address\n \n \n \n View on Explorer\n \n \n \n \n\n \n \n Your transactions willl appear here...\n \n \n \n \n \n );\n}\n","export default __webpack_public_path__ + \"static/media/color_dot.411f3a2b.svg\";","import {\n Container,\n Popover,\n PopoverArrow,\n PopoverBody,\n PopoverCloseButton,\n PopoverContent,\n PopoverHeader,\n PopoverTrigger,\n Text,\n useDisclosure,\n} from '@chakra-ui/react';\nimport * as React from 'react';\nimport { Link } from 'react-router-dom';\n\nexport const MakeMostOfMoneyContext = React.createContext({} as any);\n\nexport default function MakeMostOfMoneyCtxProvider({\n children,\n}: React.PropsWithChildren) {\n const { isOpen, onToggle, onClose } = useDisclosure();\n\n function MostOfMoneyPopover({ children }: { children: React.ReactNode }) {\n return (\n <>\n \n {children}\n \n \n \n Make the MOST of your MONEY\n \n \n \n \n
    \n
  • \n \n Trade MONEY on{' '}\n \n Platypus,{' '}\n \n \n Trader Joe\n \n , or{' '}\n \n Pangolin.\n \n \n
  • \n
    \n
  • \n \n Provide liquidity on{' '}\n \n Platypus,{' '}\n \n \n Trader Joe\n \n , or{' '}\n \n Pangolin.\n \n \n
  • \n
    \n
  • \n \n Stake MONEY\n {' '}\n to earn interest using iMONEY.\n
  • \n
\n
\n
\n \n \n \n );\n }\n\n return (\n \n {children}\n \n );\n}\n","import { Button, HStack, Image, Text, useMediaQuery } from '@chakra-ui/react';\nimport { CurrencyValue, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport colorDot from '../../assets/img/color_dot.svg';\nimport { useAddresses, useStable } from '../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../chain-interaction/tokens';\nimport { MakeMostOfMoneyContext } from '../../contexts/MakeMostOfMoneyContext';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\nimport { WalletBalancesContext } from '../../contexts/WalletBalancesContext';\nimport { useConnectWallet } from '../../utils';\n\ntype Props = {\n handleOpenModal: any;\n};\n\nexport function UserAddressComponent({ handleOpenModal }: Props) {\n const [isLargerThan1280] = useMediaQuery('(min-width: 1280px)');\n const { chainId } = useEthers();\n const { onConnect } = useConnectWallet();\n const { MostOfMoneyPopover } = React.useContext(MakeMostOfMoneyContext);\n const account = useContext(UserAddressContext);\n const stable = useStable();\n const balanceCtx = React.useContext(WalletBalancesContext);\n const moreToken = getTokenFromAddress(chainId, useAddresses().MoreToken);\n\n const walletBalance =\n balanceCtx.get(stable.address) ||\n new CurrencyValue(stable, BigNumber.from('0'));\n\n const moreBalance =\n balanceCtx.get(moreToken.address) ||\n new CurrencyValue(moreToken, BigNumber.from('0'));\n\n function handleConnectWallet() {\n onConnect();\n }\n\n return (\n \n \n \n {walletBalance &&\n moreBalance &&\n !moreBalance.isZero() &&\n !walletBalance.isZero() &&\n isLargerThan1280 ? (\n \n {walletBalance?.format({ significantDigits: 2 })} /{' '}\n {moreBalance?.format({ significantDigits: 2 })}\n \n ) : (\n \n )}\n \n \n \n {account ? (\n \n {account &&\n `${account.slice(0, 6)}...${account.slice(\n account.length - 4,\n account.length\n )}`}\n \n ) : (\n Connect wallet\n )}\n \n \n );\n}\n","export default __webpack_public_path__ + \"static/media/horizontal-dots.6d6385e8.svg\";","import {\n Container,\n IconButton,\n Image,\n Menu,\n MenuButton,\n MenuItem,\n MenuList,\n} from '@chakra-ui/react';\nimport * as React from 'react';\nimport dots from '../../assets/img/horizontal-dots.svg';\n\nconst Links = [\n {\n title: 'Audit',\n link: 'https://github.com/MoreMoney-Finance/audits/blob/main/PeckShield-Audit-Report-Moremoney-1.0.pdf',\n },\n { title: 'Twitter', link: 'https://twitter.com/Moremoneyfi' },\n { title: 'Discord', link: 'https://discord.gg/uHwQgNE776' },\n { title: 'Telegram', link: 'https://t.me/moremoneyfi' },\n { title: 'Github', link: 'https://github.com/MoreMoney-Finance' },\n { title: 'Documentation', link: 'https://moremoney.gitbook.io/docs' },\n {\n title: 'Trade MORE',\n link: 'https://traderjoexyz.com/trade?inputCurrency=AVAX&outputCurrency=0xd9d90f882cddd6063959a9d837b05cb748718a05',\n },\n {\n title: 'Trade MONEY (Platypus)',\n link: 'https://app.platypus.finance/pool?pool_group=factory',\n },\n { title: 'Trade MONEY (Curve)', link: 'https://avax.curve.fi/factory/39' },\n];\n\nexport default function MenuOptions() {\n return (\n
\n \n }\n variant=\"outline\"\n />\n \n \n {Links.map((link, index) => (\n \n {link.title}\n \n ))}\n \n \n \n
\n );\n}\n","import { CloseIcon, HamburgerIcon } from '@chakra-ui/icons';\nimport {\n Box,\n Flex,\n HStack,\n IconButton,\n Image,\n Link as LinkComponent,\n Stack,\n Text,\n useDisclosure,\n} from '@chakra-ui/react';\nimport * as React from 'react';\nimport { Link, useLocation } from 'react-router-dom';\nimport logo from '../../assets/logo/logo.png';\nimport AccountModal from '../account/AccountModal';\nimport { UserAddressComponent } from '../account/UserAddressComponent';\nimport MenuOptions from './MenuOptions';\nimport { useMediaQuery } from '@chakra-ui/react';\n\nconst Links = [\n { title: 'Borrow', link: '/' },\n { title: 'My Positions', link: '/positions' },\n { title: 'Farm', link: '/farm' },\n { title: 'Stake', link: '/stake' },\n // { title: 'Liquidate', link: '/liquidatable-positions' },\n { title: 'Analytics', link: '/analytics' },\n];\n\nexport default function NavigationBar() {\n const [isLargerThan1280] = useMediaQuery('(min-width: 1280px)');\n const { isOpen, onOpen, onClose } = useDisclosure();\n const {\n isOpen: isOpenAccount,\n onOpen: onOpenAccount,\n onClose: onCloseAccount,\n } = useDisclosure();\n const location = useLocation();\n\n return (\n <>\n \n \n : }\n aria-label={'Open Menu'}\n display={{ md: 'none' }}\n onClick={isOpen ? onClose : onOpen}\n />\n \n \n \"Logo\"\n  \n {isLargerThan1280 ? (\n \n moremoney\n \n ) : (\n ''\n )}\n \n \n \n {Links.map((link) => (\n \n {link.title}\n \n ))}\n \n \n \n \n \n \n \n {isOpen ? (\n \n \n {Links.map((link) => (\n \n {link.title}\n \n ))}\n \n \n ) : null}\n \n \n );\n}\n","import { Alert, AlertIcon } from '@chakra-ui/react';\nimport { parseEther } from '@ethersproject/units';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport {\n useGlobalDebtCeiling,\n useTotalSupply,\n} from '../../chain-interaction/contracts';\n\nexport default function GlobalDebtCeilingMessage() {\n const globalDebtCeiling = useGlobalDebtCeiling(\n 'globalDebtCeiling',\n [],\n BigNumber.from(0)\n );\n const totalSupply = useTotalSupply('totalSupply', [], undefined);\n const hasMaxedOut =\n totalSupply && totalSupply.gt(globalDebtCeiling.sub(parseEther('1000')));\n\n return (\n <>\n {hasMaxedOut ? (\n \n \n Global debt ceiling has been maxed out, please come back later!\n \n ) : (\n ''\n )}\n \n );\n}\n","import * as React from 'react';\nimport { Alert, AlertIcon, Box, Text } from '@chakra-ui/react';\n\nexport default function MigratePositionsComponent() {\n return (\n <>\n \n \n \n Where are my positions?  \n \n \n Go to V1 UI\n \n \n \n \n \n );\n}\n","import React from 'react';\nimport {\n AlertDialog,\n AlertDialogBody,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogContent,\n AlertDialogOverlay,\n useDisclosure,\n Button,\n AlertDialogCloseButton,\n} from '@chakra-ui/react';\nimport { useEthers } from '@usedapp/core';\n\nexport default function NetworkNotSupported() {\n const { onClose } = useDisclosure();\n const { deactivate } = useEthers();\n\n return (\n <>\n \n
\n \n \n Network Not Supported\n \n \n

Please connect to the appropriate Avalanche network.

\n
\n \n \n \n
\n
\n \n \n );\n}\n","import { Box, Text } from '@chakra-ui/react';\nimport { useEthers } from '@usedapp/core';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\n\nexport default function PhishingAlertComponent() {\n const { account } = useEthers();\n const userAccount = useContext(UserAddressContext);\n\n return (\n <>\n {account != userAccount ? (\n \n \n \n Phishing danger: do not make any transactions unless you know what\n you're doing!\n \n \n \n ) : (\n ''\n )}\n \n );\n}\n","import * as React from 'react';\nimport { AlertStatus, useToast } from '@chakra-ui/react';\nimport {\n ChainId,\n getExplorerTransactionLink,\n useEthers,\n useNotifications,\n} from '@usedapp/core';\n\nexport const TransactionToasts: React.FC = () => {\n const { notifications } = useNotifications();\n const toast = useToast();\n const { chainId } = useEthers();\n const _chainId = chainId === ChainId.Hardhat ? ChainId.Avalanche : chainId;\n\n function showToast(title: string, status: AlertStatus, notification: any) {\n const hash = notification.transaction.hash;\n const explorerLink = getExplorerTransactionLink(hash, _chainId!);\n toast({\n id: notification.id,\n title: title,\n description: (\n \n {`${hash.slice(0, 6)}...${hash.slice(hash.length - 4, hash.length)}`}\n \n ),\n status: status,\n duration: 7000,\n isClosable: true,\n position: 'bottom-right',\n });\n }\n\n React.useEffect(() => {\n notifications.map((notification: any) => {\n switch (notification.type) {\n case 'transactionStarted':\n showToast('Transaction Started', 'info', notification);\n break;\n case 'transactionSucceed':\n showToast('Transaction Succeeded', 'success', notification);\n break;\n case 'transactionFailed':\n showToast('Transaction Failed', 'error', notification);\n break;\n default:\n break;\n }\n });\n }, [notifications]);\n\n return <>;\n};\n","import {\n Call,\n Token,\n useCalls,\n useEthers,\n} from '@usedapp/core';\nimport { Contract } from 'ethers';\nimport { getAddress, Interface } from 'ethers/lib/utils';\nimport React from 'react';\nimport { useAddresses } from '../chain-interaction/contracts';\nimport { getTokensInQuestion } from '../chain-interaction/tokens';\nimport IsolatedLendingLiquidation from '../contracts/artifacts/contracts/IsolatedLendingLiquidation.sol/IsolatedLendingLiquidation.json';\n\nexport const LiquidationFeesContext = React.createContext>(\n new Map()\n);\n\nexport function LiquidationFeesCtxProvider({\n children,\n}: React.PropsWithChildren) {\n const { chainId } = useEthers();\n const address = useAddresses().StableLending2Liquidation;\n const tokenFees = new Map();\n\n function convert2ContractCall(aT: [string, Token]) {\n return {\n contract: new Contract(address, new Interface(IsolatedLendingLiquidation.abi)),\n method: 'viewLiquidationFeePer10k',\n args: [aT[0]],\n };\n }\n const tokensInQuestion = getTokensInQuestion(chainId!);\n const calls: Call[] = tokensInQuestion.map(convert2ContractCall);\n const results = useCalls(calls).map((x) => (x ?? {value: undefined}).value) ?? [];\n results?.forEach((result: any[] | undefined, index: number) => {\n if (result) {\n const [tokenAddress] = tokensInQuestion[index];\n tokenFees.set(getAddress(tokenAddress), result[0].toNumber() / 100);\n // console.log(`Set Fee for ${token.name}: ${result[0]} (${tokenAddress}): ${result[0].toNumber()}`);\n } else {\n // const [tokenAddress, token] = tokensInQuestion[index];\n // console.log(`No result fee for ${token.name} at ${tokenAddress}`);\n }\n });\n\n return (\n \n {children}\n \n );\n}\n","import { Progress } from '@chakra-ui/react';\nimport React from 'react';\nimport {\n StrategyMetadata,\n useIsolatedStrategyMetadata,\n} from '../chain-interaction/contracts';\n\nexport const StrategyMetadataContext = React.createContext(\n {}\n);\n\nexport function StrategyMetadataCtxProvider({\n children,\n}: React.PropsWithChildren) {\n const stratMeta = useIsolatedStrategyMetadata();\n\n return (\n \n {Object.values(stratMeta).length > 0 ? children : }\n \n );\n}\n","import { extendTheme } from '@chakra-ui/react';\nimport '@fontsource/poppins';\nimport '@fontsource/rubik';\n\nconst Container = {\n variants: {\n token: {\n position: 'relative',\n maxWidth: '100%',\n height: '100%',\n background: 'brand.gradientBg',\n padding: '0',\n borderRadius: '10px',\n _before: {\n content: '\"\"',\n position: 'absolute',\n top: '-2px',\n bottom: '-2px',\n left: '-2px',\n right: '-2px',\n background:\n 'linear-gradient(to right, hsla(0, 100%, 64%, 0.06), hsla(193, 100%, 50%, 0.06))',\n borderRadius: '10px',\n zIndex: '-2',\n },\n _after: {\n content: '\"\"',\n position: 'absolute',\n top: '0',\n bottom: '0',\n left: '0',\n right: '0',\n bg: 'brand.bg',\n borderRadius: '10px',\n zIndex: 'var(--chakra-zIndices-hide)',\n },\n },\n },\n};\n\nconst Link = {\n baseStyle: {\n fontSize: '14px',\n lineHeight: '24px',\n color: 'whiteAlpha.600',\n },\n variants: {\n footer: {\n fontSize: '17px',\n lineHeight: '24px',\n color: 'whiteAlpha.700',\n },\n header: {\n fontSize: '17px',\n fontWeight: '600',\n _hover: {\n background: 'brand.accent',\n WebkitBackgroundClip: 'text',\n WebkitTextFillColor: 'transparent',\n },\n },\n headerActive: {\n fontSize: '17px',\n fontWeight: '600',\n background: 'brand.accent',\n WebkitBackgroundClip: 'text',\n WebkitTextFillColor: 'transparent',\n },\n },\n};\n\nconst Button = {\n baseStyle: {\n border: '1px solid transparent',\n },\n _hover: {\n borderColor: 'blue.700',\n color: 'blue.400',\n },\n _active: {\n backgroundColor: 'blue.800',\n borderColor: 'blue.700',\n },\n variants: {\n action: {\n bg: 'blue.800',\n color: 'blue.300',\n fontSize: 'lg',\n fontWeight: 'medium',\n borderRadius: 'lg',\n },\n primary: {\n bg: 'brand.accent',\n border: 'none',\n _hover: {\n _disabled: {\n bg: 'brand.accent',\n },\n },\n },\n secondary: {\n bg: 'whiteAlpha.100',\n border: 'none',\n _hover: {\n _disabled: {\n bg: 'whiteAlpha.100',\n },\n },\n },\n 'submit-primary': {\n padding: '16px',\n h: '56px',\n borderRadius: '10px',\n bg: 'brand.accent',\n border: 'none',\n _hover: {\n _disabled: {\n bg: 'brand.accent',\n },\n },\n width: '100%',\n },\n submit: {\n padding: '16px',\n h: '56px',\n borderRadius: '10px',\n bg: 'whiteAlpha.200',\n width: '100%',\n },\n },\n};\n\nconst Text = {\n variants: {\n gradient: {\n background: 'linear-gradient(to right, #7bb07b, #3c7998)',\n WebkitBackgroundClip: 'text',\n WebkitTextFillColor: 'transparent',\n },\n h200: {\n fontFamily: 'Rubik',\n fontSize: '18px',\n lineHeight: '27px',\n fontWeight: 400,\n },\n h300: {\n fontFamily: 'Rubik',\n fontSize: '16px',\n lineHeight: '24px',\n fontWeight: 400,\n },\n h400: {\n fontFamily: 'Rubik',\n fontSize: '14px',\n lineHeight: '17px',\n fontWeight: 400,\n },\n bodyExtraSmall: {\n fontFamily: 'Poppins',\n fontSize: '12px',\n lineHeight: '18px',\n fontWeight: 400,\n },\n bodySmall: {\n fontFamily: 'Poppins',\n fontSize: '14px',\n lineHeight: '21px',\n fontWeight: 400,\n },\n bodyMedium: {\n fontFamily: 'Poppins',\n fontSize: '16px',\n lineHeight: '24px',\n fontWeight: 400,\n },\n bodyLarge: {\n fontFamily: 'Poppins',\n fontSize: '18px',\n lineHeight: '27px',\n fontWeight: 500,\n },\n bodyHuge: {\n fontFamily: 'Poppins',\n fontSize: '22px',\n lineHeight: '27px',\n fontWeight: 500,\n },\n bodyExtraLarge: {\n fontFamily: 'Poppins',\n fontSize: '48px',\n lineHeight: '72px',\n fontWeight: 600,\n },\n },\n};\n\nconst Tabs = {\n variants: {\n primary: {\n tablist: {\n borderBottom: '1px solid',\n borderColor: 'whiteAlpha.200',\n },\n tabpanel: {\n padding: '30px 0 0',\n },\n tab: {\n fontFamily: 'Poppins',\n fontSize: '16px',\n lineHeight: '24px',\n fontWeight: 400,\n color: 'white',\n _selected: {\n position: 'relative',\n fontWeight: 600,\n _after: {\n content: '\"\"',\n position: 'absolute',\n bottom: '-1px',\n width: '100%',\n height: '2px',\n bg: 'brand.accent',\n },\n },\n },\n },\n 'soft-rounded': {\n tab: {\n borderRadius: 'full',\n fontSize: '14px',\n lineHeight: '21px',\n fontWeight: 'normal',\n color: 'whiteAlpha.500',\n padding: '8px 22px',\n _selected: {\n color: 'white',\n bg: 'brand.active',\n },\n },\n },\n },\n};\n\nconst Input = {\n variants: {\n rounded: {\n borderRadius: '20px',\n bg: 'transparent',\n },\n percentage: {\n field: {\n borderRadius: 'full',\n bg: 'whiteAlpha.100',\n textAlign: 'right',\n fontWeight: '500',\n border: '1px',\n borderColor: 'blue.500',\n },\n },\n percentage_inactive: {\n field: {\n borderRadius: 'full',\n bg: 'whiteAlpha.100',\n textAlign: 'right',\n fontWeight: '500',\n border: 'none',\n borderColor: '',\n },\n },\n },\n};\n\nconst Table = {\n variants: {\n dashboard: {\n table: {\n width: '100%',\n borderCollapse: 'separate',\n borderSpacing: '0 16px',\n },\n thead: {\n tr: {\n td: {\n fontFamily: 'Rubik',\n fontSize: '12px',\n lineHeight: '14px',\n color: 'whiteAlpha.400',\n textTransform: 'uppercase',\n paddingTop: '20px',\n paddingBottom: '8px',\n borderTop: '1px solid',\n },\n },\n _first: {\n transform: 'translateY(16px)',\n },\n },\n tbody: {\n /** Because the table uses tr as a link */\n a: {\n position: 'relative',\n _after: {\n content: '\"\"',\n position: 'absolute',\n borderRadius: '10px',\n boxSizing: 'border-box',\n border: '1px solid transparent',\n backgroundClip: 'padding-box, border-box',\n backgroundOrigin: 'padding-box, border-box',\n backgroundImage:\n 'linear-gradient(hsla(227, 12%, 15%, 1), hsla(227, 12%, 15%, 1)), linear-gradient(to right, hsla(0, 100%, 64%, 0.3) 0%, hsla(193, 100%, 50%, 0.3) 100%)',\n top: '0',\n left: '0',\n bottom: '0',\n right: '0',\n zIndex: 'var(--chakra-zIndices-hide)',\n },\n td: {\n fontSize: '18px',\n lineHeight: '27px',\n padding: '16px 30px',\n bg: 'whiteAlpha.30',\n _first: {\n borderLeftRadius: '10px',\n },\n _last: {\n borderRightRadius: '10px',\n },\n },\n },\n },\n },\n },\n};\n\nexport const theme = extendTheme({\n config: { initialColorMode: 'dark' },\n fonts: {\n heading: 'Rubik',\n body: 'Poppins',\n },\n colors: {\n white: 'hsl(0, 0%, 100%)',\n black: 'hsl(0,0%,0%)',\n brand: {\n bg: 'hsla(227, 12%, 15%, 1)',\n bgOpacity: 'hsla(0, 0%, 0%, 0.2)',\n active: 'hsla(227, 22%, 26%, 0.59)',\n accent:\n 'linear-gradient(to bottom, hsla(166, 100%, 46%, 1), hsla(165, 86%, 34%, 1))',\n gradientBg:\n 'linear-gradient(to bottom, hsla(0, 0%, 100%, 0.1), hsla(0, 0%, 100%, 0.03))',\n },\n accent_color: 'hsla(166, 100%, 46%, 0.9)',\n accent: {\n 100: 'accent_color',\n 200: 'hsla(166, 100%, 46%, 0.9)',\n 300: 'hsla(166, 100%, 46%, 0.8)',\n 400: 'hsla(166, 100%, 46%, 0.7)',\n 500: 'hsla(166, 100%, 46%, 0.6)',\n 600: 'hsla(166, 100%, 46%, 0.5)',\n 700: 'hsla(166, 100%, 46%, 0.4)',\n 800: 'hsla(166, 100%, 46%, 0.3)',\n 900: 'hsla(166, 100%, 46%, 0.2)',\n },\n whiteAlpha: {\n 30: 'hsla(0, 0%, 100%, 0.03)',\n 50: 'hsla(0, 0%, 100%, 0.05)',\n 100: 'hsla(0, 0%, 100%, 0.1)',\n 200: 'hsla(0, 0%, 100%, 0.2)',\n 300: 'hsla(0, 0%, 100%, 0.3)',\n 400: 'hsla(0, 0%, 100%, 0.4)',\n 500: 'hsla(0, 0%, 100%, 0.5)',\n 600: 'hsla(0, 0%, 100%, 0.6)',\n 700: 'hsla(0, 0%, 100%, 0.7)',\n 800: 'hsla(0, 0%, 100%, 0.8)',\n 900: 'hsla(0, 0%, 100%, 0.9)',\n },\n gray: {\n 50: 'hsla(204, 45%, 98%, 1)',\n 100: 'hsla(210, 38%, 95%, 1)',\n 200: 'hsla(214, 32%, 91%, 1)',\n 300: 'hsla(211, 25%, 84%, 1)',\n 400: 'hsla(214, 20%, 69%, 1)',\n 500: 'hsla(216, 15%, 52%, 1)',\n 600: 'hsla(218, 17%, 35%, 1)',\n 700: 'hsla(218, 23%, 23%, 1)',\n 800: 'hsla(220, 26%, 14%, 1)',\n 900: 'hsla(230, 21%, 11%, 1)',\n },\n blue: {\n 50: 'hsla(201, 100%, 96%, 1)',\n 100: 'hsla(202, 81%, 86%, 1)',\n 200: 'hsla(203, 82%, 76%, 1)',\n 300: 'hsla(205, 79%, 66%, 1)',\n 400: 'hsla(207, 73%, 57%, 1)',\n 500: 'hsla(209, 62%, 50%, 1)',\n 600: 'hsla(211, 61%, 43%, 1)',\n 700: 'hsla(213, 49%, 34%, 1)',\n 800: 'hsla(215, 41%, 28%, 1)',\n 900: 'hsla(215, 56%, 23%, 1)',\n },\n },\n zIndices: {\n header: 100,\n },\n styles: {\n global: {\n body: {\n bg: 'brand.bg',\n color: 'white',\n },\n a: {\n textDecoration: 'none !important',\n },\n },\n },\n components: {\n Button,\n Text,\n Tabs,\n Input,\n Table,\n Link,\n Container,\n },\n});\n","import { Box, ChakraProvider } from '@chakra-ui/react';\nimport { useConfig, useEthers } from '@usedapp/core';\nimport { ethers } from 'ethers';\nimport * as React from 'react';\nimport { useEffect } from 'react';\nimport { Outlet, useLocation } from 'react-router-dom';\nimport { useAddresses } from './chain-interaction/contracts';\nimport NavigationBar from './components/navigation/NavigationBar';\nimport GlobalDebtCeilingMessage from './components/notifications/GlobalDebtCeilingMessage';\nimport MigratePositionsComponent from './components/notifications/MigratePositionsComponent';\nimport NetworkNotSupported from './components/notifications/NetworkNotSupported';\nimport PhishingAlertComponent from './components/notifications/PhishingAlertComponent';\nimport { TransactionToasts } from './components/notifications/TransactionToasts';\nimport { ExternalMetadataCtxProvider } from './contexts/ExternalMetadataContext';\nimport { LiquidationFeesCtxProvider } from './contexts/LiquidationFeesContext';\nimport MakeMostOfMoneyCtxProvider from './contexts/MakeMostOfMoneyContext';\nimport { StrategyMetadataCtxProvider } from './contexts/StrategyMetadataContext';\nimport { UserAddressCtxProvider } from './contexts/UserAddressContext';\nimport { WalletBalancesCtxProvider } from './contexts/WalletBalancesContext';\nimport { theme } from './theme';\n\ndeclare let window: any;\n\nexport const App = (params: React.PropsWithChildren) => {\n const addresses = useAddresses();\n const { active, chainId, activateBrowserWallet, account } = useEthers();\n // const chainIdsList = [31337, 43114];\n const config = useConfig();\n const chainIdsList = config.networks!.map((network) => network.chainId);\n\n const [requestedSwitch, setRequestedSwitch] = React.useState(false);\n useEffect(() => {\n (async () => {\n const wallet = new ethers.providers.Web3Provider(window.ethereum);\n const { chainId: walletChainId } = await wallet.getNetwork();\n const accounts = await wallet.listAccounts();\n\n if (chainId === 31337) {\n activateBrowserWallet();\n }\n\n if (\n accounts.length > 0 &&\n !requestedSwitch &&\n walletChainId &&\n !chainIdsList.includes(walletChainId)\n ) {\n setRequestedSwitch(true);\n try {\n await wallet.provider.request!({\n method: 'wallet_switchEthereumChain',\n params: [{ chainId: '0xa86a' }],\n });\n activateBrowserWallet();\n } catch (switchError) {\n try {\n await wallet.provider.request!({\n method: 'wallet_addEthereumChain',\n params: [\n {\n chainId: '0xa86a',\n chainName: 'Avalanche Network',\n nativeCurrency: {\n name: 'avax',\n symbol: 'AVAX',\n decimals: 18,\n },\n rpcUrls: ['https://api.avax.network/ext/bc/C/rpc'],\n blockExplorerUrls: ['https://snowtrace.io/'],\n },\n ],\n });\n activateBrowserWallet();\n } catch (addError) {\n alert(\n `Your wallet may be connected to an unsupported network. Please manually switch to a supported network: ${addError}`\n );\n }\n }\n } else if (accounts.length > 0 && !account) {\n activateBrowserWallet();\n }\n })();\n }, [active, chainId]);\n\n const location = useLocation();\n useEffect(() => window.scrollTo(0, 0), [location]);\n\n return (\n \n \n \n \n \n {addresses ? (\n <>\n \n \n \n \n \n \n \n \n
\n \n \n {/* */}\n \n {params.children}\n \n \n
\n
\n \n \n ) : (\n \n )}\n
\n
\n
\n
\n
\n );\n};\n","import { Progress } from '@chakra-ui/react';\nimport { CurrencyValue } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport { parseEther } from 'ethers/lib/utils';\nimport React, { useEffect, useState } from 'react';\nimport {\n ParsedPositionMetaRow,\n parsePositionMeta,\n useStable,\n useUpdatedMetadataLiquidatablePositions,\n useUpdatedPositions,\n} from '../chain-interaction/contracts';\nimport { parseFloatCurrencyValue } from '../utils';\nimport { StrategyMetadataContext } from './StrategyMetadataContext';\n\nexport const LiquidatablePositionsContext = React.createContext<\n ParsedPositionMetaRow[] | []\n>([]);\n\ntype CachedPos = {\n trancheId: number;\n strategy: string;\n collateral: string;\n debt: number;\n token: string;\n collateralValue: number;\n borrowablePer10k: number;\n owner: string;\n trancheContract: string;\n};\n\nexport function LiquidatablePositionsCtxProvider({\n children,\n}: React.PropsWithChildren) {\n const tokenPrices = Object.fromEntries(\n Object.entries(React.useContext(StrategyMetadataContext))\n .filter((row) => Object.values(row[1]).length > 0)\n .map(([tokenAddress, stratMeta]) => [\n tokenAddress,\n Object.values(stratMeta)[0].usdPrice,\n ])\n );\n const stable = useStable();\n\n const [cachedPositions, setCachedPosition] = useState<{\n tstamp: number;\n positions: Record;\n }>({\n tstamp: Date.now(),\n positions: {},\n });\n useEffect(() => {\n fetch(\n 'https://raw.githubusercontent.com/MoreMoney-Finance/craptastic-api/main/src/v2-updated-positions.json'\n // 'https://raw.githubusercontent.com/MoreMoney-Finance/craptastic-api/main/src/updated-positions.json'\n )\n .then((response) => response.json())\n .then(setCachedPosition)\n .catch((err) => {\n console.error('Failed to fetch cached positions');\n console.log(err);\n });\n }, []);\n const parsedCachePositions = Object.values(cachedPositions.positions)\n .map((pos) => ({\n trancheId: BigNumber.from(pos.trancheId),\n strategy: pos.strategy,\n collateral: BigNumber.from(pos.collateral),\n debt: parseEther(pos.debt.toString()),\n token: pos.token,\n collateralValue: parseEther(pos.collateralValue.toString()),\n borrowablePer10k: BigNumber.from(pos.borrowablePer10k),\n owner: pos.owner,\n yield: BigNumber.from(0),\n trancheContract: pos.trancheContract,\n }))\n .map((pos) => parsePositionMeta(pos, stable, pos.trancheContract));\n\n const START = cachedPositions.tstamp;\n const updatedPositions = useUpdatedPositions(START);\n // console.log('parseCachePositions', parsedCachePositions);\n // console.log('updatedPositions', updatedPositions);\n const jointUpdatedPositions = [...parsedCachePositions, ...updatedPositions];\n const updatedMetadata =\n useUpdatedMetadataLiquidatablePositions(parsedCachePositions);\n const updatedPositionMetadata = updatedMetadata\n .map((x) => (x && x[0] != undefined ? x[0] : []))\n .map((pos) => {\n return parsePositionMeta(pos, stable, pos.trancheContract);\n });\n\n const updatedDataMap = updatedPositionMetadata.reduce((acc, x) => {\n acc[x.trancheId] = x;\n return acc;\n }, {} as Record);\n\n const parsedPositions = new Map();\n for (let index = 0; index < jointUpdatedPositions.length; index++) {\n const pos = jointUpdatedPositions[index];\n const posUpdatedData = {\n ...updatedDataMap[pos.trancheId],\n trancheContract: pos.trancheContract,\n };\n parsedPositions.set(pos.trancheId, posUpdatedData);\n }\n const dollar = new CurrencyValue(stable, parseEther('1'));\n\n const stableTickers = [\n 'USDT',\n 'USDC',\n 'DAI',\n 'FRAX',\n 'USDT.e',\n 'USDC.e',\n 'DAI.e',\n ];\n\n const liquidatablePositions = Array.from(parsedPositions.values())\n .filter((posMeta) => {\n return (\n 1.25 * posMeta.liquidationPrice > tokenPrices[posMeta.token?.address] &&\n posMeta.debt.gt(dollar)\n );\n })\n .map((posMeta) => {\n const collateralVal =\n parseFloatCurrencyValue(posMeta.collateral!) *\n tokenPrices[posMeta.token?.address];\n const totalPercentage =\n parseFloatCurrencyValue(posMeta.collateral!) > 0 &&\n tokenPrices[posMeta.token?.address] > 0\n ? (100 * parseFloatCurrencyValue(posMeta.debt)) / collateralVal\n : 0;\n const liquidatableZone = posMeta.borrowablePercent;\n const criticalZone = (90 * posMeta.borrowablePercent) / 100;\n const riskyZone = (80 * posMeta.borrowablePercent) / 100;\n const healthyZone = (50 * posMeta.borrowablePercent) / 100;\n\n const positionHealthColor = posMeta.debt.value.lt(parseEther('0.1'))\n ? 'accent'\n : totalPercentage > liquidatableZone\n ? 'purple.400'\n : totalPercentage > criticalZone\n ? 'red'\n : totalPercentage > riskyZone\n ? 'orange'\n : totalPercentage > healthyZone\n ? 'green'\n : 'accent';\n\n const positionHealth = {\n accent: 'Safe',\n green: 'Healthy',\n orange: 'Risky',\n red: 'Critical',\n ['purple.400']: 'Liquidatable',\n };\n\n return {\n ...posMeta,\n liquidateButton:\n posMeta.liquidationPrice > tokenPrices[posMeta.token?.address],\n positionHealthColor: positionHealthColor,\n parsedPositionHealth: positionHealth[positionHealthColor],\n collateralValue: new CurrencyValue(\n stable,\n parseEther(collateralVal.toFixed(18))\n ),\n };\n })\n .map((posMeta) => {\n const positionHealthOrder = new Map([\n ['Safe', 4],\n ['Healthy', 3],\n ['Risky', 2],\n ['Critical', 1],\n ['Liquidatable', 0],\n ]);\n\n return {\n ...posMeta,\n positionHealthOrder:\n positionHealthOrder.get(posMeta.parsedPositionHealth) ?? 4,\n };\n })\n .filter((posMeta) => !stableTickers.includes(posMeta.token?.ticker))\n //sort liquidatable first\n .sort(function (a, b) {\n return a.positionHealthOrder - b.positionHealthOrder;\n });\n\n return (\n \n {Object.values(updatedDataMap).length > 0 ? (\n children\n ) : (\n \n )}\n \n );\n}\n","import { Button, Flex, useClipboard } from '@chakra-ui/react';\nimport * as React from 'react';\n\nexport default function CopyClipboard({\n value,\n label,\n}: {\n value: string;\n label?: string;\n}) {\n const { hasCopied, onCopy } = useClipboard(value);\n\n return (\n <>\n \n \n \n \n );\n}\n","import {\n Accordion,\n AccordionItem,\n AccordionButton,\n Box,\n AccordionIcon,\n AccordionPanel,\n Button,\n} from '@chakra-ui/react';\nimport { useEthers, getExplorerAddressLink } from '@usedapp/core';\nimport * as React from 'react';\nimport { useAddresses } from '../../../chain-interaction/contracts';\nimport CopyClipboard from './CopyClipboard/CopyClipboard';\n\nexport default function AllAddresses(props: React.PropsWithChildren) {\n const addresses = useAddresses();\n const { chainId } = useEthers();\n\n return (\n
\n \n \n

\n \n \n Addresses.json\n \n \n \n

\n \n
\n \n \n \n \n \n \n \n {Object.entries(addresses).map(([key, value]) => (\n \n \n \n \n \n ))}\n \n
Deployment NameCopy ClipboardFees
\n \n {key}\n \n \n \n \n \n
\n
    \n {props.children}\n
    \n
    \n
    \n
    \n {props.children}\n
    \n );\n}\n","export const deprecatedTokenList: string[] = [\n '0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664',\n '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70',\n '0x57319d41F71E81F3c65F2a47CA4e001EbAFd4F33',\n '0xd5a37dC5C9A396A03dd1136Fc76A1a02B1c88Ffa',\n];\n","import { HStack, AvatarGroup, Avatar, Text, Flex } from '@chakra-ui/react';\nimport { Token } from '@usedapp/core';\nimport * as React from 'react';\nimport {\n getAuxIconFromTokenAddress,\n getIconsFromTokenAddress,\n} from '../../chain-interaction/tokens';\nimport { deprecatedTokenList } from '../../constants/deprecated-token-list';\n\nexport function TokenDescription({\n token,\n iconSize,\n textSize,\n}: {\n token?: Token;\n iconSize?: string;\n textSize?: string;\n}) {\n const targetSize = iconSize ?? 'xs';\n const auxIcon = getAuxIconFromTokenAddress(token?.address ?? '');\n const isDeprecated = deprecatedTokenList.includes(token?.address ?? '');\n\n return token ? (\n \n \n \n {(getIconsFromTokenAddress(token.address) ?? []).map((iconUrl, i) => (\n \n ))}\n \n  \n \n {token.ticker}\n {isDeprecated ? <>(deprecated) : ''}\n \n  \n {auxIcon ? (\n <>\n (\n \n \n \n )\n \n ) : undefined}\n \n \n ) : (\n Loading token information\n );\n}\n","import { Interface } from '@ethersproject/abi';\nimport { Contract } from '@ethersproject/contracts';\nimport IERC20 from '@openzeppelin/contracts/build/contracts/IERC20.json';\nimport { useCall, useContractFunction } from '@usedapp/core';\nimport { CurrencyValue, Token } from '@usedapp/core/dist/esm/src/model';\nimport { BigNumber, ethers } from 'ethers';\nimport { getAddress, parseEther, parseUnits } from 'ethers/lib/utils';\nimport { useContext } from 'react';\nimport { UserAddressContext } from '../contexts/UserAddressContext';\nimport xMore from '../contracts/artifacts/contracts/governance/xMore.sol/xMore.json';\nimport DirectFlashLiquidation from '../contracts/artifacts/contracts/liquidation/DirectFlashLiquidation.sol/DirectFlashLiquidation.json';\nimport StableLending2Liquidation from '../contracts/artifacts/contracts/liquidation/StableLending2Liquidation.sol/StableLending2Liquidation.json';\nimport OracleRegistry from '../contracts/artifacts/contracts/OracleRegistry.sol/OracleRegistry.json';\nimport VestingLaunchReward from '../contracts/artifacts/contracts/rewards/VestingLaunchReward.sol/VestingLaunchReward.json';\nimport StableLending2 from '../contracts/artifacts/contracts/StableLending2.sol/StableLending2.json';\nimport AMMYieldConverter from '../contracts/artifacts/contracts/strategies/AMMYieldConverter.sol/AMMYieldConverter.json';\nimport YieldConversionStrategy from '../contracts/artifacts/contracts/strategies/YieldConversionStrategy.sol/YieldConversionStrategy.json';\nimport YieldYakStrategy from '../contracts/artifacts/contracts/strategies/YieldYakStrategy.sol/YieldYakStrategy.json';\nimport Strategy from '../contracts/artifacts/contracts/Strategy.sol/Strategy.json';\nimport WrapNativeStableLending2 from '../contracts/artifacts/contracts/WrapNativeStableLending2.sol/WrapNativeStableLending2.json';\nimport IOracle from '../contracts/artifacts/interfaces/IOracle.sol/IOracle.json';\nimport VeMoreToken from '../contracts/artifacts/contracts/governance/VeMoreToken.sol/VeMoreToken.json';\nimport VeMoreStaking from '../contracts/artifacts/contracts/governance/VeMoreStaking.sol/VeMoreStaking.json';\nimport StableLending2InterestForwarder from '../contracts/artifacts/contracts/rewards/StableLending2InterestForwarder.sol/StableLending2InterestForwarder.json';\nimport {\n useAddresses,\n useRegisteredOracle,\n useStable,\n useYieldConversionStrategyView,\n} from './contracts';\nimport { parseFloatCurrencyValue } from '../utils';\nimport { handleCallResultDefault } from './wrapper';\n\nexport function useWithdrawFees(strategyAddress: string, tokenAddress: string) {\n const contractsABI: Record = {\n [useAddresses().YieldYakStrategy]: new Interface(YieldYakStrategy.abi),\n [useAddresses().StableLending2]: new Interface(StableLending2.abi),\n };\n const isYY = useAddresses().YieldYakStrategy === strategyAddress;\n\n const feesContract = new Contract(\n strategyAddress,\n contractsABI[strategyAddress] ?? new Interface(StableLending2.abi)\n );\n const { send, state } = useContractFunction(feesContract, 'withdrawFees');\n\n return {\n sendWithdrawFees:\n contractsABI[strategyAddress] === undefined\n ? null\n : isYY\n ? () => send(tokenAddress)\n : () => send(),\n withdrawState: state,\n };\n}\n\nexport function useBalanceOfVeMoreToken(account: string) {\n const address = useAddresses().VeMoreToken;\n const abi = new Interface(VeMoreToken.abi);\n const contract = new Contract(address, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'balanceOf',\n args: [account],\n }),\n 0,\n 'VeMoreToken balanceOf'\n );\n}\n\nexport function useGetStakedMoreVeMoreToken(account: string) {\n const address = useAddresses().VeMoreStaking;\n const abi = new Interface(VeMoreStaking.abi);\n const contract = new Contract(address, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'getStakedMore',\n args: [account],\n }),\n 0,\n 'VeMoreStaking getStakedMore'\n );\n}\n\nexport function useClaimableVeMoreToken(account: string) {\n const address = useAddresses().VeMoreStaking;\n const abi = new Interface(VeMoreStaking.abi);\n const contract = new Contract(address, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'claimable',\n args: [account],\n }),\n 0,\n 'VeMoreStaking claimable'\n );\n}\n\nexport function useViewPendingReward(account: string, defaultResult: any) {\n const address = useAddresses().StableLending2InterestForwarder;\n const abi = new Interface(StableLending2InterestForwarder.abi);\n const contract = new Contract(address, abi);\n return handleCallResultDefault(\n useCall({\n contract,\n method: 'viewPendingReward',\n args: [account],\n }),\n defaultResult,\n 'useViewPendingReward'\n );\n}\n\nexport function useClaimIMoney() {\n const addresses = useAddresses();\n const cprAddress = addresses.StableLending2InterestForwarder;\n const cprContract = new Contract(\n cprAddress,\n new Interface(StableLending2InterestForwarder.abi)\n );\n const { send, state } = useContractFunction(cprContract, 'deposit');\n\n return {\n sendClaim: () => {\n return send(BigNumber.from(0));\n },\n claimState: state,\n };\n}\n\nexport function useClaimVeMore() {\n const addresses = useAddresses();\n const cprAddress = addresses.VeMoreStaking;\n const cprContract = new Contract(\n cprAddress,\n new Interface(VeMoreStaking.abi)\n );\n const { send, state } = useContractFunction(cprContract, 'claim');\n\n return {\n sendClaim: () => {\n return send();\n },\n claimState: state,\n };\n}\n\nexport function useUnstakeVeMoreTokenForMore() {\n const addresses = useAddresses();\n const cprAddress = addresses.VeMoreStaking;\n const cprContract = new Contract(\n cprAddress,\n new Interface(VeMoreStaking.abi)\n );\n const { send, state } = useContractFunction(cprContract, 'withdraw');\n\n return {\n sendUnstake: (unstakeToken: Token, amount: string | number) => {\n const sAmount = parseUnits(amount.toString(), unstakeToken.decimals);\n return send(sAmount);\n },\n unstakeState: state,\n };\n}\n\nexport function useStakeMoreForVeMoreToken() {\n // TODO: change cprAddress and the ABI to use the correct address\n const addresses = useAddresses();\n const cprAddress = addresses.VeMoreStaking;\n\n const cprContract = new Contract(\n cprAddress,\n new Interface(VeMoreStaking.abi)\n );\n const { send, state } = useContractFunction(cprContract, 'deposit');\n\n return {\n sendStake: (stakeToken: Token, amount: string | number) => {\n const sAmount = parseUnits(amount.toString(), stakeToken.decimals);\n return send(sAmount);\n },\n stakeState: state,\n };\n}\n\nexport function useUnstakeMore() {\n // TODO: change cprAddress and the ABI to use the correct address\n const cprAddress = useAddresses().xMore;\n const cprContract = new Contract(cprAddress, new Interface(xMore.abi));\n const { send, state } = useContractFunction(cprContract, 'leave');\n\n return {\n sendUnstake: (leaveMoreTokenToken: Token, amount: string | number) => {\n const sAmount = parseUnits(\n amount.toString(),\n leaveMoreTokenToken.decimals\n );\n return send(sAmount);\n },\n unstakeState: state,\n };\n}\n\nexport function useStakeMore() {\n // TODO: change cprAddress and the ABI to use the correct address\n const cprAddress = useAddresses().xMore;\n const cprContract = new Contract(cprAddress, new Interface(xMore.abi));\n const { send, state } = useContractFunction(cprContract, 'enter');\n\n return {\n sendStake: (stakeMoreToken: Token, amount: string | number) => {\n const sAmount = parseUnits(amount.toString(), stakeMoreToken.decimals);\n return send(sAmount);\n },\n stakeState: state,\n };\n}\n\nexport function useStakeIMoney() {\n const cprAddress = useAddresses().StableLending2InterestForwarder;\n const cprContract = new Contract(\n cprAddress,\n new Interface(StableLending2InterestForwarder.abi)\n );\n const { send, state } = useContractFunction(cprContract, 'deposit');\n\n return {\n sendDepositIMoney: (stakeToken: Token, amount: string | number) => {\n const sAmount = parseUnits(amount.toString(), stakeToken.decimals);\n return send(sAmount);\n },\n depositState: state,\n };\n}\n\nexport function useWithdrawIMoney() {\n const cprAddress = useAddresses().StableLending2InterestForwarder;\n const cprContract = new Contract(\n cprAddress,\n new Interface(StableLending2InterestForwarder.abi)\n );\n const { send, state } = useContractFunction(cprContract, 'withdraw');\n\n return {\n sendWithdrawIMoney: (withdrawToken: Token, amount: string | number) => {\n const wAmount = parseUnits(amount.toString(), withdrawToken.decimals);\n return send(wAmount);\n },\n withdrawState: state,\n };\n}\n\nexport function useNativeDepositBorrowTrans(\n trancheId: number | null | undefined\n) {\n const addresses = useAddresses();\n const lendingContract = new Contract(\n addresses.WrapNativeStableLending2,\n new Interface(WrapNativeStableLending2.abi)\n );\n const { send, state } = useContractFunction(\n lendingContract,\n trancheId ? 'depositAndBorrow' : 'mintDepositAndBorrow'\n );\n const account = useContext(UserAddressContext);\n\n return {\n sendDepositBorrow: (\n collateralToken: Token,\n strategyAddress: string,\n collateralAmount: string | number,\n borrowAmount: string | number\n ) => {\n const cAmount = parseUnits(\n collateralAmount.toString(),\n collateralToken.decimals\n );\n const bAmount = parseEther(borrowAmount.toString());\n\n return trancheId\n ? send(trancheId, bAmount, account, { value: cAmount })\n : send(strategyAddress, bAmount, account, { value: cAmount });\n },\n depositBorrowState: state,\n };\n}\n\nexport function useNativeRepayWithdrawTrans(\n trancheId: number | null | undefined,\n collateralToken: Token | null | undefined,\n totalDebt: CurrencyValue | undefined\n) {\n const addresses = useAddresses();\n const lendingContract = new Contract(\n addresses.WrapNativeStableLending2,\n new Interface(WrapNativeStableLending2.abi)\n );\n\n const { send, state } = useContractFunction(\n lendingContract,\n 'repayAndWithdraw'\n );\n\n const account = useContext(UserAddressContext);\n\n return {\n sendRepayWithdraw: (\n collateralAmount: string | number,\n repayAmount: string | number\n ) =>\n account && trancheId && collateralToken && totalDebt\n ? send(\n trancheId,\n parseUnits(collateralAmount.toString(), collateralToken.decimals),\n prepRepayAmount(repayAmount, totalDebt),\n account\n )\n : console.error('Trying to withdraw but parameters not set'),\n repayWithdrawState: state,\n };\n}\n\nfunction prepRepayAmount(\n repayAmount: string | number,\n totalDebt: CurrencyValue\n) {\n const parsedNumber = parseFloat(repayAmount.toString());\n if (Math.abs(parsedNumber - parseFloatCurrencyValue(totalDebt)) < 1) {\n return parseEther((parsedNumber * 1.10).toString());\n } else {\n return parseEther(repayAmount.toString());\n }\n}\n\nexport function useDepositBorrowTrans(trancheId: number | null | undefined) {\n const addresses = useAddresses();\n const lendingContract = new Contract(\n addresses.StableLending2,\n new Interface(StableLending2.abi)\n );\n const { send, state } = useContractFunction(\n lendingContract,\n trancheId ? 'depositAndBorrow' : 'mintDepositAndBorrow'\n );\n const account = useContext(UserAddressContext);\n\n return {\n sendDepositBorrow: (\n collateralToken: Token,\n strategyAddress: string,\n collateralAmount: string | number,\n borrowAmount: string | number\n ) => {\n const cAmount = parseUnits(\n collateralAmount.toString(),\n collateralToken.decimals\n );\n const bAmount = parseEther(borrowAmount.toString());\n\n return trancheId\n ? send(trancheId, cAmount, bAmount, account)\n : send(\n collateralToken.address,\n strategyAddress,\n cAmount,\n bAmount,\n account\n );\n },\n depositBorrowState: state,\n };\n}\n\nexport function useApproveTrans(tokenAddress: string) {\n const tokenContract = new Contract(tokenAddress, new Interface(IERC20.abi));\n const { send, state } = useContractFunction(tokenContract, 'approve');\n\n return {\n sendApprove: (spender: string) =>\n send(spender, ethers.constants.MaxUint256),\n approveState: state,\n };\n}\n\nexport function useRepayWithdrawTrans(\n trancheId: number | null | undefined,\n collateralToken: Token | null | undefined,\n totalDebt: CurrencyValue | undefined\n) {\n const addresses = useAddresses();\n const lendingContract = new Contract(\n addresses.StableLending2,\n new Interface(StableLending2.abi)\n );\n\n const { send, state } = useContractFunction(\n lendingContract,\n 'repayAndWithdraw'\n );\n\n const account = useContext(UserAddressContext);\n\n return {\n sendRepayWithdraw: (\n collateralAmount: string | number,\n repayAmount: string | number\n ) =>\n account && trancheId && collateralToken && totalDebt\n ? send(\n trancheId,\n parseUnits(collateralAmount.toString(), collateralToken.decimals),\n prepRepayAmount(repayAmount, totalDebt),\n account\n )\n : console.error('Trying to withdraw but parameters not set'),\n repayWithdrawState: state,\n };\n}\n\nexport function useTallyHarvestBalance(strategyAddress: string) {\n const strategy = new Contract(strategyAddress, new Interface(Strategy.abi));\n const { send, state } = useContractFunction(strategy, 'tallyHarvestBalance');\n\n return {\n sendTallyHarvestBalance: (tokenAddress: string) => send(tokenAddress),\n tallyHarvestState: state,\n };\n}\n\nexport function useConvertReward2Stable(contractAddress: string) {\n const strategy = new Contract(\n contractAddress,\n new Interface(YieldConversionStrategy.abi)\n );\n const { send, state } = useContractFunction(strategy, 'convertReward2Stable');\n\n return {\n sendConvertReward2Stable: (rewardAmount: BigNumber, targetBid: BigNumber) =>\n send(rewardAmount, targetBid),\n convertReward2StableState: state,\n };\n}\n\nexport function useUpdateOraclePrice() {\n const addresses = useAddresses();\n const inAmount = parseEther('1');\n const stable = useStable();\n\n const strategy = new Contract(\n addresses.OracleRegistry,\n new Interface(OracleRegistry.abi)\n );\n const { send, state } = useContractFunction(strategy, 'getAmountInPeg');\n\n return {\n sendUpdateOraclePrice: (tokenAddress: string) =>\n send(tokenAddress, inAmount, stable.address),\n updateOraclePriceState: state,\n };\n}\n\nexport function useHarvestPartially(strategyAddress: string) {\n const strategy = new Contract(\n strategyAddress,\n new Interface(YieldConversionStrategy.abi)\n );\n const { send, state } = useContractFunction(strategy, 'harvestPartially');\n return {\n sendHarvestPartially: (tokenAddress: string) => send(tokenAddress),\n harvestPartiallyState: state,\n };\n}\n\nexport function useMigrateStrategy(\n lendingContractAddress: string | undefined | null\n) {\n const addresses = useAddresses();\n const lendingAddress = lendingContractAddress ?? addresses.StableLending2;\n\n const strategy = new Contract(\n lendingAddress,\n new Interface(StableLending2.abi)\n );\n const { send, state } = useContractFunction(strategy, 'migrateStrategy');\n\n return {\n sendMigrateStrategy: (\n trancheId: number,\n targetStrategy: string,\n stable: Token,\n account: string\n ) => send(trancheId, targetStrategy, stable.address, account),\n migrateStrategyState: state,\n };\n}\n\nconst PNG = '0x60781C2586D68229fde47564546784ab3fACA982';\nconst JOE = '0x6e84a6216eA6dACC71eE8E6b0a5B7322EEbC0fDd';\nconst USDCe = '0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664';\nconst USDTe = '0xc7198437980c041c805A1EDcbA50c1Ce5db95118';\n\nconst ammDefaults: Record = {\n [PNG]: {\n router: '0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106',\n path: [PNG, USDCe],\n },\n [JOE]: {\n router: '0x60aE616a2155Ee3d9A68541Ba4544862310933d4',\n path: [JOE, USDCe],\n },\n [USDTe]: {\n router: '0x60aE616a2155Ee3d9A68541Ba4544862310933d4',\n path: [USDTe, USDCe],\n },\n};\n\nexport function useAMMHarvest(strategyAddress: string) {\n const conversionAddress = useAddresses().AMMYieldConverter;\n const conversionContract = new Contract(\n conversionAddress,\n new Interface(AMMYieldConverter.abi)\n );\n const rewardToken: string | undefined = useYieldConversionStrategyView(\n strategyAddress,\n 'rewardToken',\n [],\n undefined\n );\n\n const undefinedArgs = { router: undefined, path: undefined };\n const { router, path } = rewardToken\n ? ammDefaults[getAddress(rewardToken)] ?? undefinedArgs\n : undefinedArgs;\n const { send, state } = useContractFunction(conversionContract, 'harvest');\n\n return {\n sendAMMHarvest: (yieldBearingToken: string) => {\n // console.log(\n // 'Sending AMM harvest',\n // strategyAddress,\n // yieldBearingToken,\n // router,\n // path\n // );\n send(strategyAddress, yieldBearingToken, router, path);\n },\n AMMHarvestState: state,\n };\n}\n\nexport function useUpdatePriceOracle(token?: Token) {\n const oracleAddress = useRegisteredOracle(token?.address);\n const oracleContract =\n oracleAddress && new Contract(oracleAddress, IOracle.abi);\n const stable = useStable();\n\n const { send, state } = useContractFunction(oracleContract, 'getAmountInPeg');\n return {\n sendUpdatePriceOracle: () =>\n token && send(token.address, parseEther('1'), stable.address),\n updatePriceOracleState: state,\n };\n}\n\nexport async function viewBidTarget(\n trancheId: number,\n lendingAddress: string,\n requestedColVal: string,\n defaultResult: any\n) {\n const provider = new ethers.providers.JsonRpcProvider(\n 'https://api.avax.network/ext/bc/C/rpc'\n );\n\n const liquidationContract = new ethers.Contract(\n lendingAddress,\n new Interface(StableLending2Liquidation.abi),\n provider\n );\n\n const result = await liquidationContract.viewBidTarget(\n trancheId,\n parseEther(requestedColVal)\n );\n return result ?? defaultResult;\n}\n\nexport function usePrimitiveLiquidationTrans() {\n const addresses = useAddresses();\n const lendingAddress = addresses.StableLending2Liquidation;\n const liquidationContract = new Contract(\n lendingAddress,\n new Interface(StableLending2Liquidation.abi)\n );\n const { send, state } = useContractFunction(liquidationContract, 'liquidate');\n\n return {\n sendLiquidation: (\n trancheId: number,\n collateralRequested: string,\n rebalancingBid: string,\n recipient: string\n ) =>\n send(\n trancheId,\n parseEther(collateralRequested),\n rebalancingBid,\n recipient\n ),\n liquidationState: state,\n };\n}\n\nexport function useLiquidationTrans(contractAddress: string) {\n const liquidationContract = new Contract(\n contractAddress,\n new Interface(DirectFlashLiquidation.abi)\n );\n const { send, state } = useContractFunction(liquidationContract, 'liquidate');\n\n return {\n sendLiquidation: send,\n liquidationState: state,\n };\n}\n\nexport function useWithdrawLaunchVestingTrans() {\n const addresses = useAddresses();\n return useContractFunction(\n new Contract(\n addresses.VestingLaunchReward,\n new Interface(VestingLaunchReward.abi)\n ),\n 'burn'\n );\n}\n","import {\n Button,\n Modal,\n ModalBody,\n ModalCloseButton,\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalOverlay,\n useDisclosure,\n} from '@chakra-ui/react';\nimport { TransactionStatus } from '@usedapp/core';\nimport * as React from 'react';\nimport { useEffect } from 'react';\n\nexport function TransactionErrorDialog({\n title,\n state,\n}: {\n title: string;\n state: TransactionStatus;\n}) {\n const { isOpen, onOpen, onClose } = useDisclosure();\n\n useEffect(() => {\n if (['Fail', 'Exception'].includes(state.status)) {\n onOpen();\n }\n }, [state]);\n\n return (\n <>\n \n \n \n {title} - Transaction Failed\n \n {state.errorMessage}\n \n \n \n \n \n \n );\n}\n","import { Button } from '@chakra-ui/react';\nimport { Token } from '@usedapp/core';\nimport * as React from 'react';\nimport { useUpdateOraclePrice } from '../../../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../../../components/notifications/TransactionErrorDialog';\n\nexport default function UpdatePriceOracle({ token }: { token: Token }) {\n const { sendUpdateOraclePrice, updateOraclePriceState } =\n useUpdateOraclePrice();\n\n return (\n <>\n \n {\n sendUpdateOraclePrice(token.address);\n }}\n >\n Update Price Oracle\n \n \n );\n}\n","import { Button } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { ParsedStratMetaRow } from '../../../../../chain-interaction/contracts';\nimport { useWithdrawFees } from '../../../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../../../components/notifications/TransactionErrorDialog';\n\nexport default function WithdrawFees({\n stratMeta,\n}: React.PropsWithChildren<{ stratMeta: ParsedStratMetaRow }>) {\n const { sendWithdrawFees, withdrawState } = useWithdrawFees(\n stratMeta.strategyAddress,\n stratMeta.token.address\n );\n\n const withdrawFees = () => {\n sendWithdrawFees!();\n };\n\n return (\n <>\n {sendWithdrawFees !== null ? (\n <>\n \n \n \n ) : (\n <>\n )}\n \n );\n}\n","import { Button, Flex } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { TokenDescription } from '../../../../components/tokens/TokenDescription';\nimport { StrategyMetadataContext } from '../../../../contexts/StrategyMetadataContext';\nimport CopyClipboard from '../CopyClipboard/CopyClipboard';\nimport UpdatePriceOracle from './components/UpdatePriceOracle';\nimport WithdrawFees from './components/WithdrawFees';\n\nexport default function AllContracts(props: React.PropsWithChildren) {\n const stratMeta = React.useContext(StrategyMetadataContext);\n return (\n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n {Object.values(stratMeta).map((strat) => {\n return Object.values(strat).map((strat, index) => {\n return (\n \n \n \n \n \n \n \n );\n });\n })}\n \n
    AssetStrategyFeesOracleHarvest
    \n \n \n \n \n \n

    {strat.strategyName}

    \n
    \n \n \n \n \n \n
    \n {props.children}\n
    \n );\n}\n","import { Button, Td, Text, Tr } from '@chakra-ui/react';\nimport { CurrencyValue } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport {\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n useStable,\n} from '../../../../../chain-interaction/contracts';\nimport { TokenDescription } from '../../../../../components/tokens/TokenDescription';\nimport CopyClipboard from '../../CopyClipboard/CopyClipboard';\nimport { LiquidatableAction } from './PositionsTable';\n\nexport function PositionsRow(\n params: React.PropsWithChildren<\n ParsedStratMetaRow & ParsedPositionMetaRow & { action?: LiquidatableAction }\n >\n) {\n const { token, action, liquidateButton } = params;\n\n // const location = useLocation();\n // const details = location.search?.includes('details=true');\n\n // console.log('details', details);\n\n const actionArgs =\n action && action.args ? action.args : () => ({} as Record);\n\n const stable = useStable();\n\n // const walletBalance =\n // useWalletBalance(token.address) ??\n // new CurrencyValue(token, BigNumber.from('0'));\n // console.log(\n // `wallet balance for ${token.name}: ${walletBalance.format({\n // significantDigits: 30,\n // })} (${token.address})`\n // );\n\n const collateral =\n 'collateral' in params && params.collateral\n ? params.collateral\n : new CurrencyValue(token, BigNumber.from(0));\n const debt =\n 'debt' in params && params.debt.gt(params.yield)\n ? params.debt.sub(params.yield)\n : new CurrencyValue(stable, BigNumber.from(0));\n\n return (\n \n \n \n View\n \n \n {/* \n \n {parsedPositionHealth ?? ''}\n \n */}\n \n \n \n \n \n \n\n {((1 / (params.borrowablePercent / 100)) * 100).toFixed(2) + '%'}\n\n \n {debt.isZero()\n ? '∞'\n : (\n params.collateralValue.value\n .mul(10000)\n .div(debt.value)\n .toNumber() / 100\n ).toFixed(1)}\n %\n \n\n \n $ {params.liquidationPrice.toFixed(2)}\n \n\n \n {collateral.format({\n significantDigits: Infinity,\n suffix: '',\n })}\n \n\n \n {debt.format({\n significantDigits: 3,\n suffix: '',\n })}\n \n\n \n {liquidateButton ? (\n action.callback!(params),\n }\n : actionArgs(params))}\n >\n Liquidate\n \n ) : (\n Not Liquidatable Yet\n )}\n \n \n );\n}\n","import { Table, Tbody, Td, Thead, Tr } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { ParsedPositionMetaRow } from '../../../../../chain-interaction/contracts';\nimport { StrategyMetadataContext } from '../../../../../contexts/StrategyMetadataContext';\nimport { PositionsRow } from './PositionsRow';\n\nexport type LiquidatableAction = {\n args?: (pos: ParsedPositionMetaRow) => Record;\n callback?: (pos: ParsedPositionMetaRow) => void;\n label: string;\n};\n\nexport function PositionsTable({\n positions,\n action,\n}: {\n positions: ParsedPositionMetaRow[];\n action?: LiquidatableAction;\n}) {\n const allStratMeta = React.useContext(StrategyMetadataContext);\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {positions.map((posMeta, i) => {\n const stratMeta = allStratMeta[posMeta.token.address];\n const data = { action, ...posMeta, ...stratMeta[posMeta.strategy] };\n if (posMeta.collateralValue.isZero()) {\n return <>;\n }\n return ;\n })}\n \n
    ViewAssetTranche IdMin Col RatioCurrent Col RatioLiquidation priceCollateralDebtLiquidate
    \n );\n}\n","import { parseEther } from '@ethersproject/units';\nimport * as React from 'react';\nimport { useUpdatedPositions } from '../../../../chain-interaction/contracts';\nimport { PositionsTable } from './components/PositionsTable';\n\nexport default function AllOpenPositions(\n props: React.PropsWithChildren\n) {\n const updatedPositions = useUpdatedPositions(1646182247947).filter(\n (position) => {\n return position?.collateralValue.value.gt(parseEther('0.01'));\n }\n );\n return (\n <>\n
    \n \n {props.children}\n
    \n \n );\n}\n","import { Container } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { useParams } from 'react-router-dom';\nimport AllAddresses from './components/AllAddresses';\nimport AllContracts from './components/AllContracts/AllContracts';\nimport AllOpenPositions from './components/AllOpenPositions/AllOpenPositions';\n\nexport default function AdminPage(props: React.PropsWithChildren) {\n const { positions } = useParams();\n return (\n <>\n \n \n {props.children}\n \n {positions ? : ''}\n \n \n );\n}\n","import * as React from 'react';\nimport { Box, Text } from '@chakra-ui/react';\n\nexport function AnalyticsBox({\n title,\n subtitle,\n value,\n}: {\n title: string;\n subtitle: string;\n value: string;\n}) {\n return (\n \n {title}\n \n {subtitle}\n \n \n {value}\n \n \n );\n}\n","import { Box, Container, Grid, Text } from '@chakra-ui/react';\nimport {\n CurrencyValue,\n ERC20Interface,\n useCalls,\n useEthers,\n} from '@usedapp/core';\nimport { BigNumber, Contract, ethers } from 'ethers';\nimport { parseEther } from 'ethers/lib/utils';\nimport * as React from 'react';\nimport {\n DeploymentAddresses,\n ParsedStakingMetadata,\n useAddresses,\n useAllFeesEver,\n useCurvePoolSLDeposited,\n useLegacyIsolatedStrategyMetadata,\n useParsedStakingMetadata,\n useStable,\n useTotalSupply,\n} from '../../chain-interaction/contracts';\nimport { tokenAmount } from '../../chain-interaction/tokens';\nimport { StrategyMetadataContext } from '../../contexts/StrategyMetadataContext';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\nimport { AnalyticsBox } from './AnalyticsBox';\n\nexport default function Analytics(props: React.PropsWithChildren) {\n const allStratMeta = React.useContext(StrategyMetadataContext);\n const legacyStratMeta = useLegacyIsolatedStrategyMetadata();\n\n const account = React.useContext(UserAddressContext);\n const addresses = useAddresses();\n\n const stakeMeta: ParsedStakingMetadata[] = useParsedStakingMetadata(\n [addresses.CurvePoolRewards],\n account ?? ethers.constants.AddressZero\n ).flat(1);\n\n const feeContractNames = [\n 'IsolatedLending',\n 'StableLending',\n 'StableLending2',\n 'IsolatedLendingLiquidation',\n 'StableLendingLiquidation',\n 'StableLending2Liquidation',\n ];\n const blacklist = [\n 'StrategyRegistry',\n 'StrategyTokenActivation',\n 'StrategyViewer',\n 'LegacyStrategyViewer',\n ];\n const keys: (keyof DeploymentAddresses)[] = Object.keys(\n addresses\n ) as (keyof DeploymentAddresses)[];\n const filteredNames = keys.filter((key) => {\n return (\n feeContractNames.includes(key) ||\n (key.includes('Strategy') && !blacklist.includes(key))\n );\n });\n\n const contracts = filteredNames.map((name) => {\n return addresses[name];\n });\n // console.log('contracts', contracts);\n const stable = useStable();\n const tvlsFarm = stakeMeta.reduce(\n (tvl, row) => tvl.add(row.tvl),\n new CurrencyValue(stable, BigNumber.from(0))\n );\n console.log('All farm TVL:', tvlsFarm.format());\n\n const tvlNoFarm = Object.values(allStratMeta)\n .flatMap((rows) => Object.values(rows))\n .reduce(\n (tvl, row) => tvl.add(row.tvlInPeg),\n new CurrencyValue(stable, BigNumber.from(0))\n );\n const legacyTvlNoFarm = Object.values(legacyStratMeta)\n .flatMap((rows) => Object.values(rows))\n .reduce(\n (tvl, row) => tvl.add(row.tvlInPeg),\n new CurrencyValue(stable, BigNumber.from(0))\n );\n console.log('No-farm TVL', tvlNoFarm.format());\n\n const tvl = tvlNoFarm.add(tvlsFarm).add(legacyTvlNoFarm);\n\n const supply = useTotalSupply('totalSupply', [], ['']);\n\n const curvePoolSL = useCurvePoolSLDeposited();\n console.log('curvePoolSL', curvePoolSL.toString());\n const colRatio = !tvl.isZero()\n ? tvlNoFarm.value.mul(10000).div(supply.sub(curvePoolSL)).toNumber() / 100\n : 0;\n\n const fees = useAllFeesEver(contracts);\n\n const totalFees = fees\n .filter((fee) => fee)\n .filter((fee) => fee![0])\n .reduce(\n (total, fee) => total.add(new CurrencyValue(stable, fee![0])),\n new CurrencyValue(stable, BigNumber.from(0))\n );\n\n const circulatingBlacklist = [\n addresses.CurvePoolRewards,\n addresses.VestingLaunchReward,\n '0xcb2fb8db0e80adf47720d48e1ae9315e7d128808',\n '0xba8983fdde65354c1330e38d042c7d2f784ca3de',\n '0xc2Ee73EF5FF77c37dEBa2593EC80e5d4B655735E',\n ];\n\n function convert2ContractCall(holder: string) {\n return {\n contract: new Contract(addresses.MoreToken, ERC20Interface),\n abi: ERC20Interface,\n address: addresses.MoreToken,\n method: 'balanceOf',\n args: [holder],\n };\n }\n\n const balances = useCalls(circulatingBlacklist.map(convert2ContractCall))\n .map((x) => (x ?? { value: undefined }).value)\n .map(\n (result: any[] | undefined) =>\n (result ? result[0] : undefined) ?? BigNumber.from(0)\n )\n .reduce((agg, curr) => agg.add(curr));\n\n const { chainId } = useEthers();\n const circulatingSupply = chainId\n ? tokenAmount(\n chainId,\n addresses.MoreToken,\n parseEther('1000000000').sub(balances)\n )?.format({ useFixedPrecision: true, fixedPrecisionDigits: 0 }) ?? ''\n : '';\n\n return (\n \n Moremoney Analytics\n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {props.children}\n
    \n );\n}\n","export const hiddenStrategies: Record = {\n '0x6e84a6216eA6dACC71eE8E6b0a5B7322EEbC0fDd': [\n '0x888fC8d90177a4097e196EF6BBDc7d2e8CfFDb17',\n ],\n '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7': [\n '0xaa3Ea561a656cbE310F2E10981085DA2D989f17e',\n '0xa7c78579340FAde158810d83aCfd1ea3A17b7eBE'\n ],\n '0xA389f9430876455C36478DeEa9769B7Ca4E3DDB1': [\n '0x10d71115360F9129623096E8108bC6856cf86D3A',\n ],\n '0xeD8CBD9F0cE3C6986b22002F03c6475CEb7a6256': [\n '0x10d71115360F9129623096E8108bC6856cf86D3A',\n ],\n '0x454E67025631C065d3cFAD6d71E6892f74487a15': [\n '0x0Db20d1643112fA00C4D3DDB58369Ad26c1F7c1d',\n ],\n};\n","import { SearchIcon } from '@chakra-ui/icons';\nimport { Box, Input, InputGroup, InputLeftElement } from '@chakra-ui/react';\nimport * as React from 'react';\n\nexport function TableSearch({\n setSearchString,\n}: {\n setSearchString: React.Dispatch>;\n}) {\n const handleSearch: React.ChangeEventHandler = (event) => {\n const stripped = event.target.value.trim();\n setSearchString(stripped.toLowerCase());\n };\n\n return (\n \n \n \n \n \n \n \n \n );\n}\n","import { Box, Tab, TabList, Tabs } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { ParsedStratMetaRow } from '../../../chain-interaction/contracts';\nimport { deprecatedTokenList } from '../../../constants/deprecated-token-list';\n\nexport function TableTabs({\n setTableTabFilter,\n stratMeta,\n}: {\n setTableTabFilter: React.Dispatch>;\n stratMeta: ParsedStratMetaRow[];\n}) {\n // const stableTickers = [\n // 'USDT',\n // 'USDC',\n // 'DAI',\n // 'FRAX',\n // 'USDT.e',\n // 'USDC.e',\n // 'DAI.e',\n // ];\n\n const lpTickers = stratMeta\n .filter((meta) => meta.token.ticker.includes('/'))\n .map((meta) => meta.token.ticker);\n\n const singleAssetTickers = stratMeta\n .filter((meta) => !meta.token.ticker.includes('/'))\n .map((meta) => meta.token.ticker);\n\n const deprecatedTickers = stratMeta\n .filter((meta) => deprecatedTokenList.includes(meta.token.address))\n .map((meta) => meta.token.ticker);\n\n return (\n \n {\n if (index === 0) {\n setTableTabFilter([]);\n // } else if (index === 1) {\n // setTableTabFilter(stableTickers);\n } else if (index === 1) {\n setTableTabFilter(singleAssetTickers);\n } else if (index === 2) {\n setTableTabFilter(lpTickers);\n } else if (index === 3) {\n setTableTabFilter(deprecatedTickers);\n }\n }}\n >\n \n All Assets\n {/* Stablecoins */}\n Single Asset\n LP Tokens\n Deprecated\n \n \n \n );\n}\n","import { InfoIcon } from '@chakra-ui/icons';\nimport {\n Box,\n Button,\n Container,\n Flex,\n Table,\n Tbody,\n Td,\n Text,\n Thead,\n Tooltip,\n Tr,\n} from '@chakra-ui/react';\nimport * as React from 'react';\nimport { Link } from 'react-router-dom';\nimport { Column, useTable } from 'react-table';\nimport { ParsedStratMetaRow } from '../../../chain-interaction/contracts';\nimport { TokenDescription } from '../../../components/tokens/TokenDescription';\nimport { hiddenStrategies } from '../../../constants/hidden-strategies';\nimport { LiquidationFeesContext } from '../../../contexts/LiquidationFeesContext';\nimport { StrategyMetadataContext } from '../../../contexts/StrategyMetadataContext';\nimport { TableSearch } from './TableSearch';\nimport { TableTabs } from './TableTabs';\n\ntype Entity = ParsedStratMetaRow & {\n asset: any;\n apy: string;\n MONEYavailable: string;\n tvlPeg: string;\n totalBorrowed: string;\n liquidationFee: string;\n balance: number;\n ltv: string;\n};\n\nexport function AllSupportedCollateral() {\n const hiddenTokens: Set = new Set([]);\n const stratMeta: ParsedStratMetaRow[] = Object.values(\n React.useContext(StrategyMetadataContext)\n )\n .filter(\n (stratRows: Record) =>\n !hiddenTokens.has(Object.values(stratRows)[0].token.ticker)\n )\n .map((x: Record) => {\n const tokenAddress = x[Object.keys(x)[0]].token.address;\n const options = Object.values(x);\n const optionsFiltered = Object.values(x).filter(\n (y) =>\n hiddenStrategies[tokenAddress] &&\n !hiddenStrategies[tokenAddress].includes(y.strategyAddress)\n );\n\n return (\n hiddenStrategies[tokenAddress] ? optionsFiltered : options\n ).reduce((aggStrat, nextStrat) => {\n return {\n ...aggStrat,\n APY: aggStrat.APY > nextStrat.APY ? aggStrat.APY : nextStrat.APY,\n debtCeiling: aggStrat.debtCeiling.add(nextStrat.debtCeiling),\n totalDebt: aggStrat.totalDebt.add(nextStrat.totalDebt),\n tvlInPeg: aggStrat.tvlInPeg.add(nextStrat.tvlInPeg),\n };\n });\n });\n\n const tokenFees = React.useContext(LiquidationFeesContext);\n const [tableTabFilter, setTableTabFilter] = React.useState([]);\n const [searchString, setSearchString] = React.useState('');\n\n const data = stratMeta\n .filter((meta) => {\n if (tableTabFilter.length === 0) {\n return true;\n } else if (tableTabFilter.includes(meta.token.ticker)) {\n return true;\n } else {\n return false;\n }\n })\n .filter((meta) =>\n searchString.length > 0\n ? meta.token.name.toLowerCase().includes(searchString) ||\n meta.token.ticker.toLowerCase().includes(searchString)\n : true\n )\n .map((meta) => {\n return {\n ...meta,\n asset: ,\n apy: Math.round(meta.APY) + '%',\n MONEYavailable: meta.debtCeiling.gt(meta.totalDebt)\n ? meta.debtCeiling.sub(meta.totalDebt).format({ suffix: '' })\n : '0',\n minColRatio: `${Math.round(\n (1 / (meta.borrowablePercent / 100)) * 100\n )}%`,\n ltv: `${5 * Math.round(meta.borrowablePercent / 5)}%`,\n tvlPeg: `$ ${meta.tvlInPeg.format({ suffix: '' })}`,\n totalBorrowed: meta.totalDebt.format({ significantDigits: 2 }),\n liquidationFee:\n (tokenFees.get(meta.token.address) ?? 'Loading...') + '%',\n balance: meta.balance,\n };\n })\n .sort(function (a, b) {\n if (a.token.ticker < b.token.ticker) {\n return -1;\n }\n if (a.token.ticker > b.token.ticker) {\n return 1;\n }\n return 0;\n })\n .sort((a, b) => b.balance - a.balance);\n\n function tooltip(colName: string, label: string) {\n return (\n \n {' '}\n {colName}  \n \n \n \n \n );\n }\n\n const columns = React.useMemo[]>(\n () => [\n {\n Header: tooltip(\n 'Collateral Asset ',\n 'The kinds of collateral you can deposit to borrow MONEY'\n ),\n accessor: 'asset',\n },\n {\n Header: tooltip(\n 'APY earned ',\n 'The yield you earn on your deposited collateral'\n ),\n accessor: 'apy',\n },\n {\n Header: tooltip(\n 'MONEY available ',\n 'How much in total still can be borrowed against this asset'\n ),\n accessor: 'MONEYavailable',\n },\n {\n Header: tooltip(\n 'TVL ',\n 'Total amount of this asset locked in our protocol, in US dollars'\n ),\n accessor: 'tvlPeg',\n },\n {\n Header: tooltip(\n 'Max LTV ',\n 'How much of your deposited value you can extract as MONEY loan'\n ),\n accessor: 'ltv',\n },\n {\n Header: tooltip(\n 'Liquidation Fee ',\n 'Percentage of loan paid if you get liquidated'\n ),\n accessor: 'liquidationFee',\n },\n ],\n []\n );\n\n const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } =\n useTable({ columns, data });\n\n return (\n <>\n \n \n Select a collateral asset to\n \n \n Borrow yield bearing stablecoin MONEY\n \n \n \n while still earning yield\n \n \n on your collateral\n \n \n\n \n \n \n \n \n \n \n \n {rows.map((row) => {\n prepareRow(row);\n const headers = headerGroups\n .map((headerGroup) => {\n return headerGroup.headers.map((column) =>\n column.render('Header')\n );\n })\n .flat(1);\n return (\n // eslint-disable-next-line\n \n {row.cells.map((cell, index) => {\n // eslint-disable-next-line\n return (\n \n \n {headers[index]}\n \n {cell.render('Cell')}\n \n );\n })}\n {/* */}\n {/* */}\n \n View\n \n \n );\n })}\n \n\n \n \n {headerGroups.map((headerGroup) => (\n // eslint-disable-next-line\n \n {headerGroup.headers.map((column) => (\n // eslint-disable-next-line\n \n {column.render('Header')}\n \n ))}\n \n ))}\n \n \n {rows.map((row) => {\n prepareRow(row);\n return (\n // eslint-disable-next-line\n \n {row.cells.map((cell) => {\n // eslint-disable-next-line\n return (\n // eslint-disable-next-line\n {cell.render('Cell')}\n );\n })}\n \n );\n })}\n \n \n \n \n );\n}\n","import * as React from 'react';\nimport { Outlet } from 'react-router-dom';\nimport { AllSupportedCollateral } from './components/AllSupportedCollateral';\n\nexport default function Dashboard(params: React.PropsWithChildren) {\n // const account = React.useContext(UserAddressContext);\n // const location = useLocation();\n // const details = location.search?.includes('details=true');\n\n return (\n <>\n {params.children}\n \n \n \n );\n}\n","import React from 'react';\n\nexport class ErrorBoundary extends React.Component {\n constructor(props) {\n super(props);\n this.state = { hasError: false, errorMsg: '' };\n }\n\n static getDerivedStateFromError(error) {\n // Update state so the next render will show the fallback UI.\n return { hasError: true, errorMsg: error.toString() };\n }\n\n componentDidCatch(error, errorInfo) {\n // You can also log the error to an error reporting service\n console.log('error', error, errorInfo);\n this.setState({ hasError: true, errorMsg: error.toString() });\n // logErrorToMyService(error, errorInfo);\n }\n\n render() {\n if (this.state.hasError) {\n // You can render any custom fallback UI\n return (\n <>\n

    Something went wrong.

    \n
    \n
    \n
    \n {this.state.errorMsg}\n \n );\n }\n\n return this.props.children;\n }\n}\n","import {\n Accordion,\n AccordionButton,\n AccordionIcon,\n AccordionItem,\n Box,\n Container,\n Flex,\n Text,\n} from '@chakra-ui/react';\nimport React from 'react';\n\nexport function FarmCard({\n asset,\n stake,\n tvl,\n reward,\n apr,\n acquire,\n content,\n}: {\n asset: any;\n stake: string;\n tvl: string;\n reward: any;\n apr: string;\n acquire: any;\n content?: any;\n}) {\n return (\n <>\n \n \n \n Asset\n \n \n {asset}\n \n \n\n \n \n Stake\n \n \n {stake}\n \n \n\n \n \n TVL\n \n \n {tvl}\n \n \n\n \n \n Reward\n \n {reward}\n \n\n \n \n APR\n \n \n {apr}\n \n \n\n \n \n Acquire\n \n {acquire}\n \n\n {content ? (\n \n \n \n \n Actions\n \n \n \n {content}\n \n \n ) : (\n ''\n )}\n \n \n );\n}\n","import {\n AccordionButton,\n AccordionItem,\n Box,\n Flex,\n Grid,\n Text,\n} from '@chakra-ui/react';\nimport * as React from 'react';\n\nexport default function FarmRow({\n asset,\n stake,\n tvl,\n reward,\n apr,\n acquire,\n content,\n}: {\n asset: any;\n stake: string;\n tvl: string;\n reward: any;\n apr: string;\n acquire: any;\n content?: any;\n}) {\n const accordionStyling = {\n content: '\"\"',\n borderRadius: '10px',\n marginTop: '10px',\n border: '1px solid transparent',\n backgroundClip: 'padding-box, border-box',\n backgroundOrigin: 'padding-box, border-box',\n backgroundImage:\n 'linear-gradient(hsla(227, 12%, 15%, 1), hsla(227, 12%, 15%, 1)), linear-gradient(to right, hsla(0, 100%, 64%, 0.3) 0%, hsla(193, 100%, 50%, 0.3) 100%)',\n zIndex: 'var(--chakra-zIndices-hide)',\n fontSize: '18px',\n lineHeight: '27px',\n padding: '16px 30px',\n };\n\n return (\n \n \n \n \n {asset}\n \n \n {stake}\n \n \n {tvl}\n \n \n {reward}\n \n {apr}\n {acquire}\n \n \n {content}\n \n );\n}\n","import { useMediaQuery } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { FarmCard } from './FarmCard';\nimport FarmRow from './FarmRow';\n\nexport default function FarmItem({\n asset,\n stake,\n tvl,\n reward,\n apr,\n acquire,\n content,\n}: {\n asset: any;\n stake: string;\n tvl: string;\n reward: any;\n apr: string;\n acquire: any;\n content?: any;\n}) {\n const [isLargerThan720] = useMediaQuery('(min-width: 720px)');\n\n return isLargerThan720 ? (\n \n ) : (\n \n );\n}\n","import { ExternalLinkIcon } from '@chakra-ui/icons';\nimport {\n Accordion,\n Box,\n Button,\n Flex,\n Grid,\n Link,\n Text,\n} from '@chakra-ui/react';\nimport { formatEther } from '@ethersproject/units';\nimport { CurrencyValue } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { Link as RouterLink } from 'react-router-dom';\nimport {\n iMoneyTotalSupply,\n useAddresses,\n useIMoneyAPR,\n usePlatypusAPR,\n useStable,\n} from '../../chain-interaction/contracts';\nimport { ExternalMetadataContext } from '../../contexts/ExternalMetadataContext';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\nimport { WalletBalancesContext } from '../../contexts/WalletBalancesContext';\nimport { formatNumber } from '../../utils';\nimport FarmItem from './FarmItem';\n\nexport default function FarmPage(params: React.PropsWithChildren) {\n const account = useContext(UserAddressContext);\n\n const { yieldFarmingData, yieldMonitor } = useContext(\n ExternalMetadataContext\n );\n const avaxMorePayload = Object.values(yieldMonitor).filter(\n (item) => item.lpAddress === '0xb8361d0e3f3b0fc5e6071f3a3c3271223c49e3d9'\n )[0];\n const { APR_MONEY, APR_USDC, MoneyTVL, usdcTVL } = usePlatypusAPR(account!);\n\n const externalData =\n avaxMorePayload && yieldFarmingData\n ? [\n ...yieldFarmingData,\n {\n asset: 'MORE-AVAX',\n stake: 'n/a',\n tvl: formatNumber(avaxMorePayload.tvl),\n reward: 'MORE + ' + avaxMorePayload.rewardsCoin,\n apr: formatNumber(avaxMorePayload.totalApy),\n getTokenURL:\n 'https://traderjoexyz.com/pool/AVAX/0xd9d90f882cddd6063959a9d837b05cb748718a05',\n stakeTokenURL:\n 'https://traderjoexyz.com/farm/0xb8361D0E3F3B0fc5e6071f3a3C3271223C49e3d9-0x188bED1968b795d5c9022F6a0bb5931Ac4c18F00?fm=fm',\n },\n {\n asset: 'MONEY (Platypus)',\n stake: 'n/a',\n tvl: formatNumber(parseFloat(MoneyTVL)),\n reward: 'n/a',\n apr: APR_MONEY.toFixed(2),\n getTokenURL: 'https://app.platypus.finance/pool?pool_group=factory',\n stakeTokenURL:\n 'https://app.platypus.finance/pool?pool_group=factory',\n },\n {\n asset: 'USDC (Platypus)',\n stake: 'n/a',\n tvl: formatNumber(parseFloat(usdcTVL)),\n reward: 'n/a',\n apr: APR_USDC.toFixed(2),\n getTokenURL: 'https://app.platypus.finance/pool?pool_group=factory',\n stakeTokenURL:\n 'https://app.platypus.finance/pool?pool_group=factory',\n },\n ]\n : [];\n\n const balanceCtx = React.useContext(WalletBalancesContext);\n const iMoneyAddress = useAddresses().StableLending2InterestForwarder;\n\n const stable = useStable();\n const iMoneyBalance =\n balanceCtx.get(iMoneyAddress) ??\n new CurrencyValue(stable, BigNumber.from('0'));\n\n const iMoneyTVL = formatEther(iMoneyTotalSupply(BigNumber.from('0')));\n\n const { baseRate, boostedRate, avgBoostedRate } = useIMoneyAPR(account!);\n\n return (\n <>\n \n \n \n Yield Farming is easy, stake your\n \n \n token, sit back and relax!\n \n \n \n Asset\n Stake\n TVL\n Reward\n APR\n Acquire\n \n \n {externalData.length > 0 ? (\n externalData.map((item) => (\n \n \n Get LP Token\n \n \n \n Stake LP Token\n \n \n \n }\n />\n ))\n ) : (\n <>\n )}\n \n \n Earn MONEY\n \n \n }\n />\n \n {params.children}\n \n \n );\n}\n","import { Button, Flex, Text } from '@chakra-ui/react';\nimport { CurrencyValue } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useAddresses, useStable } from '../../../chain-interaction/contracts';\nimport {\n useClaimIMoney,\n useViewPendingReward,\n} from '../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\nimport { WalletBalancesContext } from '../../../contexts/WalletBalancesContext';\n\nexport default function ClaimIMoney({\n children,\n}: React.PropsWithChildren) {\n const balanceCtx = React.useContext(WalletBalancesContext);\n const account = React.useContext(UserAddressContext);\n const iMoneyAddress = useAddresses().StableLending2InterestForwarder;\n const stable = useStable();\n const iMoneyBalance =\n balanceCtx.get(iMoneyAddress) ??\n new CurrencyValue(stable, BigNumber.from('0'));\n\n const { sendClaim, claimState } = useClaimIMoney();\n\n const pendingRewards = new CurrencyValue(\n stable,\n useViewPendingReward(account!, BigNumber.from(0))\n );\n\n return (\n <>\n \n \n \n \n Staked MONEY\n \n \n {iMoneyBalance.format()}\n \n \n\n \n \n Claimable\n \n \n {pendingRewards.format()}\n \n \n \n \n {children}\n \n );\n}\n","import {\n Button,\n FormControl,\n FormErrorMessage,\n Input,\n InputGroup,\n InputRightElement,\n Text,\n} from '@chakra-ui/react';\nimport { CurrencyValue } from '@usedapp/core';\nimport * as React from 'react';\n\nexport function TokenAmountInputField(props: {\n name: string;\n max?: CurrencyValue;\n placeholder: string;\n registerForm: (name: string, params: { required: string }) => any;\n setValueForm: (\n name: string,\n max: string,\n args?: { shouldDirty: boolean; shouldTouch: boolean }\n ) => any;\n errorsForm?: Record;\n isDisabled?: boolean;\n percentage?: string;\n width?: string;\n}) {\n const {\n name,\n max,\n placeholder,\n registerForm,\n setValueForm,\n errorsForm,\n isDisabled,\n percentage,\n width = '200px',\n } = props;\n\n const error = errorsForm?.[name];\n\n return (\n \n \n \n \n {max ? (\n \n setValueForm(\n name,\n max.format({\n significantDigits: Infinity,\n prefix: '',\n suffix: '',\n thousandSeparator: '',\n decimalSeparator: '.',\n }),\n { shouldDirty: true, shouldTouch: true }\n )\n }\n >\n \n MAX\n \n \n ) : percentage ? (\n \n \n {percentage}\n \n \n ) : (\n <>\n )}\n \n \n {error && error.message}\n \n );\n}\n","import { Box, Button, Flex, Text } from '@chakra-ui/react';\nimport { useEthers } from '@usedapp/core';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { useAddresses } from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport { useStakeIMoney } from '../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { TokenAmountInputField } from '../../../components/tokens/TokenAmountInputField';\nimport { WalletBalancesContext } from '../../../contexts/WalletBalancesContext';\nimport { parseFloatNoNaN } from '../../../utils';\n\nexport function StakeMoreIMoney(props: React.PropsWithChildren) {\n const balanceCtx = useContext(WalletBalancesContext);\n const moneyToken = useAddresses().Stablecoin;\n const { chainId } = useEthers();\n\n const token = getTokenFromAddress(chainId, moneyToken);\n\n const { sendDepositIMoney: sendStake, depositState: stakeState } =\n useStakeIMoney();\n\n const {\n handleSubmit: handleSubmitDepForm,\n register: registerDepForm,\n setValue: setValueDepForm,\n formState: { errors: errorsDepForm, isSubmitting: isSubmittingDepForm },\n watch,\n } = useForm();\n\n const [moreStakeInput] = watch(['money-stake']);\n\n function onStakeMore(data: { [x: string]: any }) {\n console.log('data', data);\n sendStake(token, data['money-stake']);\n }\n\n const stakeMoreDisabled = balanceCtx.get(moneyToken)?.isZero();\n const stakeMoreButtonDisabled = parseFloatNoNaN(moreStakeInput) === 0;\n\n return (\n
    \n \n \n \n Stake MONEY\n \n \n \n \n \n \n \n Stake MONEY\n \n \n {props.children}\n \n );\n}\n","import { Box, Button, Flex, Text } from '@chakra-ui/react';\nimport { CurrencyValue, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useForm } from 'react-hook-form';\nimport { useAddresses, useStable } from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport { useWithdrawIMoney } from '../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { TokenAmountInputField } from '../../../components/tokens/TokenAmountInputField';\nimport { WalletBalancesContext } from '../../../contexts/WalletBalancesContext';\nimport { parseFloatNoNaN } from '../../../utils';\n\nexport function UnstakeMoreIMoney(props: React.PropsWithChildren) {\n const { chainId } = useEthers();\n const iMoneyToken = getTokenFromAddress(chainId, useAddresses().VeMoreToken);\n const balanceCtx = React.useContext(WalletBalancesContext);\n const iMoneyAddress = useAddresses().StableLending2InterestForwarder;\n const stable = useStable();\n const iMoneyBalance =\n balanceCtx.get(iMoneyAddress) ??\n new CurrencyValue(stable, BigNumber.from('0'));\n\n const token = getTokenFromAddress(chainId, iMoneyToken.address);\n\n const { sendWithdrawIMoney: sendUnstake, withdrawState: unstakeState } =\n useWithdrawIMoney();\n\n const {\n handleSubmit: handleSubmitDepForm,\n register: registerDepForm,\n setValue: setValueDepForm,\n formState: { errors: errorsDepForm, isSubmitting: isSubmittingDepForm },\n watch,\n } = useForm();\n\n const [veMoreTokenUnstakeInput] = watch(['imoney-unstake']);\n\n function onStakeMore(data: { [x: string]: any }) {\n console.log('data', data);\n sendUnstake(token, data['imoney-unstake']);\n }\n\n const stakeMoreDisabled = iMoneyBalance.isZero();\n const unstakeMoreButtonDisabled =\n parseFloatNoNaN(veMoreTokenUnstakeInput) === 0;\n\n return (\n
    \n \n \n \n Unstake MONEY\n \n \n \n \n \n \n \n Unstake MONEY\n \n \n {props.children}\n \n );\n}\n","import {\n Container,\n GridItem,\n Tab,\n TabList,\n TabPanel,\n TabPanels,\n Tabs,\n} from '@chakra-ui/react';\nimport * as React from 'react';\nimport ClaimVeMore from './ClaimiMoney';\nimport { StakeMoreIMoney } from './StakeMoreiMoney';\nimport { UnstakeMoreIMoney } from './UnstakeMoreiMoney';\n\nexport function EditMoreIMoney(props: React.PropsWithChildren) {\n return (\n \n \n \n \n Stake\n Unstake\n Claim\n \n \n \n \n \n \n \n \n \n \n \n \n \n {props.children}\n \n \n );\n}\n","import { Container, Flex, GridItem, Image, Text } from '@chakra-ui/react';\nimport { CurrencyValue, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useAddresses, useStable } from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport {\n useWalletBalance,\n WalletBalancesContext,\n} from '../../../contexts/WalletBalancesContext';\n\nexport function MoreBalanceIMoney() {\n const { chainId } = useEthers();\n const balanceCtx = React.useContext(WalletBalancesContext);\n const moneyToken = getTokenFromAddress(chainId, useAddresses().Stablecoin);\n const iMoneyAddress = useAddresses().StableLending2InterestForwarder;\n const stable = useStable();\n const iMoneyBalance =\n balanceCtx.get(iMoneyAddress) ??\n new CurrencyValue(stable, BigNumber.from('0'));\n\n const moreBalance =\n useWalletBalance(moneyToken.address) ??\n new CurrencyValue(moneyToken, BigNumber.from('0'));\n\n return (\n \n \n \n \n \n \n {moreBalance.format()}\n \n \n\n \n \n \n {iMoneyBalance.format()}\n \n \n \n \n \n );\n}\n","export default __webpack_public_path__ + \"static/media/lines.1f814fe9.svg\";","import {\n Container,\n Flex,\n GridItem,\n Image,\n Spacer,\n Text,\n} from '@chakra-ui/react';\nimport { CurrencyValue } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport lines from '../../../assets/img/lines.svg';\nimport {\n useAddresses,\n useIMoneyAPR,\n useStable,\n} from '../../../chain-interaction/contracts';\nimport { useViewPendingReward } from '../../../chain-interaction/transactions';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\nimport { WalletBalancesContext } from '../../../contexts/WalletBalancesContext';\n\nexport function StakingAPRIMoney(props: React.PropsWithChildren) {\n const account = React.useContext(UserAddressContext);\n const balanceCtx = React.useContext(WalletBalancesContext);\n const iMoneyAddress = useAddresses().StableLending2InterestForwarder;\n\n const stable = useStable();\n const iMoneyBalance =\n balanceCtx.get(iMoneyAddress) ??\n new CurrencyValue(stable, BigNumber.from('0'));\n\n const pendingRewards = new CurrencyValue(\n stable,\n useViewPendingReward(account!, BigNumber.from(0))\n );\n\n const { baseRate, boostedRate, avgBoostedRate } = useIMoneyAPR(account!);\n\n return (\n \n \n \n \n \n \n iMONEY APR\n \n \n \n {account\n ? `${baseRate}% + ${boostedRate}% `\n : `${baseRate}% + ${avgBoostedRate}% avg`}\n \n \n \n Staked MONEY\n \n \n {iMoneyBalance.format()}\n \n \n \n Claimable\n \n \n {pendingRewards.format()}\n \n \n {props?.children}\n \n \n );\n}\n","import { Box, Flex, Grid, Text } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { EditMoreIMoney } from './edit/EditMoreiMoney';\nimport { MoreBalanceIMoney } from './metadata/MoreBalanceiMoney';\nimport { StakingAPRIMoney } from './metadata/StakingAPRiMoney';\n\nexport default function IMoneyPage(props: React.PropsWithChildren) {\n return (\n \n \n \n Maximize yield by staking MONEY for iMoney\n \n \n \n \n \n \n \n {props.children}\n \n );\n}\n","import { VStack } from '@chakra-ui/react';\nimport { useEthers } from '@usedapp/core';\nimport { getAddress } from 'ethers/lib/utils';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { useAddresses } from '../../chain-interaction/contracts';\nimport {\n getLiquidationParams,\n LiquidationType,\n} from '../../chain-interaction/tokens';\nimport { useLiquidationTrans } from '../../chain-interaction/transactions';\nimport { LiquidatablePositionsContext } from '../../contexts/LiquidatablePositionsContext';\nimport { LiquidatablePositionsTable } from './LiquidatablePositionsTable';\n\nexport default function LiquidatablePositions() {\n const addresses = useAddresses();\n\n const { sendLiquidation: sendDirectLiquidationCurrent } = useLiquidationTrans(\n addresses.DirectFlashStable2Liquidation\n );\n\n const { sendLiquidation: sendLPTLiquidationCurrent } = useLiquidationTrans(\n addresses.LPTFlashStable2Liquidation\n );\n\n const { sendLiquidation: sendWsMaxiLiquidation } = useLiquidationTrans(\n 'wsMAXIStableLiquidation' in addresses\n ? addresses.wsMAXIStableLiquidation\n : addresses.DirectFlashLiquidation\n );\n const { sendLiquidation: sendXJoeLiquidation } = useLiquidationTrans(\n 'xJoeStableLiquidation' in addresses\n ? addresses.xJoeStableLiquidation\n : addresses.DirectFlashLiquidation\n );\n\n const lending2Liquidation: Record<\n string,\n Record Promise>\n > = {\n ...('StableLending2' in addresses\n ? {\n [addresses.StableLending2]: {\n [LiquidationType.LPT]: sendLPTLiquidationCurrent,\n [LiquidationType.Direct]: sendDirectLiquidationCurrent,\n },\n }\n : {}),\n };\n\n const token2Liquidation = {\n [getAddress('0x2148D1B21Faa7eb251789a51B404fc063cA6AAd6')]:\n sendWsMaxiLiquidation,\n [getAddress('0x57319d41f71e81f3c65f2a47ca4e001ebafd4f33')]:\n sendXJoeLiquidation,\n };\n // in this case using account is OK\n const { account } = useEthers();\n\n const liquidatablePositions = useContext(LiquidatablePositionsContext);\n\n return (\n <>\n {liquidatablePositions.length > 0 && false ? (\n \n

    Liquidatable positions

    \n {\n const { liqType, router } = getLiquidationParams(pos);\n console.log('liquidating', pos, liqType, router);\n console.log(lending2Liquidation);\n if (getAddress(pos.token.address) in token2Liquidation) {\n token2Liquidation[getAddress(pos.token.address)](\n pos.trancheId,\n router,\n account\n );\n } else {\n lending2Liquidation[pos.trancheContract][liqType](\n pos.trancheId,\n router,\n account\n );\n }\n },\n label: 'Liquidate',\n }}\n />\n
    \n ) : undefined}\n \n );\n}\n","import { Box, Text } from '@chakra-ui/react';\nimport * as React from 'react';\n\nexport default function LiquidationProtectedLoans(\n params: React.PropsWithChildren\n) {\n return (\n <>\n \n \n Coming soon: Liquidation protected loans\n \n \n {params.children}\n \n );\n}\n","import { Box, Button, Container, Flex, Text } from '@chakra-ui/react';\nimport { Token } from '@usedapp/core';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport { TokenDescription } from '../../components/tokens/TokenDescription';\nimport { TrancheData } from './CurrentlyOpenPositions';\n\nexport function TrancheCard({\n token,\n row,\n}: {\n token: Token;\n row: TrancheData;\n}) {\n return (\n <>\n \n \n \n Position Health\n \n \n \n {row.positionHealth}\n \n \n \n\n \n \n Asset\n \n \n \n \n \n \n \n Strategy\n \n \n {row.APY}\n \n \n\n \n \n Cur. ColRatio\n \n \n {row.collateralValue}\n \n \n\n \n \n Liq. price\n \n \n {row.liquidationPrice}\n \n \n\n \n \n Collateral\n \n \n {row.collateral}\n \n \n\n \n \n Debt\n \n \n {row.debt}\n \n \n\n \n \n \n );\n}\n","import { Td, Text, Tr } from '@chakra-ui/react';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport {\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n} from '../../chain-interaction/contracts';\nimport { TokenDescription } from '../../components/tokens/TokenDescription';\nimport { TrancheData } from './CurrentlyOpenPositions';\nimport { TrancheAction } from './TrancheTable';\n\nexport function TrancheRow(\n params: React.PropsWithChildren<\n ParsedStratMetaRow &\n ParsedPositionMetaRow & { action?: TrancheAction; row: TrancheData }\n >\n) {\n const { row } = params;\n return (\n <>\n \n \n \n {row.positionHealth}\n \n \n \n \n \n\n {row.stratLabel}\n\n {row.APY}\n\n {row.collateralValue}\n\n \n {row.liquidationPrice}\n \n\n {row.collateral}\n\n {row.debt}\n \n \n );\n}\n","import { Table, Tbody, Td, Thead, Tr } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { ParsedPositionMetaRow } from '../../chain-interaction/contracts';\nimport { StrategyMetadataContext } from '../../contexts/StrategyMetadataContext';\nimport { TrancheData } from './CurrentlyOpenPositions';\nimport { TrancheRow } from './TrancheRow';\n\nexport type TrancheAction = {\n args?: (pos: ParsedPositionMetaRow) => Record;\n callback?: (pos: ParsedPositionMetaRow) => void;\n label: string;\n};\n\nexport function TrancheTable({\n positions,\n rows,\n}: {\n positions: ParsedPositionMetaRow[];\n action?: TrancheAction;\n rows: TrancheData[];\n}) {\n const allStratMeta = React.useContext(StrategyMetadataContext);\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {positions.map((posMeta, i) => {\n const stratMeta = allStratMeta[posMeta.token.address];\n const data = { ...posMeta, ...stratMeta[posMeta.strategy] };\n if (posMeta.collateralValue.isZero()) {\n return <>;\n }\n return (\n \n );\n })}\n \n
    Position HealthAssetStrategyAPYCur. ColRatioLiq. priceCollateralDebt
    \n \n );\n}\n","import { Flex } from '@chakra-ui/react';\nimport { CurrencyValue, Token } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport { parseEther } from 'ethers/lib/utils';\nimport * as React from 'react';\nimport {\n TokenStratPositionMetadata,\n useIsolatedPositionMetadata,\n useStable,\n YieldType,\n} from '../../chain-interaction/contracts';\nimport { StrategyMetadataContext } from '../../contexts/StrategyMetadataContext';\nimport { parseFloatCurrencyValue } from '../../utils';\nimport { TrancheCard } from './TrancheCard';\nimport { TrancheTable } from './TrancheTable';\n\nexport type TrancheData = {\n token: Token;\n trancheId: number;\n positionHealth: string;\n stratLabel: string;\n APY: string;\n collateralValue: string;\n liquidationPrice: string;\n collateral: string;\n debt: string;\n positionHealthColor: string;\n};\n\nexport default function CurrentlyOpenPositions({\n account,\n}: React.PropsWithChildren<{ account: string }>) {\n const allPositionMeta: TokenStratPositionMetadata =\n useIsolatedPositionMetadata(account);\n\n const allStratMeta = React.useContext(StrategyMetadataContext);\n const positions = Object.values(allPositionMeta)\n .flatMap((x) => x)\n .filter((pos) => pos.collateralValue.value.gt(parseEther('0.01')))\n .filter((pos) => pos.strategy in allStratMeta[pos.token.address]);\n const stable = useStable();\n\n const rows: TrancheData[] =\n positions.length > 0\n ? positions.map((posMeta) => {\n const stratMeta = allStratMeta[posMeta.token.address];\n const params = { ...posMeta, ...stratMeta[posMeta.strategy] };\n const { token, APY, borrowablePercent, usdPrice } = params;\n\n const collateral =\n 'collateral' in params && params.collateral\n ? params.collateral\n : new CurrencyValue(token, BigNumber.from(0));\n const debt =\n 'debt' in params && params.debt.gt(params.yield)\n ? params.debt.sub(params.yield)\n : new CurrencyValue(stable, BigNumber.from(0));\n const contractName = params.underlyingStrategyName;\n\n const stratLabel =\n params.yieldType === YieldType.REPAYING\n ? 'Self-repaying'\n : contractName ?? 'Compounding';\n const totalPercentage =\n parseFloatCurrencyValue(collateral) > 0 && usdPrice > 0\n ? (100 * parseFloatCurrencyValue(debt)) /\n (parseFloatCurrencyValue(collateral) * usdPrice)\n : 0;\n const liquidatableZone = borrowablePercent;\n const criticalZone = (90 * borrowablePercent) / 100;\n const riskyZone = (80 * borrowablePercent) / 100;\n const healthyZone = (50 * borrowablePercent) / 100;\n\n const positionHealthColor = debt.value.lt(parseEther('0.1'))\n ? 'accent'\n : totalPercentage > liquidatableZone\n ? 'purple.400'\n : totalPercentage > criticalZone\n ? 'red'\n : totalPercentage > riskyZone\n ? 'orange'\n : totalPercentage > healthyZone\n ? 'green'\n : 'accent';\n const positionHealth = {\n accent: 'Safe',\n green: 'Healthy',\n orange: 'Risky',\n red: 'Critical',\n ['purple.400']: 'Liquidatable',\n };\n\n return {\n token: token,\n trancheId: params.trancheId,\n positionHealth: positionHealth[positionHealthColor],\n stratLabel: stratLabel,\n APY: APY.toFixed(2) + '%',\n collateralValue: debt.isZero()\n ? '∞'\n : (\n params.collateralValue.value\n .mul(10000)\n .div(debt.value)\n .toNumber() / 100\n ).toFixed(1) + '%',\n liquidationPrice: '$' + params.liquidationPrice.toFixed(2),\n collateral: collateral.format({\n significantDigits: Infinity,\n suffix: '',\n }),\n debt: debt.format({\n significantDigits: 3,\n suffix: '',\n }),\n positionHealthColor: positionHealthColor,\n };\n })\n : ([] as TrancheData[]);\n\n return positions.length > 0 ? (\n <>\n \n {rows.map((row, i) => {\n return (\n \n );\n })}\n \n \n \n \n \n ) : (\n <> \n );\n}\n","import { Box, Text } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport CurrentlyOpenPositions from './CurrentlyOpenPositions';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\n\nexport default function PositionsPage(params: React.PropsWithChildren) {\n const account = useContext(UserAddressContext);\n return (\n <>\n \n \n My Positions\n \n \n {account && }\n {params.children}\n \n );\n}\n","import { Avatar, Box, Button, Flex, Spacer, Text } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { useNavigate } from 'react-router-dom';\n\nexport default function StakeBox({\n children,\n title,\n img,\n link,\n totalStaked,\n yourStake,\n totalSupply,\n buttonLabel,\n}: React.PropsWithChildren<{\n title: string;\n img: string;\n link: string;\n totalStaked: string;\n yourStake: string;\n totalSupply: string | null;\n buttonLabel?: string;\n}>) {\n const navigate = useNavigate();\n return (\n \n \n \n \n \n   {title}\n \n \n \n \n \n \n \n \n \n {'Total Staked'}\n \n {totalStaked}\n \n \n \n \n \n \n {'Your Stake'}\n \n {yourStake}\n \n \n {totalSupply ? (\n <>\n \n \n \n \n {'Total Supply'}\n \n {totalSupply}\n \n \n \n ) : null}\n {children}\n \n {/* */}\n {/* */}\n\n {/* */}\n {/* */}\n {/* \n \n \n {'Deposit Fee'}\n \n 1.00%\n \n */}\n {/* */}\n \n );\n}\n","import { Box, Container, Flex, HStack, Spacer, Text } from '@chakra-ui/react';\nimport { formatEther } from '@ethersproject/units';\nimport { CurrencyValue, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport {\n useAddresses,\n useBalanceOfToken,\n useIMoneyAPR,\n useStable,\n useTotalSupplyIMoney,\n useTotalSupplyToken,\n} from '../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../chain-interaction/tokens';\nimport { useGetStakedMoreVeMoreToken } from '../../chain-interaction/transactions';\nimport { TokenDescription } from '../../components/tokens/TokenDescription';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\nimport { WalletBalancesContext } from '../../contexts/WalletBalancesContext';\nimport { formatNumber } from '../../utils';\nimport StakeBox from './components/StakeBox';\n\nexport default function StakePage({\n children,\n}: React.PropsWithChildren) {\n const account = React.useContext(UserAddressContext);\n const { chainId } = useEthers();\n const addresses = useAddresses();\n //xmore data\n const totalStakedXMore = formatEther(\n useBalanceOfToken(addresses.xMore, [addresses.xMore], 0)\n );\n const yourStakeXMore = formatEther(\n useBalanceOfToken(addresses.xMore, [account], 0)\n );\n const totalSupplyStakedXMore = formatEther(\n useTotalSupplyToken(addresses.xMore, 'totalSupply', [], 0)\n );\n\n //veMore data\n const totalStakedVeMore = formatEther(\n useBalanceOfToken(addresses.MoreToken, [addresses.VeMoreStaking], 0)\n );\n const yourStakeVeMore = formatEther(useGetStakedMoreVeMoreToken(account!));\n const totalSupplyStakedVeMore = formatEther(\n useTotalSupplyToken(addresses.VeMoreToken, 'totalSupply', [], 0)\n );\n\n //iMoney data\n const balanceCtx = React.useContext(WalletBalancesContext);\n const iMoneyAddress = useAddresses().StableLending2InterestForwarder;\n const stable = useStable();\n const iMoneyBalance =\n balanceCtx.get(iMoneyAddress) ??\n new CurrencyValue(stable, BigNumber.from('0'));\n const totalSupplyIMoney = new CurrencyValue(\n stable,\n useTotalSupplyIMoney(BigNumber.from(1))\n );\n\n const inputStyle = {\n marginTop: '12px',\n padding: '12px',\n bg: 'whiteAlpha.50',\n borderRadius: '10px',\n justifyContent: 'space-between',\n };\n\n const { baseRate, boostedRate, avgBoostedRate } = useIMoneyAPR(account!);\n\n return (\n \n \n \n \n \n \n \n \n \n \n <>\n \n \n \n \n {'Base + Boosted APR'}\n \n \n {account\n ? `${baseRate}% + ${boostedRate}% `\n : `${baseRate}% + ${avgBoostedRate}% avg`}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {/* descriptions of the tokens */}\n \n \n \n Boost your yield on iMoney staking and LP rewards\n \n \n \n \n \n Earn interest on your MONEY\n \n \n \n \n \n Get compounding MORE rewards\n \n \n \n \n \n {children}\n \n );\n}\n","import React from 'react';\nimport { HStack, Text } from '@chakra-ui/react';\nimport { useNavigate } from 'react-router-dom';\nimport { ArrowBackIcon } from '@chakra-ui/icons';\n\nexport function BackButton() {\n const navigate = useNavigate();\n\n return (\n navigate(-1)} cursor={'pointer'}>\n \n BACK\n \n );\n}\n","import { Alert, AlertIcon } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { useParams } from 'react-router-dom';\nimport { deprecatedTokenList } from '../../constants/deprecated-token-list';\n\nexport default function DeprecatedTokenMessage() {\n const params = useParams<'tokenAddress'>();\n const isDeprecated = deprecatedTokenList.includes(params.tokenAddress ?? '');\n\n return (\n <>\n {isDeprecated ? (\n <>\n \n \n \n This token has been deprecated, you can repay, but not borrow\n against it.\n \n \n
    \n \n ) : (\n ''\n )}\n \n );\n}\n","import { Button } from '@chakra-ui/react';\nimport * as React from 'react';\n\nexport default function ChangeStrategyButton({\n chooseStrategy,\n onClose,\n}: {\n chooseStrategy: () => void;\n onClose: () => void;\n}) {\n return (\n <>\n {\n chooseStrategy();\n onClose();\n }}\n >\n Choose\n \n \n );\n}\n","import { Box, Table, Tbody, Td, Thead, Tr } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { Column, useTable } from 'react-table';\nimport { ParsedStratMetaRow } from '../../../../chain-interaction/contracts';\nimport ChangeStrategyButton from './ChangeStrategyButton';\n\ntype Entity = {\n strategyName: string;\n apy: string;\n totalBorrowed: string;\n action: any;\n};\n\nexport function ChangeStrategyTable({\n stratMeta,\n chooseStrategy,\n currentStrategy,\n onClose,\n}: {\n stratMeta: Record;\n chooseStrategy: (strategyToChoose: string) => void;\n currentStrategy: string;\n onClose: () => void;\n}) {\n\n const data = Object.keys(stratMeta).map((key) => {\n const meta = stratMeta[key];\n return {\n strategyAddress: meta.strategyAddress,\n strategyName: meta.underlyingStrategyName ?? meta.strategyName,\n apy: meta.APY.toFixed(2) + '%',\n totalBorrowed: meta.totalDebt.format({ significantDigits: 2 }),\n action:\n meta.strategyAddress === currentStrategy ? (\n <>Current strategy\n ) : (\n {\n chooseStrategy(meta.strategyAddress);\n }}\n />\n ),\n };\n });\n\n const columns = React.useMemo[]>(\n () => [\n {\n Header: 'Strategy Name',\n accessor: 'strategyName',\n },\n {\n Header: 'Collateral APY',\n accessor: 'apy',\n },\n {\n Header: 'Total borrowed',\n accessor: 'totalBorrowed',\n },\n {\n Header: 'Action',\n accessor: 'action',\n },\n ],\n []\n );\n\n const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } =\n useTable({ columns, data });\n\n return (\n <>\n \n <>\n \n \n {headerGroups.map((headerGroup) => (\n // eslint-disable-next-line\n \n {headerGroup.headers.map((column) => (\n // eslint-disable-next-line\n \n ))}\n \n ))}\n \n \n {rows.map((row) => {\n prepareRow(row);\n return (\n // eslint-disable-next-line\n \n {row.cells.map((cell) => {\n // eslint-disable-next-line\n return (\n // eslint-disable-next-line\n \n );\n })}\n \n );\n })}\n \n
    \n {column.render('Header')}\n
    {cell.render('Cell')}
    \n \n
    \n \n );\n}\n","import {\n Button,\n Modal,\n ModalBody,\n ModalCloseButton,\n ModalContent,\n ModalHeader,\n ModalOverlay,\n Text,\n useDisclosure,\n} from '@chakra-ui/react';\nimport * as React from 'react';\nimport { ParsedStratMetaRow } from '../../../../chain-interaction/contracts';\nimport { ChangeStrategyTable } from './ChangeStrategyTable';\n\nexport default function ChangeStrategyModal({\n chooseStrategy,\n stratMeta,\n currentStrategy,\n}: {\n chooseStrategy: (strategyToChoose: string) => void;\n stratMeta: Record;\n currentStrategy: string;\n}) {\n const { isOpen, onOpen, onClose } = useDisclosure();\n return (\n <>\n \n Change\n \n\n \n \n \n Select Strategy\n \n \n \n \n \n \n \n );\n}\n","import { Container, Flex, GridItem, Text } from '@chakra-ui/react';\nimport * as React from 'react';\nimport {\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n YieldType,\n} from '../../../../chain-interaction/contracts';\nimport { hiddenStrategies } from '../../../../constants/hidden-strategies';\nimport ChangeStrategyModal from './ChangeStrategyModal';\n\nexport default function StrategyNameAndSwitch({\n position,\n chooseStrategy,\n stratMeta,\n chosenStrategy,\n}: {\n position?: ParsedPositionMetaRow;\n chooseStrategy: (strategyToChoose: string) => void;\n stratMeta: Record;\n chosenStrategy: string;\n}) {\n\n const stratLabel =\n stratMeta[chosenStrategy].yieldType === YieldType.REPAYING\n ? 'Self-repaying loan'\n : stratMeta[chosenStrategy].underlyingStrategyName ?? 'Compound collateral';\n\n const options = Object.values(stratMeta).filter((strat) =>\n stratFilter(strat, position)\n );\n\n const multipleOptions = options.length > 1;\n const textVariant = multipleOptions ? 'bodySmall' : 'bodyLarge';\n\n return (\n \n \n \n \n Strategy\n \n \n {stratLabel}\n \n
    \n {multipleOptions && (\n \n )}\n \n
    \n
    \n );\n}\n\nexport function stratFilter(\n strat: ParsedStratMetaRow,\n position?: ParsedPositionMetaRow\n) {\n if (position && position.trancheId == 60200000002) {\n if (position.strategy === strat.strategyAddress) {\n return true;\n } else {\n return false;\n }\n } else if (hiddenStrategies[strat.token.address]) {\n //if the strategy is hidden\n if (hiddenStrategies[strat.token.address].includes(strat.strategyAddress)) {\n //if the strategy that is hidden has a position opened for that\n if (position?.strategy === strat.strategyAddress) {\n return true;\n } else {\n return false;\n }\n } else {\n return true;\n }\n } else {\n return true;\n }\n}\n","import { Button } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\nimport { useConnectWallet } from '../../utils';\n\nexport function EnsureWalletConnected(\n params: React.PropsWithChildren\n) {\n const { onConnect } = useConnectWallet();\n const account = useContext(UserAddressContext);\n\n return (\n <>\n {account ? (\n params.children\n ) : (\n {\n onConnect();\n }}\n >\n Connect to a wallet\n \n )}\n \n );\n}\n","import {\n Alert,\n AlertIcon,\n Popover,\n PopoverArrow,\n PopoverBody,\n PopoverContent,\n PopoverTrigger,\n} from '@chakra-ui/react';\nimport * as React from 'react';\n\nexport default function WarningMessage(\n props: React.PropsWithChildren<{ isOpen: boolean; message: string }>\n) {\n const { message, isOpen } = props;\n return (\n <>\n \n {props.children}\n \n \n \n \n \n {message}\n \n \n \n \n \n );\n}\n","import { ChainId } from '@usedapp/core';\n\ntype AddressMap = { [chainId: number]: string };\n\nexport const WNATIVE_ADDRESS: AddressMap = {\n [ChainId.Mainnet]: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n [ChainId.Ropsten]: '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n [ChainId.Rinkeby]: '0xc778417E063141139Fce010982780140Aa0cD5Ab',\n [ChainId.Goerli]: '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6',\n [ChainId.Kovan]: '0xd0A1E359811322d97991E03f863a0C30C2cF029C',\n [ChainId.Fantom]: '0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83',\n [ChainId.xDai]: '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d',\n [ChainId.BSC]: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',\n [ChainId.Avalanche]: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7',\n [ChainId.Hardhat]: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7',\n [ChainId.Harmony]: '0xcF664087a5bB0237a0BAd6742852ec6c8d69A27a',\n [ChainId.Palm]: '0xF98cABF0a963452C5536330408B2590567611a71',\n [ChainId.Moonriver]: '0xf50225a84382c74CbdeA10b0c176f71fc3DE0C4d',\n};\n","import {\n Alert,\n AlertIcon,\n Box,\n Button,\n Flex,\n Modal,\n ModalBody,\n ModalCloseButton,\n ModalContent,\n ModalFooter,\n ModalHeader,\n ModalOverlay\n} from '@chakra-ui/react';\nimport * as React from 'react';\n\nexport const ConfirmPositionModal = ({\n title,\n isOpen,\n onClose,\n confirm,\n dangerous,\n body,\n}: {\n title: string;\n isOpen: boolean;\n onClose: () => void;\n body: { title: any; value: any }[];\n confirm: any;\n dangerous: boolean;\n}) => {\n function depositBorrow() {\n confirm();\n onClose();\n }\n\n return (\n <>\n \n \n \n \n {title}\n \n \n {/* Your position would be close to liquidation, if the collateral loses\n value. Are you sure you want to proceed? */}\n\n {body.map((item, index) => (\n \n {item.title}\n {item.value}\n \n ))}\n\n
    \n {dangerous ? (\n \n \n Your position would be close to liquidation, if the collateral\n loses value. Are you sure you want to proceed?\n \n ) : (\n ''\n )}\n
    \n \n \n \n \n
    \n
    \n
    \n \n );\n};\n","import {\n Box,\n Button,\n Flex,\n HStack,\n Input,\n InputGroup,\n InputRightElement,\n Progress,\n Text,\n useDisclosure,\n VStack,\n} from '@chakra-ui/react';\nimport {\n CurrencyValue,\n useEtherBalance,\n useEthers,\n useTokenAllowance,\n} from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport { getAddress } from 'ethers/lib/utils';\nimport * as React from 'react';\nimport { useContext, useState } from 'react';\nimport { useForm } from 'react-hook-form';\nimport {\n calcLiqPriceFromNum,\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n TxStatus,\n useStable,\n} from '../../../../chain-interaction/contracts';\nimport {\n useApproveTrans,\n useDepositBorrowTrans,\n useNativeDepositBorrowTrans,\n} from '../../../../chain-interaction/transactions';\nimport { EnsureWalletConnected } from '../../../../components/account/EnsureWalletConnected';\nimport { TransactionErrorDialog } from '../../../../components/notifications/TransactionErrorDialog';\nimport WarningMessage from '../../../../components/notifications/WarningMessage';\nimport { TokenAmountInputField } from '../../../../components/tokens/TokenAmountInputField';\nimport { TokenDescription } from '../../../../components/tokens/TokenDescription';\nimport { WNATIVE_ADDRESS } from '../../../../constants/addresses';\nimport { MakeMostOfMoneyContext } from '../../../../contexts/MakeMostOfMoneyContext';\nimport { UserAddressContext } from '../../../../contexts/UserAddressContext';\nimport { useWalletBalance } from '../../../../contexts/WalletBalancesContext';\nimport { parseFloatCurrencyValue, parseFloatNoNaN } from '../../../../utils';\nimport { ConfirmPositionModal } from './ConfirmPositionModal';\n\nexport default function DepositBorrow({\n position,\n stratMeta,\n}: React.PropsWithChildren<{\n position?: ParsedPositionMetaRow;\n stratMeta: ParsedStratMetaRow;\n}>) {\n const { token, strategyAddress, borrowablePercent, usdPrice } = stratMeta;\n const { chainId } = useEthers();\n const [data, setData] = useState<{ [x: string]: any }>();\n const { isOpen, onOpen, onClose } = useDisclosure();\n const { onToggle, onClose: onClosePopover } = React.useContext(\n MakeMostOfMoneyContext\n );\n const account = useContext(UserAddressContext);\n const stable = useStable();\n\n const isNativeToken = WNATIVE_ADDRESS[chainId!] === token.address;\n\n const allowResult = useTokenAllowance(\n token.address,\n account,\n strategyAddress\n );\n const allowCV = new CurrencyValue(token, allowResult ?? BigNumber.from('0'));\n const allowance = token.address && account && strategyAddress && allowCV;\n\n const etherBalance = useEtherBalance(account);\n\n const nativeTokenBalance = etherBalance\n ? new CurrencyValue(token, etherBalance)\n : new CurrencyValue(token, BigNumber.from('0'));\n\n const walletBalance =\n useWalletBalance(token.address) ??\n new CurrencyValue(token, BigNumber.from('0'));\n\n const { approveState, sendApprove } = useApproveTrans(token.address);\n\n const {\n handleSubmit: handleSubmitDepForm,\n register: registerDepForm,\n setValue: setValueDepForm,\n formState: { errors: errorsDepForm, isSubmitting: isSubmittingDepForm },\n watch,\n } = useForm();\n\n const { sendDepositBorrow, depositBorrowState } = useDepositBorrowTrans(\n position ? position.trancheId : undefined\n // position ? position.trancheContract : undefined\n );\n const {\n sendDepositBorrow: sendNativeDepositBorrow,\n depositBorrowState: nativeDepositBorrowState,\n } = useNativeDepositBorrowTrans(\n position ? position.trancheId : undefined\n // position ? position.trancheContract : undefined\n );\n\n function onDepositBorrow(data: { [x: string]: any }) {\n // console.log('deposit borrow');\n // console.log(data);\n setData(data);\n onOpen();\n }\n\n function confirmDeposit() {\n if (isNativeToken) {\n sendNativeDepositBorrow(\n token,\n strategyAddress,\n data!['collateral-deposit'] ?? '0',\n data!['money-borrow'] ?? '0'\n );\n } else {\n sendDepositBorrow(\n token,\n strategyAddress,\n data!['collateral-deposit'] ?? '0',\n data!['money-borrow'] ?? '0'\n );\n }\n }\n\n const [collateralInput, borrowInput, customPercentageInput] = watch([\n 'collateral-deposit',\n 'money-borrow',\n 'custom-percentage',\n ]);\n\n const extantCollateral =\n position && position.collateral\n ? parseFloatCurrencyValue(position.collateral)\n : 0;\n const totalCollateral = parseFloatNoNaN(collateralInput) + extantCollateral;\n\n const extantDebt =\n position && position.debt && position.debt.gt(position.yield)\n ? parseFloatCurrencyValue(position.debt.sub(position.yield))\n : 0;\n const totalDebt = parseFloatNoNaN(borrowInput) + extantDebt;\n\n const currentPercentage =\n totalCollateral > 0 && usdPrice > 0\n ? (100 * extantDebt) / (totalCollateral * usdPrice)\n : 0;\n const percentageRange = borrowablePercent - currentPercentage;\n\n const percentageStep = Math.max(percentageRange / 5, 10);\n const percentageSteps =\n 10 >= percentageRange\n ? [(currentPercentage + borrowablePercent) / 2]\n : Array(Math.floor((percentageRange - 0.5) / percentageStep))\n .fill(currentPercentage)\n .map((p, i) => Math.round((p + (i + 1) * percentageStep) / 5) * 5);\n\n const totalPercentage =\n totalCollateral > 0 && usdPrice > 0\n ? (100 * totalDebt) / (totalCollateral * usdPrice)\n : 0;\n\n const percentageLabel =\n totalCollateral > 0 && usdPrice > 0\n ? `${totalPercentage.toFixed(0)} %`\n : 'LTV %';\n const percentages = Object.fromEntries(\n percentageSteps.map((percentage) => [\n `${percentage.toFixed(0)} %`,\n (percentage * totalCollateral * usdPrice) / 100 - extantDebt,\n ])\n );\n\n const showWarning =\n !(\n parseFloatNoNaN(collateralInput) === 0 &&\n parseFloatNoNaN(borrowInput) === 0\n ) && totalPercentage > borrowablePercent;\n\n React.useEffect(() => {\n // console.log('In effect', customPercentageInput);\n if (customPercentageInput) {\n setValueDepForm(\n 'money-borrow',\n (customPercentageInput * totalCollateral * usdPrice) / 100 - extantDebt,\n { shouldDirty: true }\n );\n }\n }, [customPercentageInput, totalCollateral, extantDebt, usdPrice]);\n\n React.useEffect(() => {\n async function waitTransactionResult() {\n const depositBorrowResult = await depositBorrowState.transaction?.wait();\n const nativeDepositBorrowResult =\n await nativeDepositBorrowState.transaction?.wait();\n if (\n depositBorrowResult?.status === 1 ||\n nativeDepositBorrowResult?.status === 1\n ) {\n onToggle();\n setTimeout(() => {\n onClosePopover();\n }, 60000);\n }\n }\n waitTransactionResult();\n }, [depositBorrowState, nativeDepositBorrowState]);\n\n const depositBorrowDisabled =\n !position &&\n (isNativeToken ? nativeTokenBalance.isZero() : walletBalance.isZero());\n\n const isJoeToken =\n getAddress(token.address) ===\n getAddress('0x6e84a6216eA6dACC71eE8E6b0a5B7322EEbC0fDd');\n\n const depositBorrowButtonDisabledForJoe =\n parseFloatNoNaN(collateralInput) > 0 && isJoeToken;\n\n const depositBorrowButtonDisabled =\n (parseFloatNoNaN(collateralInput) === 0 &&\n parseFloatNoNaN(borrowInput) === 0) ||\n totalPercentage > borrowablePercent;\n\n const inputStyle = {\n padding: '8px 8px 8px 20px',\n bg: 'whiteAlpha.50',\n borderRadius: '10px',\n justifyContent: 'space-between',\n };\n\n const liquidatableZone = borrowablePercent;\n const criticalZone = (90 * borrowablePercent) / 100;\n const riskyZone = (80 * borrowablePercent) / 100;\n const healthyZone = (50 * borrowablePercent) / 100;\n\n const positionHealthColor =\n 0.1 > totalDebt\n ? 'accent'\n : totalPercentage > liquidatableZone\n ? 'purple.400'\n : totalPercentage > criticalZone\n ? 'red'\n : totalPercentage > riskyZone\n ? 'orange'\n : totalPercentage > healthyZone\n ? 'green'\n : 'accent';\n const positionHealth = {\n accent: 'Safe',\n green: 'Healthy',\n orange: 'Risky',\n red: 'Critical',\n ['purple.400']: 'Liquidatable',\n };\n\n // console.log(\n // 'DepositBorrow',\n // position?.debt,\n // borrowablePercent,\n // totalPercentage,\n // currentPercentage\n // );\n\n const dangerousPosition = totalPercentage > borrowablePercent * 0.92;\n console.log('customPercentageInput', customPercentageInput);\n\n return (\n <>\n ,\n value: {data ? data!['collateral-deposit'] : ''},\n },\n {\n title: ,\n value: {data ? data!['money-borrow'] : ''},\n },\n {\n title: 'At Loan-To-Value %',\n value: totalPercentage.toFixed(1) + ' %',\n },\n ]}\n dangerous={dangerousPosition}\n />\n
    \n \n \n \n \n Deposit Collateral\n \n \n \n \n \n \n \n \n \n \n \n \n Borrow MONEY\n \n \n \n \n \n \n \n \n
    \n \n {percentages &&\n Object.entries(percentages).map(([key, value]) => (\n {\n setValueDepForm('custom-percentage', '');\n setValueDepForm('money-borrow', value.toFixed(10), {\n shouldDirty: true,\n });\n }}\n >\n \n {key}\n \n \n ))}\n \n \n \n %\n \n \n \n
    \n \n \n \n Deposit Value\n \n \n $ {(usdPrice * (totalCollateral - extantCollateral)).toFixed(2)}\n \n \n \n \n Liquidation Price\n \n \n ${' '}\n {calcLiqPriceFromNum(\n borrowablePercent,\n totalDebt,\n totalCollateral\n ).toFixed(2)}\n \n \n \n \n {positionHealth[positionHealthColor]} Position\n \n \n \n \n \n \n \n cRatio\n \n \n {totalDebt > 0.01\n ? ((100 * usdPrice * totalCollateral) / totalDebt).toFixed(2)\n : '∞'}\n \n \n \n \n \n Price:\n \n {`1 ${\n token.ticker\n } = $ ${usdPrice.toFixed(2)}`}\n \n \n \n \n\n \n {allowance && !allowance.gt(walletBalance) && !isNativeToken ? (\n \n sendApprove(strategyAddress)}\n isLoading={\n approveState.status === TxStatus.MINING &&\n allowance &&\n !allowance.gt(walletBalance)\n }\n >\n Approve {token.name}{' '}\n \n \n ) : (\n \n Deposit & Borrow\n \n )}\n \n \n \n );\n}\n","import { ExternalLinkIcon } from '@chakra-ui/icons';\nimport {\n Alert,\n AlertIcon,\n Box,\n Button,\n Flex,\n HStack,\n Link,\n Progress,\n Text,\n useDisclosure,\n VStack,\n} from '@chakra-ui/react';\nimport { CurrencyValue, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport { getAddress, parseEther } from 'ethers/lib/utils';\nimport * as React from 'react';\nimport { useContext, useState } from 'react';\nimport { useForm } from 'react-hook-form';\nimport {\n calcLiqPriceFromNum,\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n useStable,\n} from '../../../../chain-interaction/contracts';\nimport {\n useNativeRepayWithdrawTrans,\n useRepayWithdrawTrans,\n} from '../../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../../components/notifications/TransactionErrorDialog';\nimport WarningMessage from '../../../../components/notifications/WarningMessage';\nimport { TokenAmountInputField } from '../../../../components/tokens/TokenAmountInputField';\nimport { TokenDescription } from '../../../../components/tokens/TokenDescription';\nimport { WNATIVE_ADDRESS } from '../../../../constants/addresses';\nimport {\n useWalletBalance,\n WalletBalancesContext,\n} from '../../../../contexts/WalletBalancesContext';\nimport farminfo from '../../../../contracts/farminfo.json';\nimport { parseFloatCurrencyValue, parseFloatNoNaN } from '../../../../utils';\nimport { ConfirmPositionModal } from './ConfirmPositionModal';\n\nexport default function RepayWithdraw({\n position,\n stratMeta,\n}: React.PropsWithChildren<{\n position?: ParsedPositionMetaRow;\n stratMeta: ParsedStratMetaRow;\n}>) {\n const { token, usdPrice, borrowablePercent } = stratMeta;\n const { chainId } = useEthers();\n const [data, setData] = useState<{ [x: string]: any }>();\n const { isOpen, onOpen, onClose } = useDisclosure();\n const stable = useStable();\n const isNativeToken = chainId\n ? getAddress(WNATIVE_ADDRESS[chainId!]) === getAddress(token.address)\n : false;\n const balanceCtx = useContext(WalletBalancesContext);\n\n const {\n handleSubmit: handleSubmitRepayForm,\n register: registerRepayForm,\n setValue: setValueRepayForm,\n formState: { errors: errorsRepayForm, isSubmitting: isSubmittingRepayForm },\n watch,\n } = useForm();\n\n const { sendRepayWithdraw, repayWithdrawState } = useRepayWithdrawTrans(\n position && position.trancheId,\n token,\n position?.debt\n );\n // console.log('position.trancheId', position?.trancheId);\n const {\n sendRepayWithdraw: sendNativeRepayWithdraw,\n repayWithdrawState: sendNativeWithdrawState,\n } = useNativeRepayWithdrawTrans(\n position && position.trancheId,\n token,\n position?.debt\n );\n\n function onRepayWithdraw(data: { [x: string]: any }) {\n // console.log('repay withdraw');\n // console.log(data);\n setData(data);\n onOpen();\n }\n\n function repayWithdraw() {\n if (isNativeToken) {\n sendNativeRepayWithdraw(\n data!['collateral-withdraw'] ?? '0',\n data!['money-repay'] ?? '0'\n );\n } else {\n sendRepayWithdraw(\n data!['collateral-withdraw'] ?? '0',\n data!['money-repay'] ?? '0'\n );\n }\n }\n\n const walletBalance =\n useWalletBalance(stable.address) ??\n new CurrencyValue(stable, BigNumber.from('0'));\n\n const repayWithdrawDisabled =\n !position ||\n !position.collateral ||\n (position.collateral.isZero() && position.debt.isZero());\n\n const [collateralInput, repayInput /*customPercentageInput*/] = watch([\n 'collateral-withdraw',\n 'money-repay',\n // 'custom-percentage',\n ]);\n\n const extantCollateral =\n position && position.collateral\n ? parseFloatCurrencyValue(position.collateral)\n : 0;\n const totalCollateral = extantCollateral - parseFloatNoNaN(collateralInput);\n\n const extantDebt =\n position && position.debt && position.debt.gt(position.yield)\n ? parseFloatCurrencyValue(position.debt.sub(position.yield))\n : 0;\n const totalDebt = extantDebt - parseFloatNoNaN(repayInput);\n\n // const currentPercentage =\n // totalCollateral > 0 ? (100 * extantDebt) / (totalCollateral * usdPrice) : 0;\n\n // const percentageStep = Math.max(currentPercentage / 5, 10);\n // const percentageSteps =\n // 10 >= currentPercentage\n // ? [currentPercentage / 2]\n // : Array(Math.floor((currentPercentage - 0.5) / percentageStep))\n // .fill(0)\n // .map((p, i) => Math.round((p + (i + 1) * percentageStep) / 5) * 5);\n\n const totalPercentage =\n totalCollateral > 0 && usdPrice > 0\n ? (100 * totalDebt) / (totalCollateral * usdPrice)\n : 0;\n\n const percentageLabel =\n totalCollateral > 0 ? `${totalPercentage.toFixed(0)} %` : 'LTV %';\n // const percentages = Object.fromEntries(\n // percentageSteps.map((percentage) => [\n // `${percentage.toFixed(0)} %`,\n // totalCollateral - (totalDebt * 100) / (usdPrice * customPercentageInput)\n // ])\n // );\n\n // React.useEffect(() => {\n // if (customPercentageInput) {\n // setValueRepayForm(\n // 'collateral-withdraw',\n // totalCollateral - (totalDebt * 100) / (usdPrice * customPercentageInput)\n // );\n // } else if (\n // collateralInput &&\n // collateralInput > 0 &&\n // totalPercentage > borrowablePercent\n // ) {\n // setValueRepayForm(\n // 'money-repay',\n // (borrowablePercent * totalCollateral * usdPrice) / 100 - extantDebt\n // );\n // }\n // }, [\n // customPercentageInput,\n // collateralInput,\n // totalCollateral,\n // extantDebt,\n // usdPrice,\n // ]);\n\n const farmInfoIdx = (chainId?.toString() ?? '43114') as keyof typeof farminfo;\n const curveLink = `https://avax.curve.fi/factory/${farminfo[farmInfoIdx].curvePoolIdx}/`;\n\n const repayingMoreThanBalance =\n !isNaN(parseFloat(repayInput)) &&\n parseEther(repayInput || '0').gt(walletBalance.value);\n\n const repayWithdrawButtonDisabled =\n (parseFloatNoNaN(collateralInput) === 0 &&\n parseFloatNoNaN(repayInput) === 0) ||\n totalPercentage > borrowablePercent ||\n (totalCollateral === 0 && totalDebt > 0) ||\n repayingMoreThanBalance;\n\n const inputStyle = {\n padding: '8px 8px 8px 20px',\n bg: 'whiteAlpha.50',\n borderRadius: '10px',\n justifyContent: 'space-between',\n };\n\n const showWarning =\n (!(\n parseFloatNoNaN(collateralInput) === 0 &&\n parseFloatNoNaN(repayInput) === 0\n ) &&\n totalPercentage > borrowablePercent) ||\n repayingMoreThanBalance ||\n (totalCollateral === 0 && totalDebt > 0);\n\n const warningMsgText = repayingMoreThanBalance\n ? 'Input more than wallet balance: buy more MONEY'\n : 'Repay more to keep position cRatio healthy';\n\n const residualDebt =\n position && position.debt.gt(position.yield)\n ? position.debt.sub(position.yield)\n : new CurrencyValue(stable, BigNumber.from(0));\n\n const dangerousPosition =\n totalPercentage > borrowablePercent * 0.92 && totalDebt > 0;\n const liquidatableZone = borrowablePercent;\n const criticalZone = (90 * borrowablePercent) / 100;\n const riskyZone = (80 * borrowablePercent) / 100;\n const healthyZone = (50 * borrowablePercent) / 100;\n\n const positionHealthColor =\n 0.1 > totalDebt\n ? 'accent'\n : totalPercentage > liquidatableZone\n ? 'purple.400'\n : totalPercentage > criticalZone\n ? 'red'\n : totalPercentage > riskyZone\n ? 'orange'\n : totalPercentage > healthyZone\n ? 'green'\n : 'accent';\n const positionHealth = {\n accent: 'Safe',\n green: 'Healthy',\n orange: 'Risky',\n red: 'Critical',\n ['purple.400']: 'Liquidatable',\n };\n return (\n <>\n ,\n value: {data ? data!['money-repay'] : ''},\n },\n {\n title: ,\n value: {data ? data!['collateral-withdraw'] : ''},\n },\n {\n title: 'At Loan-To-Value %',\n value: totalPercentage.toFixed(1) + ' %',\n },\n ]}\n dangerous={dangerousPosition}\n />\n
    \n \n \n \n \n Repay MONEY\n \n \n \n \n \n \n \n \n \n \n \n Withdraw Collateral\n \n \n \n \n \n \n \n
    \n \n {/* {percentages &&\n Object.entries(percentages).map(([key, value]) => (\n \n setValueRepayForm('collateral-withdraw', value.toFixed(18))\n }\n >\n {key}\n \n ))} */}\n\n {/* \n \n \n %\n \n */}\n \n \n To unwind / repay minting fee:\n\n \n Buy MONEY  \n \n \n \n \n
    \n \n \n \n Withdrawal Value\n \n \n $ {(usdPrice * (extantCollateral - totalCollateral)).toFixed(2)}\n \n \n \n \n Liquidation Price\n \n \n ${' '}\n {calcLiqPriceFromNum(\n borrowablePercent,\n totalDebt,\n totalCollateral\n ).toFixed(2)}\n \n \n \n \n {positionHealth[positionHealthColor]} Position\n \n \n \n \n \n \n \n cRatio\n \n \n {totalDebt > 0.01\n ? ((100 * usdPrice * totalCollateral) / totalDebt).toFixed(2)\n : '∞'}\n \n \n \n \n \n Price:\n \n {`1 ${\n token.ticker\n } = $ ${usdPrice.toFixed(2)}`}\n \n\n \n \n\n \n \n Repay & Withdraw\n \n \n \n \n );\n}\n","import {\n Container,\n GridItem,\n Tab,\n TabList,\n TabPanel,\n TabPanels,\n Tabs,\n} from '@chakra-ui/react';\nimport * as React from 'react';\nimport {\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n} from '../../../../chain-interaction/contracts';\nimport DepositBorrow from './DepositBorrow';\nimport RepayWithdraw from './RepayWithdraw';\n\nexport default function EditPosition({\n position,\n stratMeta,\n}: React.PropsWithChildren<{\n position?: ParsedPositionMetaRow;\n stratMeta: ParsedStratMetaRow;\n}>) {\n return (\n \n {/* */}\n \n \n \n Borrow\n Repay\n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n","import { Container, Flex, GridItem, Text } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { ParsedStratMetaRow } from '../../../../chain-interaction/contracts';\n\nexport default function CollateralAPY({\n stratMeta,\n chosenStrategy,\n}: {\n stratMeta: Record;\n chosenStrategy: string;\n}) {\n const multipleOptions =\n stratMeta[chosenStrategy].selfRepayingAPY > 0 &&\n stratMeta[chosenStrategy].compoundingAPY > 0;\n const textVariant = 'bodySmall';\n\n return (\n \n {/* */}\n \n \n \n Collateral APY\n \n \n {' '}\n {stratMeta[chosenStrategy].APY.toFixed(2)}%\n \n {multipleOptions ? (\n \n \n \n {stratMeta[chosenStrategy].compoundingAPY.toFixed(2)}%\n \n \n  {stratMeta[chosenStrategy].underlyingStrategyName\n ?? 'Compounding'}\n \n \n \n \n {stratMeta[chosenStrategy].selfRepayingAPY.toFixed(2)}%\n \n \n  {'Self-Repaying'}\n \n \n \n ) : null}\n \n \n \n );\n}\n","import React from 'react';\nimport { VStack, Text } from '@chakra-ui/react';\n\ntype Props = {\n title: string;\n value: any;\n};\n\nexport function TitleValue({ title, value }: Props) {\n return (\n \n \n {title}\n \n {value}\n \n );\n}\n","import { Container, Flex, GridItem, Text } from '@chakra-ui/react';\nimport { parseEther } from '@ethersproject/units';\nimport { CurrencyValue } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport React from 'react';\nimport {\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n} from '../../../chain-interaction/contracts';\nimport { TitleValue } from '../../../components/data-display/TitleValue';\nimport { parseFloatCurrencyValue } from '../../../utils';\n\nexport function PositionData({\n position,\n stratMeta,\n}: {\n position: ParsedPositionMetaRow;\n stratMeta: ParsedStratMetaRow;\n}) {\n const effectiveDebt = position.debt.gt(position.yield)\n ? position.debt.sub(position.yield)\n : new CurrencyValue(position.debt.currency, BigNumber.from(0));\n\n const { collateral, debt, borrowablePercent } = position;\n const { usdPrice } = stratMeta;\n\n const totalPercentage =\n collateral?.value.gt(0) && usdPrice > 0\n ? (100 * parseFloatCurrencyValue(debt)) /\n (parseFloatCurrencyValue(collateral) * usdPrice)\n : 0;\n const liquidatableZone = borrowablePercent;\n const criticalZone = (90 * borrowablePercent) / 100;\n const riskyZone = (80 * borrowablePercent) / 100;\n const healthyZone = (50 * borrowablePercent) / 100;\n\n const positionHealthColor = debt.value.lt(parseEther('0.1'))\n ? 'accent'\n : totalPercentage > liquidatableZone\n ? 'purple.400'\n : totalPercentage > criticalZone\n ? 'red'\n : totalPercentage > riskyZone\n ? 'orange'\n : totalPercentage > healthyZone\n ? 'green'\n : 'accent';\n const positionHealth = {\n accent: 'Safe',\n green: 'Healthy',\n orange: 'Risky',\n red: 'Critical',\n ['purple.400']: 'Liquidatable',\n };\n\n // console.log('PositionData', debt, borrowablePercent, totalPercentage);\n return (\n \n \n \n \n {positionHealth[positionHealthColor]}\n \n }\n />\n \n \n \n \n \n \n \n );\n}\n","import {\n Container,\n Flex,\n GridItem,\n Image,\n Spacer,\n Text,\n} from '@chakra-ui/react';\nimport { BigNumber } from 'ethers';\n// import { CurrencyValue } from '@usedapp/core';\n// import { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport lines from '../../../assets/img/lines.svg';\nimport {\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n useInterestRate,\n} from '../../../chain-interaction/contracts';\n// import {\n// useAMMHarvest,\n// useHarvestPartially,\n// } from '../../../chain-interaction/transactions';\n// import { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { LiquidationFeesContext } from '../../../contexts/LiquidationFeesContext';\n\nexport default function StrategyTokenInformation({\n stratMeta,\n}: React.PropsWithChildren<{\n position?: ParsedPositionMetaRow;\n stratMeta: ParsedStratMetaRow;\n}>) {\n const calcCRatio = () => {\n return `${Math.round((1 / (stratMeta.borrowablePercent / 100)) * 100)}%`;\n };\n\n // const { sendAMMHarvest, AMMHarvestState } = useAMMHarvest(\n // stratMeta.strategyAddress\n // );\n\n const tokenFees = React.useContext(LiquidationFeesContext);\n const interestRate = useInterestRate(BigNumber.from(0));\n console.log('interestRate', interestRate.toString());\n\n // const { sendHarvestPartially, harvestPartiallyState } = useHarvestPartially(\n // stratMeta.strategyAddress\n // );\n\n // const stable = useStable();\n // const estimatedHarvestable: BigNumber | undefined = useEstimatedHarvestable(\n // stratMeta.strategyAddress,\n // stratMeta.token.address\n // );\n // const harvestLabel = estimatedHarvestable\n // ? ` $ ${new CurrencyValue(stable, estimatedHarvestable).format({\n // fixedPrecisionDigits: 0,\n // useFixedPrecision: true,\n // suffix: '',\n // prefix: '',\n // })}`\n // : '';\n return (\n \n \n \n {/* \n */}\n \n \n \n Interest Rate\n \n \n {interestRate.toString() ?? ''}%\n \n \n \n Borrow Fee\n \n \n \n {stratMeta.mintingFeePercent.toFixed(2)}%\n \n \n \n \n Minimum cRatio\n \n \n {calcCRatio()}\n \n \n \n Max Loan-To-Value\n \n \n \n {Math.round(stratMeta.borrowablePercent)}%\n \n \n \n \n Liquidation Fee\n \n \n \n {tokenFees.get(stratMeta.token.address) + '%'}\n \n \n {/* \n \n Stability fee\n \n \n \n {stratMeta.stabilityFeePercent.toFixed(2)}%\n \n */}\n {/* \n {stratMeta.yieldType !== YieldType.COMPOUNDING && false ? (\n \n \n Harvestable\n \n \n {\n if (stratMeta.yieldType === YieldType.REPAYING) {\n sendAMMHarvest(stratMeta.token.address);\n } else if (stratMeta.yieldType === YieldType.COMPOUNDING) {\n sendHarvestPartially(stratMeta.token.address);\n }\n }}\n >\n {`Harvest${harvestLabel}`}\n \n \n ) : undefined} */}\n \n \n \n );\n}\n","import { Grid } from '@chakra-ui/react';\nimport { parseEther } from '@ethersproject/units';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport {\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n useStable,\n} from '../../../chain-interaction/contracts';\nimport { useMigrateStrategy } from '../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\nimport StrategyNameAndSwitch, {\n stratFilter,\n} from './change-strategy/StrategyNameAndSwitch';\nimport EditPosition from './edit/EditPosition';\nimport CollateralAPY from './metadata/CollateralAPY';\nimport { PositionData } from './PositionData';\nimport StrategyTokenInformation from './StrategyTokenInformation';\n\nexport function PositionBody({\n position: inputPos,\n stratMeta,\n}: React.PropsWithChildren<{\n position?: ParsedPositionMetaRow;\n stratMeta: Record;\n}>) {\n const position =\n inputPos &&\n inputPos.collateralValue.value.gt(parseEther('0.01')) &&\n inputPos.strategy in stratMeta\n ? inputPos\n : undefined;\n\n stratMeta = Object.fromEntries(\n Object.entries(stratMeta).filter(([, strat]) =>\n stratFilter(strat, position)\n )\n );\n\n const highestAPYStrategy: any = Object.values(\n Object.fromEntries(Object.entries(stratMeta))\n ).reduce((aggStrat, nextStrat) => {\n return {\n ...aggStrat,\n APY: aggStrat.APY > nextStrat.APY ? aggStrat.APY : nextStrat.APY,\n highestAPY:\n aggStrat.APY > nextStrat.APY\n ? aggStrat.strategyAddress\n : nextStrat.strategyAddress,\n };\n });\n\n const [chosenStrategy, setChosenStrategy] = React.useState(\n position?.strategy ??\n highestAPYStrategy['highestAPY'] ??\n Object.keys(stratMeta)[0]\n );\n\n const account = useContext(UserAddressContext);\n const stable = useStable();\n const { sendMigrateStrategy, migrateStrategyState } = useMigrateStrategy(\n position?.trancheContract\n );\n\n function chooseStrategy(strategyToChoose: string) {\n if (position) {\n sendMigrateStrategy(\n position.trancheId,\n stratMeta[strategyToChoose].strategyAddress,\n stable,\n account!\n );\n } else {\n setChosenStrategy(strategyToChoose);\n }\n }\n\n // console.log('strategy', chosenStrategy);\n\n return (\n <>\n \n \n {position && position.collateralValue.value.gt(parseEther('0.01')) && (\n \n )}\n \n\n \n \n\n \n \n \n \n \n );\n}\n","import { parseEther } from '@ethersproject/units';\nimport * as React from 'react';\nimport {\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n TokenStratPositionMetadata,\n useIsolatedPositionMetadata,\n} from '../../../chain-interaction/contracts';\nimport { PositionBody } from './PositionBody';\n\nexport function TokenPageBody({\n stratMeta,\n account,\n tokenAddress,\n}: React.PropsWithChildren<{\n stratMeta: Record;\n account: string;\n tokenAddress?: string;\n}>) {\n const allPositionMeta: TokenStratPositionMetadata =\n useIsolatedPositionMetadata(account);\n const positionMeta1: ParsedPositionMetaRow[] =\n (tokenAddress && allPositionMeta && allPositionMeta[tokenAddress]) || [];\n const positionMeta =\n positionMeta1\n .filter((pos) => pos)\n .filter((pos) => pos.collateralValue.value.gt(parseEther('0.01')))\n .filter((pos) => pos.strategy in stratMeta) ?? [];\n\n return positionMeta.length === 0 ? (\n \n ) : (\n <>\n {positionMeta.map((position) => (\n \n ))}\n \n );\n}\n","import { Box, HStack } from '@chakra-ui/react';\nimport { useEthers } from '@usedapp/core';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { ParsedStratMetaRow } from '../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../chain-interaction/tokens';\nimport { BackButton } from '../../components/navigation/BackButton';\nimport DeprecatedTokenMessage from '../../components/notifications/DeprecatedTokenMessage';\nimport { TokenDescription } from '../../components/tokens/TokenDescription';\nimport { StrategyMetadataContext } from '../../contexts/StrategyMetadataContext';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\nimport { PositionBody } from './components/PositionBody';\nimport { TokenPageBody } from './components/TokenPageBody';\n\nexport default function TokenPage(props: React.PropsWithChildren) {\n const { chainId } = useEthers();\n const account = useContext(UserAddressContext);\n const params = useParams<'tokenAddress'>();\n const tokenAddress = params.tokenAddress;\n const allStratMeta = React.useContext(StrategyMetadataContext);\n const token = tokenAddress\n ? getTokenFromAddress(chainId, tokenAddress)\n : undefined;\n\n const stratMeta: Record =\n tokenAddress && tokenAddress in allStratMeta\n ? allStratMeta[tokenAddress]\n : {};\n\n return Object.values(stratMeta).length > 0 ? (\n \n \n \n \n \n {token ? (\n \n ) : undefined}\n \n {account ? (\n \n ) : (\n \n )}\n {props.children}\n \n ) : (\n <> \n );\n}\n","import { Button, Flex, Text } from '@chakra-ui/react';\nimport { CurrencyValue, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useAddresses } from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport {\n useClaimableVeMoreToken,\n useClaimVeMore,\n useGetStakedMoreVeMoreToken,\n} from '../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\n\nexport default function ClaimVeMore({\n children,\n}: React.PropsWithChildren) {\n const { chainId } = useEthers();\n const account = React.useContext(UserAddressContext);\n const veMoreTokenToken = getTokenFromAddress(\n chainId,\n useAddresses().VeMoreToken\n );\n const moreToken = getTokenFromAddress(chainId, useAddresses().MoreToken);\n\n const stakedMore = useGetStakedMoreVeMoreToken(account!);\n const claimableVeMoreToken = useClaimableVeMoreToken(account!);\n\n const stakedMoreBalance = new CurrencyValue(\n moreToken,\n BigNumber.from(stakedMore)\n );\n const claimableVeMoreTokenBalance = new CurrencyValue(\n veMoreTokenToken,\n BigNumber.from(claimableVeMoreToken)\n );\n\n const { sendClaim, claimState } = useClaimVeMore();\n\n const disabledButton = BigNumber.from(claimableVeMoreToken).isZero();\n\n return (\n <>\n \n \n \n \n Staked MORE\n \n \n {stakedMoreBalance.format()}\n \n \n\n \n \n Claimable\n \n \n \n {claimableVeMoreTokenBalance.format()}\n \n \n \n \n \n Claim\n \n {children}\n \n );\n}\n","import { Box, Button, Flex, Text } from '@chakra-ui/react';\nimport { CurrencyValue, useEthers, useTokenAllowance } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { TxStatus, useAddresses } from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport {\n useApproveTrans,\n useStakeMoreForVeMoreToken,\n} from '../../../chain-interaction/transactions';\nimport { EnsureWalletConnected } from '../../../components/account/EnsureWalletConnected';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { TokenAmountInputField } from '../../../components/tokens/TokenAmountInputField';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\nimport {\n useWalletBalance,\n WalletBalancesContext,\n} from '../../../contexts/WalletBalancesContext';\nimport { parseFloatNoNaN } from '../../../utils';\n\nexport function StakeMoreVeMore(props: React.PropsWithChildren) {\n const veMoreTokenContract = useAddresses().VeMoreStaking;\n const balanceCtx = useContext(WalletBalancesContext);\n const moreToken = useAddresses().MoreToken;\n const account = useContext(UserAddressContext);\n const { chainId } = useEthers();\n\n const token = getTokenFromAddress(chainId, moreToken);\n const walletBalance =\n useWalletBalance(token.address) ??\n new CurrencyValue(token, BigNumber.from('0'));\n\n const { sendStake, stakeState } = useStakeMoreForVeMoreToken();\n\n const allowance = new CurrencyValue(\n token,\n useTokenAllowance(token.address, account, veMoreTokenContract) ??\n BigNumber.from('0')\n );\n const { approveState, sendApprove } = useApproveTrans(token.address);\n\n const {\n handleSubmit: handleSubmitDepForm,\n register: registerDepForm,\n setValue: setValueDepForm,\n formState: { errors: errorsDepForm, isSubmitting: isSubmittingDepForm },\n watch,\n } = useForm();\n\n const [moreStakeInput] = watch(['more-stake']);\n\n function onStakeMore(data: { [x: string]: any }) {\n console.log('data', data);\n sendStake(token, data['more-stake']);\n }\n\n const stakeMoreDisabled = balanceCtx.get(moreToken)?.isZero();\n const stakeMoreButtonDisabled = parseFloatNoNaN(moreStakeInput) === 0;\n\n return (\n
    \n \n \n \n Stake MORE\n \n \n \n \n \n \n \n {allowance.gt(walletBalance) === false ? (\n \n sendApprove(veMoreTokenContract)}\n isLoading={\n approveState.status == TxStatus.SUCCESS &&\n allowance.gt(walletBalance) === false\n }\n >\n Approve {token.name}{' '}\n \n \n ) : (\n \n Stake MORE\n \n )}\n \n {props.children}\n \n );\n}\n","import { Box, Button, Flex, Text } from '@chakra-ui/react';\nimport { CurrencyValue, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useForm } from 'react-hook-form';\nimport { useAddresses } from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport {\n useGetStakedMoreVeMoreToken,\n useUnstakeVeMoreTokenForMore,\n} from '../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { TokenAmountInputField } from '../../../components/tokens/TokenAmountInputField';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\nimport { parseFloatNoNaN } from '../../../utils';\n\nexport function UnstakeMoreVeMore(props: React.PropsWithChildren) {\n const { chainId } = useEthers();\n const veMoreTokenToken = getTokenFromAddress(\n chainId,\n useAddresses().VeMoreToken\n );\n const account = React.useContext(UserAddressContext);\n const veMoreTokenStaked = useGetStakedMoreVeMoreToken(account!);\n\n const veMoreTokenBalance = new CurrencyValue(\n veMoreTokenToken,\n BigNumber.from(veMoreTokenStaked)\n );\n\n const token = getTokenFromAddress(chainId, veMoreTokenToken.address);\n\n const { sendUnstake, unstakeState } = useUnstakeVeMoreTokenForMore();\n\n const {\n handleSubmit: handleSubmitDepForm,\n register: registerDepForm,\n setValue: setValueDepForm,\n formState: { errors: errorsDepForm, isSubmitting: isSubmittingDepForm },\n watch,\n } = useForm();\n\n const [veMoreTokenUnstakeInput] = watch(['veMoreToken-unstake']);\n\n function onStakeMore(data: { [x: string]: any }) {\n console.log('data', data);\n sendUnstake(token, data['veMoreToken-unstake']);\n }\n\n const stakeMoreDisabled = veMoreTokenBalance.isZero();\n const unstakeMoreButtonDisabled =\n parseFloatNoNaN(veMoreTokenUnstakeInput) === 0;\n\n return (\n
    \n \n \n \n Unstake veMore\n \n \n \n \n \n \n \n Unstake MORE\n \n \n {props.children}\n \n );\n}\n","import {\n Container,\n GridItem,\n Tab,\n TabList,\n TabPanel,\n TabPanels,\n Tabs,\n} from '@chakra-ui/react';\nimport * as React from 'react';\nimport ClaimVeMore from './ClaimVeMore';\nimport { StakeMoreVeMore } from './StakeMoreVeMore';\nimport { UnstakeMoreVeMore } from './UnstakeMoreVeMore';\n\nexport function EditMoreVeMoreToken(props: React.PropsWithChildren) {\n return (\n \n \n \n \n Stake MORE\n Unstake\n Claim\n \n \n \n \n \n \n \n \n \n \n \n \n \n {props.children}\n \n \n );\n}\n","import { Container, Flex, GridItem, Image, Text } from '@chakra-ui/react';\nimport { CurrencyValue, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useAddresses } from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport { useBalanceOfVeMoreToken } from '../../../chain-interaction/transactions';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\nimport { useWalletBalance } from '../../../contexts/WalletBalancesContext';\n\nexport function MoreBalanceVeMoreToken() {\n const { chainId } = useEthers();\n const account = React.useContext(UserAddressContext);\n const moreToken = getTokenFromAddress(chainId, useAddresses().MoreToken);\n const veMoreToken = getTokenFromAddress(chainId, useAddresses().VeMoreToken);\n\n const moreBalance =\n useWalletBalance(moreToken.address) ??\n new CurrencyValue(moreToken, BigNumber.from('0'));\n const veMoreTokenBalanceOf = useBalanceOfVeMoreToken(account!);\n\n const veMoreTokenBalance = new CurrencyValue(\n veMoreToken,\n BigNumber.from(veMoreTokenBalanceOf)\n );\n\n return (\n \n \n \n \n \n \n {moreBalance.format()}\n \n \n\n \n \n \n {veMoreTokenBalance.format()}\n \n \n \n \n \n );\n}\n","import {\n Container,\n Flex,\n GridItem,\n Image,\n Spacer,\n Text,\n} from '@chakra-ui/react';\nimport { formatEther } from '@ethersproject/units';\nimport { CurrencyValue, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport lines from '../../../assets/img/lines.svg';\nimport {\n useAddresses,\n useTotalSupplyToken,\n} from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport {\n useGetStakedMoreVeMoreToken,\n useClaimableVeMoreToken,\n} from '../../../chain-interaction/transactions';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\nimport { formatNumber } from '../../../utils';\n\nexport function StakingAPRVeMoreToken(props: React.PropsWithChildren) {\n const addresses = useAddresses();\n const totalSupplyStakedVeMore = formatEther(\n useTotalSupplyToken(addresses.VeMoreToken, 'totalSupply', [], 0)\n );\n const account = React.useContext(UserAddressContext);\n const { chainId } = useEthers();\n const veMoreTokenToken = getTokenFromAddress(\n chainId,\n useAddresses().VeMoreToken\n );\n const moreToken = getTokenFromAddress(chainId, useAddresses().MoreToken);\n\n const stakedMore = useGetStakedMoreVeMoreToken(account!);\n const claimableVeMoreToken = useClaimableVeMoreToken(account!);\n\n const stakedMoreBalance = new CurrencyValue(\n moreToken,\n BigNumber.from(stakedMore)\n );\n const claimableVeMoreTokenBalance = new CurrencyValue(\n veMoreTokenToken,\n BigNumber.from(claimableVeMoreToken)\n );\n\n return (\n \n \n \n \n \n \n Staked MORE\n \n \n {stakedMoreBalance.format()}\n \n \n \n Claimable\n \n \n \n {' '}\n {claimableVeMoreTokenBalance.format()}\n \n \n \n \n Total veMore Supply\n \n \n \n {formatNumber(parseFloat(totalSupplyStakedVeMore))}\n \n \n \n {props?.children}\n \n \n );\n}\n","import { Box, Flex, Grid, Text } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { EditMoreVeMoreToken } from './edit/EditMoreVeMore';\nimport { MoreBalanceVeMoreToken } from './metadata/MoreBalanceVeMore';\nimport { StakingAPRVeMoreToken } from './metadata/StakingAPRVeMore';\n\nexport default function veMorePage(props: React.PropsWithChildren) {\n return (\n \n \n \n Maximize yield by staking MORE for veMore\n \n \n \n \n \n \n \n {props.children}\n \n );\n}\n","import { Box, Button, Flex, Text } from '@chakra-ui/react';\nimport { CurrencyValue, useEthers, useTokenAllowance } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { TxStatus, useAddresses } from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport {\n useApproveTrans,\n useStakeMore,\n} from '../../../chain-interaction/transactions';\nimport { EnsureWalletConnected } from '../../../components/account/EnsureWalletConnected';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { TokenAmountInputField } from '../../../components/tokens/TokenAmountInputField';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\nimport {\n useWalletBalance,\n WalletBalancesContext,\n} from '../../../contexts/WalletBalancesContext';\nimport { parseFloatNoNaN } from '../../../utils';\n\nexport function StakeMore(props: React.PropsWithChildren) {\n const xMoreContract = useAddresses().xMore;\n const balanceCtx = useContext(WalletBalancesContext);\n const moreToken = useAddresses().MoreToken;\n const account = useContext(UserAddressContext);\n const { chainId } = useEthers();\n\n const token = getTokenFromAddress(chainId, moreToken);\n const walletBalance =\n useWalletBalance(token.address) ??\n new CurrencyValue(token, BigNumber.from('0'));\n\n const { sendStake, stakeState } = useStakeMore();\n\n const allowance = new CurrencyValue(\n token,\n useTokenAllowance(token.address, account, xMoreContract) ??\n BigNumber.from('0')\n );\n const { approveState, sendApprove } = useApproveTrans(token.address);\n\n const {\n handleSubmit: handleSubmitDepForm,\n register: registerDepForm,\n setValue: setValueDepForm,\n formState: { errors: errorsDepForm, isSubmitting: isSubmittingDepForm },\n watch,\n } = useForm();\n\n const [moreStakeInput] = watch(['more-stake']);\n\n function onStakeMore(data: { [x: string]: any }) {\n console.log('data', data);\n sendStake(token, data['more-stake']);\n }\n\n const stakeMoreDisabled = balanceCtx.get(moreToken)?.isZero();\n const stakeMoreButtonDisabled = parseFloatNoNaN(moreStakeInput) === 0;\n\n return (\n
    \n \n \n \n Stake MORE\n \n \n \n \n \n \n \n {allowance.gt(walletBalance) === false ? (\n \n sendApprove(xMoreContract)}\n isLoading={\n approveState.status == TxStatus.SUCCESS &&\n allowance.gt(walletBalance) === false\n }\n >\n Approve {token.name}{' '}\n \n \n ) : (\n \n Stake MORE\n \n )}\n \n {props.children}\n \n );\n}\n","import { Box, Button, Flex, Text } from '@chakra-ui/react';\nimport { useEthers } from '@usedapp/core';\nimport * as React from 'react';\nimport { useForm } from 'react-hook-form';\nimport { useAddresses } from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport {\n useUnstakeMore\n} from '../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { TokenAmountInputField } from '../../../components/tokens/TokenAmountInputField';\nimport {\n WalletBalancesContext\n} from '../../../contexts/WalletBalancesContext';\nimport { parseFloatNoNaN } from '../../../utils';\n\nexport function UnstakeMore(props: React.PropsWithChildren) {\n const balanceCtx = React.useContext(WalletBalancesContext);\n const xMoreToken = useAddresses().xMore;\n const { chainId } = useEthers();\n\n const token = getTokenFromAddress(chainId, xMoreToken);\n\n const { sendUnstake, unstakeState } = useUnstakeMore();\n\n const {\n handleSubmit: handleSubmitDepForm,\n register: registerDepForm,\n setValue: setValueDepForm,\n formState: { errors: errorsDepForm, isSubmitting: isSubmittingDepForm },\n watch,\n } = useForm();\n\n const [xmoreUnstakeInput] = watch(['xmore-unstake']);\n\n function onStakeMore(data: { [x: string]: any }) {\n console.log('data', data);\n sendUnstake(token, data['xmore-unstake']);\n }\n\n const stakeMoreDisabled = balanceCtx.get(xMoreToken)?.isZero();\n const unstakeMoreButtonDisabled = parseFloatNoNaN(xmoreUnstakeInput) === 0;\n\n return (\n
    \n \n \n \n Unstake xMORE\n \n \n \n \n \n \n \n Unstake xMORE\n \n \n {props.children}\n \n );\n}\n","import {\n Container,\n GridItem,\n Tab,\n TabList,\n TabPanel,\n TabPanels,\n Tabs,\n} from '@chakra-ui/react';\nimport * as React from 'react';\nimport { StakeMore } from './StakeMore';\nimport { UnstakeMore } from './UnstakeMore';\n\nexport function EditMore(props: React.PropsWithChildren) {\n return (\n \n \n \n \n Stake MORE\n Unstake\n \n \n \n \n \n \n \n \n \n \n {props.children}\n \n \n );\n}\n","import { Container, Flex, GridItem, Image, Text } from '@chakra-ui/react';\nimport { CurrencyValue, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useAddresses } from '../../../chain-interaction/contracts';\nimport { getTokenFromAddress } from '../../../chain-interaction/tokens';\nimport { useWalletBalance } from '../../../contexts/WalletBalancesContext';\n\nexport function MoreBalance() {\n const { chainId } = useEthers();\n const moreToken = getTokenFromAddress(chainId, useAddresses().MoreToken);\n const xMoreToken = getTokenFromAddress(chainId, useAddresses().xMore);\n\n const moreBalance =\n useWalletBalance(moreToken.address) ??\n new CurrencyValue(moreToken, BigNumber.from('0'));\n const xMoreBalance =\n useWalletBalance(xMoreToken.address) ??\n new CurrencyValue(xMoreToken, BigNumber.from('0'));\n\n return (\n \n \n \n \n \n \n {moreBalance.format()}\n \n \n\n \n \n \n {xMoreBalance.format()}\n \n \n \n \n \n );\n}\n","import {\n Container,\n Flex,\n GridItem,\n Image,\n Spacer,\n Text,\n} from '@chakra-ui/react';\nimport * as React from 'react';\nimport lines from '../../../assets/img/lines.svg';\nimport { ExternalMetadataContext } from '../../../contexts/ExternalMetadataContext';\nimport { formatNumber } from '../../../utils';\n\nexport function StakingAPR(props: React.PropsWithChildren) {\n const { xMoreData } = React.useContext(ExternalMetadataContext);\n\n return (\n \n \n \n \n \n \n Approximate APR\n \n \n \n {xMoreData?.cachedAPR?.toFixed(2)}%\n \n \n \n \n Total Supply\n \n \n \n {formatNumber(xMoreData?.totalSupply)}\n \n \n \n \n MORE / xMORE\n \n \n \n {formatNumber(xMoreData?.currentRatio)}\n \n \n \n {props?.children}\n \n \n );\n}\n","import { Box, Flex, Grid, Text } from '@chakra-ui/react';\nimport * as React from 'react';\nimport { EditMore } from './edit/EditMore';\nimport { MoreBalance } from './metadata/MoreBalance';\nimport { StakingAPR } from './metadata/StakingAPR';\n\nexport default function XMorePage(props: React.PropsWithChildren) {\n return (\n \n \n \n Maximize yield by staking MORE for xMORE\n \n \n \n \n \n \n \n {props.children}\n \n );\n}\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://cra.link/PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://cra.link/PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://cra.link/PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It is the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch((error) => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then((registration) => {\n registration.unregister();\n })\n .catch((error) => {\n console.error(error.message);\n });\n }\n}\n","import { ColorModeScript } from '@chakra-ui/react';\nimport {\n Avalanche,\n ChainId,\n DAppProvider,\n Hardhat,\n Localhost,\n} from '@usedapp/core';\nimport * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport { BrowserRouter, Route, Routes } from 'react-router-dom';\nimport { App } from './App';\nimport { LiquidatablePositionsCtxProvider } from './contexts/LiquidatablePositionsContext';\nimport AdminPage from './pages/Admin';\nimport Analytics from './pages/Analytics';\nimport Dashboard from './pages/Dashboard';\nimport { ErrorBoundary } from './pages/ErrorBoundary/ErrorBoundary';\nimport FarmPage from './pages/Farm';\nimport IMoneyPage from './pages/iMoney';\nimport LiquidatablePositions from './pages/LiquidatablePositions';\nimport LiquidationProtectedLoans from './pages/Loans';\nimport PositionsPage from './pages/Positions';\nimport StakePage from './pages/Stake';\nimport TokenPage from './pages/TokenPage';\nimport VeMoreTokenPage from './pages/vMore';\nimport XMorePage from './pages/XMore';\nimport reportWebVitals from './reportWebVitals';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(\n \n \n \n \n \n }>\n } />\n \n \n \n }\n />\n } />\n } />\n \n \n \n }\n />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n \n \n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://cra.link/PWA\nserviceWorker.unregister();\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}