{"version":3,"sources":["contexts/ExternalMetadataContext.tsx","chain-interaction/tokens.ts","contexts/UserAddressContext.tsx","contexts/WalletBalancesContext.tsx","utils/index.ts","chain-interaction/contracts.ts","assets/logo/logo.png","components/account/AccountModal.tsx","assets/img/color_dot.svg","components/account/UserAddressComponent.tsx","assets/img/horizontal-dots.svg","components/navigation/MenuOptions.tsx","components/navigation/NavigationBar.tsx","components/notifications/GlobalDebtCeilingMessage.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/components/ClaimReward.tsx","components/account/EnsureWalletConnected.tsx","components/tokens/TokenAmountInputField.tsx","constants/addresses.ts","pages/Farm/components/DepositForm.tsx","pages/Farm/components/WithdrawForm.tsx","pages/Farm/index.tsx","pages/LiquidatablePositions/LiquidatableRow.tsx","pages/LiquidatablePositions/LiquidatablePositionsTable.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","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/notifications/WarningMessage.tsx","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","assets/img/lines.svg","pages/TokenPage/components/StrategyTokenInformation.tsx","pages/TokenPage/components/PositionBody.tsx","pages/TokenPage/components/TokenPageBody.tsx","pages/TokenPage/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","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","addressToken","Object","fromEntries","values","ChainId","map","key","Map","addressIcons","addressAuxIcon","getTokenFromAddress","chainId","address","Avalanche","get","getIconsFromTokenAddress","tokenAmount","tokenAddress","amount","token","CurrencyValue","getTokensInQuestion","_chainId","undefined","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","nativeCurrency","NativeCurrency","wrappedNativeCurrency","UserAddressContext","UserAddressCtxProvider","account","useEthers","search","useLocation","userAddress","URLSearchParams","WalletBalancesContext","WalletBalancesCtxProvider","useContext","tokenBalances","tokensInQuestion","calls","abi","ERC20Interface","method","args","results","useContractCalls","forEach","result","index","useWalletBalance","ctxAccount","balancesCtx","parseFloatNoNaN","input","parsed","parseFloat","isNaN","parseFloatCurrencyValue","format","significantDigits","Infinity","suffix","thousandSeparator","decimalSeparator","formatNumber","toLocaleString","TxStatus","YieldType","require","useAddresses","chainIdStr","toString","parseStratMeta","row","stable","globalMoneyAvailable","additionalYield","tvlInToken","tvl","balance","BigNumber","strategyAddress","strategy","underlyingAddress","underlyingStrategy","APY","LiquidYieldStrategy","apy","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","yieldType","REPAYING","COMPOUNDING","NOYIELD","useStable","calcLiquidationPrice","debt","collateral","calcLiqPriceFromNum","debtNum","colNum","parsePositionMeta","trancheContract","posYield","yield","trancheId","collateralValue","owner","liquidationPrice","sub","useIsolatedPositionMetadata","defaultResult","Interface","IsolatedLending","legacy","useContractCall","StableLending","current","useIsolatedLendingView","reduceFn","parsedRow","list","legacyResults","reduce","useGlobalDebtCeiling","useTotalSupply","ERC20","ONE_WEEK_SECONDS","useUpdatedPositions","timeStart","endPeriod","Math","round","Date","now","startPeriod","floor","fill","x","i","legacyRows","currentRows","parseRows","rows","flatMap","length","useParsedStakingMetadata","stakingContracts","VestingStakingRewards","userAccount","ethers","constants","AddressZero","contractCalls2","useStakingMetadata","stakingMeta","stakingToken","rewardsToken","earned","rewards","totalRewards","aprPercent","aprPer10k","totalSupply","vestingCliff","timestamp2Date","periodFinish","stakedBalance","vestingStart","vested","tstamp","AccountModal","isOpen","onClose","deactivate","balanceCtx","moreToken","MoreToken","walletBalance","moreBalance","explorerLink","getExplorerAddressLink","isCentered","size","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","UserAddressComponent","handleOpenModal","useMediaQuery","isLargerThan1280","activateBrowserWallet","spacing","bg","padding","isZero","src","colorDot","h","Links","title","link","MenuOptions","as","IconButton","icon","dots","alt","zIndex","target","rel","NavigationBar","useDisclosure","onOpen","isOpenAccount","onOpenAccount","onCloseAccount","location","position","md","to","logo","width","base","pathname","flexDirection","GlobalDebtCeilingMessage","globalDebtCeiling","hasMaxedOut","status","NetworkNotSupported","motionPreset","leastDestructiveRef","colorScheme","PhishingAlertComponent","w","TransactionToasts","notifications","useNotifications","toast","useToast","showToast","notification","hash","transaction","getExplorerTransactionLink","id","description","style","duration","isClosable","type","LiquidationFeesContext","LiquidationFeesCtxProvider","StableLendingLiquidation","tokenFees","IsolatedLendingLiquidation","StrategyMetadataContext","StrategyMetadataCtxProvider","stratMeta","setStratMeta","token2Strat","YieldYakAVAXStrategy","YieldYakStrategy","TraderJoeMasterChefStrategy","SimpleHoldingStrategy","MultiTraderJoeMasterChef3Strategy","masterChef2Tokens","keys","strats","sJoeStrategy","provider","providers","JsonRpcProvider","stratViewer","Contract","StrategyViewer","viewMetadata","normalResults","viewMetadataNoHarvestBalance","OracleRegistry","TraderJoeMasterChef2Strategy","noHarvestBalanceResults","getData","useIsolatedStrategyMetadata","isIndeterminate","theme","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","useConfig","requestedSwitch","setRequestedSwitch","wallet","Web3Provider","window","ethereum","getNetwork","walletChainId","listAccounts","accounts","supportedChains","includes","request","chainName","rpcUrls","blockExplorerUrls","alert","scrollTo","margin","minHeight","opacity","pointerEvents","bgGradient","LiquidatablePositionsContext","LiquidatablePositionsCtxProvider","tokenPrices","positions","cachedPositions","setCachedPosition","log","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","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","sendUpdateOraclePrice","updateOraclePriceState","useUpdateOraclePrice","WithdrawFees","contractsABI","isYY","feesContract","sendWithdrawFees","withdrawState","useWithdrawFees","AllContracts","strat","PositionsRow","actionArgs","callback","PositionsTable","allStratMeta","data","AllOpenPositions","AdminPage","useParams","AnalyticsBox","subtitle","Analytics","stakeMeta","CurvePoolRewards","flat","feeContractNames","blacklist","contracts","tvlsFarm","tvlNoFarm","supply","curvePoolSL","colRatio","fees","contract","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","Set","stratRows","has","options","optionsFiltered","y","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","ClaimReward","ilAddress","ilContract","sendClaim","claimState","useClaimReward","buttonDisabled","timeDelta","getTime","isDisabled","EnsureWalletConnected","TokenAmountInputField","registerForm","setValueForm","errorsForm","isInvalid","required","inputMode","step","autoComplete","autoCorrect","defaultValue","minLength","maxLength","spellCheck","pattern","prefix","shouldDirty","shouldTouch","message","WNATIVE_ADDRESS","Mainnet","Ropsten","Rinkeby","Goerli","Kovan","Fantom","xDai","BSC","Harmony","Palm","Moonriver","DepositForm","stakingAddress","isNativeToken","allowance","useTokenAllowance","etherBalance","useEtherBalance","nativeTokenBalance","cprAddress","cprContract","sendStake","stakeToken","sAmount","stakeState","useStake","useForm","handleSubmitDepForm","handleSubmit","registerDepForm","register","setValueDepForm","setValue","formState","errorsDepForm","errors","isSubmittingDepForm","isSubmitting","watch","confirmButtonEnabled","depositBorrowDisabled","onSubmit","justify","marginBottom","isLoading","SUCCESS","WithdrawForm","sendWithdraw","withdrawToken","wAmount","useWithdraw","FarmPage","avaxMorePayload","item","useSpecialRewardsData","sendSpecialWithdraw","useWithdrawLaunchVestingTrans","farmInfoIdx","getLPTokenLinks","farminfo","curvePoolIdx","accordionStyling","externalData","stake","reward","rewardsCoin","apr","getTokenURL","stakeTokenURL","verticalAlign","allowToggle","defaultIndex","colSpan","LiquidatableRow","LiquidatablePositionsTable","LiquidatablePositions","sendDirectLiquidationLegacy","DirectFlashStableLiquidation","sendDirectLiquidationCurrent","sendLPTLiquidationLegacy","LPTFlashLiquidation","LPTFlashStableLiquidation","sendLPTLiquidationCurrent","sendWsMaxiLiquidation","wsMAXIStableLiquidation","sendXJoeLiquidation","xJoeStableLiquidation","lending2Liquidation","token2Liquidation","getLiquidationParams","LiquidationProtectedLoans","TrancheCard","TrancheRow","stratLabel","TrancheTable","CurrentlyOpenPositions","allPositionMeta","PositionsPage","align","BackButton","navigate","useNavigate","cursor","DeprecatedTokenMessage","ChangeStrategyButton","chooseStrategy","ChangeStrategyTable","currentStrategy","ChangeStrategyModal","StrategyNameAndSwitch","chosenStrategy","multipleOptions","textVariant","rowSpan","mx","WarningMessage","autoFocus","returnFocusOnClose","placement","ConfirmPositionModal","confirm","dangerous","DepositBorrow","setData","allowResult","allowCV","lendingAddress","lendingContract","sendDepositBorrow","collateralToken","collateralAmount","borrowAmount","cAmount","bAmount","depositBorrowState","useDepositBorrowTrans","WrapNativeIsolatedLending","WrapNativeStableLending","useNativeDepositBorrowTrans","sendNativeDepositBorrow","nativeDepositBorrowState","collateralInput","borrowInput","customPercentageInput","extantCollateral","extantDebt","currentPercentage","percentageRange","percentageStep","percentageSteps","percentageLabel","percentages","showWarning","isJoeToken","depositBorrowButtonDisabledForJoe","depositBorrowButtonDisabled","inputStyle","dangerousPosition","marginRight","MINING","RepayWithdraw","handleSubmitRepayForm","registerRepayForm","setValueRepayForm","errorsRepayForm","isSubmittingRepayForm","sendRepayWithdraw","repayAmount","repayWithdrawState","useRepayWithdrawTrans","useNativeRepayWithdrawTrans","sendNativeRepayWithdraw","sendNativeWithdrawState","repayWithdrawDisabled","repayInput","curveLink","repayingMoreThanBalance","repayWithdrawButtonDisabled","warningMsgText","residualDebt","EditPosition","CollateralAPY","stratMetaData","TitleValue","PositionData","effectiveDebt","currency","StrategyTokenInformation","lines","PositionBody","inputPos","setChosenStrategy","lendingContractAddress","sendMigrateStrategy","targetStrategy","migrateStrategyState","useMigrateStrategy","templateRows","strategyToChoose","TokenPageBody","positionMeta","TokenPage","StakeMore","xMoreContract","xMore","stakeMoreToken","useStakeMore","moreStakeInput","stakeMoreDisabled","stakeMoreButtonDisabled","UnstakeMore","xMoreToken","sendUnstake","leaveMoreToken","unstakeState","useUnstakeMore","xmoreUnstakeInput","unstakeMoreButtonDisabled","EditMore","MoreBalance","xMoreBalance","direction","marginLeft","StakingAPR","cachedAPR","currentRatio","XMorePage","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","Boolean","hostname","match","ReactDOM","DAppProvider","readOnlyChainId","readOnlyUrls","multicallAddresses","element","document","getElementById","serviceWorker","ready","registration","unregister"],"mappings":"m4+1BAyDaA,EACXC,IAAMC,cAAoC,CACxCC,iBAAkB,GAClBC,WAAY,GACZC,aAAc,GACdC,UAAW,GACXC,oBAAqB,KAGlB,SAASC,EAAT,GAE2B,IADhCC,EAC+B,EAD/BA,SAEA,EAAkCC,mBAChC,IADF,mBAAOJ,EAAP,KAAkBK,EAAlB,KAGA,EAAgDD,qBAAhD,mBAAOP,EAAP,KAAyBS,EAAzB,KACA,EAAgCF,mBAAqB,IAArD,mBAAON,EAAP,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,SAASoZ,QAAS,cAACjB,GAAD,MAC9B,cAAC,IAAD,CAAOnY,KAAK,SAASoZ,QAAS,cAACtX,GAAD,MAC9B,cAAC,IAAD,CAAO9B,KAAK,oBAAoBoZ,QAAS,cAACtX,GAAD,kBAMnDuX,SAASC,eAAe,SDqEpB,kBAAmBpsB,WACrBA,UAAUqsB,cAAcC,MACrBx+B,MAAK,SAACy+B,GACLA,EAAaC,gBAEdv+B,OAAM,SAACG,GACND,QAAQC,MAAMA,EAAMyuB,YChE5BqO,O","file":"static/js/main.df5bbffe.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};\n\nexport const ExternalMetadataContext =\n React.createContext({\n yieldFarmingData: [],\n yyMetadata: {},\n yieldMonitor: {},\n xMoreData: {} as xMoreMetadata,\n additionalYieldData: {},\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 { BigNumber } from '@ethersproject/bignumber';\nimport {\n ChainId,\n CurrencyValue,\n NativeCurrency,\n Token,\n useContractCall,\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';\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 ('pairAddress' in record && record.pairAddress && longTicker !== 'JPL-WAVAX-WBTCe') {\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 ('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 ('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/Moremoney_05.jpg',\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\n const pegValues = (useContractCall({\n abi,\n address,\n method,\n args,\n }) ?? [[]])[0];\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 ContractCall,\n CurrencyValue,\n ERC20Interface,\n Token,\n useContractCalls,\n useEthers,\n} from '@usedapp/core';\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 abi: ERC20Interface,\n address: aT[0],\n method: 'balanceOf',\n args: [account],\n };\n }\n const tokensInQuestion = getTokensInQuestion(chainId!);\n const calls: ContractCall[] = account\n ? tokensInQuestion.map(convert2ContractCall)\n : [];\n const results = useContractCalls(calls) ?? [];\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 } from '@usedapp/core';\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;\n }\n}\n","import { parseUnits } from '@ethersproject/units';\nimport {\n ChainId,\n ContractCall,\n CurrencyValue,\n Token,\n useContractCall,\n useContractCalls,\n useEthers,\n} from '@usedapp/core';\nimport {\n formatEther,\n parseEther,\n} from '@usedapp/core/node_modules/@ethersproject/units';\nimport { BigNumber, 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 IsolatedLending from '../contracts/artifacts/contracts/IsolatedLending.sol/IsolatedLending.json';\nimport StableLending from '../contracts/artifacts/contracts/StableLending.sol/StableLending.json';\nimport OracleRegistry from '../contracts/artifacts/contracts/OracleRegistry.sol/OracleRegistry.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 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 { getTokenFromAddress, tokenAmount } from './tokens';\nimport { parseFloatCurrencyValue } from '../utils';\n\n// import earnedRewards from '../constants/earned-rewards.json';\n// import rewardsRewards from '../constants/rewards-rewards.json';\n\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 IsolatedLending: 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 CurvePoolRewards: string;\n DirectFlashLiquidation: string;\n LPTFlashLiquidation: string;\n\n MoreToken: string;\n xMore: string;\n\n StableLending: string;\n StableLendingLiquidation: string;\n DirectFlashStableLiquidation: string;\n LPTFlashStableLiquidation: string;\n wsMAXIStableLiquidation: string;\n xJoeStableLiquidation: string;\n WrapNativeStableLending: string;\n sJoeStrategy: string;\n\n VestingLaunchReward: string;\n\n CurvePoolSL: string;\n StrategyViewer: string;\n\n LiquidYieldStrategy: string;\n MultiTraderJoeMasterChef3Strategy: 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(IsolatedLending.abi);\n\n return {\n legacy: (useContractCall({\n abi,\n address:\n 'IsolatedLending' in addresses\n ? addresses.IsolatedLending\n : addresses.StableLending,\n method,\n args,\n }) ?? [defaultResult])[0],\n current: (useContractCall({\n abi,\n address:\n 'StableLending' in addresses\n ? addresses.StableLending\n : addresses.IsolatedLending,\n method,\n args,\n }) ?? [defaultResult])[0],\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};\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): 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.8) /\n 0.5 +\n 8\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\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 };\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\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']:\n addresses.LiquidYieldStrategy,\n ['0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7']:\n addresses.YieldYakAVAXStrategy,\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 ['0x454E67025631C065d3cFAD6d71E6892f74487a15']:\n addresses.TraderJoeMasterChefStrategy,\n ['0x2148D1B21Faa7eb251789a51B404fc063cA6AAd6']:\n addresses.SimpleHoldingStrategy,\n ['0xCDFD91eEa657cc2701117fe9711C9a4F61FEED23']:\n addresses.MultiTraderJoeMasterChef3Strategy,\n };\n\n const masterChef2Tokens = [\n '0x57319d41f71e81f3c65f2a47ca4e001ebafd4f33',\n '0xa389f9430876455c36478deea9769b7ca4e3ddb1',\n '0xed8cbd9f0ce3c6986b22002f03c6475ceb7a6256',\n '0xd5a37dc5c9a396a03dd1136fc76a1a02b1c88ffa',\n ].map(getAddress);\n\n const tokens = Object.keys(token2Strat);\n tokens.push('0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7');\n const strats = Object.values(token2Strat);\n strats.push(addresses.LiquidYieldStrategy);\n const globalMoneyAvailable = globalDebtCeiling.sub(totalSupply);\n\n tokens.push('0x6e84a6216eA6dACC71eE8E6b0a5B7322EEbC0fDd');\n strats.push(addresses.sJoeStrategy);\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\n const normalResults = await stratViewer.viewMetadata(\n addresses.StableLending,\n tokens,\n strats\n );\n const noHarvestBalanceResults =\n await stratViewer.viewMetadataNoHarvestBalance(\n addresses.StableLending,\n addresses.OracleRegistry,\n addresses.Stablecoin,\n masterChef2Tokens,\n Array(masterChef2Tokens.length).fill(\n addresses.TraderJoeMasterChef2Strategy\n )\n );\n\n const results = [...normalResults, ...noHarvestBalanceResults];\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 );\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 ]);\n\n return stratMeta;\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 'IsolatedLending' in addresses\n ? legacy.reduce(reduceFn(addresses.IsolatedLending), {})\n : {};\n return 'StableLending' in addresses\n ? current.reduce(reduceFn(addresses.StableLending), legacyResults)\n : legacyResults;\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 return (useContractCall({\n abi,\n address,\n method,\n args,\n }) ?? [defaultResult])[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 return (useContractCall({\n abi,\n address,\n method,\n args,\n }) ?? [defaultResult])[0];\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 return (useContractCall({\n abi,\n address,\n method,\n args,\n }) ?? [defaultResult])[0];\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 return (useContractCall({\n abi,\n address: strategyAddress,\n method,\n args,\n }) ?? [defaultResult])[0];\n}\n\nconst ONE_WEEK_SECONDS = 60 * 60 * 24 * 7;\nexport function useUpdatedPositions(timeStart: number) {\n const endPeriod = 1 + Math.round(Date.now() / 1000 / ONE_WEEK_SECONDS);\n const startPeriod = Math.floor(timeStart / 1000 / ONE_WEEK_SECONDS) - 2;\n // console.log('endPeriod', endPeriod);\n // console.log('startPeriod', startPeriod);\n const stable = useStable();\n const addresses = useAddresses();\n\n function args(trancheContract: string) {\n return Array(endPeriod - startPeriod)\n .fill(startPeriod)\n .map((x, i) => ({\n abi: new Interface(IsolatedLending.abi),\n address: trancheContract,\n method: 'viewPositionsByTrackingPeriod',\n args: [x + i],\n }));\n }\n\n const legacyRows =\n (useContractCalls(\n args(addresses.IsolatedLending)\n ) as RawPositionMetaRow[][][]) || [];\n const currentRows =\n (useContractCalls(\n args(addresses.StableLending)\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 ...((legacyRows.length > 0 &&\n parseRows(legacyRows, addresses.IsolatedLending)) ||\n []),\n ...((currentRows.length > 0 &&\n parseRows(currentRows, addresses.StableLending)) ||\n []),\n ];\n}\n\nexport function useUpdatedMetadataLiquidatablePositions(\n positions?: ParsedPositionMetaRow[]\n) {\n const abi = {\n [useAddresses().IsolatedLending]: new Interface(IsolatedLending.abi),\n [useAddresses().StableLending]: new Interface(StableLending.abi),\n };\n\n const positionCalls: ContractCall[] = positions!.map((pos) => {\n return {\n abi: abi[pos.trancheContract],\n address: pos.trancheContract,\n method: 'viewPositionMetadata',\n args: [pos.trancheId],\n };\n });\n\n const updatedData = useContractCalls(positionCalls);\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 stable = useStable();\n return (useContractCall({\n abi,\n address,\n method: 'tokenOracle',\n args: [tokenAddress, stable.address],\n }) ?? [undefined])[0];\n}\n\nexport function useAllFeesEver(contracts: string[]) {\n function convert2ContractCall(contract: string) {\n return {\n abi: new Interface(IFeeReporter.abi),\n address: contract,\n method: 'viewAllFeesEver',\n args: [],\n };\n }\n\n const calls: ContractCall[] = contracts.map(convert2ContractCall);\n // console.log('calls', calls);\n const results = useContractCalls(calls) ?? [];\n\n return results;\n}\n\nexport function useEstimatedHarvestable(\n strategyAddress: string,\n tokenAddress: string\n) {\n const abi = new Interface(IStrategy.abi);\n return (useContractCall({\n abi,\n address: strategyAddress,\n method: 'viewEstimatedHarvestable',\n args: [tokenAddress],\n }) ?? [undefined])[0];\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 const calls: ContractCall[] = stakingContracts.map((address) => ({\n abi,\n address,\n method: 'stakingMetadata',\n args: [userAccount],\n }));\n\n let contractCalls2 = useContractCalls(calls);\n const results = (contractCalls2 ?? []) 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\n const balance = (useContractCall({\n address,\n abi,\n method: 'balanceOf',\n args: [account],\n }) ?? [BigNumber.from(0)])[0];\n\n const vested = (useContractCall({\n address,\n abi,\n method: 'burnableByAccount',\n args: [account],\n }) ?? [BigNumber.from(0)])[0];\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 address = useAddresses().CurvePoolSL;\n return parseEther('2240893.705535866887471228');\n}\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 { 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 { UserAddressContext } from '../../contexts/UserAddressContext';\nimport { WalletBalancesContext } from '../../contexts/WalletBalancesContext';\n\ntype Props = {\n handleOpenModal: any;\n};\n\nexport function UserAddressComponent({ handleOpenModal }: Props) {\n const [isLargerThan1280] = useMediaQuery('(min-width: 1280px)');\n const { activateBrowserWallet, chainId } = useEthers();\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 activateBrowserWallet();\n }\n\n return (\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 {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 { title: 'Trade MONEY (Curve)', link: 'https://avax.curve.fi/factory/39' },\n {\n title: 'Trade MONEY (Pangolin)',\n link: 'https://app.pangolin.exchange/#/swap?inputCurrency=AVAX&outputCurrency=0x0f577433Bf59560Ef2a79c124E9Ff99fCa258948',\n },\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: '/xmore' },\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 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 ContractCall,\n Token,\n useContractCalls,\n useEthers\n} from '@usedapp/core';\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().StableLendingLiquidation;\n const tokenFees = new Map();\n\n function convert2ContractCall(aT: [string, Token]) {\n return {\n abi: new Interface(IsolatedLendingLiquidation.abi),\n address: address,\n method: 'viewLiquidationFeePer10k',\n args: [aT[0]],\n };\n }\n const tokensInQuestion = getTokensInQuestion(chainId!);\n const calls: ContractCall[] = tokensInQuestion.map(convert2ContractCall);\n const results = useContractCalls(calls) ?? [];\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 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 { 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 config = useConfig();\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 !config.supportedChains.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 {params.children}\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 { parseEther } from '@usedapp/core/node_modules/@ethersproject/units';\nimport { BigNumber } from '@usedapp/core/node_modules/ethers';\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/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 { useContractFunction } from '@usedapp/core';\nimport { Token } from '@usedapp/core/dist/esm/src/model';\nimport {\n parseEther,\n parseUnits,\n} from '@usedapp/core/node_modules/@ethersproject/units';\nimport { BigNumber, ethers } from 'ethers';\nimport { getAddress } from 'ethers/lib/utils';\nimport { useContext } from 'react';\nimport { UserAddressContext } from '../contexts/UserAddressContext';\nimport OracleRegistry from '../contracts/artifacts/contracts/OracleRegistry.sol/OracleRegistry.json';\nimport IsolatedLending from '../contracts/artifacts/contracts/IsolatedLending.sol/IsolatedLending.json';\nimport CurvePoolRewards from '../contracts/artifacts/contracts/rewards/CurvePoolRewards.sol/CurvePoolRewards.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 StableLending from '../contracts/artifacts/contracts/StableLending.sol/StableLending.json';\nimport DirectFlashLiquidation from '../contracts/artifacts/contracts/liquidation/DirectFlashLiquidation.sol/DirectFlashLiquidation.json';\nimport Strategy from '../contracts/artifacts/contracts/Strategy.sol/Strategy.json';\nimport WrapNativeIsolatedLending from '../contracts/artifacts/contracts/WrapNativeIsolatedLending.sol/WrapNativeIsolatedLending.json';\nimport IOracle from '../contracts/artifacts/interfaces/IOracle.sol/IOracle.json';\nimport VestingLaunchReward from '../contracts/artifacts/contracts/rewards/VestingLaunchReward.sol/VestingLaunchReward.json';\nimport xMore from '../contracts/artifacts/contracts/governance/xMore.sol/xMore.json';\nimport {\n useAddresses,\n useRegisteredOracle,\n useStable,\n useYieldConversionStrategyView,\n} from './contracts';\n\nexport function useWithdrawFees(strategyAddress: string, tokenAddress: string) {\n const contractsABI: Record = {\n [useAddresses().YieldYakStrategy]: new Interface(YieldYakStrategy.abi),\n [useAddresses().StableLending]: new Interface(StableLending.abi),\n [useAddresses().IsolatedLending]: new Interface(IsolatedLending.abi),\n };\n const isYY = useAddresses().YieldYakStrategy === strategyAddress;\n\n const feesContract = new Contract(\n strategyAddress,\n contractsABI[strategyAddress] ?? new Interface(StableLending.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 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: (leaveMoreToken: Token, amount: string | number) => {\n const sAmount = parseUnits(amount.toString(), leaveMoreToken.decimals);\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 useClaimReward() {\n const ilAddress = useAddresses().CurvePoolRewards;\n const ilContract = new Contract(\n ilAddress,\n new Interface(CurvePoolRewards.abi)\n );\n const { send, state } = useContractFunction(\n ilContract,\n 'withdrawVestedReward'\n );\n\n return {\n sendClaim: () => {\n return send();\n },\n claimState: state,\n };\n}\n\nexport function useStake() {\n const cprAddress = useAddresses().CurvePoolRewards;\n const cprContract = new Contract(\n cprAddress,\n new Interface(CurvePoolRewards.abi)\n );\n const { send, state } = useContractFunction(cprContract, 'stake');\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 useWithdraw() {\n const cprAddress = useAddresses().CurvePoolRewards;\n const cprContract = new Contract(\n cprAddress,\n new Interface(CurvePoolRewards.abi)\n );\n const { send, state } = useContractFunction(cprContract, 'withdraw');\n\n return {\n sendWithdraw: (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 lendingAddress: string | undefined | null\n) {\n const addresses = useAddresses();\n const lendingContract = new Contract(\n lendingAddress === addresses.IsolatedLending\n ? addresses.WrapNativeIsolatedLending\n : addresses.WrapNativeStableLending,\n new Interface(WrapNativeIsolatedLending.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 lendingAddress: string | undefined | null\n) {\n const addresses = useAddresses();\n const lendingContract = new Contract(\n lendingAddress === addresses.IsolatedLending\n ? addresses.WrapNativeIsolatedLending\n : addresses.WrapNativeStableLending,\n new Interface(WrapNativeIsolatedLending.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\n ? send(\n trancheId,\n parseUnits(collateralAmount.toString(), collateralToken.decimals),\n parseEther(repayAmount.toString()),\n account\n )\n : console.error('Trying to withdraw but parameters not set'),\n repayWithdrawState: state,\n };\n}\n\nexport function useDepositBorrowTrans(\n trancheId: number | null | undefined,\n lendingAddress: string | undefined | null\n) {\n const addresses = useAddresses();\n const lendingContract = new Contract(\n lendingAddress === addresses.IsolatedLending\n ? addresses.IsolatedLending\n : addresses.StableLending,\n new Interface(IsolatedLending.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 lendingAddress: string | undefined | null\n) {\n const addresses = useAddresses();\n const lendingContract = new Contract(\n lendingAddress === addresses.IsolatedLending\n ? addresses.IsolatedLending\n : addresses.StableLending,\n new Interface(IsolatedLending.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\n ? send(\n trancheId,\n parseUnits(collateralAmount.toString(), collateralToken.decimals),\n parseEther(repayAmount.toString()),\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 =\n lendingContractAddress ??\n addresses.StableLending ??\n addresses.IsolatedLending;\n\n const strategy = new Contract(\n lendingAddress,\n new Interface(IsolatedLending.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 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 useContractCalls,\n useEthers,\n} from '@usedapp/core';\nimport { BigNumber, ethers } from 'ethers';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport {\n DeploymentAddresses,\n ParsedStakingMetadata,\n useAddresses,\n useAllFeesEver,\n useCurvePoolSLDeposited,\n useParsedStakingMetadata,\n useStable,\n useTotalSupply,\n} from '../../chain-interaction/contracts';\nimport { StrategyMetadataContext } from '../../contexts/StrategyMetadataContext';\nimport { AnalyticsBox } from './AnalyticsBox';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\nimport { parseEther } from '@usedapp/core/node_modules/@ethersproject/units';\nimport { tokenAmount } from '../../chain-interaction/tokens';\n\nexport default function Analytics(props: React.PropsWithChildren) {\n const allStratMeta = React.useContext(StrategyMetadataContext);\n\n const account = 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 'IsolatedLendingLiquidation',\n 'StableLendingLiquidation',\n ];\n const blacklist = [\n 'StrategyRegistry',\n 'StrategyTokenActivation',\n 'StrategyViewer',\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\n Object.values(allStratMeta)\n .flatMap((rows) => Object.values(rows))\n .map((row) => console.log(row.token.ticker, row.tvlInPeg.format()));\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\n const tvl = tvlNoFarm.add(tvlsFarm);\n\n const supply = useTotalSupply('totalSupply', [], ['']);\n\n const curvePoolSL = useCurvePoolSLDeposited();\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 abi: ERC20Interface,\n address: addresses.MoreToken,\n method: 'balanceOf',\n args: [holder],\n };\n }\n const balances = useContractCalls(\n circulatingBlacklist.map(convert2ContractCall)\n )\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};\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 Open an interest-free debt position\n \n \n that improves with yield from\n \n \n 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 { InfoOutlineIcon } from '@chakra-ui/icons';\nimport { Avatar, Button, HStack, Link, Text, VStack } from '@chakra-ui/react';\nimport { Token } from '@usedapp/core';\nimport * as React from 'react';\nimport { ParsedStakingMetadata } from '../../../chain-interaction/contracts';\nimport { getIconsFromTokenAddress } from '../../../chain-interaction/tokens';\nimport { useClaimReward } from '../../../chain-interaction/transactions';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { parseFloatCurrencyValue } from '../../../utils';\n\nexport default function ClaimReward({\n token,\n stakeMeta,\n}: React.PropsWithChildren<{\n token: Token;\n stakeMeta: ParsedStakingMetadata;\n}>) {\n const { sendClaim, claimState } = useClaimReward();\n\n const buttonDisabled = stakeMeta?.vested?.isZero();\n console.log(buttonDisabled);\n\n const timeDelta = (Date.now() - stakeMeta.vestingStart.getTime()) / 1000;\n\n const vested =\n (parseFloatCurrencyValue(stakeMeta.rewards) * timeDelta) /\n (60 * 24 * 60 * 60);\n\n return (\n \n \n Vested Reward{' '}\n \n \n \n \n \n \n {vested.toFixed(2)} MORE\n \n \n {stakeMeta.earned.gt(stakeMeta.rewards.mul(2))\n ? `Vest ${stakeMeta.earned.format({\n fixedPrecisionDigits: 0,\n useFixedPrecision: true,\n })}`\n : 'Claim'}\n \n \n \n );\n}\n","import { Button } 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 function EnsureWalletConnected(\n params: React.PropsWithChildren\n) {\n const { activateBrowserWallet } = useEthers();\n const account = useContext(UserAddressContext);\n\n return (\n <>\n {account ? (\n params.children\n ) : (\n {\n activateBrowserWallet();\n }}\n >\n Connect to a wallet\n \n )}\n \n );\n}\n","import {\n Button, FormControl,\n FormErrorMessage, Input,\n InputGroup, InputRightElement, 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 { 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 { Box, Button, Flex, Text } from '@chakra-ui/react';\nimport {\n CurrencyValue,\n useEtherBalance,\n useEthers,\n useTokenAllowance,\n} from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { useForm } from 'react-hook-form';\nimport {\n ParsedStakingMetadata,\n useAddresses,\n TxStatus,\n} from '../../../chain-interaction/contracts';\nimport {\n useApproveTrans,\n useStake,\n} from '../../../chain-interaction/transactions';\nimport { EnsureWalletConnected } from '../../../components/account/EnsureWalletConnected';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { TokenAmountInputField } from '../../../components/tokens/TokenAmountInputField';\nimport { WNATIVE_ADDRESS } from '../../../constants/addresses';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\nimport { useWalletBalance } from '../../../contexts/WalletBalancesContext';\nimport { parseFloatNoNaN } from '../../../utils';\n\nexport default function DepositForm({\n stakeMeta,\n}: React.PropsWithChildren<{\n stakeMeta: ParsedStakingMetadata;\n}>) {\n const token = stakeMeta.stakingToken;\n const stakingAddress = useAddresses().CurvePoolRewards;\n const { chainId } = useEthers();\n const account = useContext(UserAddressContext);\n\n const isNativeToken = WNATIVE_ADDRESS[chainId!] === token.address;\n\n const allowance = new CurrencyValue(\n token,\n useTokenAllowance(token.address, account, stakingAddress) ??\n BigNumber.from('0')\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 { sendStake, stakeState } = useStake();\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 [depositInput] = watch(['amount-stake']);\n\n function onDeposit(data: { [x: string]: any }) {\n // console.log('data', data, position);\n sendStake(token, data['amount-stake']);\n setValueDepForm('amount-stake', '');\n }\n\n const confirmButtonEnabled = parseFloatNoNaN(depositInput) > 0;\n\n const depositBorrowDisabled = isNativeToken\n ? nativeTokenBalance.isZero()\n : walletBalance.isZero();\n\n return (\n
    \n \n \n \n Deposit\n \n \n \n \n\n \n \n\n \n {allowance.gt(walletBalance) === false && isNativeToken === false ? (\n \n sendApprove(stakingAddress)}\n width={'full'}\n variant={'submit-primary'}\n isLoading={\n approveState.status == TxStatus.SUCCESS &&\n allowance.gt(walletBalance) === false\n }\n >\n Approve\n \n \n ) : (\n \n Confirm\n \n )}\n \n \n );\n}\n","import { Box, Button, Flex, Text } from '@chakra-ui/react';\nimport { CurrencyValue, useEtherBalance, useEthers } from '@usedapp/core';\nimport { BigNumber } from 'ethers';\nimport { getAddress } from 'ethers/lib/utils';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { ParsedStakingMetadata } from '../../../chain-interaction/contracts';\nimport { useWithdraw } from '../../../chain-interaction/transactions';\nimport { EnsureWalletConnected } from '../../../components/account/EnsureWalletConnected';\nimport { TransactionErrorDialog } from '../../../components/notifications/TransactionErrorDialog';\nimport { TokenAmountInputField } from '../../../components/tokens/TokenAmountInputField';\nimport { WNATIVE_ADDRESS } from '../../../constants/addresses';\nimport { UserAddressContext } from '../../../contexts/UserAddressContext';\nimport { parseFloatNoNaN } from '../../../utils';\n\nexport default function WithdrawForm({\n stakeMeta,\n}: React.PropsWithChildren<{\n stakeMeta: ParsedStakingMetadata;\n}>) {\n const token = stakeMeta.stakingToken;\n\n const { chainId } = useEthers();\n const account = useContext(UserAddressContext);\n\n const isNativeToken = getAddress(WNATIVE_ADDRESS[chainId!]) === getAddress(token.address);\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 stakeMeta.stakedBalance ?? new CurrencyValue(token, BigNumber.from('0'));\n\n const { sendWithdraw, withdrawState } = useWithdraw();\n\n const {\n handleSubmit: handleSubmitDepForm,\n register: registerDepForm,\n setValue: setValueDepForm,\n formState: { errors: errorsDepForm, isSubmitting: isSubmittingDepForm },\n watch,\n } = useForm();\n\n function onWithdraw(data: { [x: string]: any }) {\n // console.log('withdraw from farm', data, position);\n sendWithdraw(token, data['amount-withdraw']);\n setValueDepForm('amount-withdraw', '');\n }\n\n const [withdrawInput] = watch(['amount-withdraw']);\n\n const confirmButtonEnabled = parseFloatNoNaN(withdrawInput) > 0;\n\n const depositBorrowDisabled = isNativeToken\n ? nativeTokenBalance.isZero()\n : walletBalance.isZero();\n\n return (\n
    \n \n \n \n Withdraw\n \n \n \n \n\n \n\n \n \n \n Withdraw\n \n \n \n \n );\n}\n","import { ExternalLinkIcon } from '@chakra-ui/icons';\nimport {\n Accordion,\n AccordionButton,\n AccordionItem,\n AccordionPanel,\n Box,\n Button,\n Container,\n Flex,\n Grid,\n GridItem,\n Link,\n Text,\n} from '@chakra-ui/react';\nimport { useEthers } from '@usedapp/core';\nimport { ethers } from 'ethers';\nimport * as React from 'react';\nimport { useContext } from 'react';\nimport {\n ParsedStakingMetadata,\n useAddresses,\n useParsedStakingMetadata,\n useSpecialRewardsData,\n} from '../../chain-interaction/contracts';\nimport { useWithdrawLaunchVestingTrans } from '../../chain-interaction/transactions';\nimport { TokenDescription } from '../../components/tokens/TokenDescription';\nimport {\n ExternalMetadataContext,\n YieldFarmingData,\n} from '../../contexts/ExternalMetadataContext';\nimport { UserAddressContext } from '../../contexts/UserAddressContext';\nimport farminfo from '../../contracts/farminfo.json';\nimport { formatNumber } from '../../utils';\nimport ClaimReward from './components/ClaimReward';\nimport DepositForm from './components/DepositForm';\nimport WithdrawForm from './components/WithdrawForm';\n\nexport default function FarmPage(params: React.PropsWithChildren) {\n const { chainId } = useEthers();\n const account = useContext(UserAddressContext);\n\n const stakeMeta: ParsedStakingMetadata[] = useParsedStakingMetadata(\n [useAddresses().CurvePoolRewards],\n account ?? ethers.constants.AddressZero\n ).flat(1);\n\n const { yieldFarmingData, yieldMonitor } = useContext(\n ExternalMetadataContext\n );\n const avaxMorePayload = Object.values(yieldMonitor).filter(\n (item) => item.lpAddress === '0xb8361d0e3f3b0fc5e6071f3a3c3271223c49e3d9'\n )[0];\n\n const { balance, vested } = useSpecialRewardsData(\n account ?? ethers.constants.AddressZero\n );\n const { send: sendSpecialWithdraw } = useWithdrawLaunchVestingTrans();\n\n const farmInfoIdx = (chainId?.toString() ?? '43114') as keyof typeof farminfo;\n const getLPTokenLinks = [\n `https://avax.curve.fi/factory/${farminfo[farmInfoIdx].curvePoolIdx}/deposit`,\n ];\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 const externalData: YieldFarmingData[] =\n avaxMorePayload && yieldFarmingData\n ? [\n ...yieldFarmingData,\n {\n asset: 'MORE-AVAX',\n stake: 'n/a',\n tvl: avaxMorePayload.tvl,\n reward: \"MORE + \" + avaxMorePayload.rewardsCoin,\n apr: 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 : [];\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 {!balance.isZero() ? (\n \n \n \n \n Special Launch Rewards\n \n \n n/a\n \n \n $ {stakeMeta[0].tvl.format({ suffix: '' })}\n \n \n {balance.format()}\n \n n/a\n \n {\n console.log(`Claiming vested`, vested.format());\n sendSpecialWithdraw(vested.value);\n }}\n >\n {vested.format({ suffix: '' })} Vested\n \n \n \n \n \n ) : (\n <>\n )}\n {externalData.length > 0 ? (\n externalData.map((item) => (\n \n \n \n \n {item.asset}\n \n\n \n {item.stake}\n \n\n \n $ {formatNumber(item.tvl)}\n \n\n \n {item.reward}\n \n\n {formatNumber(item.apr)} %\n\n \n \n Get LP Token\n \n \n \n Stake LP Token\n \n \n \n \n \n \n ))\n ) : (\n <>\n )}\n {stakeMeta.map((item, index) => {\n const { totalRewards } = item;\n return (\n
    \n \n \n \n \n \n \n \n \n \n {item.stakedBalance.format({ suffix: '' })}\n \n \n $ {item.tvl.format({ suffix: '' })}\n \n \n {totalRewards.isZero() ? (\n \n \n \n ) : (\n totalRewards.format()\n )}\n \n {item.aprPercent.toFixed(1)} %\n \n \n Get LP Token  \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 {params.children}\n
    \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 {\n ParsedStratMetaRow,\n ParsedPositionMetaRow,\n useStable,\n} from '../../chain-interaction/contracts';\nimport { TokenDescription } from '../../components/tokens/TokenDescription';\nimport { LiquidatableAction } from './LiquidatablePositionsTable';\n\nexport function LiquidatableRow(\n params: React.PropsWithChildren<\n ParsedStratMetaRow & ParsedPositionMetaRow & { action?: LiquidatableAction }\n >\n) {\n const {\n token,\n action,\n liquidateButton,\n positionHealthColor,\n parsedPositionHealth,\n } = 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 console.log(\n 'liquidatable',\n params.trancheId,\n params.debt.format(),\n params.collateral?.toString(),\n params.collateral?.format(),\n parsedPositionHealth\n );\n return (\n <>\n \n \n \n {parsedPositionHealth ?? ''}\n \n \n \n \n \n\n \n {((1 / (params.borrowablePercent / 100)) * 100).toFixed(2) + '%'}\n \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}\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 { LiquidatableRow } from './LiquidatableRow';\n\nexport type LiquidatableAction = {\n args?: (pos: ParsedPositionMetaRow) => Record;\n callback?: (pos: ParsedPositionMetaRow) => void;\n label: string;\n};\n\nexport function LiquidatablePositionsTable({\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 {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
    Position HealthAssetMin Col RatioCurrent Col RatioLiquidation priceCollateralDebtLiquidate
    \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 const { sendLiquidation: sendDirectLiquidationLegacy } = useLiquidationTrans(\n 'IsolatedLending' in addresses\n ? addresses.DirectFlashLiquidation\n : addresses.DirectFlashStableLiquidation\n );\n const { sendLiquidation: sendDirectLiquidationCurrent } = useLiquidationTrans(\n 'StableLending' in addresses\n ? addresses.DirectFlashStableLiquidation\n : addresses.DirectFlashLiquidation\n );\n const { sendLiquidation: sendLPTLiquidationLegacy } = useLiquidationTrans(\n 'IsolatedLending' in addresses\n ? addresses.LPTFlashLiquidation\n : addresses.LPTFlashStableLiquidation\n );\n const { sendLiquidation: sendLPTLiquidationCurrent } = useLiquidationTrans(\n 'StableLending' in addresses\n ? addresses.LPTFlashStableLiquidation\n : addresses.LPTFlashLiquidation\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 ...('IsolatedLending' in addresses\n ? {\n [addresses.IsolatedLending]: {\n [LiquidationType.LPT]: sendLPTLiquidationLegacy,\n [LiquidationType.Direct]: sendDirectLiquidationLegacy,\n },\n }\n : {}),\n ...('StableLending' in addresses\n ? {\n [addresses.StableLending]: {\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 ? (\n \n

    Liquidatable positions

    \n {\n const { liqType, router } = getLiquidationParams(\n pos\n );\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 { parseEther } from '@usedapp/core/node_modules/@ethersproject/units';\nimport { BigNumber } from 'ethers';\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\n const stratLabel =\n params.yieldType === YieldType.REPAYING\n ? 'Self-repaying'\n : '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 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 if (false) {\n chooseStrategy();\n }\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 const data = Object.keys(stratMeta).map((key) => {\n const meta = stratMeta[key];\n return {\n strategyAddress: meta.strategyAddress,\n strategyName: 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 const stratLabel =\n stratMeta[chosenStrategy].yieldType === YieldType.REPAYING\n ? 'Self-repaying loan'\n : 'Compound collateral';\n\n const options = Object.values(stratMeta).filter((strat) => {\n //if we have hidden strategies for this token\n if (hiddenStrategies[strat.token.address]) {\n //if the strategy is hidden\n if (\n hiddenStrategies[strat.token.address].includes(strat.strategyAddress)\n ) {\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\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","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 {\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 { 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 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 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 ? position.trancheContract : undefined\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 ? position.trancheContract : undefined\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 stratMetaData,\n}: {\n stratMetaData: ParsedStratMetaRow;\n}) {\n return (\n \n {/* */}\n \n \n \n Collateral APY\n \n \n {' '}\n {stratMetaData.APY.toFixed(2)}%\n \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","export default __webpack_public_path__ + \"static/media/lines.1f814fe9.svg\";","import {\n // Button,\n Container,\n Flex,\n GridItem,\n Image,\n Spacer,\n Text,\n} from '@chakra-ui/react';\n// import { CurrencyValue } from '@usedapp/core';\n// import { BigNumber } from 'ethers';\nimport * as React from 'react';\nimport {\n ParsedPositionMetaRow,\n ParsedStratMetaRow,\n // useStable,\n // useEstimatedHarvestable,\n // YieldType,\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';\nimport lines from '../../../assets/img/lines.svg';\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\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 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 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 const [chosenStrategy, setChosenStrategy] = React.useState(\n position?.strategy ?? Object.keys(stratMeta)[0]\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 { 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 { ChainId, DAppProvider } 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 LiquidatablePositions from './pages/LiquidatablePositions';\nimport LiquidationProtectedLoans from './pages/Loans';\nimport PositionsPage from './pages/Positions';\nimport TokenPage from './pages/TokenPage';\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 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":""}