mirror of
				https://github.com/Instadapp/assembly.git
				synced 2024-07-29 22:37:06 +00:00 
			
		
		
		
	
							parent
							
								
									88d312ed6c
								
							
						
					
					
						commit
						7279f9d284
					
				
							
								
								
									
										1222
									
								
								abis/read/aaveV3.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1222
									
								
								abis/read/aaveV3.json
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										482
									
								
								abis/read/uiProtocolDataProvider.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										482
									
								
								abis/read/uiProtocolDataProvider.json
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,482 @@
 | 
			
		|||
[
 | 
			
		||||
    {
 | 
			
		||||
        "inputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "contract IEACAggregatorProxy",
 | 
			
		||||
                "name": "_networkBaseTokenPriceInUsdProxyAggregator",
 | 
			
		||||
                "type": "address"
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "contract IEACAggregatorProxy",
 | 
			
		||||
                "name": "_marketReferenceCurrencyPriceInUsdProxyAggregator",
 | 
			
		||||
                "type": "address"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "stateMutability": "nonpayable",
 | 
			
		||||
        "type": "constructor"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "inputs": [],
 | 
			
		||||
        "name": "ETH_CURRENCY_UNIT",
 | 
			
		||||
        "outputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "uint256",
 | 
			
		||||
                "name": "",
 | 
			
		||||
                "type": "uint256"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "stateMutability": "view",
 | 
			
		||||
        "type": "function"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "inputs": [],
 | 
			
		||||
        "name": "MKR_ADDRESS",
 | 
			
		||||
        "outputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "address",
 | 
			
		||||
                "name": "",
 | 
			
		||||
                "type": "address"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "stateMutability": "view",
 | 
			
		||||
        "type": "function"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "inputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "bytes32",
 | 
			
		||||
                "name": "_bytes32",
 | 
			
		||||
                "type": "bytes32"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "name": "bytes32ToString",
 | 
			
		||||
        "outputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "string",
 | 
			
		||||
                "name": "",
 | 
			
		||||
                "type": "string"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "stateMutability": "pure",
 | 
			
		||||
        "type": "function"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "inputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "contract IPoolAddressesProvider",
 | 
			
		||||
                "name": "provider",
 | 
			
		||||
                "type": "address"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "name": "getReservesData",
 | 
			
		||||
        "outputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "components": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "address",
 | 
			
		||||
                        "name": "underlyingAsset",
 | 
			
		||||
                        "type": "address"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "string",
 | 
			
		||||
                        "name": "name",
 | 
			
		||||
                        "type": "string"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "string",
 | 
			
		||||
                        "name": "symbol",
 | 
			
		||||
                        "type": "string"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "decimals",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "baseLTVasCollateral",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "reserveLiquidationThreshold",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "reserveLiquidationBonus",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "reserveFactor",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "bool",
 | 
			
		||||
                        "name": "usageAsCollateralEnabled",
 | 
			
		||||
                        "type": "bool"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "bool",
 | 
			
		||||
                        "name": "borrowingEnabled",
 | 
			
		||||
                        "type": "bool"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "bool",
 | 
			
		||||
                        "name": "stableBorrowRateEnabled",
 | 
			
		||||
                        "type": "bool"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "bool",
 | 
			
		||||
                        "name": "isActive",
 | 
			
		||||
                        "type": "bool"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "bool",
 | 
			
		||||
                        "name": "isFrozen",
 | 
			
		||||
                        "type": "bool"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint128",
 | 
			
		||||
                        "name": "liquidityIndex",
 | 
			
		||||
                        "type": "uint128"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint128",
 | 
			
		||||
                        "name": "variableBorrowIndex",
 | 
			
		||||
                        "type": "uint128"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint128",
 | 
			
		||||
                        "name": "liquidityRate",
 | 
			
		||||
                        "type": "uint128"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint128",
 | 
			
		||||
                        "name": "variableBorrowRate",
 | 
			
		||||
                        "type": "uint128"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint128",
 | 
			
		||||
                        "name": "stableBorrowRate",
 | 
			
		||||
                        "type": "uint128"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint40",
 | 
			
		||||
                        "name": "lastUpdateTimestamp",
 | 
			
		||||
                        "type": "uint40"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "address",
 | 
			
		||||
                        "name": "aTokenAddress",
 | 
			
		||||
                        "type": "address"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "address",
 | 
			
		||||
                        "name": "stableDebtTokenAddress",
 | 
			
		||||
                        "type": "address"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "address",
 | 
			
		||||
                        "name": "variableDebtTokenAddress",
 | 
			
		||||
                        "type": "address"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "address",
 | 
			
		||||
                        "name": "interestRateStrategyAddress",
 | 
			
		||||
                        "type": "address"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "availableLiquidity",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "totalPrincipalStableDebt",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "averageStableRate",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "stableDebtLastUpdateTimestamp",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "totalScaledVariableDebt",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "priceInMarketReferenceCurrency",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "address",
 | 
			
		||||
                        "name": "priceOracle",
 | 
			
		||||
                        "type": "address"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "variableRateSlope1",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "variableRateSlope2",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "stableRateSlope1",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "stableRateSlope2",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "baseStableBorrowRate",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "baseVariableBorrowRate",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "optimalUsageRatio",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "bool",
 | 
			
		||||
                        "name": "isPaused",
 | 
			
		||||
                        "type": "bool"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint128",
 | 
			
		||||
                        "name": "accruedToTreasury",
 | 
			
		||||
                        "type": "uint128"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint128",
 | 
			
		||||
                        "name": "unbacked",
 | 
			
		||||
                        "type": "uint128"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint128",
 | 
			
		||||
                        "name": "isolationModeTotalDebt",
 | 
			
		||||
                        "type": "uint128"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "debtCeiling",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "debtCeilingDecimals",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint8",
 | 
			
		||||
                        "name": "eModeCategoryId",
 | 
			
		||||
                        "type": "uint8"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "borrowCap",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "supplyCap",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint16",
 | 
			
		||||
                        "name": "eModeLtv",
 | 
			
		||||
                        "type": "uint16"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint16",
 | 
			
		||||
                        "name": "eModeLiquidationThreshold",
 | 
			
		||||
                        "type": "uint16"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint16",
 | 
			
		||||
                        "name": "eModeLiquidationBonus",
 | 
			
		||||
                        "type": "uint16"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "address",
 | 
			
		||||
                        "name": "eModePriceSource",
 | 
			
		||||
                        "type": "address"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "string",
 | 
			
		||||
                        "name": "eModeLabel",
 | 
			
		||||
                        "type": "string"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "bool",
 | 
			
		||||
                        "name": "borrowableInIsolation",
 | 
			
		||||
                        "type": "bool"
 | 
			
		||||
                    }
 | 
			
		||||
                ],
 | 
			
		||||
                "internalType": "struct IUiPoolDataProviderV3.AggregatedReserveData[]",
 | 
			
		||||
                "name": "",
 | 
			
		||||
                "type": "tuple[]"
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                "components": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "marketReferenceCurrencyUnit",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "int256",
 | 
			
		||||
                        "name": "marketReferenceCurrencyPriceInUsd",
 | 
			
		||||
                        "type": "int256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "int256",
 | 
			
		||||
                        "name": "networkBaseTokenPriceInUsd",
 | 
			
		||||
                        "type": "int256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint8",
 | 
			
		||||
                        "name": "networkBaseTokenPriceDecimals",
 | 
			
		||||
                        "type": "uint8"
 | 
			
		||||
                    }
 | 
			
		||||
                ],
 | 
			
		||||
                "internalType": "struct IUiPoolDataProviderV3.BaseCurrencyInfo",
 | 
			
		||||
                "name": "",
 | 
			
		||||
                "type": "tuple"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "stateMutability": "view",
 | 
			
		||||
        "type": "function"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "inputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "contract IPoolAddressesProvider",
 | 
			
		||||
                "name": "provider",
 | 
			
		||||
                "type": "address"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "name": "getReservesList",
 | 
			
		||||
        "outputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "address[]",
 | 
			
		||||
                "name": "",
 | 
			
		||||
                "type": "address[]"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "stateMutability": "view",
 | 
			
		||||
        "type": "function"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "inputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "contract IPoolAddressesProvider",
 | 
			
		||||
                "name": "provider",
 | 
			
		||||
                "type": "address"
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "address",
 | 
			
		||||
                "name": "user",
 | 
			
		||||
                "type": "address"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "name": "getUserReservesData",
 | 
			
		||||
        "outputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "components": [
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "address",
 | 
			
		||||
                        "name": "underlyingAsset",
 | 
			
		||||
                        "type": "address"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "scaledATokenBalance",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "bool",
 | 
			
		||||
                        "name": "usageAsCollateralEnabledOnUser",
 | 
			
		||||
                        "type": "bool"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "stableBorrowRate",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "scaledVariableDebt",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "principalStableDebt",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    },
 | 
			
		||||
                    {
 | 
			
		||||
                        "internalType": "uint256",
 | 
			
		||||
                        "name": "stableBorrowLastUpdateTimestamp",
 | 
			
		||||
                        "type": "uint256"
 | 
			
		||||
                    }
 | 
			
		||||
                ],
 | 
			
		||||
                "internalType": "struct IUiPoolDataProviderV3.UserReserveData[]",
 | 
			
		||||
                "name": "",
 | 
			
		||||
                "type": "tuple[]"
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "uint8",
 | 
			
		||||
                "name": "",
 | 
			
		||||
                "type": "uint8"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "stateMutability": "view",
 | 
			
		||||
        "type": "function"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "inputs": [],
 | 
			
		||||
        "name": "marketReferenceCurrencyPriceInUsdProxyAggregator",
 | 
			
		||||
        "outputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "contract IEACAggregatorProxy",
 | 
			
		||||
                "name": "",
 | 
			
		||||
                "type": "address"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "stateMutability": "view",
 | 
			
		||||
        "type": "function"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "inputs": [],
 | 
			
		||||
        "name": "networkBaseTokenPriceInUsdProxyAggregator",
 | 
			
		||||
        "outputs": [
 | 
			
		||||
            {
 | 
			
		||||
                "internalType": "contract IEACAggregatorProxy",
 | 
			
		||||
                "name": "",
 | 
			
		||||
                "type": "address"
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "stateMutability": "view",
 | 
			
		||||
        "type": "function"
 | 
			
		||||
    }
 | 
			
		||||
]
 | 
			
		||||
							
								
								
									
										228
									
								
								components/sidebar/context/aaveV3/SidebarAaveV3Borrow.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										228
									
								
								components/sidebar/context/aaveV3/SidebarAaveV3Borrow.vue
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,228 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <SidebarContextRootContainer>
 | 
			
		||||
    <template #title>Borrow {{ symbol }}</template>
 | 
			
		||||
 | 
			
		||||
    <SidebarRateTypeSelect
 | 
			
		||||
      class="flex flex-col items-center"
 | 
			
		||||
      v-model="rateType"
 | 
			
		||||
      :items="annualPercentageRateTypes"
 | 
			
		||||
      :borrow-stable-rate="borrowStableRate"
 | 
			
		||||
      :stable-borrow-enabled="stableBorrowEnabled"
 | 
			
		||||
    />
 | 
			
		||||
 | 
			
		||||
    <SidebarSectionValueWithIcon class="mt-6" label="Borrowed" center>
 | 
			
		||||
      <template #icon
 | 
			
		||||
        ><IconCurrency :currency="rootTokenKey" class="w-20 h-20" noHeight
 | 
			
		||||
      /></template>
 | 
			
		||||
      <template #value>{{ formatNumber(balance) }} {{ symbol }}</template>
 | 
			
		||||
    </SidebarSectionValueWithIcon>
 | 
			
		||||
 | 
			
		||||
    <div class="bg-[#C5CCE1] bg-opacity-[0.15] mt-10 p-8">
 | 
			
		||||
      <h3 class="text-primary-gray text-xs font-semibold mb-2.5">
 | 
			
		||||
        Amount to borrow
 | 
			
		||||
      </h3>
 | 
			
		||||
 | 
			
		||||
      <input-numeric
 | 
			
		||||
        v-model="amount"
 | 
			
		||||
        placeholder="Amount to borrow"
 | 
			
		||||
        :error="errors.amount.message"
 | 
			
		||||
      >
 | 
			
		||||
      </input-numeric>
 | 
			
		||||
 | 
			
		||||
      <SidebarContextHeading class="mt-5">
 | 
			
		||||
        Projected Debt Position
 | 
			
		||||
      </SidebarContextHeading>
 | 
			
		||||
 | 
			
		||||
      <SidebarSectionStatus
 | 
			
		||||
        class="mt-8"
 | 
			
		||||
        :liquidation="liquidation"
 | 
			
		||||
        :status="status"
 | 
			
		||||
      />
 | 
			
		||||
 | 
			
		||||
      <SidebarSectionValueWithIcon class="mt-8" label="Liquidation Price (ETH)">
 | 
			
		||||
        <template #value>
 | 
			
		||||
          {{ formatUsdMax(liquidationPrice, liquidationMaxPrice) }}
 | 
			
		||||
          <span class="text-primary-gray"
 | 
			
		||||
            >/ {{ formatUsd(liquidationMaxPrice) }}</span
 | 
			
		||||
          >
 | 
			
		||||
        </template>
 | 
			
		||||
      </SidebarSectionValueWithIcon>
 | 
			
		||||
 | 
			
		||||
      <div class="flex flex-shrink-0 mt-10">
 | 
			
		||||
        <ButtonCTA
 | 
			
		||||
          class="w-full"
 | 
			
		||||
          :disabled="!isValid || pending"
 | 
			
		||||
          :loading="pending"
 | 
			
		||||
          @click="cast"
 | 
			
		||||
        >
 | 
			
		||||
          Borrow
 | 
			
		||||
        </ButtonCTA>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <ValidationErrors :error-messages="errorMessages" class="mt-6" />
 | 
			
		||||
    </div>
 | 
			
		||||
  </SidebarContextRootContainer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { computed, defineComponent, ref } from '@nuxtjs/composition-api'
 | 
			
		||||
import InputNumeric from '~/components/common/input/InputNumeric.vue'
 | 
			
		||||
import { useAaveV3Position } from '~/composables/protocols/useAaveV3Position'
 | 
			
		||||
import { useBalances } from '~/composables/useBalances'
 | 
			
		||||
import { useBigNumber } from '~/composables/useBigNumber'
 | 
			
		||||
import { useFormatting } from '~/composables/useFormatting'
 | 
			
		||||
import { useValidators } from '~/composables/useValidators'
 | 
			
		||||
import { useValidation } from '~/composables/useValidation'
 | 
			
		||||
import { useToken } from '~/composables/useToken'
 | 
			
		||||
import { useParsing } from '~/composables/useParsing'
 | 
			
		||||
import { useMaxAmountActive } from '~/composables/useMaxAmountActive'
 | 
			
		||||
import { useWeb3 } from '@instadapp/vue-web3'
 | 
			
		||||
import atokens from '~/constant/atokensV3'
 | 
			
		||||
import ToggleButton from '~/components/common/input/ToggleButton.vue'
 | 
			
		||||
import { useDSA } from '~/composables/useDSA'
 | 
			
		||||
import ButtonCTA from '~/components/common/input/ButtonCTA.vue'
 | 
			
		||||
import { useNotification } from '~/composables/useNotification'
 | 
			
		||||
import Button from '~/components/Button.vue'
 | 
			
		||||
import { useSidebar } from '~/composables/useSidebar'
 | 
			
		||||
import { useNetwork } from '~/composables/useNetwork'
 | 
			
		||||
 | 
			
		||||
