|
| 1 | +// ABI for the Euler EVK Vault Lens at 0x0eaDDE9EfCf1540dcA8f94e813E12db55f8405a8 |
| 2 | +// Used to fetch lend vault info including supply/borrow APY from the IRM. |
| 3 | +// The full struct definition is required for correct ABI decoding. |
| 4 | + |
| 5 | +const assetPriceInfoComponents = [ |
| 6 | + { name: 'queryFailure', type: 'bool' }, |
| 7 | + { name: 'queryFailureReason', type: 'bytes' }, |
| 8 | + { name: 'timestamp', type: 'uint256' }, |
| 9 | + { name: 'oracle', type: 'address' }, |
| 10 | + { name: 'asset', type: 'address' }, |
| 11 | + { name: 'unitOfAccount', type: 'address' }, |
| 12 | + { name: 'amountIn', type: 'uint256' }, |
| 13 | + { name: 'amountOutMid', type: 'uint256' }, |
| 14 | + { name: 'amountOutBid', type: 'uint256' }, |
| 15 | + { name: 'amountOutAsk', type: 'uint256' }, |
| 16 | +] as const; |
| 17 | + |
| 18 | +const oracleDetailedInfoComponents = [ |
| 19 | + { name: 'oracle', type: 'address' }, |
| 20 | + { name: 'name', type: 'string' }, |
| 21 | + { name: 'oracleInfo', type: 'bytes' }, |
| 22 | +] as const; |
| 23 | + |
| 24 | +export const hypurrfiVaultLensAbi = [ |
| 25 | + { |
| 26 | + type: 'function', |
| 27 | + name: 'getVaultInfoFull', |
| 28 | + inputs: [{ name: 'vault', type: 'address' }], |
| 29 | + outputs: [ |
| 30 | + { |
| 31 | + name: '', |
| 32 | + type: 'tuple', |
| 33 | + components: [ |
| 34 | + { name: 'timestamp', type: 'uint256' }, |
| 35 | + { name: 'vault', type: 'address' }, |
| 36 | + { name: 'vaultName', type: 'string' }, |
| 37 | + { name: 'vaultSymbol', type: 'string' }, |
| 38 | + { name: 'vaultDecimals', type: 'uint256' }, |
| 39 | + { name: 'asset', type: 'address' }, |
| 40 | + { name: 'assetName', type: 'string' }, |
| 41 | + { name: 'assetSymbol', type: 'string' }, |
| 42 | + { name: 'assetDecimals', type: 'uint256' }, |
| 43 | + { name: 'unitOfAccount', type: 'address' }, |
| 44 | + { name: 'unitOfAccountName', type: 'string' }, |
| 45 | + { name: 'unitOfAccountSymbol', type: 'string' }, |
| 46 | + { name: 'unitOfAccountDecimals', type: 'uint256' }, |
| 47 | + { name: 'totalShares', type: 'uint256' }, |
| 48 | + { name: 'totalCash', type: 'uint256' }, |
| 49 | + { name: 'totalBorrowed', type: 'uint256' }, |
| 50 | + { name: 'totalAssets', type: 'uint256' }, |
| 51 | + { name: 'accumulatedFeesShares', type: 'uint256' }, |
| 52 | + { name: 'accumulatedFeesAssets', type: 'uint256' }, |
| 53 | + { name: 'governorFeeReceiver', type: 'address' }, |
| 54 | + { name: 'protocolFeeReceiver', type: 'address' }, |
| 55 | + { name: 'protocolFeeShare', type: 'uint256' }, |
| 56 | + { name: 'interestFee', type: 'uint256' }, |
| 57 | + { name: 'hookedOperations', type: 'uint256' }, |
| 58 | + { name: 'configFlags', type: 'uint256' }, |
| 59 | + { name: 'supplyCap', type: 'uint256' }, |
| 60 | + { name: 'borrowCap', type: 'uint256' }, |
| 61 | + { name: 'maxLiquidationDiscount', type: 'uint256' }, |
| 62 | + { name: 'liquidationCoolOffTime', type: 'uint256' }, |
| 63 | + { name: 'dToken', type: 'address' }, |
| 64 | + { name: 'oracle', type: 'address' }, |
| 65 | + { name: 'interestRateModel', type: 'address' }, |
| 66 | + { name: 'hookTarget', type: 'address' }, |
| 67 | + { name: 'evc', type: 'address' }, |
| 68 | + { name: 'protocolConfig', type: 'address' }, |
| 69 | + { name: 'balanceTracker', type: 'address' }, |
| 70 | + { name: 'permit2', type: 'address' }, |
| 71 | + { name: 'creator', type: 'address' }, |
| 72 | + { name: 'governorAdmin', type: 'address' }, |
| 73 | + { |
| 74 | + name: 'irmInfo', |
| 75 | + type: 'tuple', |
| 76 | + components: [ |
| 77 | + { name: 'queryFailure', type: 'bool' }, |
| 78 | + { name: 'queryFailureReason', type: 'bytes' }, |
| 79 | + { name: 'vault', type: 'address' }, |
| 80 | + { name: 'interestRateModel', type: 'address' }, |
| 81 | + { |
| 82 | + name: 'interestRateInfo', |
| 83 | + type: 'tuple[]', |
| 84 | + components: [ |
| 85 | + { name: 'cash', type: 'uint256' }, |
| 86 | + { name: 'borrows', type: 'uint256' }, |
| 87 | + { name: 'borrowSPY', type: 'uint256' }, |
| 88 | + { name: 'borrowAPY', type: 'uint256' }, |
| 89 | + { name: 'supplyAPY', type: 'uint256' }, |
| 90 | + ], |
| 91 | + }, |
| 92 | + { |
| 93 | + name: 'interestRateModelInfo', |
| 94 | + type: 'tuple', |
| 95 | + components: [ |
| 96 | + { name: 'interestRateModel', type: 'address' }, |
| 97 | + { name: 'interestRateModelType', type: 'uint8' }, |
| 98 | + { name: 'interestRateModelParams', type: 'bytes' }, |
| 99 | + ], |
| 100 | + }, |
| 101 | + ], |
| 102 | + }, |
| 103 | + { |
| 104 | + name: 'collateralLTVInfo', |
| 105 | + type: 'tuple[]', |
| 106 | + components: [ |
| 107 | + { name: 'collateral', type: 'address' }, |
| 108 | + { name: 'borrowLTV', type: 'uint256' }, |
| 109 | + { name: 'liquidationLTV', type: 'uint256' }, |
| 110 | + { name: 'initialLiquidationLTV', type: 'uint256' }, |
| 111 | + { name: 'targetTimestamp', type: 'uint256' }, |
| 112 | + { name: 'rampDuration', type: 'uint256' }, |
| 113 | + ], |
| 114 | + }, |
| 115 | + { name: 'liabilityPriceInfo', type: 'tuple', components: assetPriceInfoComponents }, |
| 116 | + { name: 'collateralPriceInfo', type: 'tuple[]', components: assetPriceInfoComponents }, |
| 117 | + { name: 'oracleInfo', type: 'tuple', components: oracleDetailedInfoComponents }, |
| 118 | + { name: 'backupAssetPriceInfo', type: 'tuple', components: assetPriceInfoComponents }, |
| 119 | + { name: 'backupAssetOracleInfo', type: 'tuple', components: oracleDetailedInfoComponents }, |
| 120 | + ], |
| 121 | + }, |
| 122 | + ], |
| 123 | + stateMutability: 'view', |
| 124 | + }, |
| 125 | +] as const; |
0 commit comments