From 08cc23090a6fd3eb3d59c756721bc4368e95aeac Mon Sep 17 00:00:00 2001 From: Georges KABBOUCHI Date: Wed, 21 Jul 2021 23:53:46 +0300 Subject: [PATCH] polygon aave v2 pos --- abis/read/aaveV2.json | 168 +++++++++ assets/icons/back.svg | 5 + assets/icons/colored/aave.svg | 13 + components/Navbar.vue | 4 +- components/NetworkSwitcher.vue | 14 +- composables/useAaveV2Position.ts | 324 +++++++++++++++++ composables/useBigNumber.ts | 229 ++++++++++++ composables/useDSA.ts | 2 + composables/useFormatting.ts | 152 ++++++++ composables/useNetwork.ts | 31 ++ composables/useWeb3.ts | 23 +- constant/abi/makerProxyRegistry.json | 12 + constant/abi/read/aave.json | 66 ++++ constant/abi/read/aaveV2.json | 168 +++++++++ constant/abi/read/accounts.json | 520 +++++++++++++++++++++++++++ constant/abi/read/balance.json | 109 ++++++ constant/abi/read/compound.json | 250 +++++++++++++ constant/abi/read/maker.json | 1 + constant/abi/read/unipool.json | 71 ++++ constant/abis.ts | 23 ++ constant/addresses.ts | 32 ++ constant/atokens.ts | 54 +++ constant/atokensV2.ts | 42 +++ constant/ctokens.ts | 37 ++ constant/errorMessages.ts | 2 + constant/tokens.ts | 62 ++++ constant/tokens/vaults.ts | 41 +++ constant/uniPoolTokens.ts | 429 ++++++++++++++++++++++ layouts/default.vue | 32 +- package.json | 1 + pages/index.vue | 85 ++++- pages/mainnet/aave-v2.vue | 3 + pages/polygon/aave-v2.vue | 133 +++++++ tsconfig.json | 3 +- utils/create-token-utils.ts | 15 + utils/web3.ts | 16 + yarn.lock | 2 +- 37 files changed, 3119 insertions(+), 55 deletions(-) create mode 100644 abis/read/aaveV2.json create mode 100644 assets/icons/back.svg create mode 100644 assets/icons/colored/aave.svg create mode 100644 composables/useAaveV2Position.ts create mode 100644 composables/useBigNumber.ts create mode 100644 composables/useFormatting.ts create mode 100644 composables/useNetwork.ts create mode 100644 constant/abi/makerProxyRegistry.json create mode 100644 constant/abi/read/aave.json create mode 100644 constant/abi/read/aaveV2.json create mode 100644 constant/abi/read/accounts.json create mode 100644 constant/abi/read/balance.json create mode 100644 constant/abi/read/compound.json create mode 100644 constant/abi/read/maker.json create mode 100644 constant/abi/read/unipool.json create mode 100644 constant/abis.ts create mode 100644 constant/addresses.ts create mode 100644 constant/atokens.ts create mode 100644 constant/atokensV2.ts create mode 100644 constant/ctokens.ts create mode 100644 constant/errorMessages.ts create mode 100644 constant/tokens.ts create mode 100644 constant/tokens/vaults.ts create mode 100644 constant/uniPoolTokens.ts create mode 100644 pages/mainnet/aave-v2.vue create mode 100644 pages/polygon/aave-v2.vue create mode 100644 utils/create-token-utils.ts create mode 100644 utils/web3.ts diff --git a/abis/read/aaveV2.json b/abis/read/aaveV2.json new file mode 100644 index 0000000..48b0b08 --- /dev/null +++ b/abis/read/aaveV2.json @@ -0,0 +1,168 @@ +[{ + "inputs": [{ + "internalType": "address", + "name": "user", + "type": "address" + }, { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }], + "name": "getPosition", + "outputs": [{ + "components": [{ + "internalType": "uint256", + "name": "tokenPriceInEth", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "tokenPriceInUsd", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "supplyBalance", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "stableBorrowBalance", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "variableBorrowBalance", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "supplyRate", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "userStableBorrowRate", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "variableBorrowRate", + "type": "uint256" + }, { + "internalType": "bool", + "name": "isCollateral", + "type": "bool" + }, { + "components": [{ + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "reserveFactor", + "type": "uint256" + }, { + "internalType": "bool", + "name": "usageAsCollEnabled", + "type": "bool" + }, { + "internalType": "bool", + "name": "borrowEnabled", + "type": "bool" + }, { + "internalType": "bool", + "name": "stableBorrowEnabled", + "type": "bool" + }, { + "internalType": "bool", + "name": "isActive", + "type": "bool" + }, { + "internalType": "bool", + "name": "isFrozen", + "type": "bool" + }, { + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "availableLiquidity", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "totalStableDebt", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "totalVariableDebt", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "collateralEmission", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "debtEmission", + "type": "uint256" + }], + "internalType": "struct AaveHelpers.AaveTokenData", + "name": "aaveTokenData", + "type": "tuple" + }], + "internalType": "struct AaveHelpers.AaveUserTokenData[]", + "name": "", + "type": "tuple[]" + }, { + "components": [{ + "internalType": "uint256", + "name": "totalCollateralETH", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "totalBorrowsETH", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "availableBorrowsETH", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "currentLiquidationThreshold", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "healthFactor", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "ethPriceInUsd", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "pendingRewards", + "type": "uint256" + }], + "internalType": "struct AaveHelpers.AaveUserData", + "name": "", + "type": "tuple" + }], + "stateMutability": "view", + "type": "function" + }, { + "inputs": [], + "name": "name", + "outputs": [{ + "internalType": "string", + "name": "", + "type": "string" + }], + "stateMutability": "view", + "type": "function" + }] \ No newline at end of file diff --git a/assets/icons/back.svg b/assets/icons/back.svg new file mode 100644 index 0000000..ac0be76 --- /dev/null +++ b/assets/icons/back.svg @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/assets/icons/colored/aave.svg b/assets/icons/colored/aave.svg new file mode 100644 index 0000000..b9ef1c1 --- /dev/null +++ b/assets/icons/colored/aave.svg @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/components/Navbar.vue b/components/Navbar.vue index a89b483..cecfd65 100644 --- a/components/Navbar.vue +++ b/components/Navbar.vue @@ -2,7 +2,7 @@
-
+ ASSEMBLY -
+