export default defineComponent({
 | 
			
		||||
  components: { InputNumeric, ToggleButton, ButtonCTA, Button },
 | 
			
		||||
  props: {
 | 
			
		||||
    tokenKey: { type: String, required: true },
 | 
			
		||||
  },
 | 
			
		||||
  setup(props) {
 | 
			
		||||
    const { close } = useSidebar()
 | 
			
		||||
    const { account } = useWeb3()
 | 
			
		||||
    const { activeNetworkId } = useNetwork()
 | 
			
		||||
    const { dsa } = useDSA()
 | 
			
		||||
    const { getTokenByKey, valInt } = useToken()
 | 
			
		||||
    const { formatNumber, formatUsdMax, formatUsd } = useFormatting()
 | 
			
		||||
    const { isZero, gt, plus } = useBigNumber()
 | 
			
		||||
    const { parseSafeFloat } = useParsing()
 | 
			
		||||
    const { showPendingTransaction, showWarning, showConfirmedTransaction } = useNotification()
 | 
			
		||||
    const { fetchBalances } = useBalances();
 | 
			
		||||
 | 
			
		||||
    const { status, displayPositions, liquidation, maxLiquidation, liquidationPrice, liquidationMaxPrice, annualPercentageRateTypes, refreshPosition } = useAaveV3Position({
 | 
			
		||||
      overridePosition: (position) => {
 | 
			
		||||
        if (rootTokenKey.value !== position.key) return position
 | 
			
		||||
 | 
			
		||||
        return {
 | 
			
		||||
          ...position,
 | 
			
		||||
          borrow: plus(position.borrow, amountParsed.value).toFixed(),
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    const rateType = ref(null)
 | 
			
		||||
 | 
			
		||||
    const amount = ref('')
 | 
			
		||||
    const amountParsed = computed(() => parseSafeFloat(amount.value))
 | 
			
		||||
 | 
			
		||||
    const rootTokenKey = computed(() => atokens[activeNetworkId.value].rootTokens.includes(props.tokenKey) ? props.tokenKey : 'eth')
 | 
			
		||||
 | 
			
		||||
    const currentPosition = computed(() =>
 | 
			
		||||
      displayPositions.value.find((position) => position.key === rootTokenKey.value)
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    const token = computed(() => getTokenByKey(rootTokenKey.value))
 | 
			
		||||
    const symbol = computed(() => token.value?.symbol)
 | 
			
		||||
    const decimals = computed(() => token.value?.decimals)
 | 
			
		||||
    const balance = computed(() => {
 | 
			
		||||
      if (rateType.value?.value === 'stable') {
 | 
			
		||||
        return currentPosition.value?.borrowStable || '0'
 | 
			
		||||
      }
 | 
			
		||||
      return currentPosition.value?.borrow || '0'
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    const availableLiquidity = computed(() => currentPosition.value?.availableLiquidity || '0')
 | 
			
		||||
    const borrowStableRate = computed(() => currentPosition.value?.borrowStableRate || '0')
 | 
			
		||||
    const stableBorrowEnabled = computed(
 | 
			
		||||
      () => currentPosition.value?.stableBorrowEnabled && isZero(currentPosition.value?.supply)
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    const address = computed(() => token.value?.address)
 | 
			
		||||
 | 
			
		||||
    const { validateAmount, validateLiquidation, validateLiquidity, validateIsLoggedIn } = useValidators()
 | 
			
		||||
    const errors = computed(() => {
 | 
			
		||||
      const hasAmountValue = !isZero(amount.value)
 | 
			
		||||
 | 
			
		||||
      return {
 | 
			
		||||
        amount: { message: validateAmount(amountParsed.value), show: hasAmountValue },
 | 
			
		||||
        liquidation: { message: validateLiquidation(status.value, liquidation.value), show: hasAmountValue },
 | 
			
		||||
        auth: { message: validateIsLoggedIn(!!account.value), show: true },
 | 
			
		||||
        liquidity: {
 | 
			
		||||
          message: validateLiquidity(amountParsed.value, availableLiquidity.value, symbol.value),
 | 
			
		||||
          show: hasAmountValue,
 | 
			
		||||
        },
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
    const { errorMessages, isValid } = useValidation(errors)
 | 
			
		||||
 | 
			
		||||
    const pending = ref(false)
 | 
			
		||||
 | 
			
		||||
    async function cast() {
 | 
			
		||||
      pending.value = true
 | 
			
		||||
 | 
			
		||||
      const amount = valInt(amountParsed.value, decimals.value)
 | 
			
		||||
 | 
			
		||||
      const spells = dsa.value.Spell()
 | 
			
		||||
 | 
			
		||||
      const rateMode = rateType.value?.rateMode
 | 
			
		||||
 | 
			
		||||
      spells.add({
 | 
			
		||||
        connector: 'AAVE-V3-A',
 | 
			
		||||
        method: 'borrow',
 | 
			
		||||
        args: [address.value, amount, rateMode, 0, 0],
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
      try {
 | 
			
		||||
        const txHash = await dsa.value.cast({
 | 
			
		||||
          spells,
 | 
			
		||||
          from: account.value,
 | 
			
		||||
          onReceipt: async receipt => {
 | 
			
		||||
            showConfirmedTransaction(receipt.transactionHash);
 | 
			
		||||
 | 
			
		||||
            await fetchBalances(true);
 | 
			
		||||
            await refreshPosition();
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
        showPendingTransaction(txHash)
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        showWarning(error.message)
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      pending.value = false
 | 
			
		||||
 | 
			
		||||
      close()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      pending,
 | 
			
		||||
      cast,
 | 
			
		||||
      errors,
 | 
			
		||||
      amount,
 | 
			
		||||
      status,
 | 
			
		||||
      rootTokenKey,
 | 
			
		||||
      token,
 | 
			
		||||
      symbol,
 | 
			
		||||
      balance,
 | 
			
		||||
      formatNumber,
 | 
			
		||||
      formatUsdMax,
 | 
			
		||||
      formatUsd,
 | 
			
		||||
      maxLiquidation,
 | 
			
		||||
      liquidation,
 | 
			
		||||
      liquidationPrice,
 | 
			
		||||
      liquidationMaxPrice,
 | 
			
		||||
      errorMessages,
 | 
			
		||||
      isValid,
 | 
			
		||||
      annualPercentageRateTypes,
 | 
			
		||||
      availableLiquidity,
 | 
			
		||||
      borrowStableRate,
 | 
			
		||||
      stableBorrowEnabled,
 | 
			
		||||
      rateType,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
})
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										265
									
								
								components/sidebar/context/aaveV3/SidebarAaveV3Payback.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										265
									
								
								components/sidebar/context/aaveV3/SidebarAaveV3Payback.vue
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,265 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <SidebarContextRootContainer>
 | 
			
		||||
    <template #title>Payback {{ symbol }}</template>
 | 
			
		||||
 | 
			
		||||
    <SidebarRateTypeSelect
 | 
			
		||||
      class="flex flex-col items-center"
 | 
			
		||||
      v-model="rateType"
 | 
			
		||||
      :items="annualPercentageRateTypes"
 | 
			
		||||
      :borrow-stable-rate="borrowStableRate"
 | 
			
		||||
      :stable-borrow-enabled="stableBorrowEnabled"
 | 
			
		||||
    />
 | 
			
		||||
 | 
			
		||||
    <div class="mt-6 flex justify-around items-center  w-full">
 | 
			
		||||
      <SidebarSectionValueWithIcon class="" label="Borrowed" center>
 | 
			
		||||
        <template #icon
 | 
			
		||||
          ><IconCurrency :currency="rootTokenKey" class="w-20 h-20" noHeight
 | 
			
		||||
        /></template>
 | 
			
		||||
        <template #value>{{ formatNumber(balance) }} {{ symbol }}</template>
 | 
			
		||||
      </SidebarSectionValueWithIcon>
 | 
			
		||||
 | 
			
		||||
      <SidebarSectionValueWithIcon class="" label="Token Balance" center>
 | 
			
		||||
        <template #icon
 | 
			
		||||
          ><IconCurrency :currency="rootTokenKey" class="w-20 h-20" noHeight
 | 
			
		||||
        /></template>
 | 
			
		||||
 | 
			
		||||
        <template #value
 | 
			
		||||
          >{{ formatNumber(tokenMaxBalance) }} {{ symbol }}</template
 | 
			
		||||
        >
 | 
			
		||||
      </SidebarSectionValueWithIcon>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="bg-[#C5CCE1] bg-opacity-[0.15] mt-10 p-8">
 | 
			
		||||
      <h3 class="text-primary-gray text-xs font-semibold mb-2.5">
 | 
			
		||||
        Amount to supply
 | 
			
		||||
      </h3>
 | 
			
		||||
 | 
			
		||||
      <input-numeric
 | 
			
		||||
        v-model="amount"
 | 
			
		||||
        placeholder="Amount to supply"
 | 
			
		||||
        :error="errors.amount.message"
 | 
			
		||||
      >
 | 
			
		||||
        <template v-if="!isMaxAmount" #suffix>
 | 
			
		||||
          <div class="absolute mt-2 top-0 right-0 mr-4">
 | 
			
		||||
            <button
 | 
			
		||||
              type="button"
 | 
			
		||||
              class="text-primary-blue-dark font-semibold text-sm hover:text-primary-blue-hover"
 | 
			
		||||
              @click="toggle"
 | 
			
		||||
            >
 | 
			
		||||
              Max
 | 
			
		||||
            </button>
 | 
			
		||||
          </div>
 | 
			
		||||
        </template>
 | 
			
		||||
      </input-numeric>
 | 
			
		||||
 | 
			
		||||
      <SidebarContextHeading class="mt-5">
 | 
			
		||||
        Projected Debt Position
 | 
			
		||||
      </SidebarContextHeading>
 | 
			
		||||
 | 
			
		||||
      <SidebarSectionStatus
 | 
			
		||||
        class="mt-8"
 | 
			
		||||
        :liquidation="maxLiquidation"
 | 
			
		||||
        :status="status"
 | 
			
		||||
      />
 | 
			
		||||
 | 
			
		||||
      <SidebarSectionValueWithIcon class="mt-8" label="Liquidation Price (ETH)">
 | 
			
		||||
        <template #value>
 | 
			
		||||
          {{ formatUsdMax(liquidationPrice, liquidationMaxPrice) }}
 | 
			
		||||
          <span class="text-primary-gray"
 | 
			
		||||
            >/ {{ formatUsd(liquidationMaxPrice) }}</span
 | 
			
		||||
          >
 | 
			
		||||
        </template>
 | 
			
		||||
      </SidebarSectionValueWithIcon>
 | 
			
		||||
 | 
			
		||||
      <div class="flex flex-shrink-0 mt-10">
 | 
			
		||||
        <ButtonCTA
 | 
			
		||||
          class="w-full"
 | 
			
		||||
          :disabled="!isValid || pending"
 | 
			
		||||
          :loading="pending"
 | 
			
		||||
          @click="cast"
 | 
			
		||||
        >
 | 
			
		||||
          Payback
 | 
			
		||||
        </ButtonCTA>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <ValidationErrors :error-messages="errorMessages" class="mt-6" />
 | 
			
		||||
    </div>
 | 
			
		||||
  </SidebarContextRootContainer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { computed, defineComponent, ref } from '@nuxtjs/composition-api'
 | 
			
		||||
import InputNumeric from '~/components/common/input/InputNumeric.vue'
 | 
			
		||||
import { useAaveV3Position } from '~/composables/protocols/useAaveV3Position'
 | 
			
		||||
import { useBalances } from '~/composables/useBalances'
 | 
			
		||||
import { useBigNumber } from '~/composables/useBigNumber'
 | 
			
		||||
import { useFormatting } from '~/composables/useFormatting'
 | 
			
		||||
import { useValidators } from '~/composables/useValidators'
 | 
			
		||||
import { useValidation } from '~/composables/useValidation'
 | 
			
		||||
import { useToken } from '~/composables/useToken'
 | 
			
		||||
import { useParsing } from '~/composables/useParsing'
 | 
			
		||||
import { useMaxAmountActive } from '~/composables/useMaxAmountActive'
 | 
			
		||||
import { useWeb3 } from '@instadapp/vue-web3'
 | 
			
		||||
import atokens from '~/constant/atokensV3'
 | 
			
		||||
import ToggleButton from '~/components/common/input/ToggleButton.vue'
 | 
			
		||||
import { useDSA } from '~/composables/useDSA'
 | 
			
		||||
import ButtonCTA from '~/components/common/input/ButtonCTA.vue'
 | 
			
		||||
import { useNotification } from '~/composables/useNotification'
 | 
			
		||||
import Button from '~/components/Button.vue'
 | 
			
		||||
import { useSidebar } from '~/composables/useSidebar'
 | 
			
		||||
import { useNetwork } from '~/composables/useNetwork'
 | 
			
		||||
 | 
			
		||||
export default defineComponent({
 | 
			
		||||
  components: { InputNumeric, ToggleButton, ButtonCTA, Button },
 | 
			
		||||
  props: {
 | 
			
		||||
    tokenKey: { type: String, required: true },
 | 
			
		||||
  },
 | 
			
		||||
  setup(props) {
 | 
			
		||||
    const { close } = useSidebar()
 | 
			
		||||
    const { account } = useWeb3()
 | 
			
		||||
    const { activeNetworkId } = useNetwork()
 | 
			
		||||
    const { dsa } = useDSA()
 | 
			
		||||
    const { getTokenByKey, valInt } = useToken()
 | 
			
		||||
    const { getBalanceByKey, getBalanceRawByKey, fetchBalances } = useBalances()
 | 
			
		||||
    const { formatNumber, formatUsdMax, formatUsd } = useFormatting()
 | 
			
		||||
    const { isZero, gt, plus, max, minus } = useBigNumber()
 | 
			
		||||
    const { parseSafeFloat } = useParsing()
 | 
			
		||||
    const { showPendingTransaction, showWarning, showConfirmedTransaction } = useNotification()
 | 
			
		||||
    const { status, displayPositions, liquidation, maxLiquidation, liquidationPrice, liquidationMaxPrice, annualPercentageRateTypes, refreshPosition } = useAaveV3Position({
 | 
			
		||||
      overridePosition: (position) => {
 | 
			
		||||
        if (rootTokenKey.value !== position.key) return position
 | 
			
		||||
 | 
			
		||||
        return {
 | 
			
		||||
          ...position,
 | 
			
		||||
          borrow: max(minus(position.borrow, amountParsed.value), '0').toFixed(),
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    const rateType = ref(null)
 | 
			
		||||
 | 
			
		||||
    const amount = ref('')
 | 
			
		||||
    const amountParsed = computed(() => parseSafeFloat(amount.value))
 | 
			
		||||
 | 
			
		||||
    const rootTokenKey = computed(() => atokens[activeNetworkId.value].rootTokens.includes(props.tokenKey) ? props.tokenKey : 'eth')
 | 
			
		||||
 | 
			
		||||
    const currentPosition = computed(() =>
 | 
			
		||||
      displayPositions.value.find((position) => position.key === rootTokenKey.value)
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    const token = computed(() => getTokenByKey(rootTokenKey.value))
 | 
			
		||||
    const symbol = computed(() => token.value?.symbol)
 | 
			
		||||
    const decimals = computed(() => token.value?.decimals)
 | 
			
		||||
    const balance = computed(() => {
 | 
			
		||||
      if (rateType.value?.value === 'stable') {
 | 
			
		||||
        return currentPosition.value?.borrowStable || '0'
 | 
			
		||||
      }
 | 
			
		||||
      return currentPosition.value?.borrow || '0'
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    const tokenMaxBalance = computed(() => getBalanceByKey(rootTokenKey.value))
 | 
			
		||||
    const tokenMaxBalanceRaw = computed(() => getBalanceRawByKey(rootTokenKey.value))
 | 
			
		||||
 | 
			
		||||
    const availableLiquidity = computed(() => currentPosition.value?.availableLiquidity || '0')
 | 
			
		||||
    const borrowStableRate = computed(() => currentPosition.value?.borrowStableRate || '0')
 | 
			
		||||
    const stableBorrowEnabled = computed(
 | 
			
		||||
      () => currentPosition.value?.stableBorrowEnabled && isZero(currentPosition.value?.supply)
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    const address = computed(() => token.value?.address)
 | 
			
		||||
 | 
			
		||||
    const factor = computed(
 | 
			
		||||
      () => displayPositions.value?.find((position) => rootTokenKey.value === position.key)?.factor
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    const { toggle, isMaxAmount } = useMaxAmountActive(amount, balance)
 | 
			
		||||
 | 
			
		||||
    const { validateAmount, validateLiquidation, validateLiquidity, validateIsLoggedIn } = useValidators()
 | 
			
		||||
    const errors = computed(() => {
 | 
			
		||||
      const hasAmountValue = !isZero(amount.value)
 | 
			
		||||
 | 
			
		||||
      return {
 | 
			
		||||
        amount: { message: validateAmount(amountParsed.value), show: hasAmountValue },
 | 
			
		||||
        liquidation: { message: validateLiquidation(status.value, liquidation.value), show: hasAmountValue },
 | 
			
		||||
        auth: { message: validateIsLoggedIn(!!account.value), show: true },
 | 
			
		||||
        liquidity: {
 | 
			
		||||
          message: validateLiquidity(amountParsed.value, availableLiquidity.value, symbol.value),
 | 
			
		||||
          show: hasAmountValue,
 | 
			
		||||
        },
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
    const { errorMessages, isValid } = useValidation(errors)
 | 
			
		||||
 | 
			
		||||
    const pending = ref(false)
 | 
			
		||||
 | 
			
		||||
    async function cast() {
 | 
			
		||||
      pending.value = true
 | 
			
		||||
 | 
			
		||||
      const amount = isMaxAmount.value
 | 
			
		||||
        ? gte(tokenMaxBalance.value, balance.value)
 | 
			
		||||
          ? $dsa().maxValue
 | 
			
		||||
          : tokenMaxBalanceRaw.value
 | 
			
		||||
        : valInt(amountParsed.value, decimals.value)
 | 
			
		||||
 | 
			
		||||
      const spells = dsa.value.Spell()
 | 
			
		||||
 | 
			
		||||
      const rateMode = rateType.value?.rateMode
 | 
			
		||||
 | 
			
		||||
      spells.add({
 | 
			
		||||
        connector: 'AAVE-V3-A',
 | 
			
		||||
        method: 'payback',
 | 
			
		||||
        args: [address.value, amount, rateMode, 0, 0],
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
      try {
 | 
			
		||||
        const txHash = await dsa.value.cast({
 | 
			
		||||
          spells,
 | 
			
		||||
          from: account.value,
 | 
			
		||||
          onReceipt: async receipt => {
 | 
			
		||||
            showConfirmedTransaction(receipt.transactionHash);
 | 
			
		||||
 | 
			
		||||
            await fetchBalances(true);
 | 
			
		||||
            await refreshPosition();
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
        showPendingTransaction(txHash)
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        showWarning(error.message)
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      pending.value = false
 | 
			
		||||
 | 
			
		||||
      close()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      pending,
 | 
			
		||||
      cast,
 | 
			
		||||
      errors,
 | 
			
		||||
      amount,
 | 
			
		||||
      status,
 | 
			
		||||
      rootTokenKey,
 | 
			
		||||
      token,
 | 
			
		||||
      symbol,
 | 
			
		||||
      balance,
 | 
			
		||||
      formatNumber,
 | 
			
		||||
      formatUsdMax,
 | 
			
		||||
      formatUsd,
 | 
			
		||||
      toggle,
 | 
			
		||||
      isMaxAmount,
 | 
			
		||||
      maxLiquidation,
 | 
			
		||||
      liquidationPrice,
 | 
			
		||||
      liquidationMaxPrice,
 | 
			
		||||
      errorMessages,
 | 
			
		||||
      isValid,
 | 
			
		||||
      annualPercentageRateTypes,
 | 
			
		||||
      availableLiquidity,
 | 
			
		||||
      borrowStableRate,
 | 
			
		||||
      stableBorrowEnabled,
 | 
			
		||||
      rateType,
 | 
			
		||||
      tokenMaxBalance,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
})
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										238
									
								
								components/sidebar/context/aaveV3/SidebarAaveV3Supply.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										238
									
								
								components/sidebar/context/aaveV3/SidebarAaveV3Supply.vue
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,238 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <SidebarContextRootContainer>
 | 
			
		||||
    <template #title>Supply {{ symbol }}</template>
 | 
			
		||||
 | 
			
		||||
    <SidebarSectionValueWithIcon label="Token Balance" center>
 | 
			
		||||
      <template #icon
 | 
			
		||||
        ><IconCurrency :currency="rootTokenKey" class="w-20 h-20" noHeight
 | 
			
		||||
      /></template>
 | 
			
		||||
      <template #value>{{ formatNumber(balance) }} {{ symbol }}</template>
 | 
			
		||||
    </SidebarSectionValueWithIcon>
 | 
			
		||||
 | 
			
		||||
    <div class="bg-[#C5CCE1] bg-opacity-[0.15] mt-10 p-8">
 | 
			
		||||
      <h3 class="text-primary-gray text-xs font-semibold mb-2.5">
 | 
			
		||||
        Amount to supply
 | 
			
		||||
      </h3>
 | 
			
		||||
 | 
			
		||||
      <input-numeric
 | 
			
		||||
        v-model="amount"
 | 
			
		||||
        placeholder="Amount to supply"
 | 
			
		||||
        :error="errors.amount.message"
 | 
			
		||||
      >
 | 
			
		||||
        <template v-if="!isMaxAmount" #suffix>
 | 
			
		||||
          <div class="absolute mt-2 top-0 right-0 mr-4">
 | 
			
		||||
            <button
 | 
			
		||||
              type="button"
 | 
			
		||||
              class="text-primary-blue-dark font-semibold text-sm hover:text-primary-blue-hover"
 | 
			
		||||
              @click="toggle"
 | 
			
		||||
            >
 | 
			
		||||
              Max
 | 
			
		||||
            </button>
 | 
			
		||||
          </div>
 | 
			
		||||
        </template>
 | 
			
		||||
      </input-numeric>
 | 
			
		||||
 | 
			
		||||
      <SidebarContextHeading class="mt-5">
 | 
			
		||||
        Projected Debt Position
 | 
			
		||||
      </SidebarContextHeading>
 | 
			
		||||
 | 
			
		||||
      <SidebarSectionStatus
 | 
			
		||||
        class="mt-8"
 | 
			
		||||
        :liquidation="maxLiquidation"
 | 
			
		||||
        :status="status"
 | 
			
		||||
      />
 | 
			
		||||
 | 
			
		||||
      <SidebarSectionValueWithIcon class="mt-8" label="Liquidation Price (ETH)">
 | 
			
		||||
        <template #value>
 | 
			
		||||
          {{ formatUsdMax(liquidationPrice, liquidationMaxPrice) }}
 | 
			
		||||
          <span class="text-primary-gray"
 | 
			
		||||
            >/ {{ formatUsd(liquidationMaxPrice) }}</span
 | 
			
		||||
          >
 | 
			
		||||
        </template>
 | 
			
		||||
      </SidebarSectionValueWithIcon>
 | 
			
		||||
 | 
			
		||||
      <div class="flex flex-shrink-0 mt-10">
 | 
			
		||||
        <ButtonCTA
 | 
			
		||||
          class="w-full"
 | 
			
		||||
          :disabled="!isValid || pending"
 | 
			
		||||
          :loading="pending"
 | 
			
		||||
          @click="cast"
 | 
			
		||||
        >
 | 
			
		||||
          Supply
 | 
			
		||||
        </ButtonCTA>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <ValidationErrors :error-messages="errorMessages" class="mt-6" />
 | 
			
		||||
    </div>
 | 
			
		||||
  </SidebarContextRootContainer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
import { computed, defineComponent, ref } from "@nuxtjs/composition-api";
 | 
			
		||||
import InputNumeric from "~/components/common/input/InputNumeric.vue";
 | 
			
		||||
import { useAaveV3Position } from "~/composables/protocols/useAaveV3Position";
 | 
			
		||||
import { useBalances } from "~/composables/useBalances";
 | 
			
		||||
import { useNotification } from "~/composables/useNotification";
 | 
			
		||||
import { useBigNumber } from "~/composables/useBigNumber";
 | 
			
		||||
import { useFormatting } from "~/composables/useFormatting";
 | 
			
		||||
import { useValidators } from "~/composables/useValidators";
 | 
			
		||||
import { useValidation } from "~/composables/useValidation";
 | 
			
		||||
import { useToken } from "~/composables/useToken";
 | 
			
		||||
import { useParsing } from "~/composables/useParsing";
 | 
			
		||||
import { useMaxAmountActive } from "~/composables/useMaxAmountActive";
 | 
			
		||||
import { useWeb3 } from "@instadapp/vue-web3";
 | 
			
		||||
import atokens from "~/constant/atokensV3";
 | 
			
		||||
import ToggleButton from "~/components/common/input/ToggleButton.vue";
 | 
			
		||||
import { useDSA } from "~/composables/useDSA";
 | 
			
		||||
import ButtonCTA from "~/components/common/input/ButtonCTA.vue";
 | 
			
		||||
import Button from "~/components/Button.vue";
 | 
			
		||||
import { useSidebar } from "~/composables/useSidebar";
 | 
			
		||||
import DSA from "dsa-connect";
 | 
			
		||||
import { useNetwork } from "~/composables/useNetwork";
 | 
			
		||||
export default defineComponent({
 | 
			
		||||
  components: { InputNumeric, ToggleButton, ButtonCTA, Button },
 | 
			
		||||
  props: {
 | 
			
		||||
    tokenKey: { type: String, required: true }
 | 
			
		||||
  },
 | 
			
		||||
  setup(props) {
 | 
			
		||||
    const { close } = useSidebar();
 | 
			
		||||
    const { account } = useWeb3();
 | 
			
		||||
    const { activeNetworkId } = useNetwork()
 | 
			
		||||
    const { dsa } = useDSA();
 | 
			
		||||
    const { getTokenByKey, valInt } = useToken();
 | 
			
		||||
    const { getBalanceByKey, fetchBalances } = useBalances();
 | 
			
		||||
    const { formatNumber, formatUsdMax, formatUsd } = useFormatting();
 | 
			
		||||
    const { isZero, gt, plus } = useBigNumber();
 | 
			
		||||
    const { parseSafeFloat } = useParsing();
 | 
			
		||||
    const {
 | 
			
		||||
      showPendingTransaction,
 | 
			
		||||
      showWarning,
 | 
			
		||||
      showConfirmedTransaction
 | 
			
		||||
    } = useNotification();
 | 
			
		||||
    const {
 | 
			
		||||
      status,
 | 
			
		||||
      displayPositions,
 | 
			
		||||
      maxLiquidation,
 | 
			
		||||
      liquidationPrice,
 | 
			
		||||
      liquidationMaxPrice,
 | 
			
		||||
      refreshPosition
 | 
			
		||||
    } = useAaveV3Position({
 | 
			
		||||
      overridePosition: position => {
 | 
			
		||||
        if (rootTokenKey.value !== position.key) return position;
 | 
			
		||||
 | 
			
		||||
        return {
 | 
			
		||||
          ...position,
 | 
			
		||||
          supply: plus(position.supply, amountParsed.value).toFixed()
 | 
			
		||||
        };
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    const amount = ref("");
 | 
			
		||||
    const amountParsed = computed(() => parseSafeFloat(amount.value));
 | 
			
		||||
 | 
			
		||||
    const rootTokenKey = computed(() =>
 | 
			
		||||
      atokens[activeNetworkId.value].rootTokens.includes(props.tokenKey)
 | 
			
		||||
        ? props.tokenKey
 | 
			
		||||
        : "eth"
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    const token = computed(() => getTokenByKey(rootTokenKey.value));
 | 
			
		||||
    const symbol = computed(() => token.value?.symbol);
 | 
			
		||||
    const decimals = computed(() => token.value?.decimals);
 | 
			
		||||
    const balance = computed(() => getBalanceByKey(rootTokenKey.value));
 | 
			
		||||
    const address = computed(() => token.value?.address);
 | 
			
		||||
 | 
			
		||||
    const factor = computed(
 | 
			
		||||
      () =>
 | 
			
		||||
        displayPositions.value?.find(
 | 
			
		||||
          position => rootTokenKey.value === position.key
 | 
			
		||||
        )?.factor
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    const { toggle, isMaxAmount } = useMaxAmountActive(amount, balance);
 | 
			
		||||
 | 
			
		||||
    const {
 | 
			
		||||
      validateAmount,
 | 
			
		||||
      validateLiquidation,
 | 
			
		||||
      validateIsLoggedIn
 | 
			
		||||
    } = useValidators();
 | 
			
		||||
    const errors = computed(() => {
 | 
			
		||||
      const hasAmountValue = !isZero(amount.value);
 | 
			
		||||
      const liqValid = gt(factor.value, "0")
 | 
			
		||||
        ? validateLiquidation(status.value, maxLiquidation.value)
 | 
			
		||||
        : null;
 | 
			
		||||
 | 
			
		||||
      return {
 | 
			
		||||
        amount: {
 | 
			
		||||
          message: validateAmount(amountParsed.value, balance.value),
 | 
			
		||||
          show: hasAmountValue
 | 
			
		||||
        },
 | 
			
		||||
        liquidation: { message: liqValid, show: hasAmountValue },
 | 
			
		||||
        auth: { message: validateIsLoggedIn(!!account.value), show: true }
 | 
			
		||||
      };
 | 
			
		||||
    });
 | 
			
		||||
    const { errorMessages, isValid } = useValidation(errors);
 | 
			
		||||
 | 
			
		||||
    const pending = ref(false);
 | 
			
		||||
 | 
			
		||||
    async function cast() {
 | 
			
		||||
      pending.value = true;
 | 
			
		||||
 | 
			
		||||
      const amount = isMaxAmount.value
 | 
			
		||||
        ? dsa.value.maxValue
 | 
			
		||||
        : valInt(amountParsed.value, decimals.value);
 | 
			
		||||
 | 
			
		||||
      const spells = dsa.value.Spell();
 | 
			
		||||
 | 
			
		||||
      spells.add({
 | 
			
		||||
        connector: "AAVE-V3-A",
 | 
			
		||||
        method: "deposit",
 | 
			
		||||
        args: [address.value, amount, 0, 0]
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      try {
 | 
			
		||||
        const txHash = await (dsa.value as DSA).cast({
 | 
			
		||||
          spells,
 | 
			
		||||
          from: account.value,
 | 
			
		||||
          onReceipt: async receipt => {
 | 
			
		||||
            showConfirmedTransaction(receipt.transactionHash);
 | 
			
		||||
 | 
			
		||||
            await fetchBalances(true);
 | 
			
		||||
            await refreshPosition();
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        showPendingTransaction(txHash);
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        showWarning(error.message);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      pending.value = false;
 | 
			
		||||
 | 
			
		||||
      close();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      pending,
 | 
			
		||||
      cast,
 | 
			
		||||
      errors,
 | 
			
		||||
      amount,
 | 
			
		||||
      status,
 | 
			
		||||
      rootTokenKey,
 | 
			
		||||
      token,
 | 
			
		||||
      symbol,
 | 
			
		||||
      balance,
 | 
			
		||||
      formatNumber,
 | 
			
		||||
      formatUsdMax,
 | 
			
		||||
      formatUsd,
 | 
			
		||||
      toggle,
 | 
			
		||||
      isMaxAmount,
 | 
			
		||||
      maxLiquidation,
 | 
			
		||||
      liquidationPrice,
 | 
			
		||||
      liquidationMaxPrice,
 | 
			
		||||
      errorMessages,
 | 
			
		||||
      isValid
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										231
									
								
								components/sidebar/context/aaveV3/SidebarAaveV3Withdraw.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										231
									
								
								components/sidebar/context/aaveV3/SidebarAaveV3Withdraw.vue
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,231 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <SidebarContextRootContainer>
 | 
			
		||||
    <template #title>Withdraw {{ symbol }}</template>
 | 
			
		||||
 | 
			
		||||
    <SidebarSectionValueWithIcon label="Token Balance" center>
 | 
			
		||||
      <template #icon
 | 
			
		||||
        ><IconCurrency :currency="rootTokenKey" class="w-20 h-20" noHeight
 | 
			
		||||
      /></template>
 | 
			
		||||
      <template #value
 | 
			
		||||
        >{{ formatNumber(originalBalance) }} {{ symbol }}</template
 | 
			
		||||
      >
 | 
			
		||||
    </SidebarSectionValueWithIcon>
 | 
			
		||||
 | 
			
		||||
    <div class="bg-[#C5CCE1] bg-opacity-[0.15] mt-10 p-8">
 | 
			
		||||
      <h3 class="text-primary-gray text-xs font-semibold mb-2.5">
 | 
			
		||||
        Amount to withdraw
 | 
			
		||||
      </h3>
 | 
			
		||||
 | 
			
		||||
      <input-numeric
 | 
			
		||||
        v-model="amount"
 | 
			
		||||
        placeholder="Amount to withdraw"
 | 
			
		||||
        :error="errors.amount.message"
 | 
			
		||||
      >
 | 
			
		||||
        <template v-if="!isMaxAmount" #suffix>
 | 
			
		||||
          <div class="absolute mt-2 top-0 right-0 mr-4">
 | 
			
		||||
            <button
 | 
			
		||||
              type="button"
 | 
			
		||||
              class="text-primary-blue-dark font-semibold text-sm hover:text-primary-blue-hover"
 | 
			
		||||
              @click="toggle"
 | 
			
		||||
            >
 | 
			
		||||
              Max
 | 
			
		||||
            </button>
 | 
			
		||||
          </div>
 | 
			
		||||
        </template>
 | 
			
		||||
      </input-numeric>
 | 
			
		||||
 | 
			
		||||
      <SidebarContextHeading class="mt-5">
 | 
			
		||||
        Projected Debt Position
 | 
			
		||||
      </SidebarContextHeading>
 | 
			
		||||
 | 
			
		||||
      <SidebarSectionStatus
 | 
			
		||||
        class="mt-8"
 | 
			
		||||
        :liquidation="maxLiquidation"
 | 
			
		||||
        :status="status"
 | 
			
		||||
      />
 | 
			
		||||
 | 
			
		||||
      <SidebarSectionValueWithIcon class="mt-8" label="Liquidation Price (ETH)">
 | 
			
		||||
        <template #value>
 | 
			
		||||
          {{ formatUsdMax(liquidationPrice, liquidationMaxPrice) }}
 | 
			
		||||
          <span class="text-primary-gray"
 | 
			
		||||
            >/ {{ formatUsd(liquidationMaxPrice) }}</span
 | 
			
		||||
          >
 | 
			
		||||
        </template>
 | 
			
		||||
      </SidebarSectionValueWithIcon>
 | 
			
		||||
 | 
			
		||||
      <div class="flex flex-shrink-0 mt-10">
 | 
			
		||||
        <ButtonCTA
 | 
			
		||||
          class="w-full"
 | 
			
		||||
          :disabled="!isValid || pending"
 | 
			
		||||
          :loading="pending"
 | 
			
		||||
          @click="cast"
 | 
			
		||||
        >
 | 
			
		||||
          Withdraw
 | 
			
		||||
        </ButtonCTA>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <ValidationErrors :error-messages="errorMessages" class="mt-6" />
 | 
			
		||||
    </div>
 | 
			
		||||
  </SidebarContextRootContainer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { computed, defineComponent, onMounted, ref } from '@nuxtjs/composition-api'
 | 
			
		||||
import InputNumeric from '~/components/common/input/InputNumeric.vue'
 | 
			
		||||
import { useAaveV3Position } from '~/composables/protocols/useAaveV3Position'
 | 
			
		||||
import { useBalances } from '~/composables/useBalances'
 | 
			
		||||
import { useBigNumber } from '~/composables/useBigNumber'
 | 
			
		||||
import { useFormatting } from '~/composables/useFormatting'
 | 
			
		||||
import { useValidators } from '~/composables/useValidators'
 | 
			
		||||
import { useValidation } from '~/composables/useValidation'
 | 
			
		||||
import { useToken } from '~/composables/useToken'
 | 
			
		||||
import { useParsing } from '~/composables/useParsing'
 | 
			
		||||
import { useMaxAmountActive } from '~/composables/useMaxAmountActive'
 | 
			
		||||
import { useWeb3 } from '@instadapp/vue-web3'
 | 
			
		||||
import atokens from '~/constant/atokensV3'
 | 
			
		||||
import ToggleButton from '~/components/common/input/ToggleButton.vue'
 | 
			
		||||
import { useDSA } from '~/composables/useDSA'
 | 
			
		||||
import ButtonCTA from '~/components/common/input/ButtonCTA.vue'
 | 
			
		||||
import { useNotification } from '~/composables/useNotification'
 | 
			
		||||
import Button from '~/components/Button.vue'
 | 
			
		||||
import { useSidebar } from '~/composables/useSidebar'
 | 
			
		||||
import { useNetwork } from '~/composables/useNetwork'
 | 
			
		||||
 | 
			
		||||
export default defineComponent({
 | 
			
		||||
  components: { InputNumeric, ToggleButton, ButtonCTA, Button },
 | 
			
		||||
  props: {
 | 
			
		||||
    tokenKey: { type: String, required: true },
 | 
			
		||||
  },
 | 
			
		||||
  setup(props) {
 | 
			
		||||
    const { close } = useSidebar()
 | 
			
		||||
    const { account } = useWeb3()
 | 
			
		||||
    const { activeNetworkId } = useNetwork()
 | 
			
		||||
    const { dsa } = useDSA()
 | 
			
		||||
    const { getTokenByKey, valInt } = useToken()
 | 
			
		||||
    const { formatNumber, formatUsdMax, formatUsd } = useFormatting()
 | 
			
		||||
    const { isZero, gt, plus, max, minus } = useBigNumber()
 | 
			
		||||
    const { parseSafeFloat } = useParsing()
 | 
			
		||||
    const { showPendingTransaction, showConfirmedTransaction, showWarning } = useNotification()
 | 
			
		||||
    const { fetchBalances } = useBalances();
 | 
			
		||||
 | 
			
		||||
    const originalBalance = ref('0')
 | 
			
		||||
    const { stats, status, displayPositions, maxLiquidation, liquidationPrice, liquidationMaxPrice, refreshPosition } = useAaveV3Position({
 | 
			
		||||
      overridePosition: (position) => {
 | 
			
		||||
        if (rootTokenKey.value !== position.key) return position
 | 
			
		||||
 | 
			
		||||
        originalBalance.value = position.supply
 | 
			
		||||
 | 
			
		||||
        return {
 | 
			
		||||
          ...position,
 | 
			
		||||
          supply: max(minus(position.supply, amountParsed.value), '0').toFixed(),
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    const availableLiquidity = computed(
 | 
			
		||||
      () => displayPositions.value.find((position) => position.key === rootTokenKey.value)?.availableLiquidity || '0'
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    const balance = computed(
 | 
			
		||||
      () => displayPositions.value.find((position) => position.key === rootTokenKey.value)?.supply || '0'
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    const amount = ref('')
 | 
			
		||||
    const amountParsed = computed(() => parseSafeFloat(amount.value))
 | 
			
		||||
 | 
			
		||||
    const rootTokenKey = computed(() => atokens[activeNetworkId.value].rootTokens.includes(props.tokenKey) ? props.tokenKey : 'eth')
 | 
			
		||||
 | 
			
		||||
    const token = computed(() => getTokenByKey(rootTokenKey.value))
 | 
			
		||||
    const symbol = computed(() => token.value?.symbol)
 | 
			
		||||
    const decimals = computed(() => token.value?.decimals)
 | 
			
		||||
    const address = computed(() => token.value?.address)
 | 
			
		||||
 | 
			
		||||
    const factor = computed(
 | 
			
		||||
      () => displayPositions.value?.find((position) => rootTokenKey.value === position.key)?.factor
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    const { toggle, isMaxAmount } = useMaxAmountActive(amount, balance)
 | 
			
		||||
 | 
			
		||||
    const { validateAmount, validateLiquidation, validateIsLoggedIn, validateLiquidity } = useValidators()
 | 
			
		||||
 | 
			
		||||
    const errors = computed(() => {
 | 
			
		||||
      const hasAmountValue = !isZero(amount.value)
 | 
			
		||||
      const liqValid = gt(factor.value, '0')
 | 
			
		||||
        ? validateLiquidation(status.value, maxLiquidation.value, isZero(stats.value.totalBorrowInEth))
 | 
			
		||||
        : null
 | 
			
		||||
 | 
			
		||||
      return {
 | 
			
		||||
        amount: { message: validateAmount(amountParsed.value, originalBalance.value), show: hasAmountValue },
 | 
			
		||||
        liquidation: { message: liqValid, show: hasAmountValue },
 | 
			
		||||
        auth: { message: validateIsLoggedIn(!!account.value), show: true },
 | 
			
		||||
        liquidity: {
 | 
			
		||||
          message: validateLiquidity(amountParsed.value, availableLiquidity.value, symbol.value, true),
 | 
			
		||||
          show: hasAmountValue,
 | 
			
		||||
        },
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
    const { errorMessages, isValid } = useValidation(errors)
 | 
			
		||||
 | 
			
		||||
    const pending = ref(false)
 | 
			
		||||
 | 
			
		||||
    async function cast() {
 | 
			
		||||
      pending.value = true
 | 
			
		||||
 | 
			
		||||
      const amount = isMaxAmount.value ? dsa.value.maxValue : valInt(amountParsed.value, decimals.value)
 | 
			
		||||
 | 
			
		||||
      const spells = dsa.value.Spell()
 | 
			
		||||
 | 
			
		||||
      spells.add({
 | 
			
		||||
        connector: 'AAVE-V3-A',
 | 
			
		||||
        method: 'withdraw',
 | 
			
		||||
        args: [address.value, amount, 0, 0],
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
      try {
 | 
			
		||||
        const txHash = await dsa.value.cast({
 | 
			
		||||
          spells,
 | 
			
		||||
          from: account.value,
 | 
			
		||||
          onReceipt: async receipt => {
 | 
			
		||||
            showConfirmedTransaction(receipt.transactionHash);
 | 
			
		||||
 | 
			
		||||
            await fetchBalances(true);
 | 
			
		||||
            await refreshPosition();
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
        showPendingTransaction(txHash)
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        showWarning(error.message)
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      pending.value = false
 | 
			
		||||
 | 
			
		||||
      close()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      pending,
 | 
			
		||||
      cast,
 | 
			
		||||
      errors,
 | 
			
		||||
      amount,
 | 
			
		||||
      status,
 | 
			
		||||
      rootTokenKey,
 | 
			
		||||
      token,
 | 
			
		||||
      symbol,
 | 
			
		||||
      originalBalance,
 | 
			
		||||
      balance,
 | 
			
		||||
      formatNumber,
 | 
			
		||||
      formatUsdMax,
 | 
			
		||||
      formatUsd,
 | 
			
		||||
      toggle,
 | 
			
		||||
      isMaxAmount,
 | 
			
		||||
      maxLiquidation,
 | 
			
		||||
      liquidationPrice,
 | 
			
		||||
      liquidationMaxPrice,
 | 
			
		||||
      errorMessages,
 | 
			
		||||
      isValid
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
})
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										681
									
								
								composables/protocols/useAaveV3Position.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										681
									
								
								composables/protocols/useAaveV3Position.ts
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,681 @@
 | 
			
		|||
import { AbiItem } from "web3-utils";
 | 
			
		||||
 | 
			
		||||
import aaveV3ABI from "~/abis/read/aaveV3.json";
 | 
			
		||||
import uiDataProviderABI from '~/abis/read/uiProtocolDataProvider.json'
 | 
			
		||||
import { computed, ref, watch } from "@nuxtjs/composition-api";
 | 
			
		||||
import { useDSA } from "~/composables/useDSA";
 | 
			
		||||
import { useWeb3 } from "@instadapp/vue-web3";
 | 
			
		||||
import BigNumber from "bignumber.js";
 | 
			
		||||
import atokensV3 from "~/constant/atokensV3";
 | 
			
		||||
import tokens from "~/constant/tokens";
 | 
			
		||||
import { Multicall } from 'ethereum-multicall'
 | 
			
		||||
import { Network, useNetwork } from "~/composables/useNetwork";
 | 
			
		||||
import { useBigNumber } from "~/composables/useBigNumber";
 | 
			
		||||
import { usePosition } from "~/composables/usePosition";
 | 
			
		||||
import { useToken } from "~/composables/useToken";
 | 
			
		||||
import { useSorting } from "~/composables/useSorting";
 | 
			
		||||
import useEventBus from "../useEventBus";
 | 
			
		||||
import addresses from "~/constant/addresses";
 | 
			
		||||
import Web3 from "web3";
 | 
			
		||||
 | 
			
		||||
const {
 | 
			
		||||
  times,
 | 
			
		||||
  isZero,
 | 
			
		||||
  div,
 | 
			
		||||
  max,
 | 
			
		||||
  gt,
 | 
			
		||||
  minus,
 | 
			
		||||
  ensureValue,
 | 
			
		||||
  plus
 | 
			
		||||
} = useBigNumber();
 | 
			
		||||
const { getType } = usePosition();
 | 
			
		||||
 | 
			
		||||
export const position = ref<any>({
 | 
			
		||||
  totalSupplyInEth: new BigNumber(0),
 | 
			
		||||
  totalBorrowInEth: new BigNumber(0),
 | 
			
		||||
  totalSupplyInUsd: "0",
 | 
			
		||||
  totalBorrowInUsd: "0",
 | 
			
		||||
  totalBorrowStableInEth: new BigNumber(0),
 | 
			
		||||
  totalBorrowVariableInEth: new BigNumber(0),
 | 
			
		||||
  maxBorrowLimitInEth: new BigNumber(0),
 | 
			
		||||
  maxBorrowLiquidityLimitInEth: new BigNumber(0),
 | 
			
		||||
  status: new BigNumber(0),
 | 
			
		||||
  liquidation: new BigNumber(0),
 | 
			
		||||
  maxLiquidation: new BigNumber(0),
 | 
			
		||||
  ethPriceInUsd: new BigNumber(0),
 | 
			
		||||
  pendingRewards: new BigNumber(0),
 | 
			
		||||
  emodeId: "0",
 | 
			
		||||
  data: [],
 | 
			
		||||
});
 | 
			
		||||
const totalSupply = computed(() =>
 | 
			
		||||
  position.value
 | 
			
		||||
    ? times(
 | 
			
		||||
      position.value.totalSupplyInEth,
 | 
			
		||||
      position.value.ethPriceInUsd
 | 
			
		||||
    ).toFixed()
 | 
			
		||||
    : 0
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
const totalBorrow = computed(() =>
 | 
			
		||||
  position.value
 | 
			
		||||
    ? times(
 | 
			
		||||
      position.value.totalBorrowInEth,
 | 
			
		||||
      position.value.ethPriceInUsd
 | 
			
		||||
    ).toFixed()
 | 
			
		||||
    : 0
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
const ethPriceInUsd = computed(() => position.value?.ethPriceInUsd);
 | 
			
		||||
 | 
			
		||||
const annualPercentageRateTypes = computed(() => [
 | 
			
		||||
  { label: "Variable", value: "variable", rateMode: 2 },
 | 
			
		||||
  { label: "Stable", value: "stable", rateMode: 1 }
 | 
			
		||||
]);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
async function getAaveV3TokenList(web3Instance: Web3, network: Network) {
 | 
			
		||||
  try {
 | 
			
		||||
    let rawData
 | 
			
		||||
 | 
			
		||||
    const uiDataProvider = new web3Instance.eth.Contract(uiDataProviderABI as any, addresses[network].uiData)
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
      rawData = await uiDataProvider.methods.getReservesData(addresses[network].poolDataProvider).call()
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
      console.log(error)
 | 
			
		||||
      return Promise.reject(error)
 | 
			
		||||
    }
 | 
			
		||||
    const tokenList = { tokenData: [], aaveTokensArr: [], rawData }
 | 
			
		||||
    for (const x of rawData[0]) {
 | 
			
		||||
      const ele = atokensV3[network].allTokens.find((y) => {
 | 
			
		||||
        return y.address.toLowerCase() === x.aTokenAddress.toLowerCase()
 | 
			
		||||
      })
 | 
			
		||||
      if (!ele || !tokens[network].getTokenByKey(ele.root)) {
 | 
			
		||||
        tokenList.tokenData.push({
 | 
			
		||||
          root: x.symbol.toLowerCase(),
 | 
			
		||||
          type: 'atoken',
 | 
			
		||||
          symbol: `A${x.symbol}`,
 | 
			
		||||
          name: `AAVE ${x.symbol}`,
 | 
			
		||||
          address: x.aTokenAddress,
 | 
			
		||||
          decimals: x.decimals,
 | 
			
		||||
          factor: new BigNumber(x.baseLTVasCollateral).dividedBy(1e4),
 | 
			
		||||
          key: `a${x.symbol.toLowerCase()}`,
 | 
			
		||||
          underlyingAsset: x.underlyingAsset,
 | 
			
		||||
          supplyCap: x.supplyCap,
 | 
			
		||||
          borrowCap: x.borrowCap,
 | 
			
		||||
          availableLiquidity: new BigNumber(x.availableLiquidity).dividedBy(10 ** x.decimals),
 | 
			
		||||
          totalScaledVariableDebt: new BigNumber(x.totalScaledVariableDebt).dividedBy(10 ** x.decimals),
 | 
			
		||||
          totalPrincipalStableDebt: new BigNumber(x.totalPrincipalStableDebt).dividedBy(10 ** x.decimals),
 | 
			
		||||
          reserveLiquidationBonus: new BigNumber(x.reserveLiquidationBonus).dividedBy(1e4),
 | 
			
		||||
          eModeLiquidationThreshold: new BigNumber(x.eModeLiquidationThreshold).dividedBy(1e4),
 | 
			
		||||
          eModeLiquidationBonus: new BigNumber(x.eModeLiquidationBonus).dividedBy(1e4),
 | 
			
		||||
          eModeLtv: new BigNumber(x.eModeLtv).dividedBy(1e4),
 | 
			
		||||
          borrowableInIsolation: x.borrowableInIsolation,
 | 
			
		||||
          isolatedModeDebtCeilingInUsd: new BigNumber(x.debtCeiling).dividedBy(10 ** x.debtCeilingDecimals),
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
        tokenList.tokenData.push({
 | 
			
		||||
          ...ele,
 | 
			
		||||
          underlyingAsset: x.underlyingAsset,
 | 
			
		||||
          supplyCap: x.supplyCap,
 | 
			
		||||
          borrowCap: x.borrowCap,
 | 
			
		||||
          availableLiquidity: new BigNumber(x.availableLiquidity).dividedBy(10 ** x.decimals),
 | 
			
		||||
          totalScaledVariableDebt: new BigNumber(x.totalScaledVariableDebt).dividedBy(10 ** x.decimals),
 | 
			
		||||
          totalPrincipalStableDebt: new BigNumber(x.totalPrincipalStableDebt).dividedBy(10 ** x.decimals),
 | 
			
		||||
          reserveLiquidationBonus: new BigNumber(x.reserveLiquidationBonus).dividedBy(1e4),
 | 
			
		||||
          eModeLiquidationThreshold: new BigNumber(x.eModeLiquidationThreshold).dividedBy(1e4),
 | 
			
		||||
          eModeLiquidationBonus: new BigNumber(x.eModeLiquidationBonus).dividedBy(1e4),
 | 
			
		||||
          eModeLtv: new BigNumber(x.eModeLtv).dividedBy(1e4),
 | 
			
		||||
          borrowableInIsolation: x.borrowableInIsolation,
 | 
			
		||||
          isolatedModeDebtCeilingInUsd: new BigNumber(x.debtCeiling).dividedBy(10 ** x.debtCeilingDecimals),
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
      tokenList.aaveTokensArr.push(x.underlyingAsset)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return tokenList
 | 
			
		||||
  } catch (error) {
 | 
			
		||||
    console.log(error)
 | 
			
		||||
    return Promise.reject(error)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export function useAaveV3Position(
 | 
			
		||||
  { overridePosition } = { overridePosition: null }
 | 
			
		||||
) {
 | 
			
		||||
  overridePosition = overridePosition || (pos => pos);
 | 
			
		||||
 | 
			
		||||
  const { library, chainId } = useWeb3();
 | 
			
		||||
  const { activeNetworkId } = useNetwork();
 | 
			
		||||
  const { activeAccount } = useDSA();
 | 
			
		||||
  const { getTokenByKey, allATokensV3 } = useToken();
 | 
			
		||||
  const { byMaxSupplyOrBorrowDesc } = useSorting();
 | 
			
		||||
  const { onEvent } = useEventBus();
 | 
			
		||||
 | 
			
		||||
  const resolver = computed(
 | 
			
		||||
    () =>
 | 
			
		||||
      // @ts-ignore
 | 
			
		||||
      addresses[activeNetworkId.value]?.resolver?.aave_v3
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  const fetchPosition = async () => {
 | 
			
		||||
    if (!library.value) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!activeAccount.value) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    const multicall = new Multicall({
 | 
			
		||||
      multicallCustomContractAddress: activeNetworkId.value === Network.Optimism ? '0xca11bde05977b3631167028862be2a173976ca11' : undefined,
 | 
			
		||||
      web3Instance: library.value,
 | 
			
		||||
      tryAggregate: true,
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    const { tokenData, aaveTokensArr, rawData } = await getAaveV3TokenList(library.value, activeNetworkId.value)
 | 
			
		||||
 | 
			
		||||
    const contractCallContext = []
 | 
			
		||||
 | 
			
		||||
    tokenData.forEach((atoken, i) => {
 | 
			
		||||
      contractCallContext.push(
 | 
			
		||||
        {
 | 
			
		||||
          reference: `domainSeperatorCall${i}`,
 | 
			
		||||
          contractAddress: atoken.address,
 | 
			
		||||
          abi: ['function DOMAIN_SEPARATOR() public view returns (bytes32)'],
 | 
			
		||||
          calls: [{ reference: `domainSeperatorCall, ${i}`, methodName: 'DOMAIN_SEPARATOR', methodParameters: [] }],
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          reference: `userNonce${i}`,
 | 
			
		||||
          contractAddress: atoken.address,
 | 
			
		||||
          abi: ['function nonces(address owner) public view returns (uint256)'],
 | 
			
		||||
          calls: [{ reference: `userNonce, ${i}`, methodName: 'nonces', methodParameters: [activeAccount.value.address] }],
 | 
			
		||||
        },
 | 
			
		||||
      )
 | 
			
		||||
    })
 | 
			
		||||
    const aaveResolverInstance = new library.value.eth.Contract(
 | 
			
		||||
      aaveV3ABI as AbiItem[],
 | 
			
		||||
      resolver.value
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    const [aaveRawData, ethPrice] = await Promise.all([
 | 
			
		||||
      aaveResolverInstance.methods.getPosition(activeAccount.value.address, aaveTokensArr).call(),
 | 
			
		||||
      aaveResolverInstance.methods.getEthPrice().call(),
 | 
			
		||||
 | 
			
		||||
    ])
 | 
			
		||||
 | 
			
		||||
    const results = (await multicall.call(contractCallContext)).results
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    const newPos = calculateAavePosition(
 | 
			
		||||
      aaveRawData,
 | 
			
		||||
      rawData,
 | 
			
		||||
      tokenData,
 | 
			
		||||
      ethPrice,
 | 
			
		||||
      results,
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    return newPos;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  const refreshPosition = async () => {
 | 
			
		||||
    position.value = await fetchPosition();
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  onEvent("protocol::aaveV3::refresh", refreshPosition);
 | 
			
		||||
 | 
			
		||||
  watch(
 | 
			
		||||
    library,
 | 
			
		||||
    async val => {
 | 
			
		||||
      if (val) {
 | 
			
		||||
        refreshPosition();
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    { immediate: true }
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  watch(
 | 
			
		||||
    activeAccount,
 | 
			
		||||
    async val => {
 | 
			
		||||
      if (val) {
 | 
			
		||||
        refreshPosition();
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    { immediate: true }
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  const stats = computed(() =>
 | 
			
		||||
    displayPositions.value.reduce(
 | 
			
		||||
      (stats, { key, supply, borrow, priceInEth, factor, liquidation }) => {
 | 
			
		||||
        if (key === "eth") {
 | 
			
		||||
          stats.ethSupplied = supply;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        stats.totalSupplyInEth = plus(
 | 
			
		||||
          stats.totalSupplyInEth,
 | 
			
		||||
          times(supply, priceInEth)
 | 
			
		||||
        ).toFixed();
 | 
			
		||||
        stats.totalBorrowInEth = plus(
 | 
			
		||||
          stats.totalBorrowInEth,
 | 
			
		||||
          times(borrow, priceInEth)
 | 
			
		||||
        ).toFixed();
 | 
			
		||||
        stats.totalMaxBorrowLimitInEth = plus(
 | 
			
		||||
          stats.totalMaxBorrowLimitInEth,
 | 
			
		||||
          times(supply, times(priceInEth, factor))
 | 
			
		||||
        ).toFixed();
 | 
			
		||||
        stats.totalMaxLiquidationLimitInEth = plus(
 | 
			
		||||
          stats.totalMaxLiquidationLimitInEth,
 | 
			
		||||
          times(supply, times(priceInEth, liquidation))
 | 
			
		||||
        ).toFixed();
 | 
			
		||||
 | 
			
		||||
        return stats;
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        totalSupplyInEth: "0",
 | 
			
		||||
        totalBorrowInEth: "0",
 | 
			
		||||
        totalMaxBorrowLimitInEth: "0",
 | 
			
		||||
        totalMaxLiquidationLimitInEth: "0",
 | 
			
		||||
        ethSupplied: "0"
 | 
			
		||||
      }
 | 
			
		||||
    )
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  const rewardTokenPriceInUsd = computed(() => {
 | 
			
		||||
    if (activeNetworkId.value === Network.Polygon) {
 | 
			
		||||
      return ensureValue(
 | 
			
		||||
        position.value.data.find(position => position.key === "matic")
 | 
			
		||||
          ?.priceInUsd
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
    return ensureValue(
 | 
			
		||||
      position.value.data.find(position => position.key === "aave")?.priceInUsd
 | 
			
		||||
    );
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  const displayPositions = computed(() => {
 | 
			
		||||
    if (!position.value) {
 | 
			
		||||
      return [];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return allATokensV3.value
 | 
			
		||||
      .flatMap(atoken => {
 | 
			
		||||
        const token = getTokenByKey(atoken.root);
 | 
			
		||||
 | 
			
		||||
        const atokenPosition = position.value.data.find(
 | 
			
		||||
          x => x.key === atoken.root
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        const p = getPositionOrDefaultPosition(token, atokenPosition);
 | 
			
		||||
 | 
			
		||||
        if (gt(p.supply, "0") && gt(p.borrow, "0")) {
 | 
			
		||||
          return [
 | 
			
		||||
            { ...p, type: "supply" },
 | 
			
		||||
            { ...p, type: "borrow" }
 | 
			
		||||
          ];
 | 
			
		||||
        } else {
 | 
			
		||||
          return [p];
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      .sort((a, b) =>
 | 
			
		||||
        minus(
 | 
			
		||||
          max(b.supplyUsd, b.borrowUsd),
 | 
			
		||||
          max(a.supplyUsd, a.borrowUsd)
 | 
			
		||||
        ).toNumber()
 | 
			
		||||
      )
 | 
			
		||||
      .map(overridePosition)
 | 
			
		||||
      .sort(byMaxSupplyOrBorrowDesc);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  function getPositionOrDefaultPosition(token, position) {
 | 
			
		||||
    if (!position) {
 | 
			
		||||
      const defaultPosition = {
 | 
			
		||||
        key: token.key,
 | 
			
		||||
        aTokenKey: "",
 | 
			
		||||
        aTokenBal: "0",
 | 
			
		||||
        aDecimals: "0",
 | 
			
		||||
        cf: "0",
 | 
			
		||||
        ll: "0",
 | 
			
		||||
        supply: "0",
 | 
			
		||||
        supplyUsd: "0",
 | 
			
		||||
        supplyRate: "0",
 | 
			
		||||
        borrow: "0",
 | 
			
		||||
        borrowUsd: "0",
 | 
			
		||||
        borrowRate: "0",
 | 
			
		||||
        type: "no",
 | 
			
		||||
        isEnabledAsCollateral: true,
 | 
			
		||||
        borrowEnabled: true,
 | 
			
		||||
        availableLiquidity: "0",
 | 
			
		||||
        stableBorrowEnabled: true,
 | 
			
		||||
        borrowStable: "0",
 | 
			
		||||
        borrowStableRate: "0",
 | 
			
		||||
        supplyRewardRate: "0",
 | 
			
		||||
        borrowRewardRate: "0"
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      return defaultPosition;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      key: token.key,
 | 
			
		||||
      aTokenKey: position.aTokenKey,
 | 
			
		||||
      aTokenBal: position.aTokenBal,
 | 
			
		||||
      aDecimals: position.aDecimals,
 | 
			
		||||
      cf: position.factor,
 | 
			
		||||
      ll: position.liquidation,
 | 
			
		||||
      factor: position.factor,
 | 
			
		||||
      liquidation: position.liquidation,
 | 
			
		||||
      supply: position.supply,
 | 
			
		||||
      supplyUsd: times(position.supply, position.priceInUsd).toFixed(),
 | 
			
		||||
      supplyRate: position.supplyRate,
 | 
			
		||||
      borrow: position.borrow,
 | 
			
		||||
      borrowUsd: times(position.borrow, position.priceInUsd).toFixed(),
 | 
			
		||||
      borrowRate: position.borrowRate,
 | 
			
		||||
      priceInEth: position.priceInEth,
 | 
			
		||||
      type: getType(position),
 | 
			
		||||
      isEnabledAsCollateral: position.isEnabledAsCollateral,
 | 
			
		||||
      borrowEnabled: position.borrowEnabled,
 | 
			
		||||
      availableLiquidity: position.availableLiquidity,
 | 
			
		||||
      borrowStableUsd: times(
 | 
			
		||||
        position.borrowStable,
 | 
			
		||||
        position.priceInUsd
 | 
			
		||||
      ).toFixed(),
 | 
			
		||||
      stableBorrowEnabled: position.stableBorrowEnabled,
 | 
			
		||||
      borrowStable: position.borrowStable,
 | 
			
		||||
      borrowStableRate: position.borrowStableRate,
 | 
			
		||||
      priceInUsd: position.priceInUsd,
 | 
			
		||||
      supplyRewardRate: times(
 | 
			
		||||
        position.supplyRewardRate,
 | 
			
		||||
        rewardTokenPriceInUsd.value
 | 
			
		||||
      ).toFixed(),
 | 
			
		||||
      borrowRewardRate: times(
 | 
			
		||||
        position.borrowRewardRate,
 | 
			
		||||
        rewardTokenPriceInUsd.value
 | 
			
		||||
      ).toFixed()
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const maxLiquidation = computed(() => {
 | 
			
		||||
    if (isZero(stats.value.totalSupplyInEth)) return "0";
 | 
			
		||||
 | 
			
		||||
    return max(
 | 
			
		||||
      div(
 | 
			
		||||
        stats.value.totalMaxLiquidationLimitInEth,
 | 
			
		||||
        stats.value.totalSupplyInEth
 | 
			
		||||
      ),
 | 
			
		||||
      "0"
 | 
			
		||||
    ).toFixed();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  const liquidationPrice = computed(() => {
 | 
			
		||||
    if (isZero(stats.value.ethSupplied)) return "0";
 | 
			
		||||
 | 
			
		||||
    return max(
 | 
			
		||||
      times(
 | 
			
		||||
        div(
 | 
			
		||||
          stats.value.totalBorrowInEth,
 | 
			
		||||
          stats.value.totalMaxLiquidationLimitInEth
 | 
			
		||||
        ),
 | 
			
		||||
        ethPriceInUsd.value
 | 
			
		||||
      ),
 | 
			
		||||
      "0"
 | 
			
		||||
    ).toFixed();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  const status = computed(() => {
 | 
			
		||||
    if (
 | 
			
		||||
      isZero(stats.value.totalSupplyInEth) &&
 | 
			
		||||
      !isZero(stats.value.totalBorrowInEth)
 | 
			
		||||
    )
 | 
			
		||||
      return "1.1";
 | 
			
		||||
    if (isZero(stats.value.totalSupplyInEth)) return "0";
 | 
			
		||||
 | 
			
		||||
    return max(
 | 
			
		||||
      div(stats.value.totalBorrowInEth, stats.value.totalSupplyInEth),
 | 
			
		||||
      "0"
 | 
			
		||||
    ).toFixed();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  const liquidation = computed(() => {
 | 
			
		||||
    if (isZero(stats.value.totalSupplyInEth)) return "0";
 | 
			
		||||
 | 
			
		||||
    return max(
 | 
			
		||||
      div(stats.value.totalMaxBorrowLimitInEth, stats.value.totalSupplyInEth),
 | 
			
		||||
      "0"
 | 
			
		||||
    ).toFixed();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  return {
 | 
			
		||||
    stats,
 | 
			
		||||
    displayPositions,
 | 
			
		||||
    position,
 | 
			
		||||
    fetchPosition,
 | 
			
		||||
    refreshPosition,
 | 
			
		||||
    totalSupply,
 | 
			
		||||
    totalBorrow,
 | 
			
		||||
    status,
 | 
			
		||||
    liquidation,
 | 
			
		||||
    maxLiquidation,
 | 
			
		||||
    liquidationPrice,
 | 
			
		||||
    liquidationMaxPrice: ethPriceInUsd,
 | 
			
		||||
    annualPercentageRateTypes
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function calculateAavePosition(res: any[], rawData: any[], tokenList: any[], ethPrice: any, multiCallResults: any) {
 | 
			
		||||
  console.log({
 | 
			
		||||
    res,
 | 
			
		||||
    rawData,
 | 
			
		||||
    tokenList,
 | 
			
		||||
    ethPrice,
 | 
			
		||||
    multiCallResults,
 | 
			
		||||
  })
 | 
			
		||||
  try {
 | 
			
		||||
    ethPrice = new BigNumber(ethPrice).dividedBy(1e8)
 | 
			
		||||
 | 
			
		||||
    const dataPos = []
 | 
			
		||||
    const AaveV3UserData = res[0]
 | 
			
		||||
    const [
 | 
			
		||||
      totalCollateralBase,
 | 
			
		||||
      totalBorrowsBase,
 | 
			
		||||
      _availableBorrowsBase,
 | 
			
		||||
      currentLiquidationThreshold,
 | 
			
		||||
      ltv,
 | 
			
		||||
      _healthFactor,
 | 
			
		||||
      eModeId,
 | 
			
		||||
      _base,
 | 
			
		||||
    ] = AaveV3UserData
 | 
			
		||||
 | 
			
		||||
    // const tokenUiData = rawData[0]
 | 
			
		||||
    const baseCurrencyInfo = rawData[1]
 | 
			
		||||
 | 
			
		||||
    // const [baseUnit, baseInUSD] = baseCurrencyInfo
 | 
			
		||||
    const [baseUnit] = baseCurrencyInfo
 | 
			
		||||
 | 
			
		||||
    const newPosition: any = {
 | 
			
		||||
      totalSupplyInEth: new BigNumber(0),
 | 
			
		||||
      totalBorrowInEth: new BigNumber(0),
 | 
			
		||||
      totalSupplyInUsd: new BigNumber(totalCollateralBase).dividedBy(baseUnit).toFixed(),
 | 
			
		||||
      totalBorrowInUsd: new BigNumber(totalBorrowsBase).dividedBy(baseUnit).toFixed(),
 | 
			
		||||
      totalBorrowStableInEth: new BigNumber(0),
 | 
			
		||||
      totalBorrowVariableInEth: new BigNumber(0),
 | 
			
		||||
      maxBorrowLimitInEth: new BigNumber(0),
 | 
			
		||||
      maxBorrowLiquidityLimitInEth: new BigNumber(0),
 | 
			
		||||
      status: new BigNumber(0),
 | 
			
		||||
      liquidation: new BigNumber(ltv).dividedBy(1e4),
 | 
			
		||||
      maxLiquidation: new BigNumber(currentLiquidationThreshold).dividedBy(1e4),
 | 
			
		||||
      ethPriceInUsd: new BigNumber(ethPrice),
 | 
			
		||||
      pendingRewards: new BigNumber(0),
 | 
			
		||||
      emodeId: eModeId,
 | 
			
		||||
      data: [],
 | 
			
		||||
      // tokens: {},
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    tokenList.forEach((atoken, i) => {
 | 
			
		||||
      /* eslint-disable no-unused-vars */
 | 
			
		||||
      const [
 | 
			
		||||
        supplyBalanceInWei,
 | 
			
		||||
        borrowStableBalanceInWei,
 | 
			
		||||
        borrowVariableBalanceInWei,
 | 
			
		||||
        supplyRatePerBlock,
 | 
			
		||||
        borrowStableRatePerBlock,
 | 
			
		||||
        userStableBorrowRatePerBlock,
 | 
			
		||||
        borrowVariableRatePerBlock,
 | 
			
		||||
        isCollateralEnabled,
 | 
			
		||||
        price,
 | 
			
		||||
        flag,
 | 
			
		||||
      ] = res[1][i]
 | 
			
		||||
      const [usageAsCollateralEnabled, borrowEnabled, stableBorrowEnabled, isActive, isFrozen] = flag
 | 
			
		||||
 | 
			
		||||
      const [
 | 
			
		||||
        asset,
 | 
			
		||||
        symbol,
 | 
			
		||||
        decimals,
 | 
			
		||||
        ltv,
 | 
			
		||||
        threshold,
 | 
			
		||||
        reserveFactor,
 | 
			
		||||
        totalSupply,
 | 
			
		||||
        availableLiquidity,
 | 
			
		||||
        totalStableDebt,
 | 
			
		||||
        totalVariableDebt,
 | 
			
		||||
        reserves,
 | 
			
		||||
        aaveV3Token,
 | 
			
		||||
        // collateralEmission,
 | 
			
		||||
        // debtEmission,
 | 
			
		||||
        // aTokenAddress,
 | 
			
		||||
        // stableDebtTokenAddress,
 | 
			
		||||
        // variableDebtTokenAddress,
 | 
			
		||||
      ] = res[2][i]
 | 
			
		||||
      /* eslint-enable no-unused-vars */
 | 
			
		||||
 | 
			
		||||
      const [aTokenAddr, sTokenAddr, vTokenAddr] = reserves
 | 
			
		||||
 | 
			
		||||
      // Reward Info: TODO
 | 
			
		||||
      // const rewardInfo = res[3][i]
 | 
			
		||||
      // const aIncentiveData = rewardInfo[1]
 | 
			
		||||
      // const rewardsTokenInfo = aIncentiveData.rewardsTokenInfo
 | 
			
		||||
      // const UserRewardInfo = {
 | 
			
		||||
      //   rewardTokenSymbol: rewardsTokenInfo[0],
 | 
			
		||||
      //   rewardTokenDecimals: rewardsTokenInfo[4],
 | 
			
		||||
      //   rewardTokenAddress: rewardsTokenInfo[1],
 | 
			
		||||
      //   userUnclaimedRewards: rewardsTokenInfo[3],
 | 
			
		||||
      // }
 | 
			
		||||
 | 
			
		||||
      const [, , eModeCategory] = aaveV3Token
 | 
			
		||||
      const root = atoken.root
 | 
			
		||||
      const factor = new BigNumber(ltv).dividedBy(1e4)
 | 
			
		||||
      const priceInUsd = new BigNumber(price).dividedBy(baseUnit).toFixed()
 | 
			
		||||
      const priceInEth = new BigNumber(priceInUsd).dividedBy(ethPrice)
 | 
			
		||||
      const supply = new BigNumber(supplyBalanceInWei).dividedBy(10 ** decimals)
 | 
			
		||||
      const borrowStable = new BigNumber(borrowStableBalanceInWei).dividedBy(10 ** decimals)
 | 
			
		||||
      const borrowVariable = new BigNumber(borrowVariableBalanceInWei).dividedBy(10 ** decimals)
 | 
			
		||||
      const supplyRate = new BigNumber(supplyRatePerBlock).dividedBy(1e27).toFixed()
 | 
			
		||||
      const supplyYield = supplyRate
 | 
			
		||||
      const borrowStableRate = new BigNumber(borrowStableRatePerBlock).dividedBy(1e27).toFixed()
 | 
			
		||||
      const userBorrowStableRate = new BigNumber(userStableBorrowRatePerBlock).dividedBy(1e27).toFixed()
 | 
			
		||||
      const borrowVariableRate = new BigNumber(borrowVariableRatePerBlock).dividedBy(1e27).toFixed()
 | 
			
		||||
      const borrowStableYield = borrowStableRate
 | 
			
		||||
      const borrowVariableYield = borrowVariableRate
 | 
			
		||||
 | 
			
		||||
      // const totalSupplied = new BigNumber(totalSupply).dividedBy(10 ** decimals).multipliedBy(priceInUsd)
 | 
			
		||||
      // const totalDebt = BigNumber.sum(BigNumber(totalVariableDebt), BigNumber(totalStableDebt))
 | 
			
		||||
 | 
			
		||||
      //   .dividedBy(10 ** decimals)
 | 
			
		||||
      //   .multipliedBy(priceInUsd)
 | 
			
		||||
 | 
			
		||||
      //   const supplyRewardRate = new BigNumber(collateralEmission)
 | 
			
		||||
      //     .multipliedBy(31536000)
 | 
			
		||||
      //     .dividedBy(1e18)
 | 
			
		||||
      //     .dividedBy(totalSupplied)
 | 
			
		||||
      //     .toFixed()
 | 
			
		||||
      //   const borrowRewardRate = new BigNumber(debtEmission)
 | 
			
		||||
      //     .multipliedBy(31536000)
 | 
			
		||||
      //     .dividedBy(1e18)
 | 
			
		||||
      //     .dividedBy(totalDebt)
 | 
			
		||||
      //     .toFixed()
 | 
			
		||||
 | 
			
		||||
      newPosition.totalSupplyInEth = newPosition.totalSupplyInEth.plus(supply.multipliedBy(priceInEth))
 | 
			
		||||
      newPosition.maxBorrowLimitInEth = newPosition.maxBorrowLimitInEth.plus(
 | 
			
		||||
        supply.multipliedBy(priceInEth).multipliedBy(factor),
 | 
			
		||||
      )
 | 
			
		||||
      newPosition.maxBorrowLiquidityLimitInEth = newPosition.maxBorrowLiquidityLimitInEth.plus(
 | 
			
		||||
        supply.multipliedBy(priceInEth).multipliedBy((threshold / 10000).toString()),
 | 
			
		||||
      )
 | 
			
		||||
      newPosition.totalBorrowInEth = newPosition.totalBorrowInEth.plus(
 | 
			
		||||
        borrowStable.plus(borrowVariable).multipliedBy(priceInEth),
 | 
			
		||||
      )
 | 
			
		||||
      newPosition.totalBorrowStableInEth = newPosition.totalBorrowStableInEth.plus(borrowStable.multipliedBy(priceInEth))
 | 
			
		||||
      newPosition.totalBorrowVariableInEth = newPosition.totalBorrowVariableInEth.plus(
 | 
			
		||||
        borrowVariable.multipliedBy(priceInEth),
 | 
			
		||||
      )
 | 
			
		||||
 | 
			
		||||
      dataPos.push({
 | 
			
		||||
        key: root,
 | 
			
		||||
        underlyingTokenAddress: atoken.underlyingAsset,
 | 
			
		||||
        aTokenAddr: aTokenAddr[0],
 | 
			
		||||
        stableDebtTokenAddress: sTokenAddr[0],
 | 
			
		||||
        variableDebtTokenAddress: vTokenAddr[0],
 | 
			
		||||
        aTokenBal: supplyBalanceInWei,
 | 
			
		||||
        aTokenKey: atoken.key,
 | 
			
		||||
        aDecimals: atoken.decimals.toString(),
 | 
			
		||||
        priceInEth: priceInEth.toFixed(),
 | 
			
		||||
        priceInUsd,
 | 
			
		||||
        liquidationBonus: new BigNumber(atoken.reserveLiquidationBonus).toString(),
 | 
			
		||||
        supply: supply.toFixed(),
 | 
			
		||||
        borrowStable: borrowStable.toFixed(),
 | 
			
		||||
        borrowCap: atoken.borrowCap,
 | 
			
		||||
        supplyCap: atoken.supplyCap,
 | 
			
		||||
        borrow: borrowVariable.toFixed(), // TODO: change later
 | 
			
		||||
        supplyRate,
 | 
			
		||||
        supplyYield,
 | 
			
		||||
        borrowStableRate,
 | 
			
		||||
        userBorrowStableRate,
 | 
			
		||||
        borrowStableYield,
 | 
			
		||||
        borrowRate: borrowVariableRate, // TODO: change later
 | 
			
		||||
        borrowYield: borrowVariableYield, // TODO: change later
 | 
			
		||||
        factor: factor.toFixed(),
 | 
			
		||||
        liquidation: (threshold / 10000).toString(),
 | 
			
		||||
        isEnabledAsCollateral: isCollateralEnabled,
 | 
			
		||||
        borrowEnabled,
 | 
			
		||||
        stableBorrowEnabled,
 | 
			
		||||
        availableLiquidity: atoken.availableLiquidity.toFixed(0),
 | 
			
		||||
        totalScaledVariableDebt: atoken.totalScaledVariableDebt.toFixed(0),
 | 
			
		||||
        totalScaledStableDebt: atoken.totalPrincipalStableDebt.toFixed(0),
 | 
			
		||||
        eModeCategory,
 | 
			
		||||
        eModeFactor: new BigNumber(atoken.eModeLtv).toString(),
 | 
			
		||||
        eModeLiquidation: new BigNumber(atoken.eModeLiquidationThreshold).toString(),
 | 
			
		||||
        eModeLiquidationBonus: new BigNumber(atoken.eModeLiquidationBonus).toString(),
 | 
			
		||||
        eModeLabel: atoken.eModeLabel,
 | 
			
		||||
        borrowableInIsolation: atoken.borrowableInIsolation,
 | 
			
		||||
        isIsolatedAsset: atoken.isolatedModeDebtCeilingInUsd > 0,
 | 
			
		||||
        isolationDebtCeiling: atoken.isolatedModeDebtCeilingInUsd,
 | 
			
		||||
        UserRewardInfo: {},
 | 
			
		||||
        domainSeperator: multiCallResults[`domainSeperatorCall${i}`].callsReturnContext[0].returnValues,
 | 
			
		||||
        atokenNonce: new BigNumber(multiCallResults[`userNonce${i}`].callsReturnContext[0].returnValues).toString(),
 | 
			
		||||
        // supplyRewardRate,
 | 
			
		||||
        // borrowRewardRate,
 | 
			
		||||
      })
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    const totalSupplyInEthIsZero = newPosition.totalSupplyInEth.isZero()
 | 
			
		||||
    const status = totalSupplyInEthIsZero ? 0 : newPosition.totalBorrowInEth.dividedBy(newPosition.totalSupplyInEth).toFixed()
 | 
			
		||||
 | 
			
		||||
    // const pendingRewards = new BigNumber(res[1].pendingRewards).dividedBy(1e18).toFixed()
 | 
			
		||||
 | 
			
		||||
    newPosition.totalSupplyInEth = newPosition.totalSupplyInEth.toFixed()
 | 
			
		||||
    newPosition.totalBorrowInEth = newPosition.totalBorrowInEth.toFixed()
 | 
			
		||||
    newPosition.maxBorrowLimitInEth = newPosition.maxBorrowLimitInEth.toFixed()
 | 
			
		||||
    newPosition.maxBorrowLiquidityLimitInEth = newPosition.maxBorrowLiquidityLimitInEth.toFixed()
 | 
			
		||||
    newPosition.totalBorrowStableInEth = newPosition.totalBorrowStableInEth.toFixed()
 | 
			
		||||
    newPosition.totalBorrowVariableInEth = newPosition.totalBorrowVariableInEth.toFixed()
 | 
			
		||||
 | 
			
		||||
    newPosition.status = status
 | 
			
		||||
    newPosition.pendingRewards = 0 // TODO = pendingRewards
 | 
			
		||||
 | 
			
		||||
    newPosition.data = dataPos
 | 
			
		||||
 | 
			
		||||
    return newPosition
 | 
			
		||||
  } catch (error) {
 | 
			
		||||
    console.error(error);
 | 
			
		||||
    return Promise.reject(error);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -14,6 +14,11 @@ import SidebarAaveV2Withdraw from '~/components/sidebar/context/aaveV2/SidebarAa
 | 
			
		|||
import SidebarAaveV2Borrow from '~/components/sidebar/context/aaveV2/SidebarAaveV2Borrow.vue'
 | 
			
		||||
import SidebarAaveV2Payback from '~/components/sidebar/context/aaveV2/SidebarAaveV2Payback.vue'
 | 
			
		||||
 | 
			
		||||
import SidebarAaveV3Supply from "~/components/sidebar/context/aaveV3/SidebarAaveV3Supply.vue";
 | 
			
		||||
import SidebarAaveV3Withdraw from '~/components/sidebar/context/aaveV3/SidebarAaveV3Withdraw.vue'
 | 
			
		||||
import SidebarAaveV3Borrow from '~/components/sidebar/context/aaveV3/SidebarAaveV3Borrow.vue'
 | 
			
		||||
import SidebarAaveV3Payback from '~/components/sidebar/context/aaveV3/SidebarAaveV3Payback.vue'
 | 
			
		||||
 | 
			
		||||
import SidebarOverview from '~/components/sidebar/context/overview/SidebarOverview.vue'
 | 
			
		||||
import SidebarDepositOverview from '~/components/sidebar/context/SidebarDepositOverview.vue'
 | 
			
		||||
import SidebarWithdraw from '~/components/sidebar/context/SidebarWithdraw.vue'
 | 
			
		||||
| 
						 | 
				
			
			@ -56,8 +61,8 @@ import SidebarStrategySelection from '~/components/sidebar/context/strategy/Side
 | 
			
		|||
import SidebarStrategy from '~/components/sidebar/context/strategy/SidebarStrategy.vue'
 | 
			
		||||
 | 
			
		||||
const sidebars = {
 | 
			
		||||
  "#overview" :  {component: SidebarOverview, back : false, close : true },
 | 
			
		||||
  "#deposit-overview": {component: SidebarDepositOverview, back: { hash: 'overview' }  },
 | 
			
		||||
  "#overview": { component: SidebarOverview, back: false, close: true },
 | 
			
		||||
  "#deposit-overview": { component: SidebarDepositOverview, back: { hash: 'overview' } },
 | 
			
		||||
  '#withdraw-token': { component: SidebarWithdraw, back: { hash: 'overview' } },
 | 
			
		||||
  '#strategies': { component: SidebarStrategySelection },
 | 
			
		||||
  '#strategy': { component: SidebarStrategy },
 | 
			
		||||
| 
						 | 
				
			
			@ -107,6 +112,12 @@ const sidebars = {
 | 
			
		|||
  "/mainnet/yearn-v2": { component: null },
 | 
			
		||||
  "/mainnet/yearn-v2#supply": { component: SidebarYearnV2Supply },
 | 
			
		||||
  "/mainnet/yearn-v2#withdraw": { component: SidebarYearnV2Withdraw },
 | 
			
		||||
 | 
			
		||||
  "/aave-v3": { component: null },
 | 
			
		||||
  "/aave-v3#supply": { component: SidebarAaveV3Supply },
 | 
			
		||||
  "/aave-v3#borrow": { component: SidebarAaveV3Borrow },
 | 
			
		||||
  "/aave-v3#payback": { component: SidebarAaveV3Payback },
 | 
			
		||||
  "/aave-v3#withdraw": { component: SidebarAaveV3Withdraw },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const sidebar = ref(null);
 | 
			
		||||
| 
						 | 
				
			
			@ -130,15 +141,15 @@ export function init() {
 | 
			
		|||
 | 
			
		||||
      //@ts-ignore
 | 
			
		||||
      const [hash, params] = route.hash.split("?");
 | 
			
		||||
      
 | 
			
		||||
      if (hasPathChanged){
 | 
			
		||||
 | 
			
		||||
      if (hasPathChanged) {
 | 
			
		||||
        router.push({ hash: null })
 | 
			
		||||
        return
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
       //@ts-ignore
 | 
			
		||||
      //@ts-ignore
 | 
			
		||||
      sidebar.value = sidebars[route.path + hash] || sidebars[hash];
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
      if (!sidebar.value) {
 | 
			
		||||
        props.value = {};
 | 
			
		||||
        return;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
import { computed } from "@nuxtjs/composition-api";
 | 
			
		||||
import atokensV2 from "~/constant/atokensV2";
 | 
			
		||||
import atokensV3 from "~/constant/atokensV3";
 | 
			
		||||
import tokens from "~/constant/tokens";
 | 
			
		||||
import { useBigNumber } from "./useBigNumber";
 | 
			
		||||
import { useNetwork } from "./useNetwork";
 | 
			
		||||
| 
						 | 
				
			
			@ -14,6 +15,7 @@ export function useToken() {
 | 
			
		|||
    );
 | 
			
		||||
 | 
			
		||||
  const allATokensV2 = computed(() => atokensV2[activeNetworkId.value].allTokens);
 | 
			
		||||
  const allATokensV3 = computed(() => atokensV3[activeNetworkId.value].allTokens);
 | 
			
		||||
 | 
			
		||||
  function valInt(val, decimals) {
 | 
			
		||||
    const num = toBN(val);
 | 
			
		||||
| 
						 | 
				
			
			@ -24,6 +26,7 @@ export function useToken() {
 | 
			
		|||
  return {
 | 
			
		||||
    getTokenByKey,
 | 
			
		||||
    allATokensV2,
 | 
			
		||||
    allATokensV3,
 | 
			
		||||
    valInt
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,9 @@ const addresses = {
 | 
			
		|||
      bprotocol: "0x3843019c19259117ed473947007bcafc5c0c7129",
 | 
			
		||||
      yearnV2: "0x3f6DCA8a0b7d04737BC3B2aEAbeB1C09431581f0",
 | 
			
		||||
      universe: "0xa7963898453c00b61cff8ce7e5b28c4e8bf1348f"
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
    uiData: undefined,
 | 
			
		||||
    poolDataProvider: undefined,
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  polygon: {
 | 
			
		||||
| 
						 | 
				
			
			@ -25,13 +27,16 @@ const addresses = {
 | 
			
		|||
    },
 | 
			
		||||
    resolver: {
 | 
			
		||||
      aave_v2: "0x1f5e200493adB54FEB4a7D734E48649143ecE2CA",
 | 
			
		||||
      aave_v3: '0x7cdBD859f2EDA545289378112FD991571d6eb73e',
 | 
			
		||||
      accounts: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
 | 
			
		||||
      balance: "0x04F8a41be023f839E709eeEaA0725FD766139A4d",
 | 
			
		||||
      merkleResolver: {
 | 
			
		||||
        aave_v2: "0x2a26228e607ffD2aB2bD3aA49cBae0eDC6469Bf8"
 | 
			
		||||
      },
 | 
			
		||||
      weth: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
    uiData: '0x8F1AD487C9413d7e81aB5B4E88B024Ae3b5637D0',
 | 
			
		||||
    poolDataProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
 | 
			
		||||
  },
 | 
			
		||||
  arbitrum: {
 | 
			
		||||
    core: {
 | 
			
		||||
| 
						 | 
				
			
			@ -41,11 +46,14 @@ const addresses = {
 | 
			
		|||
    resolver: {
 | 
			
		||||
      accounts: '0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474',
 | 
			
		||||
      balance: '0x29572b16D306acd7ca0CBCA0F08C3EFF131fFDA5',
 | 
			
		||||
      aave_v3: '0x7cdBD859f2EDA545289378112FD991571d6eb73e',
 | 
			
		||||
      uniswap_v3: '0x04F8a41be023f839E709eeEaA0725FD766139A4d',
 | 
			
		||||
      // uniswap_v3_staker: '0x1a96af80ED8753a77E23074De78480675049A3c9',
 | 
			
		||||
      nonfungiblePositionManager: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88',
 | 
			
		||||
    },
 | 
			
		||||
    uniswapV3Staker: '0x1f98407aaB862CdDeF78Ed252D6f557aA5b0f00d',
 | 
			
		||||
    uiData: '0x3f960bB91e85Ae2dB561BDd01B515C5A5c65802b',
 | 
			
		||||
    poolDataProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
 | 
			
		||||
  },
 | 
			
		||||
  avalanche: {
 | 
			
		||||
    core: {
 | 
			
		||||
| 
						 | 
				
			
			@ -54,9 +62,12 @@ const addresses = {
 | 
			
		|||
    },
 | 
			
		||||
    resolver: {
 | 
			
		||||
      aave_v2: '0x43c51C24b49f7cF389D043e93533E5179870Eea3',
 | 
			
		||||
      aave_v3: '0x7cdBD859f2EDA545289378112FD991571d6eb73e',
 | 
			
		||||
      accounts: '0x746e318e179CB0A359C1FeE8331A3F9bE309b3CE',
 | 
			
		||||
      balance: '0xE6F92a3eCAa618FC5D4Bf2a14090787715C115F0',
 | 
			
		||||
    },
 | 
			
		||||
    uiData: '0xdBbFaFC45983B4659E368a3025b81f69Ab6E5093',
 | 
			
		||||
    poolDataProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
 | 
			
		||||
  },
 | 
			
		||||
  optimism: {
 | 
			
		||||
    core: {
 | 
			
		||||
| 
						 | 
				
			
			@ -68,6 +79,8 @@ const addresses = {
 | 
			
		|||
      aave_v3: '0x7cdBD859f2EDA545289378112FD991571d6eb73e',
 | 
			
		||||
      balance: '0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2',
 | 
			
		||||
    },
 | 
			
		||||
    uiData: '0x64f558d4BFC1c03a8c8B2ff84976fF04c762b51f',
 | 
			
		||||
    poolDataProvider: '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb',
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										84
									
								
								constant/atokensV3/arbitrum.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								constant/atokensV3/arbitrum.ts
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,84 @@
 | 
			
		|||
import { createTokenUtils } from '../../utils'
 | 
			
		||||
 | 
			
		||||
export default createTokenUtils([
 | 
			
		||||
  {
 | 
			
		||||
    key: 'adai',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ADAI',
 | 
			
		||||
    name: 'Aave DAI',
 | 
			
		||||
    address: '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'dai',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'alink',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ALINK',
 | 
			
		||||
    name: 'Aave LINK',
 | 
			
		||||
    address: '0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.7,
 | 
			
		||||
    root: 'link',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aeth',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AETH',
 | 
			
		||||
    name: 'Aave ETH',
 | 
			
		||||
    address: '0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.8,
 | 
			
		||||
    root: 'eth',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'ausdc',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AUSDC',
 | 
			
		||||
    name: 'Aave USDC',
 | 
			
		||||
    address: '0x625E7708f30cA75bfd92586e17077590C60eb4cD',
 | 
			
		||||
    decimals: 6,
 | 
			
		||||
    factor: 0.8,
 | 
			
		||||
    root: 'usdc',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'ausdt',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AUSDT',
 | 
			
		||||
    name: 'Aave USDT',
 | 
			
		||||
    address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620',
 | 
			
		||||
    decimals: 6,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'usdt',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'awbtc',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AWBTC',
 | 
			
		||||
    name: 'Aave WBTC',
 | 
			
		||||
    address: '0x078f358208685046a11C85e8ad32895DED33A249',
 | 
			
		||||
    decimals: 8,
 | 
			
		||||
    factor: 0.7,
 | 
			
		||||
    root: 'wbtc',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aaave',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AAAVE',
 | 
			
		||||
    name: 'Aave AAVE',
 | 
			
		||||
    address: '0xf329e36C7bF6E5E86ce2150875a84Ce77f477375',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.5,
 | 
			
		||||
    root: 'aave',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aeurs',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'EURS',
 | 
			
		||||
    name: 'Aave EURS',
 | 
			
		||||
    address: '0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97',
 | 
			
		||||
    decimals: 2,
 | 
			
		||||
    factor: 0.65,
 | 
			
		||||
    root: 'eurs',
 | 
			
		||||
  },
 | 
			
		||||
])
 | 
			
		||||
							
								
								
									
										84
									
								
								constant/atokensV3/avalanche.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								constant/atokensV3/avalanche.ts
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,84 @@
 | 
			
		|||
import { createTokenUtils } from '../../utils'
 | 
			
		||||
 | 
			
		||||
export default createTokenUtils([
 | 
			
		||||
  {
 | 
			
		||||
    key: 'adai',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ADAI',
 | 
			
		||||
    name: 'Aave DAI',
 | 
			
		||||
    address: '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'dai',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'alink',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ALINK',
 | 
			
		||||
    name: 'Aave LINK',
 | 
			
		||||
    address: '0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.5,
 | 
			
		||||
    root: 'link',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aeth',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AETH',
 | 
			
		||||
    name: 'Aave ETH',
 | 
			
		||||
    address: '0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.8,
 | 
			
		||||
    root: 'eth',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'ausdc',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AUSDC',
 | 
			
		||||
    name: 'Aave USDC',
 | 
			
		||||
    address: '0x625E7708f30cA75bfd92586e17077590C60eb4cD',
 | 
			
		||||
    decimals: 6,
 | 
			
		||||
    factor: 0.825,
 | 
			
		||||
    root: 'usdc',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'ausdt',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AUSDT',
 | 
			
		||||
    name: 'Aave USDT',
 | 
			
		||||
    address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620',
 | 
			
		||||
    decimals: 6,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'usdt',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'awbtc',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AWBTC',
 | 
			
		||||
    name: 'Aave WBTC',
 | 
			
		||||
    address: '0x078f358208685046a11C85e8ad32895DED33A249',
 | 
			
		||||
    decimals: 8,
 | 
			
		||||
    factor: 0.7,
 | 
			
		||||
    root: 'wbtc',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aaave',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AAAVE',
 | 
			
		||||
    name: 'Aave AAVE',
 | 
			
		||||
    address: '0xf329e36C7bF6E5E86ce2150875a84Ce77f477375',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.6,
 | 
			
		||||
    root: 'aave',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'awavax',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AWAVAX',
 | 
			
		||||
    name: 'Aave WAVAX',
 | 
			
		||||
    address: '0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.65,
 | 
			
		||||
    root: 'avax',
 | 
			
		||||
  },
 | 
			
		||||
])
 | 
			
		||||
							
								
								
									
										114
									
								
								constant/atokensV3/fantom.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										114
									
								
								constant/atokensV3/fantom.ts
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,114 @@
 | 
			
		|||
import { createTokenUtils } from '../../utils'
 | 
			
		||||
 | 
			
		||||
export default createTokenUtils([
 | 
			
		||||
  {
 | 
			
		||||
    key: 'adai',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ADAI',
 | 
			
		||||
    name: 'Aave DAI',
 | 
			
		||||
    address: '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'dai',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'alink',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ALINK',
 | 
			
		||||
    name: 'Aave LINK',
 | 
			
		||||
    address: '0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.5,
 | 
			
		||||
    root: 'link',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aeth',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AETH',
 | 
			
		||||
    name: 'Aave ETH',
 | 
			
		||||
    address: '0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.8,
 | 
			
		||||
    root: 'eth',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'ausdc',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AUSDC',
 | 
			
		||||
    name: 'Aave USDC',
 | 
			
		||||
    address: '0x625E7708f30cA75bfd92586e17077590C60eb4cD',
 | 
			
		||||
    decimals: 6,
 | 
			
		||||
    factor: 0.825,
 | 
			
		||||
    root: 'usdc',
 | 
			
		||||
  },
 | 
			
		||||
  // {
 | 
			
		||||
  //   key: 'ausdt',
 | 
			
		||||
  //   type: 'atoken',
 | 
			
		||||
  //   symbol: 'AUSDT',
 | 
			
		||||
  //   name: 'Aave USDT',
 | 
			
		||||
  //   address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620',
 | 
			
		||||
  //   decimals: 6,
 | 
			
		||||
  //   factor: 0,
 | 
			
		||||
  //   root: 'usdt',
 | 
			
		||||
  // },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'awbtc',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AWBTC',
 | 
			
		||||
    name: 'Aave WBTC',
 | 
			
		||||
    address: '0x078f358208685046a11C85e8ad32895DED33A249',
 | 
			
		||||
    decimals: 8,
 | 
			
		||||
    factor: 0.7,
 | 
			
		||||
    root: 'wbtc',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aaave',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AAAVE',
 | 
			
		||||
    name: 'Aave AAVE',
 | 
			
		||||
    address: '0xf329e36C7bF6E5E86ce2150875a84Ce77f477375',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.6,
 | 
			
		||||
    root: 'aave',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aftm',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AFTM',
 | 
			
		||||
    name: 'Aave FTM',
 | 
			
		||||
    address: '0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.25,
 | 
			
		||||
    root: 'ftm',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'asushi',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ASUSHI',
 | 
			
		||||
    name: 'Aave SUSHI',
 | 
			
		||||
    address: '0xc45A479877e1e9Dfe9FcD4056c699575a1045dAA',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.2,
 | 
			
		||||
    root: 'sushi',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'acrv',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ACRV',
 | 
			
		||||
    name: 'Aave CRV',
 | 
			
		||||
    address: '0x513c7E3a9c69cA3e22550eF58AC1C0088e918FFf',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'crv',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'afusdt',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AFUSDT',
 | 
			
		||||
    name: 'Aave FUSDT',
 | 
			
		||||
    address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620',
 | 
			
		||||
    decimals: 6,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'fusdt',
 | 
			
		||||
  },
 | 
			
		||||
])
 | 
			
		||||
							
								
								
									
										13
									
								
								constant/atokensV3/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								constant/atokensV3/index.ts
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
import polygon from './polygon'
 | 
			
		||||
import arbitrum from './arbitrum'
 | 
			
		||||
import avalanche from './avalanche'
 | 
			
		||||
import optimism from './optimism'
 | 
			
		||||
import fantom from './fantom'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  polygon,
 | 
			
		||||
  arbitrum,
 | 
			
		||||
  avalanche,
 | 
			
		||||
  optimism,
 | 
			
		||||
  fantom,
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										84
									
								
								constant/atokensV3/optimism.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								constant/atokensV3/optimism.ts
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,84 @@
 | 
			
		|||
import { createTokenUtils } from '../../utils'
 | 
			
		||||
 | 
			
		||||
export default createTokenUtils([
 | 
			
		||||
  {
 | 
			
		||||
    key: 'adai',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ADAI',
 | 
			
		||||
    name: 'Aave DAI',
 | 
			
		||||
    address: '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'dai',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'alink',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ALINK',
 | 
			
		||||
    name: 'Aave LINK',
 | 
			
		||||
    address: '0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.7,
 | 
			
		||||
    root: 'link',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aeth',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AETH',
 | 
			
		||||
    name: 'Aave ETH',
 | 
			
		||||
    address: '0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.8,
 | 
			
		||||
    root: 'eth',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'ausdc',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AUSDC',
 | 
			
		||||
    name: 'Aave USDC',
 | 
			
		||||
    address: '0x625E7708f30cA75bfd92586e17077590C60eb4cD',
 | 
			
		||||
    decimals: 6,
 | 
			
		||||
    factor: 0.8,
 | 
			
		||||
    root: 'usdc',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'ausdt',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AUSDT',
 | 
			
		||||
    name: 'Aave USDT',
 | 
			
		||||
    address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620',
 | 
			
		||||
    decimals: 6,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'usdt',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'awbtc',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AWBTC',
 | 
			
		||||
    name: 'Aave WBTC',
 | 
			
		||||
    address: '0x078f358208685046a11C85e8ad32895DED33A249',
 | 
			
		||||
    decimals: 8,
 | 
			
		||||
    factor: 0.7,
 | 
			
		||||
    root: 'wbtc',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aaave',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AAAVE',
 | 
			
		||||
    name: 'Aave AAVE',
 | 
			
		||||
    address: '0xf329e36C7bF6E5E86ce2150875a84Ce77f477375',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.5,
 | 
			
		||||
    root: 'aave',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'asusd',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ASUSD',
 | 
			
		||||
    name: 'AAVE SUSD',
 | 
			
		||||
    address: '0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0,
 | 
			
		||||
    root: 'susd',
 | 
			
		||||
  },
 | 
			
		||||
])
 | 
			
		||||
							
								
								
									
										164
									
								
								constant/atokensV3/polygon.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										164
									
								
								constant/atokensV3/polygon.ts
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,164 @@
 | 
			
		|||
import { createTokenUtils } from '../../utils'
 | 
			
		||||
 | 
			
		||||
export default createTokenUtils([
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aeth',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AETH',
 | 
			
		||||
    name: 'Aave ETH',
 | 
			
		||||
    address: '0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.8,
 | 
			
		||||
    root: 'eth',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'adai',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ADAI',
 | 
			
		||||
    name: 'Aave DAI',
 | 
			
		||||
    address: '0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'dai',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'ausdc',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AUSDC',
 | 
			
		||||
    name: 'Aave USDC',
 | 
			
		||||
    address: '0x625E7708f30cA75bfd92586e17077590C60eb4cD',
 | 
			
		||||
    decimals: 6,
 | 
			
		||||
    factor: 0.825,
 | 
			
		||||
    root: 'usdc',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'ausdt',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AUSDT',
 | 
			
		||||
    name: 'Aave USDT',
 | 
			
		||||
    address: '0x6ab707Aca953eDAeFBc4fD23bA73294241490620',
 | 
			
		||||
    decimals: 6,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'usdt',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'awbtc',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AWBTC',
 | 
			
		||||
    name: 'Aave WBTC',
 | 
			
		||||
    address: '0x078f358208685046a11C85e8ad32895DED33A249',
 | 
			
		||||
    decimals: 8,
 | 
			
		||||
    factor: 0.7,
 | 
			
		||||
    root: 'wbtc',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aaave',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AAAVE',
 | 
			
		||||
    name: 'Aave AAVE',
 | 
			
		||||
    address: '0xf329e36C7bF6E5E86ce2150875a84Ce77f477375',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.6,
 | 
			
		||||
    root: 'aave',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'awmatic',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AWMATIC',
 | 
			
		||||
    name: 'Aave WMATIC',
 | 
			
		||||
    address: '0x6d80113e533a2C0fe82EaBD35f1875DcEA89Ea97',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.65,
 | 
			
		||||
    root: 'matic',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'asushi',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ASUSHI',
 | 
			
		||||
    name: 'Aave SUSHI',
 | 
			
		||||
    address: '0xc45A479877e1e9Dfe9FcD4056c699575a1045dAA',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.2,
 | 
			
		||||
    root: 'sushi',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'alink',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ALINK',
 | 
			
		||||
    name: 'Aave LINK',
 | 
			
		||||
    address: '0x191c10Aa4AF7C30e871E70C95dB0E4eb77237530',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.5,
 | 
			
		||||
    root: 'link',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'abal',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ABAL',
 | 
			
		||||
    name: 'Aave BAL',
 | 
			
		||||
    address: '0x8ffDf2DE812095b1D19CB146E4c004587C0A0692',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.2,
 | 
			
		||||
    root: 'bal',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'acrv',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ACRV',
 | 
			
		||||
    name: 'Aave CRV',
 | 
			
		||||
    address: '0x513c7E3a9c69cA3e22550eF58AC1C0088e918FFf',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.75,
 | 
			
		||||
    root: 'crv',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'adpi',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'ADPI',
 | 
			
		||||
    name: 'Aave DPI',
 | 
			
		||||
    address: '0x724dc807b04555b71ed48a6896b6F41593b8C637',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.2,
 | 
			
		||||
    root: 'dpi',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aghst',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AGHST',
 | 
			
		||||
    name: 'Aave GHST',
 | 
			
		||||
    address: '0x8Eb270e296023E9D92081fdF967dDd7878724424',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0.25,
 | 
			
		||||
    root: 'ghst',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aeurs',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AEURS',
 | 
			
		||||
    name: 'Aave EURS',
 | 
			
		||||
    address: '0x38d693cE1dF5AaDF7bC62595A37D667aD57922e5',
 | 
			
		||||
    decimals: 2,
 | 
			
		||||
    factor: 0.65,
 | 
			
		||||
    root: 'eurs',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'ajeur',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AjEUR',
 | 
			
		||||
    name: 'Aave jEUR',
 | 
			
		||||
    address: '0x6533afac2E7BCCB20dca161449A13A32D391fb00',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0,
 | 
			
		||||
    root: 'jeur',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'aageur',
 | 
			
		||||
    type: 'atoken',
 | 
			
		||||
    symbol: 'AAGEUR',
 | 
			
		||||
    name: 'Aave agEUR',
 | 
			
		||||
    address: '0x8437d7C167dFB82ED4Cb79CD44B7a32A1dd95c77',
 | 
			
		||||
    decimals: 18,
 | 
			
		||||
    factor: 0,
 | 
			
		||||
    root: 'ageur',
 | 
			
		||||
  },
 | 
			
		||||
])
 | 
			
		||||
| 
						 | 
				
			
			@ -104,6 +104,16 @@ export default {
 | 
			
		|||
    '@nuxtjs/pwa',
 | 
			
		||||
  ],
 | 
			
		||||
 | 
			
		||||
  svg: {
 | 
			
		||||
    vueSvgLoader: {
 | 
			
		||||
      svgo: {
 | 
			
		||||
        plugins: [
 | 
			
		||||
          { cleanupIDs: false },
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  pwa: {
 | 
			
		||||
    meta: {
 | 
			
		||||
      appleStatusBarStyle: 'default',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,6 +31,7 @@
 | 
			
		|||
    "core-js": "^3.15.1",
 | 
			
		||||
    "css-color-function": "^1.3.3",
 | 
			
		||||
    "dsa-connect": "^0.6.13",
 | 
			
		||||
    "ethereum-multicall": "^2.10.0",
 | 
			
		||||
    "nuxt": "^2.15.7",
 | 
			
		||||
    "qrcode": "^1.4.4",
 | 
			
		||||
    "slugify": "^1.6.0",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										211
									
								
								pages/aave-v3.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										211
									
								
								pages/aave-v3.vue
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,211 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <div>
 | 
			
		||||
      <nuxt-link to="/" class="text-[#C0C5D7] text-lg font-semibold flex items-center">
 | 
			
		||||
        <BackIcon class="w-4 h-4 mr-3" />
 | 
			
		||||
        Apps
 | 
			
		||||
      </nuxt-link>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="mt-10 flex items-center justify-between">
 | 
			
		||||
      <div class="flex items-center">
 | 
			
		||||
        <div style="background: radial-gradient(42.15% 42.15% at 48.94% 48.94%, #D6DAE0 75.67%, #F0F3F9 100%), #C4C4C4;"
 | 
			
		||||
          class="w-16 h-16 rounded-full flex items-center justify-center border border-[#CCDCF3]">
 | 
			
		||||
          <div class="w-12 h-12 rounded-full flex items-center justify-center bg-[#1874FF]">
 | 
			
		||||
            <AaveIcon class="w-8 h-8 text-white" />
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <h1 class="ml-4 text-primary-black text-2xl font-semibold">Aave v3</h1>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <ButtonCTAOutlined class="px-4 h-9 w-[173px]" @click="$router.push({ hash: 'strategies?protocol=aaveV3' })">
 | 
			
		||||
        Strategies
 | 
			
		||||
 | 
			
		||||
        <svg class="ml-auto" width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
 | 
			
		||||
          <path fill-rule="evenodd" clip-rule="evenodd"
 | 
			
		||||
            d="M4.3815 8.76139C4.38149 8.99703 4.64068 9.1407 4.8405 9.01581L10.859 5.25425C11.047 5.13675 11.047 4.86295 10.859 4.74545L4.84088 0.984069C4.64108 0.859187 4.38189 1.00283 4.38188 1.23845L4.38179 2.97869C4.38178 3.14437 4.24747 3.27867 4.08179 3.27867L1.23894 3.27867C1.07325 3.27867 0.93894 3.41299 0.93894 3.57867L0.93894 6.42096C0.93894 6.58664 1.07325 6.72096 1.23894 6.72096L4.08159 6.72096C4.24728 6.72096 4.3816 6.85528 4.38159 7.02097L4.3815 8.76139Z"
 | 
			
		||||
            fill="#1874FF" />
 | 
			
		||||
        </svg>
 | 
			
		||||
      </ButtonCTAOutlined>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="mt-10" v-if="position">
 | 
			
		||||
      <h2 class="text-primary-gray text-lg font-semibold">Overview</h2>
 | 
			
		||||
 | 
			
		||||
      <div class="px-1 mt-6 grid w-full grid-cols-1 gap-4 sm:grid-cols-3 xl:gap-[18px]">
 | 
			
		||||
        <div class="shadow rounded-lg py-8 px-6 flex">
 | 
			
		||||
          <div class="flex-1">
 | 
			
		||||
            <h3 class="text-2xl text-primary-black font-medium">
 | 
			
		||||
              {{ formatUsd(totalSupply) }}
 | 
			
		||||
            </h3>
 | 
			
		||||
            <p class="mt-4 text-primary-gray font-medium">Lend</p>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="flex items-center">
 | 
			
		||||
            <svg width="27" height="29" viewBox="0 0 27 29" fill="none" xmlns="http://www.w3.org/2000/svg">
 | 
			
		||||
              <path
 | 
			
		||||
                d="M1.34917 12C0.603705 12 -7.62939e-06 12.6037 -7.62939e-06 13.3492V26.8498C-7.62939e-06 27.5953 0.603705 28.199 1.34917 28.199H25.6496C26.395 28.199 27 27.5953 27 26.8498V13.3492C27 12.6037 26.395 12 25.6496 12H1.34917ZM3.93109 14.6996H23.0676C23.1684 14.9836 23.3312 15.2415 23.5442 15.4545C23.7573 15.6675 24.0152 15.8304 24.2991 15.9311V24.2679C24.0154 24.3688 23.7578 24.5317 23.5449 24.7447C23.3321 24.9577 23.1695 25.2156 23.0689 25.4994H3.93109C3.83052 25.2153 3.66775 24.9574 3.45469 24.7443C3.24163 24.5312 2.98365 24.3685 2.69961 24.2679V15.9311C2.98365 15.8305 3.24163 15.6678 3.45469 15.4547C3.66775 15.2416 3.83052 14.9837 3.93109 14.6996ZM13.4994 16.0501C12.4252 16.0501 11.3951 16.4768 10.6355 17.2363C9.876 17.9958 9.4493 19.026 9.4493 20.1001C9.4493 21.1743 9.876 22.2044 10.6355 22.964C11.3951 23.7235 12.4252 24.1502 13.4994 24.1502C14.5735 24.1502 15.6037 23.7235 16.3632 22.964C17.1227 22.2044 17.5494 21.1743 17.5494 20.1001C17.5494 19.026 17.1227 17.9958 16.3632 17.2363C15.6037 16.4768 14.5735 16.0501 13.4994 16.0501ZM6.74968 18.7497C6.39185 18.7497 6.04868 18.8918 5.79566 19.1448C5.54264 19.3979 5.4005 19.741 5.4005 20.0989C5.4005 20.4567 5.54264 20.7999 5.79566 21.0529C6.04868 21.3059 6.39185 21.448 6.74968 21.448C7.1075 21.448 7.45067 21.3059 7.70369 21.0529C7.95671 20.7999 8.09886 20.4567 8.09886 20.0989C8.09886 19.741 7.95671 19.3979 7.70369 19.1448C7.45067 18.8918 7.1075 18.7497 6.74968 18.7497ZM20.2491 18.7497C19.8911 18.7497 19.5477 18.8919 19.2946 19.145C19.0415 19.3982 18.8992 19.7415 18.8992 20.0995C18.8992 20.4575 19.0415 20.8008 19.2946 21.054C19.5477 21.3071 19.8911 21.4493 20.2491 21.4493C20.607 21.4493 20.9504 21.3071 21.2035 21.054C21.4566 20.8008 21.5989 20.4575 21.5989 20.0995C21.5989 19.7415 21.4566 19.3982 21.2035 19.145C20.9504 18.8919 20.607 18.7497 20.2491 18.7497Z"
 | 
			
		||||
                fill="#209B9F" />
 | 
			
		||||
              <path
 | 
			
		||||
                d="M9.26922 5.85639L12.8282 9.41665C12.9101 9.50186 13.0083 9.56957 13.1171 9.61569C13.2259 9.66181 13.3429 9.68538 13.461 9.68497C13.5793 9.68521 13.6963 9.66144 13.8051 9.61511C13.9139 9.56877 14.0121 9.50082 14.0939 9.41538L17.6529 5.85639C17.7382 5.77424 17.8061 5.67566 17.8524 5.5666C17.8986 5.45754 17.9224 5.34024 17.9221 5.22176C17.9219 5.10329 17.8977 4.98609 17.851 4.87721C17.8043 4.76833 17.736 4.67003 17.6503 4.58821C17.4829 4.42155 17.2575 4.32628 17.0213 4.32243C16.7834 4.32597 16.5564 4.42224 16.3885 4.59075L14.3634 6.61578V1.90125C14.3651 1.78233 14.343 1.66428 14.2982 1.55409C14.2534 1.44391 14.187 1.34383 14.1029 1.25979C14.0187 1.17575 13.9185 1.10946 13.8083 1.06486C13.698 1.02025 13.58 0.998235 13.461 1.00011C13.3422 0.998406 13.2243 1.02055 13.1142 1.06523C13.0041 1.10992 12.9041 1.17623 12.82 1.26025C12.736 1.34427 12.6697 1.44429 12.625 1.55439C12.5803 1.66449 12.5582 1.78244 12.5599 1.90125V6.61704L10.5349 4.59201C10.3672 4.42305 10.1401 4.3263 9.90204 4.32243C9.66419 4.32597 9.43713 4.42224 9.26922 4.59075C9.18408 4.67269 9.11636 4.77098 9.0701 4.87971C9.02384 4.98845 9 5.1054 9 5.22357C9 5.34173 9.02384 5.45869 9.0701 5.56742C9.11636 5.67616 9.18408 5.77444 9.26922 5.85639Z"
 | 
			
		||||
                fill="#209B9F" stroke="#209B9F" stroke-width="0.3" />
 | 
			
		||||
            </svg>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="shadow rounded-lg py-8 px-6 flex">
 | 
			
		||||
          <div class="flex-1">
 | 
			
		||||
            <h3 class="text-2xl text-primary-black font-medium">
 | 
			
		||||
              {{ formatUsd(totalBorrow) }}
 | 
			
		||||
            </h3>
 | 
			
		||||
            <p class="mt-4 text-primary-gray font-medium">Borrowed</p>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="flex items-center">
 | 
			
		||||
            <svg width="27" height="28" viewBox="0 0 27 28" fill="none" xmlns="http://www.w3.org/2000/svg">
 | 
			
		||||
              <path
 | 
			
		||||
                d="M1.34511 11C0.601893 11 0 11.6019 0 12.3451V25.8051C0 26.5483 0.601893 27.1502 1.34511 27.1502H25.5722C26.3155 27.1502 26.9186 26.5483 26.9186 25.8051V12.3451C26.9186 11.6019 26.3155 11 25.5722 11H1.34511ZM3.91924 13.6915H22.9981C23.0985 13.9746 23.2609 14.2317 23.4733 14.4441C23.6857 14.6565 23.9428 14.8188 24.2259 14.9192V23.2309C23.943 23.3315 23.6861 23.4939 23.474 23.7063C23.2618 23.9187 23.0997 24.1757 22.9994 24.4587H3.91924C3.81898 24.1755 3.6567 23.9183 3.44428 23.7059C3.23186 23.4935 2.97466 23.3312 2.69148 23.2309V14.9192C2.97466 14.819 3.23186 14.6567 3.44428 14.4443C3.6567 14.2319 3.81898 13.9747 3.91924 13.6915ZM13.4587 15.0379C12.3878 15.0379 11.3607 15.4633 10.6035 16.2205C9.84624 16.9778 9.42082 18.0048 9.42082 19.0757C9.42082 20.1466 9.84624 21.1737 10.6035 21.9309C11.3607 22.6882 12.3878 23.1136 13.4587 23.1136C14.5296 23.1136 15.5566 22.6882 16.3139 21.9309C17.0711 21.1737 17.4965 20.1466 17.4965 19.0757C17.4965 18.0048 17.0711 16.9778 16.3139 16.2205C15.5566 15.4633 14.5296 15.0379 13.4587 15.0379ZM6.72934 17.7293C6.37259 17.7293 6.03046 17.8711 5.7782 18.1233C5.52594 18.3756 5.38423 18.7177 5.38423 19.0744C5.38423 19.4312 5.52594 19.7733 5.7782 20.0256C6.03046 20.2778 6.37259 20.4196 6.72934 20.4196C7.08608 20.4196 7.42822 20.2778 7.68048 20.0256C7.93273 19.7733 8.07445 19.4312 8.07445 19.0744C8.07445 18.7177 7.93273 18.3756 7.68048 18.1233C7.42822 17.8711 7.08608 17.7293 6.72934 17.7293ZM20.188 17.7293C19.8311 17.7293 19.4888 17.8711 19.2364 18.1235C18.9841 18.3759 18.8423 18.7182 18.8423 19.0751C18.8423 19.432 18.9841 19.7743 19.2364 20.0267C19.4888 20.279 19.8311 20.4208 20.188 20.4208C20.5449 20.4208 20.8872 20.279 21.1396 20.0267C21.392 19.7743 21.5338 19.432 21.5338 19.0751C21.5338 18.7182 21.392 18.3759 21.1396 18.1235C20.8872 17.8711 20.5449 17.7293 20.188 17.7293Z"
 | 
			
		||||
                fill="#CA8700" />
 | 
			
		||||
              <path
 | 
			
		||||
                d="M17.5573 3.7854H10.6173C10.0946 3.7854 9.6709 4.20911 9.6709 4.73177C9.6709 5.25444 10.0946 5.67815 10.6173 5.67815H17.5573C18.08 5.67815 18.5037 5.25444 18.5037 4.73177C18.5037 4.20911 18.08 3.7854 17.5573 3.7854Z"
 | 
			
		||||
                fill="#CA8700" />
 | 
			
		||||
              <path
 | 
			
		||||
                d="M17.5573 0H10.6173C10.0946 0 9.6709 0.423705 9.6709 0.946372C9.6709 1.46904 10.0946 1.89274 10.6173 1.89274H17.5573C18.08 1.89274 18.5037 1.46904 18.5037 0.946372C18.5037 0.423705 18.08 0 17.5573 0Z"
 | 
			
		||||
                fill="#CA8700" />
 | 
			
		||||
            </svg>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="shadow rounded-lg py-8 px-6 flex">
 | 
			
		||||
          <div class="flex-1">
 | 
			
		||||
            <div class="flex justify-between items-center">
 | 
			
		||||
              <h3 class="text-2xl text-primary-black font-medium">
 | 
			
		||||
                {{ formatPercent(status) }}
 | 
			
		||||
              </h3>
 | 
			
		||||
              <Badge class="w-18 xxl:w-23" :color="color">{{ text }}</Badge>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="mt-4 flex justify-between items-center text-primary-gray font-medium">
 | 
			
		||||
              <div class="flex items-center whitespace-no-wrap">
 | 
			
		||||
                <div>D/C (%)</div>
 | 
			
		||||
 | 
			
		||||
                <div class="ml-2">
 | 
			
		||||
                  <Info text="Debt/Collateral ratio" />
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
              <span>Max - {{ formatPercent(maxLiquidation) }}</span>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="mt-[60px]">
 | 
			
		||||
      <div class="w-full flex flex-col mt-6 sm:flex-row sm:items-center sm:justify-between xl:mt-4">
 | 
			
		||||
        <h2 class="text-primary-gray text-lg font-semibold">Your Positions</h2>
 | 
			
		||||
 | 
			
		||||
        <div class="mt-4 sm:mt-0 sm:mr-1">
 | 
			
		||||
          <SearchInput v-model.trim="search" dense class="w-[200px]" placeholder="Search positions" />
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="mt-3 grid w-full grid-cols-1 gap-4 sm:grid-cols-2 xxl:gap-6 min-w-max-content px-1">
 | 
			
		||||
        <div v-for="item in filteredPositions" :key="item.key">
 | 
			
		||||
          <card-aave :token-key="item.key" :supply="item.supply" :supply-usd="item.supplyUsd"
 | 
			
		||||
            :supply-rate="item.supplyRate" :borrow="item.borrow" :borrow-usd="item.borrowUsd"
 | 
			
		||||
            :borrow-rate="item.borrowRate" :type="item.type" :supply-reward-rate="item.supplyRewardRate"
 | 
			
		||||
            :borrow-reward-rate="item.borrowRewardRate" :reward-token-name="rewardTokenName"
 | 
			
		||||
            :reward-currency="rewardCurrency" :cf="item.cf" :ll="item.ll" :borrow-enabled="item.borrowEnabled"
 | 
			
		||||
            :price-in-usd="item.priceInUsd" />
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script lang="ts">
 | 
			
		||||
import { defineComponent, computed } from "@nuxtjs/composition-api";
 | 
			
		||||
import BackIcon from "~/assets/icons/back.svg?inline";
 | 
			
		||||
import { useAaveV3Position } from "~/composables/protocols/useAaveV3Position";
 | 
			
		||||
import { useFormatting } from "~/composables/useFormatting";
 | 
			
		||||
import { useSearchFilter } from "~/composables/useSearchFilter";
 | 
			
		||||
import { useStatus } from "~/composables/useStatus";
 | 
			
		||||
import { useBigNumber } from "~/composables/useBigNumber";
 | 
			
		||||
import CardAave from "~/components/protocols/CardAave.vue";
 | 
			
		||||
import AaveIcon from "~/assets/icons/aave.svg?inline";
 | 
			
		||||
import ButtonCTAOutlined from "~/components/common/input/ButtonCTAOutlined.vue";
 | 
			
		||||
import { Network, useNetwork } from "~/composables/useNetwork";
 | 
			
		||||
 | 
			
		||||
export default defineComponent({
 | 
			
		||||
  components: {
 | 
			
		||||
    BackIcon,
 | 
			
		||||
    CardAave,
 | 
			
		||||
    AaveIcon,
 | 
			
		||||
    ButtonCTAOutlined
 | 
			
		||||
  },
 | 
			
		||||
  setup() {
 | 
			
		||||
    const { activeNetworkId } = useNetwork();
 | 
			
		||||
    const {
 | 
			
		||||
      position,
 | 
			
		||||
      displayPositions,
 | 
			
		||||
      totalSupply,
 | 
			
		||||
      totalBorrow,
 | 
			
		||||
      status,
 | 
			
		||||
      liquidation,
 | 
			
		||||
      maxLiquidation
 | 
			
		||||
    } = useAaveV3Position();
 | 
			
		||||
 | 
			
		||||
    const { div } = useBigNumber();
 | 
			
		||||
 | 
			
		||||
    const statusLiquidationRatio = computed(() =>
 | 
			
		||||
      div(status.value, liquidation.value).toFixed()
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    const { color, text } = useStatus(statusLiquidationRatio);
 | 
			
		||||
 | 
			
		||||
    const { formatUsd, formatPercent } = useFormatting();
 | 
			
		||||
 | 
			
		||||
    const { filtered: filteredPositions, search } = useSearchFilter(
 | 
			
		||||
      displayPositions,
 | 
			
		||||
      "key",
 | 
			
		||||
      "type"
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    const rewardTokenName = computed(() => {
 | 
			
		||||
      if (activeNetworkId.value === Network.Avalanche) {
 | 
			
		||||
        return "AVAX";
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (activeNetworkId.value === Network.Mainnet) {
 | 
			
		||||
        return "stkAAVE";
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      return "MATIC";
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    const rewardCurrency = computed(() => {
 | 
			
		||||
      if (activeNetworkId.value === Network.Avalanche) {
 | 
			
		||||
        return "avax";
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (activeNetworkId.value === Network.Mainnet) {
 | 
			
		||||
        return "stkaave";
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      return "matic";
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      position,
 | 
			
		||||
      filteredPositions,
 | 
			
		||||
      search,
 | 
			
		||||
      totalSupply,
 | 
			
		||||
      totalBorrow,
 | 
			
		||||
      status,
 | 
			
		||||
      formatUsd,
 | 
			
		||||
      formatPercent,
 | 
			
		||||
      color,
 | 
			
		||||
      text,
 | 
			
		||||
      maxLiquidation,
 | 
			
		||||
      rewardTokenName,
 | 
			
		||||
      rewardCurrency
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
| 
						 | 
				
			
			@ -113,6 +113,13 @@ const appsPerNetwork = {
 | 
			
		|||
      name: "1inch",
 | 
			
		||||
      url: "/1inch",
 | 
			
		||||
      description: "DEX Aggregator"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      id: "aave-v3",
 | 
			
		||||
      icon: AaveIcon,
 | 
			
		||||
      name: "Aave v3",
 | 
			
		||||
      url: "/aave-v3",
 | 
			
		||||
      description: "Lend and borrow straight from your Gnosis Safe"
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  arbitrum: [
 | 
			
		||||
| 
						 | 
				
			
			@ -122,6 +129,13 @@ const appsPerNetwork = {
 | 
			
		|||
      name: "1inch",
 | 
			
		||||
      url: "/1inch",
 | 
			
		||||
      description: "DEX Aggregator"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      id: "aave-v3",
 | 
			
		||||
      icon: AaveIcon,
 | 
			
		||||
      name: "Aave v3",
 | 
			
		||||
      url: "/aave-v3",
 | 
			
		||||
      description: "Lend and borrow straight from your Gnosis Safe"
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  avalanche: [
 | 
			
		||||
| 
						 | 
				
			
			@ -131,6 +145,13 @@ const appsPerNetwork = {
 | 
			
		|||
      name: "Aave v2",
 | 
			
		||||
      url: "/aave-v2",
 | 
			
		||||
      description: "Lend and borrow straight from your Gnosis Safe"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      id: "aave-v3",
 | 
			
		||||
      icon: AaveIcon,
 | 
			
		||||
      name: "Aave v3",
 | 
			
		||||
      url: "/aave-v3",
 | 
			
		||||
      description: "Lend and borrow straight from your Gnosis Safe"
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  optimism: [
 | 
			
		||||
| 
						 | 
				
			
			@ -140,6 +161,13 @@ const appsPerNetwork = {
 | 
			
		|||
      name: "1inch",
 | 
			
		||||
      url: "/1inch",
 | 
			
		||||
      description: "DEX Aggregator"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      id: "aave-v3",
 | 
			
		||||
      icon: AaveIcon,
 | 
			
		||||
      name: "Aave v3",
 | 
			
		||||
      url: "/aave-v3",
 | 
			
		||||
      description: "Lend and borrow straight from your Gnosis Safe"
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								utils/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								utils/index.ts
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
export * from './create-token-utils';
 | 
			
		||||
							
								
								
									
										384
									
								
								yarn.lock
									
									
									
									
									
								
							
							
						
						
									
										384
									
								
								yarn.lock
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -1277,6 +1277,21 @@
 | 
			
		|||
    "@ethersproject/properties" "^5.4.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/abi@5.6.1", "@ethersproject/abi@^5.6.0":
 | 
			
		||||
  version "5.6.1"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.1.tgz#f7de888edeb56b0a657b672bdd1b3a1135cd14f7"
 | 
			
		||||
  integrity sha512-0cqssYh6FXjlwKWBmLm3+zH2BNARoS5u/hxbz+LpQmcDB3w0W553h2btWui1/uZp2GBM/SI3KniTuMcYyHpA5w==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/address" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/constants" "^5.6.0"
 | 
			
		||||
    "@ethersproject/hash" "^5.6.0"
 | 
			
		||||
    "@ethersproject/keccak256" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/abstract-provider@5.4.1", "@ethersproject/abstract-provider@^5.4.0":
 | 
			
		||||
  version "5.4.1"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.4.1.tgz#e404309a29f771bd4d28dbafadcaa184668c2a6e"
 | 
			
		||||
| 
						 | 
				
			
			@ -1290,6 +1305,19 @@
 | 
			
		|||
    "@ethersproject/transactions" "^5.4.0"
 | 
			
		||||
    "@ethersproject/web" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/abstract-provider@5.6.0", "@ethersproject/abstract-provider@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz#0c4ac7054650dbd9c476cf5907f588bbb6ef3061"
 | 
			
		||||
  integrity sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/networks" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/transactions" "^5.6.0"
 | 
			
		||||
    "@ethersproject/web" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/abstract-signer@5.4.1", "@ethersproject/abstract-signer@^5.4.0":
 | 
			
		||||
  version "5.4.1"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.4.1.tgz#e4e9abcf4dd4f1ba0db7dff9746a5f78f355ea81"
 | 
			
		||||
| 
						 | 
				
			
			@ -1301,6 +1329,17 @@
 | 
			
		|||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/abstract-signer@5.6.0", "@ethersproject/abstract-signer@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz#9cd7ae9211c2b123a3b29bf47aab17d4d016e3e7"
 | 
			
		||||
  integrity sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/abstract-provider" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/address@5.4.0", "@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.4.0.tgz#ba2d00a0f8c4c0854933b963b9a3a9f6eb4a37a3"
 | 
			
		||||
| 
						 | 
				
			
			@ -1312,6 +1351,17 @@
 | 
			
		|||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
    "@ethersproject/rlp" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/address@5.6.0", "@ethersproject/address@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.0.tgz#13c49836d73e7885fc148ad633afad729da25012"
 | 
			
		||||
  integrity sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/keccak256" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/rlp" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/base64@5.4.0", "@ethersproject/base64@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.4.0.tgz#7252bf65295954c9048c7ca5f43e5c86441b2a9a"
 | 
			
		||||
| 
						 | 
				
			
			@ -1319,6 +1369,13 @@
 | 
			
		|||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/base64@5.6.0", "@ethersproject/base64@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.6.0.tgz#a12c4da2a6fb86d88563216b0282308fc15907c9"
 | 
			
		||||
  integrity sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/basex@5.4.0", "@ethersproject/basex@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.4.0.tgz#0a2da0f4e76c504a94f2b21d3161ed9438c7f8a6"
 | 
			
		||||
| 
						 | 
				
			
			@ -1327,6 +1384,14 @@
 | 
			
		|||
    "@ethersproject/bytes" "^5.4.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/basex@5.6.0", "@ethersproject/basex@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.6.0.tgz#9ea7209bf0a1c3ddc2a90f180c3a7f0d7d2e8a69"
 | 
			
		||||
  integrity sha512-qN4T+hQd/Md32MoJpc69rOwLYRUXwjTlhHDIeUkUmiN/JyWkkLLMoG0TqvSQKNqZOMgN5stbUYN6ILC+eD7MEQ==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/bignumber@5.4.2", "@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.4.0":
 | 
			
		||||
  version "5.4.2"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.4.2.tgz#44232e015ae4ce82ac034de549eb3583c71283d8"
 | 
			
		||||
| 
						 | 
				
			
			@ -1336,6 +1401,15 @@
 | 
			
		|||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
    bn.js "^4.11.9"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/bignumber@5.6.0", "@ethersproject/bignumber@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.0.tgz#116c81b075c57fa765a8f3822648cf718a8a0e26"
 | 
			
		||||
  integrity sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    bn.js "^4.11.9"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/bytes@5.4.0", "@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.4.0.tgz#56fa32ce3bf67153756dbaefda921d1d4774404e"
 | 
			
		||||
| 
						 | 
				
			
			@ -1343,6 +1417,13 @@
 | 
			
		|||
  dependencies:
 | 
			
		||||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/bytes@5.6.1", "@ethersproject/bytes@^5.6.0":
 | 
			
		||||
  version "5.6.1"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7"
 | 
			
		||||
  integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/constants@5.4.0", "@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.4.0.tgz#ee0bdcb30bf1b532d2353c977bf2ef1ee117958a"
 | 
			
		||||
| 
						 | 
				
			
			@ -1350,6 +1431,13 @@
 | 
			
		|||
  dependencies:
 | 
			
		||||
    "@ethersproject/bignumber" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/constants@5.6.0", "@ethersproject/constants@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.0.tgz#55e3eb0918584d3acc0688e9958b0cedef297088"
 | 
			
		||||
  integrity sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/contracts@5.4.1":
 | 
			
		||||
  version "5.4.1"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.4.1.tgz#3eb4f35b7fe60a962a75804ada2746494df3e470"
 | 
			
		||||
| 
						 | 
				
			
			@ -1366,6 +1454,22 @@
 | 
			
		|||
    "@ethersproject/properties" "^5.4.0"
 | 
			
		||||
    "@ethersproject/transactions" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/contracts@5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.6.0.tgz#60f2cfc7addd99a865c6c8cfbbcec76297386067"
 | 
			
		||||
  integrity sha512-74Ge7iqTDom0NX+mux8KbRUeJgu1eHZ3iv6utv++sLJG80FVuU9HnHeKVPfjd9s3woFhaFoQGf3B3iH/FrQmgw==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/abi" "^5.6.0"
 | 
			
		||||
    "@ethersproject/abstract-provider" "^5.6.0"
 | 
			
		||||
    "@ethersproject/abstract-signer" "^5.6.0"
 | 
			
		||||
    "@ethersproject/address" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/constants" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/transactions" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/hash@5.4.0", "@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.4.0.tgz#d18a8e927e828e22860a011f39e429d388344ae0"
 | 
			
		||||
| 
						 | 
				
			
			@ -1380,6 +1484,20 @@
 | 
			
		|||
    "@ethersproject/properties" "^5.4.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/hash@5.6.0", "@ethersproject/hash@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.0.tgz#d24446a5263e02492f9808baa99b6e2b4c3429a2"
 | 
			
		||||
  integrity sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/abstract-signer" "^5.6.0"
 | 
			
		||||
    "@ethersproject/address" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/keccak256" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/hdnode@5.4.0", "@ethersproject/hdnode@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.4.0.tgz#4bc9999b9a12eb5ce80c5faa83114a57e4107cac"
 | 
			
		||||
| 
						 | 
				
			
			@ -1398,6 +1516,24 @@
 | 
			
		|||
    "@ethersproject/transactions" "^5.4.0"
 | 
			
		||||
    "@ethersproject/wordlists" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/hdnode@5.6.0", "@ethersproject/hdnode@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.0.tgz#9dcbe8d629bbbcf144f2cae476337fe92d320998"
 | 
			
		||||
  integrity sha512-61g3Jp3nwDqJcL/p4nugSyLrpl/+ChXIOtCEM8UDmWeB3JCAt5FoLdOMXQc3WWkc0oM2C0aAn6GFqqMcS/mHTw==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/abstract-signer" "^5.6.0"
 | 
			
		||||
    "@ethersproject/basex" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/pbkdf2" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/sha2" "^5.6.0"
 | 
			
		||||
    "@ethersproject/signing-key" "^5.6.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.6.0"
 | 
			
		||||
    "@ethersproject/transactions" "^5.6.0"
 | 
			
		||||
    "@ethersproject/wordlists" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/json-wallets@5.4.0", "@ethersproject/json-wallets@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz#2583341cfe313fc9856642e8ace3080154145e95"
 | 
			
		||||
| 
						 | 
				
			
			@ -1417,6 +1553,25 @@
 | 
			
		|||
    aes-js "3.0.0"
 | 
			
		||||
    scrypt-js "3.0.1"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/json-wallets@5.6.0", "@ethersproject/json-wallets@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.6.0.tgz#4c2fc27f17e36c583e7a252fb938bc46f98891e5"
 | 
			
		||||
  integrity sha512-fmh86jViB9r0ibWXTQipxpAGMiuxoqUf78oqJDlCAJXgnJF024hOOX7qVgqsjtbeoxmcLwpPsXNU0WEe/16qPQ==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/abstract-signer" "^5.6.0"
 | 
			
		||||
    "@ethersproject/address" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/hdnode" "^5.6.0"
 | 
			
		||||
    "@ethersproject/keccak256" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/pbkdf2" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/random" "^5.6.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.6.0"
 | 
			
		||||
    "@ethersproject/transactions" "^5.6.0"
 | 
			
		||||
    aes-js "3.0.0"
 | 
			
		||||
    scrypt-js "3.0.1"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/keccak256@5.4.0", "@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.0-beta.130", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.4.0.tgz#7143b8eea4976080241d2bd92e3b1f1bf7025318"
 | 
			
		||||
| 
						 | 
				
			
			@ -1425,11 +1580,24 @@
 | 
			
		|||
    "@ethersproject/bytes" "^5.4.0"
 | 
			
		||||
    js-sha3 "0.5.7"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/keccak256@5.6.0", "@ethersproject/keccak256@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.0.tgz#fea4bb47dbf8f131c2e1774a1cecbfeb9d606459"
 | 
			
		||||
  integrity sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    js-sha3 "0.8.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/logger@5.4.1", "@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.4.0":
 | 
			
		||||
  version "5.4.1"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.4.1.tgz#503bd33683538b923c578c07d1c2c0dd18672054"
 | 
			
		||||
  integrity sha512-DZ+bRinnYLPw1yAC64oRl0QyVZj43QeHIhVKfD/+YwSz4wsv1pfwb5SOFjz+r710YEWzU6LrhuSjpSO+6PeE4A==
 | 
			
		||||
 | 
			
		||||
"@ethersproject/logger@5.6.0", "@ethersproject/logger@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a"
 | 
			
		||||
  integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==
 | 
			
		||||
 | 
			
		||||
"@ethersproject/networks@5.4.2", "@ethersproject/networks@^5.4.0":
 | 
			
		||||
  version "5.4.2"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.4.2.tgz#2247d977626e97e2c3b8ee73cd2457babde0ce35"
 | 
			
		||||
| 
						 | 
				
			
			@ -1437,6 +1605,13 @@
 | 
			
		|||
  dependencies:
 | 
			
		||||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/networks@5.6.2", "@ethersproject/networks@^5.6.0":
 | 
			
		||||
  version "5.6.2"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.2.tgz#2bacda62102c0b1fcee408315f2bed4f6fbdf336"
 | 
			
		||||
  integrity sha512-9uEzaJY7j5wpYGTojGp8U89mSsgQLc40PCMJLMCnFXTs7nhBveZ0t7dbqWUNrepWTszDbFkYD6WlL8DKx5huHA==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/pbkdf2@5.4.0", "@ethersproject/pbkdf2@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz#ed88782a67fda1594c22d60d0ca911a9d669641c"
 | 
			
		||||
| 
						 | 
				
			
			@ -1445,6 +1620,14 @@
 | 
			
		|||
    "@ethersproject/bytes" "^5.4.0"
 | 
			
		||||
    "@ethersproject/sha2" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/pbkdf2@5.6.0", "@ethersproject/pbkdf2@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.6.0.tgz#04fcc2d7c6bff88393f5b4237d906a192426685a"
 | 
			
		||||
  integrity sha512-Wu1AxTgJo3T3H6MIu/eejLFok9TYoSdgwRr5oGY1LTLfmGesDoSx05pemsbrPT2gG4cQME+baTSCp5sEo2erZQ==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/sha2" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/properties@5.4.1", "@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.4.0":
 | 
			
		||||
  version "5.4.1"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.4.1.tgz#9f051f976ce790142c6261ccb7b826eaae1f2f36"
 | 
			
		||||
| 
						 | 
				
			
			@ -1452,6 +1635,13 @@
 | 
			
		|||
  dependencies:
 | 
			
		||||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/properties@5.6.0", "@ethersproject/properties@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04"
 | 
			
		||||
  integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/providers@5.4.5":
 | 
			
		||||
  version "5.4.5"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.4.5.tgz#eb2ea2a743a8115f79604a8157233a3a2c832928"
 | 
			
		||||
| 
						 | 
				
			
			@ -1477,6 +1667,31 @@
 | 
			
		|||
    bech32 "1.1.4"
 | 
			
		||||
    ws "7.4.6"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/providers@5.6.4", "@ethersproject/providers@^5.0.10":
 | 
			
		||||
  version "5.6.4"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.4.tgz#1a49c211b57b0b2703c320819abbbfa35c83dff7"
 | 
			
		||||
  integrity sha512-WAdknnaZ52hpHV3qPiJmKx401BLpup47h36Axxgre9zT+doa/4GC/Ne48ICPxTm0BqndpToHjpLP1ZnaxyE+vw==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/abstract-provider" "^5.6.0"
 | 
			
		||||
    "@ethersproject/abstract-signer" "^5.6.0"
 | 
			
		||||
    "@ethersproject/address" "^5.6.0"
 | 
			
		||||
    "@ethersproject/basex" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/constants" "^5.6.0"
 | 
			
		||||
    "@ethersproject/hash" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/networks" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/random" "^5.6.0"
 | 
			
		||||
    "@ethersproject/rlp" "^5.6.0"
 | 
			
		||||
    "@ethersproject/sha2" "^5.6.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.6.0"
 | 
			
		||||
    "@ethersproject/transactions" "^5.6.0"
 | 
			
		||||
    "@ethersproject/web" "^5.6.0"
 | 
			
		||||
    bech32 "1.1.4"
 | 
			
		||||
    ws "7.4.6"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/random@5.4.0", "@ethersproject/random@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.4.0.tgz#9cdde60e160d024be39cc16f8de3b9ce39191e16"
 | 
			
		||||
| 
						 | 
				
			
			@ -1485,6 +1700,14 @@
 | 
			
		|||
    "@ethersproject/bytes" "^5.4.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/random@5.6.0", "@ethersproject/random@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.6.0.tgz#1505d1ab6a250e0ee92f436850fa3314b2cb5ae6"
 | 
			
		||||
  integrity sha512-si0PLcLjq+NG/XHSZz90asNf+YfKEqJGVdxoEkSukzbnBgC8rydbgbUgBbBGLeHN4kAJwUFEKsu3sCXT93YMsw==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/rlp@5.4.0", "@ethersproject/rlp@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.4.0.tgz#de61afda5ff979454e76d3b3310a6c32ad060931"
 | 
			
		||||
| 
						 | 
				
			
			@ -1493,6 +1716,14 @@
 | 
			
		|||
    "@ethersproject/bytes" "^5.4.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/rlp@5.6.0", "@ethersproject/rlp@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.6.0.tgz#55a7be01c6f5e64d6e6e7edb6061aa120962a717"
 | 
			
		||||
  integrity sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/sha2@5.4.0", "@ethersproject/sha2@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.4.0.tgz#c9a8db1037014cbc4e9482bd662f86c090440371"
 | 
			
		||||
| 
						 | 
				
			
			@ -1502,6 +1733,15 @@
 | 
			
		|||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
    hash.js "1.1.7"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/sha2@5.6.0", "@ethersproject/sha2@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.6.0.tgz#364c4c11cc753bda36f31f001628706ebadb64d9"
 | 
			
		||||
  integrity sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    hash.js "1.1.7"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/signing-key@5.4.0", "@ethersproject/signing-key@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.4.0.tgz#2f05120984e81cf89a3d5f6dec5c68ee0894fbec"
 | 
			
		||||
| 
						 | 
				
			
			@ -1514,6 +1754,18 @@
 | 
			
		|||
    elliptic "6.5.4"
 | 
			
		||||
    hash.js "1.1.7"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/signing-key@5.6.0", "@ethersproject/signing-key@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.0.tgz#4f02e3fb09e22b71e2e1d6dc4bcb5dafa69ce042"
 | 
			
		||||
  integrity sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    bn.js "^4.11.9"
 | 
			
		||||
    elliptic "6.5.4"
 | 
			
		||||
    hash.js "1.1.7"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/solidity@5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.4.0.tgz#1305e058ea02dc4891df18b33232b11a14ece9ec"
 | 
			
		||||
| 
						 | 
				
			
			@ -1525,6 +1777,18 @@
 | 
			
		|||
    "@ethersproject/sha2" "^5.4.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/solidity@5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.6.0.tgz#64657362a596bf7f5630bdc921c07dd78df06dc3"
 | 
			
		||||
  integrity sha512-YwF52vTNd50kjDzqKaoNNbC/r9kMDPq3YzDWmsjFTRBcIF1y4JCQJ8gB30wsTfHbaxgxelI5BfxQSxD/PbJOww==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/keccak256" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/sha2" "^5.6.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/strings@5.4.0", "@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.4.0.tgz#fb12270132dd84b02906a8d895ae7e7fa3d07d9a"
 | 
			
		||||
| 
						 | 
				
			
			@ -1534,6 +1798,15 @@
 | 
			
		|||
    "@ethersproject/constants" "^5.4.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/strings@5.6.0", "@ethersproject/strings@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.0.tgz#9891b26709153d996bf1303d39a7f4bc047878fd"
 | 
			
		||||
  integrity sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/constants" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/transactions@5.4.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.4.0.tgz#a159d035179334bd92f340ce0f77e83e9e1522e0"
 | 
			
		||||
| 
						 | 
				
			
			@ -1549,6 +1822,21 @@
 | 
			
		|||
    "@ethersproject/rlp" "^5.4.0"
 | 
			
		||||
    "@ethersproject/signing-key" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/transactions@5.6.0", "@ethersproject/transactions@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.0.tgz#4b594d73a868ef6e1529a2f8f94a785e6791ae4e"
 | 
			
		||||
  integrity sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/address" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/constants" "^5.6.0"
 | 
			
		||||
    "@ethersproject/keccak256" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/rlp" "^5.6.0"
 | 
			
		||||
    "@ethersproject/signing-key" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/units@5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.4.0.tgz#d57477a4498b14b88b10396062c8cbbaf20c79fe"
 | 
			
		||||
| 
						 | 
				
			
			@ -1558,6 +1846,15 @@
 | 
			
		|||
    "@ethersproject/constants" "^5.4.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/units@5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.6.0.tgz#e5cbb1906988f5740254a21b9ded6bd51e826d9c"
 | 
			
		||||
  integrity sha512-tig9x0Qmh8qbo1w8/6tmtyrm/QQRviBh389EQ+d8fP4wDsBrJBf08oZfoiz1/uenKK9M78yAP4PoR7SsVoTjsw==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/constants" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/wallet@5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.4.0.tgz#fa5b59830b42e9be56eadd45a16a2e0933ad9353"
 | 
			
		||||
| 
						 | 
				
			
			@ -1579,6 +1876,27 @@
 | 
			
		|||
    "@ethersproject/transactions" "^5.4.0"
 | 
			
		||||
    "@ethersproject/wordlists" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/wallet@5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.6.0.tgz#33d11a806d783864208f348709a5a3badac8e22a"
 | 
			
		||||
  integrity sha512-qMlSdOSTyp0MBeE+r7SUhr1jjDlC1zAXB8VD84hCnpijPQiSNbxr6GdiLXxpUs8UKzkDiNYYC5DRI3MZr+n+tg==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/abstract-provider" "^5.6.0"
 | 
			
		||||
    "@ethersproject/abstract-signer" "^5.6.0"
 | 
			
		||||
    "@ethersproject/address" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bignumber" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/hash" "^5.6.0"
 | 
			
		||||
    "@ethersproject/hdnode" "^5.6.0"
 | 
			
		||||
    "@ethersproject/json-wallets" "^5.6.0"
 | 
			
		||||
    "@ethersproject/keccak256" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/random" "^5.6.0"
 | 
			
		||||
    "@ethersproject/signing-key" "^5.6.0"
 | 
			
		||||
    "@ethersproject/transactions" "^5.6.0"
 | 
			
		||||
    "@ethersproject/wordlists" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/web@5.4.0", "@ethersproject/web@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.4.0.tgz#49fac173b96992334ed36a175538ba07a7413d1f"
 | 
			
		||||
| 
						 | 
				
			
			@ -1590,6 +1908,17 @@
 | 
			
		|||
    "@ethersproject/properties" "^5.4.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/web@5.6.0", "@ethersproject/web@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.6.0.tgz#4bf8b3cbc17055027e1a5dd3c357e37474eaaeb8"
 | 
			
		||||
  integrity sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/base64" "^5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/wordlists@5.4.0", "@ethersproject/wordlists@^5.4.0":
 | 
			
		||||
  version "5.4.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.4.0.tgz#f34205ec3bbc9e2c49cadaee774cf0b07e7573d7"
 | 
			
		||||
| 
						 | 
				
			
			@ -1601,6 +1930,17 @@
 | 
			
		|||
    "@ethersproject/properties" "^5.4.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.4.0"
 | 
			
		||||
 | 
			
		||||
"@ethersproject/wordlists@5.6.0", "@ethersproject/wordlists@^5.6.0":
 | 
			
		||||
  version "5.6.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.6.0.tgz#79e62c5276e091d8575f6930ba01a29218ded032"
 | 
			
		||||
  integrity sha512-q0bxNBfIX3fUuAo9OmjlEYxP40IB8ABgb7HjEZCL5IKubzV3j30CWi2rqQbjTS2HfoyQbfINoKcTVWP4ejwR7Q==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/bytes" "^5.6.0"
 | 
			
		||||
    "@ethersproject/hash" "^5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "^5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "^5.6.0"
 | 
			
		||||
    "@ethersproject/strings" "^5.6.0"
 | 
			
		||||
 | 
			
		||||
"@gar/promisify@^1.0.1":
 | 
			
		||||
  version "1.1.2"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210"
 | 
			
		||||
| 
						 | 
				
			
			@ -7027,6 +7367,14 @@ ethereum-cryptography@^0.1.3:
 | 
			
		|||
    secp256k1 "^4.0.1"
 | 
			
		||||
    setimmediate "^1.0.5"
 | 
			
		||||
 | 
			
		||||
ethereum-multicall@^2.10.0:
 | 
			
		||||
  version "2.10.0"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/ethereum-multicall/-/ethereum-multicall-2.10.0.tgz#db8e41109e01c63058cf99a1b00770c93e8abb75"
 | 
			
		||||
  integrity sha512-H5rYoNJ+ukV5Z932AkxsEzV9MveJgb1Y5aFfS5SmenFuUkTwx9gje1d1JSl44+Wa8PBLuu9+7BHIX1mdJdQLSg==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/providers" "^5.0.10"
 | 
			
		||||
    ethers "^5.0.15"
 | 
			
		||||
 | 
			
		||||
ethereum-types@^2.1.6:
 | 
			
		||||
  version "2.1.6"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/ethereum-types/-/ethereum-types-2.1.6.tgz#57d9d515fad86ab987c0f6962c4203be37da8579"
 | 
			
		||||
| 
						 | 
				
			
			@ -7247,6 +7595,42 @@ ethereumjs-wallet@0.6.5:
 | 
			
		|||
    utf8 "^3.0.0"
 | 
			
		||||
    uuid "^3.3.2"
 | 
			
		||||
 | 
			
		||||
ethers@^5.0.15:
 | 
			
		||||
  version "5.6.4"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.6.4.tgz#23629e9a7d4bc5802dfb53d4da420d738744b53c"
 | 
			
		||||
  integrity sha512-62UIfxAQXdf67TeeOaoOoPctm5hUlYgfd0iW3wxfj7qRYKDcvvy0f+sJ3W2/Pyx77R8dblvejA8jokj+lS+ATQ==
 | 
			
		||||
  dependencies:
 | 
			
		||||
    "@ethersproject/abi" "5.6.1"
 | 
			
		||||
    "@ethersproject/abstract-provider" "5.6.0"
 | 
			
		||||
    "@ethersproject/abstract-signer" "5.6.0"
 | 
			
		||||
    "@ethersproject/address" "5.6.0"
 | 
			
		||||
    "@ethersproject/base64" "5.6.0"
 | 
			
		||||
    "@ethersproject/basex" "5.6.0"
 | 
			
		||||
    "@ethersproject/bignumber" "5.6.0"
 | 
			
		||||
    "@ethersproject/bytes" "5.6.1"
 | 
			
		||||
    "@ethersproject/constants" "5.6.0"
 | 
			
		||||
    "@ethersproject/contracts" "5.6.0"
 | 
			
		||||
    "@ethersproject/hash" "5.6.0"
 | 
			
		||||
    "@ethersproject/hdnode" "5.6.0"
 | 
			
		||||
    "@ethersproject/json-wallets" "5.6.0"
 | 
			
		||||
    "@ethersproject/keccak256" "5.6.0"
 | 
			
		||||
    "@ethersproject/logger" "5.6.0"
 | 
			
		||||
    "@ethersproject/networks" "5.6.2"
 | 
			
		||||
    "@ethersproject/pbkdf2" "5.6.0"
 | 
			
		||||
    "@ethersproject/properties" "5.6.0"
 | 
			
		||||
    "@ethersproject/providers" "5.6.4"
 | 
			
		||||
    "@ethersproject/random" "5.6.0"
 | 
			
		||||
    "@ethersproject/rlp" "5.6.0"
 | 
			
		||||
    "@ethersproject/sha2" "5.6.0"
 | 
			
		||||
    "@ethersproject/signing-key" "5.6.0"
 | 
			
		||||
    "@ethersproject/solidity" "5.6.0"
 | 
			
		||||
    "@ethersproject/strings" "5.6.0"
 | 
			
		||||
    "@ethersproject/transactions" "5.6.0"
 | 
			
		||||
    "@ethersproject/units" "5.6.0"
 | 
			
		||||
    "@ethersproject/wallet" "5.6.0"
 | 
			
		||||
    "@ethersproject/web" "5.6.0"
 | 
			
		||||
    "@ethersproject/wordlists" "5.6.0"
 | 
			
		||||
 | 
			
		||||
ethers@^5.4.5:
 | 
			
		||||
  version "5.4.7"
 | 
			
		||||
  resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.4.7.tgz#0fd491a5da7c9793de2d6058d76b41b1e7efba8f"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user