diff --git a/deployment/deployment.json b/deployment/deployment.json index 8b1e071b51..9e3850226d 100644 --- a/deployment/deployment.json +++ b/deployment/deployment.json @@ -675,6 +675,246 @@ } } }, + "kinza-finance": { + "schema": "lending", + "base": "aave-forks", + "protocol": "kinza-finance", + "project": "kinza-finance", + "deployments": { + "kinza-finance-bsc": { + "network": "bsc", + "status": "prod", + "versions": { + "schema": "3.1.0", + "subgraph": "1.0.0", + "methodology": "1.0.0" + }, + "files": { + "template": "kinza.finance.template.yaml" + }, + "options": { + "prepare:yaml": true, + "prepare:constants": false + }, + "services": { + "hosted-service": { + "slug": "kinza-finance-bsc", + "query-id": "kinza-finance-bsc" + }, + "decentralized-network": { + "slug": "kinza-finance-bsc", + "query-id": "todo" + } + } + } + } + }, + "seismic": { + "schema": "lending", + "base": "aave-forks", + "protocol": "seismic", + "project": "seismic", + "deployments": { + "seismic-blast": { + "network": "blast-mainnet", + "status": "prod", + "versions": { + "schema": "3.1.0", + "subgraph": "1.0.0", + "methodology": "1.0.0" + }, + "files": { + "template": "seismic.template.yaml" + }, + "options": { + "prepare:yaml": true, + "prepare:constants": false + }, + "services": { + "hosted-service": { + "slug": "seismic-blast", + "query-id": "seismic-blast" + }, + "decentralized-network": { + "slug": "seismic-blast", + "query-id": "todo" + } + } + } + } + }, + "pac-finance": { + "schema": "lending", + "base": "aave-forks", + "protocol": "pac-finance", + "project": "pac-finance", + "deployments": { + "pac-finance-blast": { + "network": "blast-mainnet", + "status": "prod", + "versions": { + "schema": "3.1.0", + "subgraph": "1.0.0", + "methodology": "1.0.0" + }, + "files": { + "template": "pac.finance.template.yaml" + }, + "options": { + "prepare:yaml": true, + "prepare:constants": false + }, + "services": { + "hosted-service": { + "slug": "pac-finance-blast", + "query-id": "pac-finance-blast" + }, + "decentralized-network": { + "slug": "pac-finance-blast", + "query-id": "todo" + } + } + } + } + }, + "zerolend": { + "schema": "lending", + "base": "aave-forks", + "protocol": "zerolend", + "project": "zerolend", + "deployments": { + "zerolend-ethereum": { + "network": "ethereum", + "status": "prod", + "versions": { + "schema": "3.1.0", + "subgraph": "1.0.0", + "methodology": "1.0.0" + }, + "files": { + "template": "zerolend.template.yaml" + }, + "options": { + "prepare:yaml": true, + "prepare:constants": false + }, + "services": { + "hosted-service": { + "slug": "zerolend-ethereum", + "query-id": "zerolend-ethereum" + }, + "decentralized-network": { + "slug": "zerolend-ethereum", + "query-id": "todo" + } + } + }, + "zerolend-blast": { + "network": "blast-mainnet", + "status": "prod", + "versions": { + "schema": "3.1.0", + "subgraph": "1.0.0", + "methodology": "1.0.0" + }, + "files": { + "template": "zerolend.template.yaml" + }, + "options": { + "prepare:yaml": true, + "prepare:constants": false + }, + "services": { + "hosted-service": { + "slug": "zerolend-blast", + "query-id": "zerolend-blast" + }, + "decentralized-network": { + "slug": "zerolend-blast", + "query-id": "todo" + } + } + }, + "zerolend-zksync-era": { + "network": "zksync-era", + "status": "prod", + "versions": { + "schema": "3.1.0", + "subgraph": "1.0.0", + "methodology": "1.0.0" + }, + "files": { + "template": "zerolend.template.yaml" + }, + "options": { + "prepare:yaml": true, + "prepare:constants": false + }, + "services": { + "hosted-service": { + "slug": "zerolend-zksync-era", + "query-id": "zerolend-zksync-era" + }, + "decentralized-network": { + "slug": "zerolend-zksync-era", + "query-id": "todo" + } + } + }, + "zerolend-linea": { + "network": "linea", + "status": "prod", + "versions": { + "schema": "3.1.0", + "subgraph": "1.0.0", + "methodology": "1.0.0" + }, + "files": { + "template": "zerolend.template.yaml" + }, + "options": { + "prepare:yaml": true, + "prepare:constants": false + }, + "services": { + "hosted-service": { + "slug": "zerolend-linea", + "query-id": "zerolend-linea" + }, + "decentralized-network": { + "slug": "zerolend-linea", + "query-id": "todo" + } + } + }, + "zerolend-xlayer": { + "network": "xlayer-mainnet", + "status": "prod", + "versions": { + "schema": "3.1.0", + "subgraph": "1.0.0", + "methodology": "1.0.0" + }, + "files": { + "template": "zerolend.template.yaml" + }, + "options": { + "prepare:yaml": true, + "prepare:constants": false + }, + "services": { + "hosted-service": { + "slug": "zerolend-xlayer", + "query-id": "zerolend-xlayer" + }, + "decentralized-network": { + "slug": "zerolend-xlayer", + "query-id": "todo" + } + } + } + } + }, "alpaca-finance-lending": { "schema": "lending", "base": "alpaca-finance-lending", diff --git a/subgraphs/aave-forks/abis/kinza-finance/AToken.json b/subgraphs/aave-forks/abis/kinza-finance/AToken.json new file mode 100644 index 0000000000..79bd31f9cc --- /dev/null +++ b/subgraphs/aave-forks/abis/kinza-finance/AToken.json @@ -0,0 +1,568 @@ +[ + { + "inputs": [ + { "internalType": "contract IPool", "name": "pool", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "BalanceTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "treasury", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "aTokenDecimals", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "string", + "name": "aTokenName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "aTokenSymbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "ATOKEN_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EIP712_REVISION", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL", + "outputs": [ + { "internalType": "contract IPool", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RESERVE_TREASURY_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERLYING_ASSET_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { + "internalType": "address", + "name": "receiverOfUnderlying", + "type": "address" + }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getIncentivesController", + "outputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getPreviousIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getScaledUserBalanceAndSupply", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "handleRepayment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPool", + "name": "initializingPool", + "type": "address" + }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "internalType": "contract IAaveIncentivesController", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "uint8", "name": "aTokenDecimals", "type": "uint8" }, + { "internalType": "string", "name": "aTokenName", "type": "string" }, + { "internalType": "string", "name": "aTokenSymbol", "type": "string" }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "caller", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "mint", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "mintToTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "rescueTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "scaledBalanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "scaledTotalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "controller", + "type": "address" + } + ], + "name": "setIncentivesController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "transferOnLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "target", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferUnderlyingTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/kinza-finance/AaveOracle.json b/subgraphs/aave-forks/abis/kinza-finance/AaveOracle.json new file mode 100644 index 0000000000..3149642bb9 --- /dev/null +++ b/subgraphs/aave-forks/abis/kinza-finance/AaveOracle.json @@ -0,0 +1,159 @@ +[ + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + }, + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address[]", "name": "sources", "type": "address[]" }, + { + "internalType": "address", + "name": "fallbackOracle", + "type": "address" + }, + { "internalType": "address", "name": "baseCurrency", "type": "address" }, + { + "internalType": "uint256", + "name": "baseCurrencyUnit", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "source", + "type": "address" + } + ], + "name": "AssetSourceUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baseCurrency", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseCurrencyUnit", + "type": "uint256" + } + ], + "name": "BaseCurrencySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fallbackOracle", + "type": "address" + } + ], + "name": "FallbackOracleUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "ADDRESSES_PROVIDER", + "outputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BASE_CURRENCY", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BASE_CURRENCY_UNIT", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getAssetPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" } + ], + "name": "getAssetsPrices", + "outputs": [ + { "internalType": "uint256[]", "name": "", "type": "uint256[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFallbackOracle", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getSourceOfAsset", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address[]", "name": "sources", "type": "address[]" } + ], + "name": "setAssetSources", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "fallbackOracle", "type": "address" } + ], + "name": "setFallbackOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/kinza-finance/LendingPool.json b/subgraphs/aave-forks/abis/kinza-finance/LendingPool.json new file mode 100644 index 0000000000..78122307ae --- /dev/null +++ b/subgraphs/aave-forks/abis/kinza-finance/LendingPool.json @@ -0,0 +1,1265 @@ +[ + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "backer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "BackUnbacked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum DataTypes.InterestRateMode", + "name": "interestRateMode", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "Borrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "initiator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum DataTypes.InterestRateMode", + "name": "interestRateMode", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "premium", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "FlashLoan", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalDebt", + "type": "uint256" + } + ], + "name": "IsolationModeTotalDebtUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateralAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "debtAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "debtToCover", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidatedCollateralAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "receiveAToken", + "type": "bool" + } + ], + "name": "LiquidationCall", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "MintUnbacked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountMinted", + "type": "uint256" + } + ], + "name": "MintedToTreasury", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "RebalanceStableBorrowRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "repayer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "useATokens", + "type": "bool" + } + ], + "name": "Repay", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidityRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "variableBorrowRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidityIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "variableBorrowIndex", + "type": "uint256" + } + ], + "name": "ReserveDataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ReserveUsedAsCollateralDisabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ReserveUsedAsCollateralEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "Supply", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum DataTypes.InterestRateMode", + "name": "interestRateMode", + "type": "uint8" + } + ], + "name": "SwapBorrowRateMode", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "categoryId", + "type": "uint8" + } + ], + "name": "UserEModeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "ADDRESSES_PROVIDER", + "outputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BRIDGE_PROTOCOL_FEE", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FLASHLOAN_PREMIUM_TOTAL", + "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FLASHLOAN_PREMIUM_TO_PROTOCOL", + "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_NUMBER_RESERVES", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_STABLE_RATE_BORROW_SIZE_PERCENT", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "fee", "type": "uint256" } + ], + "name": "backUnbacked", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" } + ], + "name": "borrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "id", "type": "uint8" }, + { + "components": [ + { "internalType": "uint16", "name": "ltv", "type": "uint16" }, + { + "internalType": "uint16", + "name": "liquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationBonus", + "type": "uint16" + }, + { + "internalType": "address", + "name": "priceSource", + "type": "address" + }, + { "internalType": "string", "name": "label", "type": "string" } + ], + "internalType": "struct DataTypes.EModeCategory", + "name": "category", + "type": "tuple" + } + ], + "name": "configureEModeCategory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint128", + "name": "blacklistBitmap", + "type": "uint128" + } + ], + "name": "configureReserveBlacklistBitmap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "dropReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "balanceFromBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceToBefore", + "type": "uint256" + } + ], + "name": "finalizeTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { + "internalType": "uint256[]", + "name": "interestRateModes", + "type": "uint256[]" + }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "bytes", "name": "params", "type": "bytes" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "flashLoan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "bytes", "name": "params", "type": "bytes" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "flashLoanSimple", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getConfiguration", + "outputs": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint8", "name": "id", "type": "uint8" }], + "name": "getEModeCategoryData", + "outputs": [ + { + "components": [ + { "internalType": "uint16", "name": "ltv", "type": "uint16" }, + { + "internalType": "uint16", + "name": "liquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationBonus", + "type": "uint16" + }, + { + "internalType": "address", + "name": "priceSource", + "type": "address" + }, + { "internalType": "string", "name": "label", "type": "string" } + ], + "internalType": "struct DataTypes.EModeCategory", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "id", "type": "uint16" }], + "name": "getReserveAddressById", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveBitmap", + "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "assetToBorrow", "type": "address" } + ], + "name": "getReserveBorrowable", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveData", + "outputs": [ + { + "components": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "configuration", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "liquidityIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentLiquidityRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "variableBorrowIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentVariableBorrowRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentStableBorrowRate", + "type": "uint128" + }, + { + "internalType": "uint40", + "name": "lastUpdateTimestamp", + "type": "uint40" + }, + { "internalType": "uint16", "name": "id", "type": "uint16" }, + { + "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": "uint128", + "name": "accruedToTreasury", + "type": "uint128" + }, + { "internalType": "uint128", "name": "unbacked", "type": "uint128" }, + { + "internalType": "uint128", + "name": "isolationModeTotalDebt", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "blacklistBitmap", + "type": "uint128" + } + ], + "internalType": "struct DataTypes.ReserveData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveNormalizedIncome", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveNormalizedVariableDebt", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getReservesList", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserAccountData", + "outputs": [ + { + "internalType": "uint256", + "name": "totalCollateralBase", + "type": "uint256" + }, + { "internalType": "uint256", "name": "totalDebtBase", "type": "uint256" }, + { + "internalType": "uint256", + "name": "availableBorrowsBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentLiquidationThreshold", + "type": "uint256" + }, + { "internalType": "uint256", "name": "ltv", "type": "uint256" }, + { "internalType": "uint256", "name": "healthFactor", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserConfiguration", + "outputs": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.UserConfigurationMap", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserEMode", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "aTokenAddress", "type": "address" }, + { + "internalType": "address", + "name": "stableDebtAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + } + ], + "name": "initReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralAsset", + "type": "address" + }, + { "internalType": "address", "name": "debtAsset", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "debtToCover", "type": "uint256" }, + { "internalType": "bool", "name": "receiveAToken", "type": "bool" } + ], + "name": "liquidationCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" } + ], + "name": "mintToTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "mintUnbacked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "rebalanceStableBorrowRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" } + ], + "name": "repay", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + } + ], + "name": "repayWithATokens", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "permitV", "type": "uint8" }, + { "internalType": "bytes32", "name": "permitR", "type": "bytes32" }, + { "internalType": "bytes32", "name": "permitS", "type": "bytes32" } + ], + "name": "repayWithPermit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "rescueTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "resetIsolationModeTotalDebt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "configuration", + "type": "tuple" + } + ], + "name": "setConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "rateStrategyAddress", + "type": "address" + } + ], + "name": "setReserveInterestRateStrategyAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "categoryId", "type": "uint8" } + ], + "name": "setUserEMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "useAsCollateral", "type": "bool" } + ], + "name": "setUserUseReserveAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "supply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "permitV", "type": "uint8" }, + { "internalType": "bytes32", "name": "permitR", "type": "bytes32" }, + { "internalType": "bytes32", "name": "permitS", "type": "bytes32" } + ], + "name": "supplyWithPermit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + } + ], + "name": "swapBorrowRateMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "protocolFee", "type": "uint256" } + ], + "name": "updateBridgeProtocolFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "flashLoanPremiumTotal", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "flashLoanPremiumToProtocol", + "type": "uint128" + } + ], + "name": "updateFlashloanPremiums", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "withdraw", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/kinza-finance/LendingPoolAddressesProvider.json b/subgraphs/aave-forks/abis/kinza-finance/LendingPoolAddressesProvider.json new file mode 100644 index 0000000000..4287c98808 --- /dev/null +++ b/subgraphs/aave-forks/abis/kinza-finance/LendingPoolAddressesProvider.json @@ -0,0 +1,456 @@ +[ + { + "inputs": [ + { "internalType": "string", "name": "marketId", "type": "string" }, + { "internalType": "address", "name": "owner", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "ACLAdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "ACLManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "AddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldImplementationAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newImplementationAddress", + "type": "address" + } + ], + "name": "AddressSetAsProxy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "oldMarketId", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "newMarketId", + "type": "string" + } + ], + "name": "MarketIdSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PoolConfiguratorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PoolDataProviderUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PoolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PriceOracleSentinelUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PriceOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementationAddress", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "inputs": [], + "name": "getACLAdmin", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getACLManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "id", "type": "bytes32" }], + "name": "getAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMarketId", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPool", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolConfigurator", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolDataProvider", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPriceOracle", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPriceOracleSentinel", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newAclAdmin", "type": "address" } + ], + "name": "setACLAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newAclManager", "type": "address" } + ], + "name": "setACLManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "id", "type": "bytes32" }, + { "internalType": "address", "name": "newAddress", "type": "address" } + ], + "name": "setAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "id", "type": "bytes32" }, + { + "internalType": "address", + "name": "newImplementationAddress", + "type": "address" + } + ], + "name": "setAddressAsProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "newMarketId", "type": "string" } + ], + "name": "setMarketId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPoolConfiguratorImpl", + "type": "address" + } + ], + "name": "setPoolConfiguratorImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newDataProvider", + "type": "address" + } + ], + "name": "setPoolDataProvider", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newPoolImpl", "type": "address" } + ], + "name": "setPoolImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newPriceOracle", "type": "address" } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPriceOracleSentinel", + "type": "address" + } + ], + "name": "setPriceOracleSentinel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/kinza-finance/LendingPoolConfigurator.json b/subgraphs/aave-forks/abis/kinza-finance/LendingPoolConfigurator.json new file mode 100644 index 0000000000..addbf8ec54 --- /dev/null +++ b/subgraphs/aave-forks/abis/kinza-finance/LendingPoolConfigurator.json @@ -0,0 +1,1104 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ATokenUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBorrowCap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBorrowCap", + "type": "uint256" + } + ], + "name": "BorrowCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "borrowable", + "type": "bool" + } + ], + "name": "BorrowableInIsolationChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldBridgeProtocolFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBridgeProtocolFee", + "type": "uint256" + } + ], + "name": "BridgeProtocolFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + } + ], + "name": "CollateralConfigurationChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldDebtCeiling", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newDebtCeiling", + "type": "uint256" + } + ], + "name": "DebtCeilingChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "oldCategoryId", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "newCategoryId", + "type": "uint8" + } + ], + "name": "EModeAssetCategoryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "categoryId", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "oracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "EModeCategoryAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "oldFlashloanPremiumToProtocol", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "newFlashloanPremiumToProtocol", + "type": "uint128" + } + ], + "name": "FlashloanPremiumToProtocolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "oldFlashloanPremiumTotal", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "newFlashloanPremiumTotal", + "type": "uint128" + } + ], + "name": "FlashloanPremiumTotalUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newFee", + "type": "uint256" + } + ], + "name": "LiquidationProtocolFeeChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "ReserveActive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "bitmapBlacklist", + "type": "uint128" + } + ], + "name": "ReserveBlacklistBitmapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "ReserveBorrowing", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "ReserveDropped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldReserveFactor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newReserveFactor", + "type": "uint256" + } + ], + "name": "ReserveFactorChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "ReserveFlashLoaning", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "frozen", + "type": "bool" + } + ], + "name": "ReserveFrozen", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "aToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "stableDebtToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "variableDebtToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + } + ], + "name": "ReserveInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldStrategy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newStrategy", + "type": "address" + } + ], + "name": "ReserveInterestRateStrategyChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "ReservePaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "ReserveStableRateBorrowing", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldState", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newState", + "type": "bool" + } + ], + "name": "SiloedBorrowingChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "StableDebtTokenUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldSupplyCap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "SupplyCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldUnbackedMintCap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newUnbackedMintCap", + "type": "uint256" + } + ], + "name": "UnbackedMintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "VariableDebtTokenUpgraded", + "type": "event" + }, + { + "inputs": [], + "name": "CONFIGURATOR_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "ltv", "type": "uint256" }, + { + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + } + ], + "name": "configureReserveAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "dropReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "aTokenImpl", + "type": "address" + }, + { + "internalType": "address", + "name": "stableDebtTokenImpl", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtTokenImpl", + "type": "address" + }, + { + "internalType": "uint8", + "name": "underlyingAssetDecimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "aTokenName", "type": "string" }, + { + "internalType": "string", + "name": "aTokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "variableDebtTokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "variableDebtTokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "stableDebtTokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "stableDebtTokenSymbol", + "type": "string" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.InitReserveInput[]", + "name": "input", + "type": "tuple[]" + } + ], + "name": "initReserves", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint8", "name": "newCategoryId", "type": "uint8" } + ], + "name": "setAssetEModeCategory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newBorrowCap", "type": "uint256" } + ], + "name": "setBorrowCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "borrowable", "type": "bool" } + ], + "name": "setBorrowableInIsolation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newDebtCeiling", "type": "uint256" } + ], + "name": "setDebtCeiling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "categoryId", "type": "uint8" }, + { "internalType": "uint16", "name": "ltv", "type": "uint16" }, + { + "internalType": "uint16", + "name": "liquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationBonus", + "type": "uint16" + }, + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "string", "name": "label", "type": "string" } + ], + "name": "setEModeCategory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newFee", "type": "uint256" } + ], + "name": "setLiquidationProtocolFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "paused", "type": "bool" }], + "name": "setPoolPause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "active", "type": "bool" } + ], + "name": "setReserveActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint128", + "name": "blacklistBitmap", + "type": "uint128" + } + ], + "name": "setReserveBlacklistBitmap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "setReserveBorrowing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint256", + "name": "newReserveFactor", + "type": "uint256" + } + ], + "name": "setReserveFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "setReserveFlashLoaning", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "freeze", "type": "bool" } + ], + "name": "setReserveFreeze", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "newRateStrategyAddress", + "type": "address" + } + ], + "name": "setReserveInterestRateStrategyAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "paused", "type": "bool" } + ], + "name": "setReservePause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "setReserveStableRateBorrowing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "newSiloed", "type": "bool" } + ], + "name": "setSiloedBorrowing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newSupplyCap", "type": "uint256" } + ], + "name": "setSupplyCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint256", + "name": "newUnbackedMintCap", + "type": "uint256" + } + ], + "name": "setUnbackedMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.UpdateATokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateAToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newBridgeProtocolFee", + "type": "uint256" + } + ], + "name": "updateBridgeProtocolFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newFlashloanPremiumToProtocol", + "type": "uint128" + } + ], + "name": "updateFlashloanPremiumToProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newFlashloanPremiumTotal", + "type": "uint128" + } + ], + "name": "updateFlashloanPremiumTotal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.UpdateDebtTokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateStableDebtToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.UpdateDebtTokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateVariableDebtToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/kinza-finance/RewardsController.json b/subgraphs/aave-forks/abis/kinza-finance/RewardsController.json new file mode 100644 index 0000000000..2ddb1e1158 --- /dev/null +++ b/subgraphs/aave-forks/abis/kinza-finance/RewardsController.json @@ -0,0 +1,594 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "emissionManager", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "reward", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assetIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "userIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsAccrued", + "type": "uint256" + } + ], + "name": "Accrued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "reward", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldEmission", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newEmission", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldDistributionEnd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newDistributionEnd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assetIndex", + "type": "uint256" + } + ], + "name": "AssetConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "claimer", + "type": "address" + } + ], + "name": "ClaimerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reward", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "rewardOracle", + "type": "address" + } + ], + "name": "RewardOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "reward", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "claimer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RewardsClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reward", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "transferStrategy", + "type": "address" + } + ], + "name": "TransferStrategyInstalled", + "type": "event" + }, + { + "inputs": [], + "name": "EMISSION_MANAGER", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "claimAllRewards", + "outputs": [ + { + "internalType": "address[]", + "name": "rewardsList", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "claimedAmounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "claimAllRewardsOnBehalf", + "outputs": [ + { + "internalType": "address[]", + "name": "rewardsList", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "claimedAmounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" } + ], + "name": "claimAllRewardsToSelf", + "outputs": [ + { + "internalType": "address[]", + "name": "rewardsList", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "claimedAmounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "claimRewards", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "claimRewardsOnBehalf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "claimRewardsToSelf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint88", + "name": "emissionPerSecond", + "type": "uint88" + }, + { + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "distributionEnd", + "type": "uint32" + }, + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" }, + { + "internalType": "contract ITransferStrategyBase", + "name": "transferStrategy", + "type": "address" + }, + { + "internalType": "contract IEACAggregatorProxy", + "name": "rewardOracle", + "type": "address" + } + ], + "internalType": "struct RewardsDataTypes.RewardsConfigInput[]", + "name": "config", + "type": "tuple[]" + } + ], + "name": "configureAssets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getAllUserRewards", + "outputs": [ + { + "internalType": "address[]", + "name": "rewardsList", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "unclaimedAmounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getAssetDecimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getAssetIndex", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getClaimer", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getDistributionEnd", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getEmissionManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getRewardOracle", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getRewardsByAsset", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getRewardsData", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardsList", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getTransferStrategy", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getUserAccruedRewards", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getUserAssetIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getUserRewards", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, + { "internalType": "uint256", "name": "userBalance", "type": "uint256" } + ], + "name": "handleAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "caller", "type": "address" } + ], + "name": "setClaimer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" }, + { + "internalType": "uint32", + "name": "newDistributionEnd", + "type": "uint32" + } + ], + "name": "setDistributionEnd", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[]", "name": "rewards", "type": "address[]" }, + { + "internalType": "uint88[]", + "name": "newEmissionsPerSecond", + "type": "uint88[]" + } + ], + "name": "setEmissionPerSecond", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "reward", "type": "address" }, + { + "internalType": "contract IEACAggregatorProxy", + "name": "rewardOracle", + "type": "address" + } + ], + "name": "setRewardOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "reward", "type": "address" }, + { + "internalType": "contract ITransferStrategyBase", + "name": "transferStrategy", + "type": "address" + } + ], + "name": "setTransferStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/kinza-finance/StableDebtToken.json b/subgraphs/aave-forks/abis/kinza-finance/StableDebtToken.json new file mode 100644 index 0000000000..38c834b3c0 --- /dev/null +++ b/subgraphs/aave-forks/abis/kinza-finance/StableDebtToken.json @@ -0,0 +1,568 @@ +[ + { + "inputs": [ + { "internalType": "contract IPool", "name": "pool", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fromUser", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toUser", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BorrowAllowanceDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "avgStableRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalSupply", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "debtTokenDecimals", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "string", + "name": "debtTokenName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "debtTokenSymbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "avgStableRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalSupply", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEBT_TOKEN_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DELEGATION_WITH_SIG_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EIP712_REVISION", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL", + "outputs": [ + { "internalType": "contract IPool", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERLYING_ASSET_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegatee", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approveDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "fromUser", "type": "address" }, + { "internalType": "address", "name": "toUser", "type": "address" } + ], + "name": "borrowAllowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "burn", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegator", "type": "address" }, + { "internalType": "address", "name": "delegatee", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "delegationWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAverageStableRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getIncentivesController", + "outputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSupplyData", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint40", "name": "", "type": "uint40" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalSupplyAndAvgRate", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalSupplyLastUpdated", + "outputs": [{ "internalType": "uint40", "name": "", "type": "uint40" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserLastUpdated", + "outputs": [{ "internalType": "uint40", "name": "", "type": "uint40" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserStableRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPool", + "name": "initializingPool", + "type": "address" + }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "internalType": "contract IAaveIncentivesController", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "uint8", "name": "debtTokenDecimals", "type": "uint8" }, + { "internalType": "string", "name": "debtTokenName", "type": "string" }, + { "internalType": "string", "name": "debtTokenSymbol", "type": "string" }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "rate", "type": "uint256" } + ], + "name": "mint", + "outputs": [ + { "internalType": "bool", "name": "", "type": "bool" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "principalBalanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "controller", + "type": "address" + } + ], + "name": "setIncentivesController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/kinza-finance/VariableDebtToken.json b/subgraphs/aave-forks/abis/kinza-finance/VariableDebtToken.json new file mode 100644 index 0000000000..2907474e42 --- /dev/null +++ b/subgraphs/aave-forks/abis/kinza-finance/VariableDebtToken.json @@ -0,0 +1,515 @@ +[ + { + "inputs": [ + { "internalType": "contract IPool", "name": "pool", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fromUser", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toUser", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BorrowAllowanceDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "debtTokenDecimals", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "string", + "name": "debtTokenName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "debtTokenSymbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEBT_TOKEN_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DELEGATION_WITH_SIG_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EIP712_REVISION", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL", + "outputs": [ + { "internalType": "contract IPool", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERLYING_ASSET_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegatee", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approveDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "fromUser", "type": "address" }, + { "internalType": "address", "name": "toUser", "type": "address" } + ], + "name": "borrowAllowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "burn", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegator", "type": "address" }, + { "internalType": "address", "name": "delegatee", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "delegationWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getIncentivesController", + "outputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getPreviousIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getScaledUserBalanceAndSupply", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPool", + "name": "initializingPool", + "type": "address" + }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "internalType": "contract IAaveIncentivesController", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "uint8", "name": "debtTokenDecimals", "type": "uint8" }, + { "internalType": "string", "name": "debtTokenName", "type": "string" }, + { "internalType": "string", "name": "debtTokenSymbol", "type": "string" }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "mint", + "outputs": [ + { "internalType": "bool", "name": "", "type": "bool" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "scaledBalanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "scaledTotalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "controller", + "type": "address" + } + ], + "name": "setIncentivesController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/pac-finance/AToken.json b/subgraphs/aave-forks/abis/pac-finance/AToken.json new file mode 100644 index 0000000000..b1cf1b011c --- /dev/null +++ b/subgraphs/aave-forks/abis/pac-finance/AToken.json @@ -0,0 +1,630 @@ +[ + { + "inputs": [ + { "internalType": "contract IPool", "name": "pool", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "BalanceTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "treasury", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "aTokenDecimals", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "string", + "name": "aTokenName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "aTokenSymbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "ATOKEN_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BLAST", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EIP712_REVISION", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL", + "outputs": [ + { "internalType": "contract IPool", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RESERVE_TREASURY_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERLYING_ASSET_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { + "internalType": "address", + "name": "receiverOfUnderlying", + "type": "address" + }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" } + ], + "name": "claimRefundedGas", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" } + ], + "name": "claimYield", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "configureClaimableYield", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "blastPoints", "type": "address" }, + { "internalType": "address", "name": "pointsOperator", "type": "address" } + ], + "name": "configurePointOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getIncentivesController", + "outputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getPreviousIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getScaledUserBalanceAndSupply", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "handleRepayment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPool", + "name": "initializingPool", + "type": "address" + }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "internalType": "contract IAaveIncentivesController", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "uint8", "name": "aTokenDecimals", "type": "uint8" }, + { "internalType": "string", "name": "aTokenName", "type": "string" }, + { "internalType": "string", "name": "aTokenSymbol", "type": "string" }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "caller", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "mint", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "mintToTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "rescueTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "scaledBalanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "scaledTotalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "controller", + "type": "address" + } + ], + "name": "setIncentivesController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_yieldDistributor", + "type": "address" + } + ], + "name": "setYieldDistributor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "transferOnLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "target", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferUnderlyingTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "yieldDistributor", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/pac-finance/AaveOracle.json b/subgraphs/aave-forks/abis/pac-finance/AaveOracle.json new file mode 100644 index 0000000000..3149642bb9 --- /dev/null +++ b/subgraphs/aave-forks/abis/pac-finance/AaveOracle.json @@ -0,0 +1,159 @@ +[ + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + }, + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address[]", "name": "sources", "type": "address[]" }, + { + "internalType": "address", + "name": "fallbackOracle", + "type": "address" + }, + { "internalType": "address", "name": "baseCurrency", "type": "address" }, + { + "internalType": "uint256", + "name": "baseCurrencyUnit", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "source", + "type": "address" + } + ], + "name": "AssetSourceUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baseCurrency", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseCurrencyUnit", + "type": "uint256" + } + ], + "name": "BaseCurrencySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fallbackOracle", + "type": "address" + } + ], + "name": "FallbackOracleUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "ADDRESSES_PROVIDER", + "outputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BASE_CURRENCY", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BASE_CURRENCY_UNIT", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getAssetPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" } + ], + "name": "getAssetsPrices", + "outputs": [ + { "internalType": "uint256[]", "name": "", "type": "uint256[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFallbackOracle", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getSourceOfAsset", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address[]", "name": "sources", "type": "address[]" } + ], + "name": "setAssetSources", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "fallbackOracle", "type": "address" } + ], + "name": "setFallbackOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/pac-finance/LendingPool.json b/subgraphs/aave-forks/abis/pac-finance/LendingPool.json new file mode 100644 index 0000000000..72579ddd74 --- /dev/null +++ b/subgraphs/aave-forks/abis/pac-finance/LendingPool.json @@ -0,0 +1,1254 @@ +[ + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + }, + { "internalType": "address", "name": "blast", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "backer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "BackUnbacked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum DataTypes.InterestRateMode", + "name": "interestRateMode", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "Borrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "initiator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum DataTypes.InterestRateMode", + "name": "interestRateMode", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "premium", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "FlashLoan", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalDebt", + "type": "uint256" + } + ], + "name": "IsolationModeTotalDebtUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateralAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "debtAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "debtToCover", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidatedCollateralAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "receiveAToken", + "type": "bool" + } + ], + "name": "LiquidationCall", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "MintUnbacked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountMinted", + "type": "uint256" + } + ], + "name": "MintedToTreasury", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "RebalanceStableBorrowRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "repayer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "useATokens", + "type": "bool" + } + ], + "name": "Repay", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidityRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "variableBorrowRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidityIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "variableBorrowIndex", + "type": "uint256" + } + ], + "name": "ReserveDataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ReserveUsedAsCollateralDisabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ReserveUsedAsCollateralEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "Supply", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum DataTypes.InterestRateMode", + "name": "interestRateMode", + "type": "uint8" + } + ], + "name": "SwapBorrowRateMode", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "categoryId", + "type": "uint8" + } + ], + "name": "UserEModeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "ADDRESSES_PROVIDER", + "outputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BLAST", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BRIDGE_PROTOCOL_FEE", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FLASHLOAN_PREMIUM_TOTAL", + "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FLASHLOAN_PREMIUM_TO_PROTOCOL", + "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_NUMBER_RESERVES", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_STABLE_RATE_BORROW_SIZE_PERCENT", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "fee", "type": "uint256" } + ], + "name": "backUnbacked", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" } + ], + "name": "borrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" } + ], + "name": "claimRefundedGas", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "id", "type": "uint8" }, + { + "components": [ + { "internalType": "uint16", "name": "ltv", "type": "uint16" }, + { + "internalType": "uint16", + "name": "liquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationBonus", + "type": "uint16" + }, + { + "internalType": "address", + "name": "priceSource", + "type": "address" + }, + { "internalType": "string", "name": "label", "type": "string" } + ], + "internalType": "struct DataTypes.EModeCategory", + "name": "category", + "type": "tuple" + } + ], + "name": "configureEModeCategory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "blastPoints", "type": "address" }, + { "internalType": "address", "name": "pointsOperator", "type": "address" } + ], + "name": "configurePointOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "dropReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "balanceFromBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceToBefore", + "type": "uint256" + } + ], + "name": "finalizeTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { + "internalType": "uint256[]", + "name": "interestRateModes", + "type": "uint256[]" + }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "bytes", "name": "params", "type": "bytes" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "flashLoan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "bytes", "name": "params", "type": "bytes" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "flashLoanSimple", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getConfiguration", + "outputs": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint8", "name": "id", "type": "uint8" }], + "name": "getEModeCategoryData", + "outputs": [ + { + "components": [ + { "internalType": "uint16", "name": "ltv", "type": "uint16" }, + { + "internalType": "uint16", + "name": "liquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationBonus", + "type": "uint16" + }, + { + "internalType": "address", + "name": "priceSource", + "type": "address" + }, + { "internalType": "string", "name": "label", "type": "string" } + ], + "internalType": "struct DataTypes.EModeCategory", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "id", "type": "uint16" }], + "name": "getReserveAddressById", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveData", + "outputs": [ + { + "components": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "configuration", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "liquidityIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentLiquidityRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "variableBorrowIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentVariableBorrowRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentStableBorrowRate", + "type": "uint128" + }, + { + "internalType": "uint40", + "name": "lastUpdateTimestamp", + "type": "uint40" + }, + { "internalType": "uint16", "name": "id", "type": "uint16" }, + { + "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": "uint128", + "name": "accruedToTreasury", + "type": "uint128" + }, + { "internalType": "uint128", "name": "unbacked", "type": "uint128" }, + { + "internalType": "uint128", + "name": "isolationModeTotalDebt", + "type": "uint128" + } + ], + "internalType": "struct DataTypes.ReserveData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveNormalizedIncome", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveNormalizedVariableDebt", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getReservesList", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserAccountData", + "outputs": [ + { + "internalType": "uint256", + "name": "totalCollateralBase", + "type": "uint256" + }, + { "internalType": "uint256", "name": "totalDebtBase", "type": "uint256" }, + { + "internalType": "uint256", + "name": "availableBorrowsBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentLiquidationThreshold", + "type": "uint256" + }, + { "internalType": "uint256", "name": "ltv", "type": "uint256" }, + { "internalType": "uint256", "name": "healthFactor", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserConfiguration", + "outputs": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.UserConfigurationMap", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserEMode", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "aTokenAddress", "type": "address" }, + { + "internalType": "address", + "name": "stableDebtAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + } + ], + "name": "initReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralAsset", + "type": "address" + }, + { "internalType": "address", "name": "debtAsset", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "debtToCover", "type": "uint256" }, + { "internalType": "bool", "name": "receiveAToken", "type": "bool" } + ], + "name": "liquidationCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" } + ], + "name": "mintToTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "mintUnbacked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "rebalanceStableBorrowRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" } + ], + "name": "repay", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + } + ], + "name": "repayWithATokens", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "permitV", "type": "uint8" }, + { "internalType": "bytes32", "name": "permitR", "type": "bytes32" }, + { "internalType": "bytes32", "name": "permitS", "type": "bytes32" } + ], + "name": "repayWithPermit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "rescueTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "resetIsolationModeTotalDebt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "configuration", + "type": "tuple" + } + ], + "name": "setConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "rateStrategyAddress", + "type": "address" + } + ], + "name": "setReserveInterestRateStrategyAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "categoryId", "type": "uint8" } + ], + "name": "setUserEMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "useAsCollateral", "type": "bool" } + ], + "name": "setUserUseReserveAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "supply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "permitV", "type": "uint8" }, + { "internalType": "bytes32", "name": "permitR", "type": "bytes32" }, + { "internalType": "bytes32", "name": "permitS", "type": "bytes32" } + ], + "name": "supplyWithPermit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + } + ], + "name": "swapBorrowRateMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "protocolFee", "type": "uint256" } + ], + "name": "updateBridgeProtocolFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "flashLoanPremiumTotal", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "flashLoanPremiumToProtocol", + "type": "uint128" + } + ], + "name": "updateFlashloanPremiums", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "withdraw", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/pac-finance/LendingPoolAddressesProvider.json b/subgraphs/aave-forks/abis/pac-finance/LendingPoolAddressesProvider.json new file mode 100644 index 0000000000..4287c98808 --- /dev/null +++ b/subgraphs/aave-forks/abis/pac-finance/LendingPoolAddressesProvider.json @@ -0,0 +1,456 @@ +[ + { + "inputs": [ + { "internalType": "string", "name": "marketId", "type": "string" }, + { "internalType": "address", "name": "owner", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "ACLAdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "ACLManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "AddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldImplementationAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newImplementationAddress", + "type": "address" + } + ], + "name": "AddressSetAsProxy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "oldMarketId", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "newMarketId", + "type": "string" + } + ], + "name": "MarketIdSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PoolConfiguratorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PoolDataProviderUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PoolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PriceOracleSentinelUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PriceOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementationAddress", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "inputs": [], + "name": "getACLAdmin", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getACLManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "id", "type": "bytes32" }], + "name": "getAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMarketId", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPool", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolConfigurator", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolDataProvider", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPriceOracle", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPriceOracleSentinel", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newAclAdmin", "type": "address" } + ], + "name": "setACLAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newAclManager", "type": "address" } + ], + "name": "setACLManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "id", "type": "bytes32" }, + { "internalType": "address", "name": "newAddress", "type": "address" } + ], + "name": "setAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "id", "type": "bytes32" }, + { + "internalType": "address", + "name": "newImplementationAddress", + "type": "address" + } + ], + "name": "setAddressAsProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "newMarketId", "type": "string" } + ], + "name": "setMarketId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPoolConfiguratorImpl", + "type": "address" + } + ], + "name": "setPoolConfiguratorImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newDataProvider", + "type": "address" + } + ], + "name": "setPoolDataProvider", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newPoolImpl", "type": "address" } + ], + "name": "setPoolImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newPriceOracle", "type": "address" } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPriceOracleSentinel", + "type": "address" + } + ], + "name": "setPriceOracleSentinel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/pac-finance/LendingPoolConfigurator.json b/subgraphs/aave-forks/abis/pac-finance/LendingPoolConfigurator.json new file mode 100644 index 0000000000..fbf489d2e0 --- /dev/null +++ b/subgraphs/aave-forks/abis/pac-finance/LendingPoolConfigurator.json @@ -0,0 +1,1071 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ATokenUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBorrowCap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBorrowCap", + "type": "uint256" + } + ], + "name": "BorrowCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "borrowable", + "type": "bool" + } + ], + "name": "BorrowableInIsolationChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldBridgeProtocolFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBridgeProtocolFee", + "type": "uint256" + } + ], + "name": "BridgeProtocolFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + } + ], + "name": "CollateralConfigurationChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldDebtCeiling", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newDebtCeiling", + "type": "uint256" + } + ], + "name": "DebtCeilingChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "oldCategoryId", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "newCategoryId", + "type": "uint8" + } + ], + "name": "EModeAssetCategoryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "categoryId", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "oracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "EModeCategoryAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "oldFlashloanPremiumToProtocol", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "newFlashloanPremiumToProtocol", + "type": "uint128" + } + ], + "name": "FlashloanPremiumToProtocolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "oldFlashloanPremiumTotal", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "newFlashloanPremiumTotal", + "type": "uint128" + } + ], + "name": "FlashloanPremiumTotalUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newFee", + "type": "uint256" + } + ], + "name": "LiquidationProtocolFeeChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "ReserveActive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "ReserveBorrowing", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "ReserveDropped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldReserveFactor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newReserveFactor", + "type": "uint256" + } + ], + "name": "ReserveFactorChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "ReserveFlashLoaning", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "frozen", + "type": "bool" + } + ], + "name": "ReserveFrozen", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "aToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "stableDebtToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "variableDebtToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + } + ], + "name": "ReserveInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldStrategy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newStrategy", + "type": "address" + } + ], + "name": "ReserveInterestRateStrategyChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "ReservePaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "ReserveStableRateBorrowing", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldState", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newState", + "type": "bool" + } + ], + "name": "SiloedBorrowingChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "StableDebtTokenUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldSupplyCap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "SupplyCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldUnbackedMintCap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newUnbackedMintCap", + "type": "uint256" + } + ], + "name": "UnbackedMintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "VariableDebtTokenUpgraded", + "type": "event" + }, + { + "inputs": [], + "name": "CONFIGURATOR_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "ltv", "type": "uint256" }, + { + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + } + ], + "name": "configureReserveAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "dropReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "aTokenImpl", + "type": "address" + }, + { + "internalType": "address", + "name": "stableDebtTokenImpl", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtTokenImpl", + "type": "address" + }, + { + "internalType": "uint8", + "name": "underlyingAssetDecimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "aTokenName", "type": "string" }, + { + "internalType": "string", + "name": "aTokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "variableDebtTokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "variableDebtTokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "stableDebtTokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "stableDebtTokenSymbol", + "type": "string" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.InitReserveInput[]", + "name": "input", + "type": "tuple[]" + } + ], + "name": "initReserves", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint8", "name": "newCategoryId", "type": "uint8" } + ], + "name": "setAssetEModeCategory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newBorrowCap", "type": "uint256" } + ], + "name": "setBorrowCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "borrowable", "type": "bool" } + ], + "name": "setBorrowableInIsolation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newDebtCeiling", "type": "uint256" } + ], + "name": "setDebtCeiling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "categoryId", "type": "uint8" }, + { "internalType": "uint16", "name": "ltv", "type": "uint16" }, + { + "internalType": "uint16", + "name": "liquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationBonus", + "type": "uint16" + }, + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "string", "name": "label", "type": "string" } + ], + "name": "setEModeCategory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newFee", "type": "uint256" } + ], + "name": "setLiquidationProtocolFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "paused", "type": "bool" }], + "name": "setPoolPause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "active", "type": "bool" } + ], + "name": "setReserveActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "setReserveBorrowing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint256", + "name": "newReserveFactor", + "type": "uint256" + } + ], + "name": "setReserveFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "setReserveFlashLoaning", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "freeze", "type": "bool" } + ], + "name": "setReserveFreeze", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "newRateStrategyAddress", + "type": "address" + } + ], + "name": "setReserveInterestRateStrategyAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "paused", "type": "bool" } + ], + "name": "setReservePause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "setReserveStableRateBorrowing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "newSiloed", "type": "bool" } + ], + "name": "setSiloedBorrowing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newSupplyCap", "type": "uint256" } + ], + "name": "setSupplyCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint256", + "name": "newUnbackedMintCap", + "type": "uint256" + } + ], + "name": "setUnbackedMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.UpdateATokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateAToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newBridgeProtocolFee", + "type": "uint256" + } + ], + "name": "updateBridgeProtocolFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newFlashloanPremiumToProtocol", + "type": "uint128" + } + ], + "name": "updateFlashloanPremiumToProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newFlashloanPremiumTotal", + "type": "uint128" + } + ], + "name": "updateFlashloanPremiumTotal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.UpdateDebtTokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateStableDebtToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.UpdateDebtTokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateVariableDebtToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/pac-finance/VariableDebtToken.json b/subgraphs/aave-forks/abis/pac-finance/VariableDebtToken.json new file mode 100644 index 0000000000..293087c339 --- /dev/null +++ b/subgraphs/aave-forks/abis/pac-finance/VariableDebtToken.json @@ -0,0 +1,531 @@ +[ + { + "inputs": [ + { "internalType": "contract IPool", "name": "pool", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fromUser", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toUser", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BorrowAllowanceDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "debtTokenDecimals", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "string", + "name": "debtTokenName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "debtTokenSymbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "BLAST", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DEBT_TOKEN_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DELEGATION_WITH_SIG_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EIP712_REVISION", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL", + "outputs": [ + { "internalType": "contract IPool", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERLYING_ASSET_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegatee", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approveDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "fromUser", "type": "address" }, + { "internalType": "address", "name": "toUser", "type": "address" } + ], + "name": "borrowAllowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "burn", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" } + ], + "name": "claimRefundedGas", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegator", "type": "address" }, + { "internalType": "address", "name": "delegatee", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "delegationWithSig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getIncentivesController", + "outputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getPreviousIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getScaledUserBalanceAndSupply", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPool", + "name": "initializingPool", + "type": "address" + }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "internalType": "contract IAaveIncentivesController", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "uint8", "name": "debtTokenDecimals", "type": "uint8" }, + { "internalType": "string", "name": "debtTokenName", "type": "string" }, + { "internalType": "string", "name": "debtTokenSymbol", "type": "string" }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "mint", + "outputs": [ + { "internalType": "bool", "name": "", "type": "bool" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "scaledBalanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "scaledTotalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "controller", + "type": "address" + } + ], + "name": "setIncentivesController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/seismic/LendingPool.json b/subgraphs/aave-forks/abis/seismic/LendingPool.json new file mode 100644 index 0000000000..59dec5e61f --- /dev/null +++ b/subgraphs/aave-forks/abis/seismic/LendingPool.json @@ -0,0 +1,809 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowRateMode", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referral", + "type": "uint16" + } + ], + "name": "Borrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referral", + "type": "uint16" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "initiator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "premium", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "FlashLoan", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateralAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "debtAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "debtToCover", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidatedCollateralAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "receiveAToken", + "type": "bool" + } + ], + "name": "LiquidationCall", + "type": "event" + }, + { "anonymous": false, "inputs": [], "name": "Paused", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "RebalanceStableBorrowRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "repayer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Repay", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidityRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "variableBorrowRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidityIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "variableBorrowIndex", + "type": "uint256" + } + ], + "name": "ReserveDataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ReserveUsedAsCollateralDisabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ReserveUsedAsCollateralEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rateMode", + "type": "uint256" + } + ], + "name": "Swap", + "type": "event" + }, + { "anonymous": false, "inputs": [], "name": "Unpaused", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "BLAST", + "outputs": [ + { "internalType": "contract IBlast", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FLASHLOAN_PREMIUM_TOTAL", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "GAS_CLAIMER", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LENDINGPOOL_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_NUMBER_RESERVES", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_STABLE_RATE_BORROW_SIZE_PERCENT", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" } + ], + "name": "borrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "balanceFromBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceToBefore", + "type": "uint256" + } + ], + "name": "finalizeTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "modes", "type": "uint256[]" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "bytes", "name": "params", "type": "bytes" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "flashLoan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAddressesProvider", + "outputs": [ + { + "internalType": "contract ILendingPoolAddressesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getConfiguration", + "outputs": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveData", + "outputs": [ + { + "components": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "configuration", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "liquidityIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "variableBorrowIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentLiquidityRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentVariableBorrowRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentStableBorrowRate", + "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": "uint8", "name": "id", "type": "uint8" } + ], + "internalType": "struct DataTypes.ReserveData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveNormalizedIncome", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveNormalizedVariableDebt", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getReservesList", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserAccountData", + "outputs": [ + { + "internalType": "uint256", + "name": "totalCollateralETH", + "type": "uint256" + }, + { "internalType": "uint256", "name": "totalDebtETH", "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" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserConfiguration", + "outputs": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.UserConfigurationMap", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "aTokenAddress", "type": "address" }, + { + "internalType": "address", + "name": "stableDebtAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + } + ], + "name": "initReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ILendingPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralAsset", + "type": "address" + }, + { "internalType": "address", "name": "debtAsset", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "debtToCover", "type": "uint256" }, + { "internalType": "bool", "name": "receiveAToken", "type": "bool" } + ], + "name": "liquidationCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "rebalanceStableBorrowRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "rateMode", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" } + ], + "name": "repay", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "configuration", "type": "uint256" } + ], + "name": "setConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "val", "type": "bool" }], + "name": "setPause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "rateStrategyAddress", + "type": "address" + } + ], + "name": "setReserveInterestRateStrategyAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "useAsCollateral", "type": "bool" } + ], + "name": "setUserUseReserveAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "rateMode", "type": "uint256" } + ], + "name": "swapBorrowRateMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "withdraw", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/seismic/LendingPoolAddressesProvider.json b/subgraphs/aave-forks/abis/seismic/LendingPoolAddressesProvider.json new file mode 100644 index 0000000000..e3dbb2c113 --- /dev/null +++ b/subgraphs/aave-forks/abis/seismic/LendingPoolAddressesProvider.json @@ -0,0 +1,378 @@ +[ + { + "inputs": [ + { "internalType": "string", "name": "marketId", "type": "string" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "hasProxy", + "type": "bool" + } + ], + "name": "AddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "ConfigurationAdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "EmergencyAdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "LendingPoolCollateralManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "LendingPoolConfiguratorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "LendingPoolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "LendingRateOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "newMarketId", + "type": "string" + } + ], + "name": "MarketIdSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PriceOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "inputs": [], + "name": "BLAST", + "outputs": [ + { "internalType": "contract IBlast", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "GAS_CLAIMER", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "id", "type": "bytes32" }], + "name": "getAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getEmergencyAdmin", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLendingPool", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLendingPoolCollateralManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLendingPoolConfigurator", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLendingRateOracle", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMarketId", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolAdmin", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPriceOracle", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "id", "type": "bytes32" }, + { "internalType": "address", "name": "newAddress", "type": "address" } + ], + "name": "setAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "id", "type": "bytes32" }, + { + "internalType": "address", + "name": "implementationAddress", + "type": "address" + } + ], + "name": "setAddressAsProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "emergencyAdmin", "type": "address" } + ], + "name": "setEmergencyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "manager", "type": "address" } + ], + "name": "setLendingPoolCollateralManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "configurator", "type": "address" } + ], + "name": "setLendingPoolConfiguratorImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "pool", "type": "address" } + ], + "name": "setLendingPoolImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "lendingRateOracle", + "type": "address" + } + ], + "name": "setLendingRateOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "marketId", "type": "string" } + ], + "name": "setMarketId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "admin", "type": "address" } + ], + "name": "setPoolAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "priceOracle", "type": "address" } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/seismic/LendingPoolConfigurator.json b/subgraphs/aave-forks/abis/seismic/LendingPoolConfigurator.json new file mode 100644 index 0000000000..3a32230ea2 --- /dev/null +++ b/subgraphs/aave-forks/abis/seismic/LendingPoolConfigurator.json @@ -0,0 +1,644 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ATokenUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "BorrowingDisabledOnReserve", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "stableRateEnabled", + "type": "bool" + } + ], + "name": "BorrowingEnabledOnReserve", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + } + ], + "name": "CollateralConfigurationChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "ReserveActivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "ReserveDeactivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "decimals", + "type": "uint256" + } + ], + "name": "ReserveDecimalsChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "factor", + "type": "uint256" + } + ], + "name": "ReserveFactorChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "ReserveFrozen", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "aToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "stableDebtToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "variableDebtToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + } + ], + "name": "ReserveInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "strategy", + "type": "address" + } + ], + "name": "ReserveInterestRateStrategyChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "ReserveUnfrozen", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "StableDebtTokenUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "StableRateDisabledOnReserve", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "StableRateEnabledOnReserve", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "VariableDebtTokenUpgraded", + "type": "event" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "activateReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "aTokenImpl", + "type": "address" + }, + { + "internalType": "address", + "name": "stableDebtTokenImpl", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtTokenImpl", + "type": "address" + }, + { + "internalType": "uint8", + "name": "underlyingAssetDecimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { + "internalType": "string", + "name": "underlyingAssetName", + "type": "string" + }, + { "internalType": "string", "name": "aTokenName", "type": "string" }, + { + "internalType": "string", + "name": "aTokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "variableDebtTokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "variableDebtTokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "stableDebtTokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "stableDebtTokenSymbol", + "type": "string" + }, + { + "internalType": "bool", + "name": "shouldSetOperator", + "type": "bool" + }, + { + "internalType": "address", + "name": "pointsOperator", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ILendingPoolConfigurator.InitReserveInput[]", + "name": "input", + "type": "tuple[]" + } + ], + "name": "batchInitReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "ltv", "type": "uint256" }, + { + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + } + ], + "name": "configureReserveAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "deactivateReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "disableBorrowingOnReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "disableReserveStableRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "bool", + "name": "stableBorrowRateEnabled", + "type": "bool" + } + ], + "name": "enableBorrowingOnReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "enableReserveStableRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "freezeReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ILendingPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "val", "type": "bool" }], + "name": "setPoolPause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "reserveFactor", "type": "uint256" } + ], + "name": "setReserveFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "rateStrategyAddress", + "type": "address" + } + ], + "name": "setReserveInterestRateStrategyAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "unfreezeReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "shouldSetOperator", + "type": "bool" + }, + { + "internalType": "address", + "name": "pointsOperator", + "type": "address" + }, + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ILendingPoolConfigurator.UpdateATokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateAToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ILendingPoolConfigurator.UpdateDebtTokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateStableDebtToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ILendingPoolConfigurator.UpdateDebtTokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateVariableDebtToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/zerolend/AToken.json b/subgraphs/aave-forks/abis/zerolend/AToken.json new file mode 100644 index 0000000000..79bd31f9cc --- /dev/null +++ b/subgraphs/aave-forks/abis/zerolend/AToken.json @@ -0,0 +1,568 @@ +[ + { + "inputs": [ + { "internalType": "contract IPool", "name": "pool", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "BalanceTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "treasury", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "aTokenDecimals", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "string", + "name": "aTokenName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "aTokenSymbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "ATOKEN_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EIP712_REVISION", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL", + "outputs": [ + { "internalType": "contract IPool", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RESERVE_TREASURY_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERLYING_ASSET_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { + "internalType": "address", + "name": "receiverOfUnderlying", + "type": "address" + }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getIncentivesController", + "outputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getPreviousIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getScaledUserBalanceAndSupply", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "handleRepayment", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPool", + "name": "initializingPool", + "type": "address" + }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "internalType": "contract IAaveIncentivesController", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "uint8", "name": "aTokenDecimals", "type": "uint8" }, + { "internalType": "string", "name": "aTokenName", "type": "string" }, + { "internalType": "string", "name": "aTokenSymbol", "type": "string" }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "caller", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "mint", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "mintToTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "rescueTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "scaledBalanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "scaledTotalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "controller", + "type": "address" + } + ], + "name": "setIncentivesController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "transferOnLiquidation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "target", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferUnderlyingTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/zerolend/AaveOracle.json b/subgraphs/aave-forks/abis/zerolend/AaveOracle.json new file mode 100644 index 0000000000..3149642bb9 --- /dev/null +++ b/subgraphs/aave-forks/abis/zerolend/AaveOracle.json @@ -0,0 +1,159 @@ +[ + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + }, + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address[]", "name": "sources", "type": "address[]" }, + { + "internalType": "address", + "name": "fallbackOracle", + "type": "address" + }, + { "internalType": "address", "name": "baseCurrency", "type": "address" }, + { + "internalType": "uint256", + "name": "baseCurrencyUnit", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "source", + "type": "address" + } + ], + "name": "AssetSourceUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "baseCurrency", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseCurrencyUnit", + "type": "uint256" + } + ], + "name": "BaseCurrencySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fallbackOracle", + "type": "address" + } + ], + "name": "FallbackOracleUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "ADDRESSES_PROVIDER", + "outputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BASE_CURRENCY", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BASE_CURRENCY_UNIT", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getAssetPrice", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" } + ], + "name": "getAssetsPrices", + "outputs": [ + { "internalType": "uint256[]", "name": "", "type": "uint256[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFallbackOracle", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getSourceOfAsset", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address[]", "name": "sources", "type": "address[]" } + ], + "name": "setAssetSources", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "fallbackOracle", "type": "address" } + ], + "name": "setFallbackOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/zerolend/LendingPool.json b/subgraphs/aave-forks/abis/zerolend/LendingPool.json new file mode 100644 index 0000000000..90336d4ecc --- /dev/null +++ b/subgraphs/aave-forks/abis/zerolend/LendingPool.json @@ -0,0 +1,1234 @@ +[ + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "backer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "BackUnbacked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum DataTypes.InterestRateMode", + "name": "interestRateMode", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "borrowRate", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "Borrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "initiator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum DataTypes.InterestRateMode", + "name": "interestRateMode", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "premium", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "FlashLoan", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalDebt", + "type": "uint256" + } + ], + "name": "IsolationModeTotalDebtUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "collateralAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "debtAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "debtToCover", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidatedCollateralAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "liquidator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "receiveAToken", + "type": "bool" + } + ], + "name": "LiquidationCall", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "MintUnbacked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountMinted", + "type": "uint256" + } + ], + "name": "MintedToTreasury", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "RebalanceStableBorrowRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "repayer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "useATokens", + "type": "bool" + } + ], + "name": "Repay", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidityRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stableBorrowRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "variableBorrowRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidityIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "variableBorrowIndex", + "type": "uint256" + } + ], + "name": "ReserveDataUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ReserveUsedAsCollateralDisabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "ReserveUsedAsCollateralEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint16", + "name": "referralCode", + "type": "uint16" + } + ], + "name": "Supply", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum DataTypes.InterestRateMode", + "name": "interestRateMode", + "type": "uint8" + } + ], + "name": "SwapBorrowRateMode", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "categoryId", + "type": "uint8" + } + ], + "name": "UserEModeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reserve", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "ADDRESSES_PROVIDER", + "outputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BRIDGE_PROTOCOL_FEE", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FLASHLOAN_PREMIUM_TOTAL", + "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "FLASHLOAN_PREMIUM_TO_PROTOCOL", + "outputs": [{ "internalType": "uint128", "name": "", "type": "uint128" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_NUMBER_RESERVES", + "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_STABLE_RATE_BORROW_SIZE_PERCENT", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "fee", "type": "uint256" } + ], + "name": "backUnbacked", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" } + ], + "name": "borrow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "id", "type": "uint8" }, + { + "components": [ + { "internalType": "uint16", "name": "ltv", "type": "uint16" }, + { + "internalType": "uint16", + "name": "liquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationBonus", + "type": "uint16" + }, + { + "internalType": "address", + "name": "priceSource", + "type": "address" + }, + { "internalType": "string", "name": "label", "type": "string" } + ], + "internalType": "struct DataTypes.EModeCategory", + "name": "category", + "type": "tuple" + } + ], + "name": "configureEModeCategory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "dropReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "balanceFromBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceToBefore", + "type": "uint256" + } + ], + "name": "finalizeTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256[]", "name": "amounts", "type": "uint256[]" }, + { + "internalType": "uint256[]", + "name": "interestRateModes", + "type": "uint256[]" + }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "bytes", "name": "params", "type": "bytes" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "flashLoan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiverAddress", + "type": "address" + }, + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "bytes", "name": "params", "type": "bytes" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "flashLoanSimple", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getConfiguration", + "outputs": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint8", "name": "id", "type": "uint8" }], + "name": "getEModeCategoryData", + "outputs": [ + { + "components": [ + { "internalType": "uint16", "name": "ltv", "type": "uint16" }, + { + "internalType": "uint16", + "name": "liquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationBonus", + "type": "uint16" + }, + { + "internalType": "address", + "name": "priceSource", + "type": "address" + }, + { "internalType": "string", "name": "label", "type": "string" } + ], + "internalType": "struct DataTypes.EModeCategory", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint16", "name": "id", "type": "uint16" }], + "name": "getReserveAddressById", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveData", + "outputs": [ + { + "components": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "configuration", + "type": "tuple" + }, + { + "internalType": "uint128", + "name": "liquidityIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentLiquidityRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "variableBorrowIndex", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentVariableBorrowRate", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "currentStableBorrowRate", + "type": "uint128" + }, + { + "internalType": "uint40", + "name": "lastUpdateTimestamp", + "type": "uint40" + }, + { "internalType": "uint16", "name": "id", "type": "uint16" }, + { + "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": "uint128", + "name": "accruedToTreasury", + "type": "uint128" + }, + { "internalType": "uint128", "name": "unbacked", "type": "uint128" }, + { + "internalType": "uint128", + "name": "isolationModeTotalDebt", + "type": "uint128" + } + ], + "internalType": "struct DataTypes.ReserveData", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveNormalizedIncome", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getReserveNormalizedVariableDebt", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getReservesCount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getReservesList", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserAccountData", + "outputs": [ + { + "internalType": "uint256", + "name": "totalCollateralBase", + "type": "uint256" + }, + { "internalType": "uint256", "name": "totalDebtBase", "type": "uint256" }, + { + "internalType": "uint256", + "name": "availableBorrowsBase", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "currentLiquidationThreshold", + "type": "uint256" + }, + { "internalType": "uint256", "name": "ltv", "type": "uint256" }, + { "internalType": "uint256", "name": "healthFactor", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserConfiguration", + "outputs": [ + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.UserConfigurationMap", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserEMode", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "aTokenAddress", "type": "address" }, + { + "internalType": "address", + "name": "stableDebtAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + } + ], + "name": "initReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collateralAsset", + "type": "address" + }, + { "internalType": "address", "name": "debtAsset", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "debtToCover", "type": "uint256" }, + { "internalType": "bool", "name": "receiveAToken", "type": "bool" } + ], + "name": "liquidationCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" } + ], + "name": "mintToTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "mintUnbacked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "rebalanceStableBorrowRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" } + ], + "name": "repay", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + } + ], + "name": "repayWithATokens", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "permitV", "type": "uint8" }, + { "internalType": "bytes32", "name": "permitR", "type": "bytes32" }, + { "internalType": "bytes32", "name": "permitS", "type": "bytes32" } + ], + "name": "repayWithPermit", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "rescueTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "resetIsolationModeTotalDebt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "components": [ + { "internalType": "uint256", "name": "data", "type": "uint256" } + ], + "internalType": "struct DataTypes.ReserveConfigurationMap", + "name": "configuration", + "type": "tuple" + } + ], + "name": "setConfiguration", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "rateStrategyAddress", + "type": "address" + } + ], + "name": "setReserveInterestRateStrategyAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "categoryId", "type": "uint8" } + ], + "name": "setUserEMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "useAsCollateral", "type": "bool" } + ], + "name": "setUserUseReserveAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" } + ], + "name": "supply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint16", "name": "referralCode", "type": "uint16" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "permitV", "type": "uint8" }, + { "internalType": "bytes32", "name": "permitR", "type": "bytes32" }, + { "internalType": "bytes32", "name": "permitS", "type": "bytes32" } + ], + "name": "supplyWithPermit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint256", + "name": "interestRateMode", + "type": "uint256" + } + ], + "name": "swapBorrowRateMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "protocolFee", "type": "uint256" } + ], + "name": "updateBridgeProtocolFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "flashLoanPremiumTotal", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "flashLoanPremiumToProtocol", + "type": "uint128" + } + ], + "name": "updateFlashloanPremiums", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "withdraw", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/zerolend/LendingPoolAddressesProvider.json b/subgraphs/aave-forks/abis/zerolend/LendingPoolAddressesProvider.json new file mode 100644 index 0000000000..4287c98808 --- /dev/null +++ b/subgraphs/aave-forks/abis/zerolend/LendingPoolAddressesProvider.json @@ -0,0 +1,456 @@ +[ + { + "inputs": [ + { "internalType": "string", "name": "marketId", "type": "string" }, + { "internalType": "address", "name": "owner", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "ACLAdminUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "ACLManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "AddressSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldImplementationAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newImplementationAddress", + "type": "address" + } + ], + "name": "AddressSetAsProxy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "oldMarketId", + "type": "string" + }, + { + "indexed": true, + "internalType": "string", + "name": "newMarketId", + "type": "string" + } + ], + "name": "MarketIdSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PoolConfiguratorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PoolDataProviderUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PoolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PriceOracleSentinelUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PriceOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxyAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementationAddress", + "type": "address" + } + ], + "name": "ProxyCreated", + "type": "event" + }, + { + "inputs": [], + "name": "getACLAdmin", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getACLManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "bytes32", "name": "id", "type": "bytes32" }], + "name": "getAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMarketId", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPool", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolConfigurator", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolDataProvider", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPriceOracle", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPriceOracleSentinel", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newAclAdmin", "type": "address" } + ], + "name": "setACLAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newAclManager", "type": "address" } + ], + "name": "setACLManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "id", "type": "bytes32" }, + { "internalType": "address", "name": "newAddress", "type": "address" } + ], + "name": "setAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "id", "type": "bytes32" }, + { + "internalType": "address", + "name": "newImplementationAddress", + "type": "address" + } + ], + "name": "setAddressAsProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "string", "name": "newMarketId", "type": "string" } + ], + "name": "setMarketId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPoolConfiguratorImpl", + "type": "address" + } + ], + "name": "setPoolConfiguratorImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newDataProvider", + "type": "address" + } + ], + "name": "setPoolDataProvider", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newPoolImpl", "type": "address" } + ], + "name": "setPoolImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newPriceOracle", "type": "address" } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPriceOracleSentinel", + "type": "address" + } + ], + "name": "setPriceOracleSentinel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/zerolend/LendingPoolConfigurator.json b/subgraphs/aave-forks/abis/zerolend/LendingPoolConfigurator.json new file mode 100644 index 0000000000..fbf489d2e0 --- /dev/null +++ b/subgraphs/aave-forks/abis/zerolend/LendingPoolConfigurator.json @@ -0,0 +1,1071 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ATokenUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBorrowCap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBorrowCap", + "type": "uint256" + } + ], + "name": "BorrowCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "borrowable", + "type": "bool" + } + ], + "name": "BorrowableInIsolationChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldBridgeProtocolFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBridgeProtocolFee", + "type": "uint256" + } + ], + "name": "BridgeProtocolFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + } + ], + "name": "CollateralConfigurationChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldDebtCeiling", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newDebtCeiling", + "type": "uint256" + } + ], + "name": "DebtCeilingChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "oldCategoryId", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "newCategoryId", + "type": "uint8" + } + ], + "name": "EModeAssetCategoryChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "categoryId", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "ltv", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "oracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "label", + "type": "string" + } + ], + "name": "EModeCategoryAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "oldFlashloanPremiumToProtocol", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "newFlashloanPremiumToProtocol", + "type": "uint128" + } + ], + "name": "FlashloanPremiumToProtocolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint128", + "name": "oldFlashloanPremiumTotal", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "newFlashloanPremiumTotal", + "type": "uint128" + } + ], + "name": "FlashloanPremiumTotalUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newFee", + "type": "uint256" + } + ], + "name": "LiquidationProtocolFeeChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "active", + "type": "bool" + } + ], + "name": "ReserveActive", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "ReserveBorrowing", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "ReserveDropped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldReserveFactor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newReserveFactor", + "type": "uint256" + } + ], + "name": "ReserveFactorChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "ReserveFlashLoaning", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "frozen", + "type": "bool" + } + ], + "name": "ReserveFrozen", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "aToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "stableDebtToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "variableDebtToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + } + ], + "name": "ReserveInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldStrategy", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newStrategy", + "type": "address" + } + ], + "name": "ReserveInterestRateStrategyChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "ReservePaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "ReserveStableRateBorrowing", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "oldState", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "newState", + "type": "bool" + } + ], + "name": "SiloedBorrowingChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "StableDebtTokenUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldSupplyCap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSupplyCap", + "type": "uint256" + } + ], + "name": "SupplyCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldUnbackedMintCap", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newUnbackedMintCap", + "type": "uint256" + } + ], + "name": "UnbackedMintCapChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proxy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "VariableDebtTokenUpgraded", + "type": "event" + }, + { + "inputs": [], + "name": "CONFIGURATOR_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "ltv", "type": "uint256" }, + { + "internalType": "uint256", + "name": "liquidationThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationBonus", + "type": "uint256" + } + ], + "name": "configureReserveAsCollateral", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "dropReserve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "aTokenImpl", + "type": "address" + }, + { + "internalType": "address", + "name": "stableDebtTokenImpl", + "type": "address" + }, + { + "internalType": "address", + "name": "variableDebtTokenImpl", + "type": "address" + }, + { + "internalType": "uint8", + "name": "underlyingAssetDecimals", + "type": "uint8" + }, + { + "internalType": "address", + "name": "interestRateStrategyAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "aTokenName", "type": "string" }, + { + "internalType": "string", + "name": "aTokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "variableDebtTokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "variableDebtTokenSymbol", + "type": "string" + }, + { + "internalType": "string", + "name": "stableDebtTokenName", + "type": "string" + }, + { + "internalType": "string", + "name": "stableDebtTokenSymbol", + "type": "string" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.InitReserveInput[]", + "name": "input", + "type": "tuple[]" + } + ], + "name": "initReserves", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPoolAddressesProvider", + "name": "provider", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint8", "name": "newCategoryId", "type": "uint8" } + ], + "name": "setAssetEModeCategory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newBorrowCap", "type": "uint256" } + ], + "name": "setBorrowCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "borrowable", "type": "bool" } + ], + "name": "setBorrowableInIsolation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newDebtCeiling", "type": "uint256" } + ], + "name": "setDebtCeiling", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint8", "name": "categoryId", "type": "uint8" }, + { "internalType": "uint16", "name": "ltv", "type": "uint16" }, + { + "internalType": "uint16", + "name": "liquidationThreshold", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "liquidationBonus", + "type": "uint16" + }, + { "internalType": "address", "name": "oracle", "type": "address" }, + { "internalType": "string", "name": "label", "type": "string" } + ], + "name": "setEModeCategory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newFee", "type": "uint256" } + ], + "name": "setLiquidationProtocolFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "bool", "name": "paused", "type": "bool" }], + "name": "setPoolPause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "active", "type": "bool" } + ], + "name": "setReserveActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "setReserveBorrowing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint256", + "name": "newReserveFactor", + "type": "uint256" + } + ], + "name": "setReserveFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "setReserveFlashLoaning", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "freeze", "type": "bool" } + ], + "name": "setReserveFreeze", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "newRateStrategyAddress", + "type": "address" + } + ], + "name": "setReserveInterestRateStrategyAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "paused", "type": "bool" } + ], + "name": "setReservePause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "enabled", "type": "bool" } + ], + "name": "setReserveStableRateBorrowing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "bool", "name": "newSiloed", "type": "bool" } + ], + "name": "setSiloedBorrowing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "uint256", "name": "newSupplyCap", "type": "uint256" } + ], + "name": "setSupplyCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "uint256", + "name": "newUnbackedMintCap", + "type": "uint256" + } + ], + "name": "setUnbackedMintCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "treasury", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.UpdateATokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateAToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newBridgeProtocolFee", + "type": "uint256" + } + ], + "name": "updateBridgeProtocolFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newFlashloanPremiumToProtocol", + "type": "uint128" + } + ], + "name": "updateFlashloanPremiumToProtocol", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newFlashloanPremiumTotal", + "type": "uint128" + } + ], + "name": "updateFlashloanPremiumTotal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.UpdateDebtTokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateStableDebtToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "string", "name": "name", "type": "string" }, + { "internalType": "string", "name": "symbol", "type": "string" }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "internalType": "struct ConfiguratorInputTypes.UpdateDebtTokenInput", + "name": "input", + "type": "tuple" + } + ], + "name": "updateVariableDebtToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/zerolend/RewardsController.json b/subgraphs/aave-forks/abis/zerolend/RewardsController.json new file mode 100644 index 0000000000..2ddb1e1158 --- /dev/null +++ b/subgraphs/aave-forks/abis/zerolend/RewardsController.json @@ -0,0 +1,594 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "emissionManager", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "reward", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assetIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "userIndex", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsAccrued", + "type": "uint256" + } + ], + "name": "Accrued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "reward", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldEmission", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newEmission", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldDistributionEnd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newDistributionEnd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assetIndex", + "type": "uint256" + } + ], + "name": "AssetConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "claimer", + "type": "address" + } + ], + "name": "ClaimerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reward", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "rewardOracle", + "type": "address" + } + ], + "name": "RewardOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "reward", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "claimer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "RewardsClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "reward", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "transferStrategy", + "type": "address" + } + ], + "name": "TransferStrategyInstalled", + "type": "event" + }, + { + "inputs": [], + "name": "EMISSION_MANAGER", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "claimAllRewards", + "outputs": [ + { + "internalType": "address[]", + "name": "rewardsList", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "claimedAmounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" } + ], + "name": "claimAllRewardsOnBehalf", + "outputs": [ + { + "internalType": "address[]", + "name": "rewardsList", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "claimedAmounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" } + ], + "name": "claimAllRewardsToSelf", + "outputs": [ + { + "internalType": "address[]", + "name": "rewardsList", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "claimedAmounts", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "claimRewards", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "claimRewardsOnBehalf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "claimRewardsToSelf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint88", + "name": "emissionPerSecond", + "type": "uint88" + }, + { + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "distributionEnd", + "type": "uint32" + }, + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" }, + { + "internalType": "contract ITransferStrategyBase", + "name": "transferStrategy", + "type": "address" + }, + { + "internalType": "contract IEACAggregatorProxy", + "name": "rewardOracle", + "type": "address" + } + ], + "internalType": "struct RewardsDataTypes.RewardsConfigInput[]", + "name": "config", + "type": "tuple[]" + } + ], + "name": "configureAssets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getAllUserRewards", + "outputs": [ + { + "internalType": "address[]", + "name": "rewardsList", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "unclaimedAmounts", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getAssetDecimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getAssetIndex", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getClaimer", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getDistributionEnd", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getEmissionManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getRewardOracle", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" } + ], + "name": "getRewardsByAsset", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getRewardsData", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRewardsList", + "outputs": [ + { "internalType": "address[]", "name": "", "type": "address[]" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getTransferStrategy", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getUserAccruedRewards", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getUserAssetIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "assets", "type": "address[]" }, + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" } + ], + "name": "getUserRewards", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, + { "internalType": "uint256", "name": "userBalance", "type": "uint256" } + ], + "name": "handleAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "caller", "type": "address" } + ], + "name": "setClaimer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address", "name": "reward", "type": "address" }, + { + "internalType": "uint32", + "name": "newDistributionEnd", + "type": "uint32" + } + ], + "name": "setDistributionEnd", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "asset", "type": "address" }, + { "internalType": "address[]", "name": "rewards", "type": "address[]" }, + { + "internalType": "uint88[]", + "name": "newEmissionsPerSecond", + "type": "uint88[]" + } + ], + "name": "setEmissionPerSecond", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "reward", "type": "address" }, + { + "internalType": "contract IEACAggregatorProxy", + "name": "rewardOracle", + "type": "address" + } + ], + "name": "setRewardOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "reward", "type": "address" }, + { + "internalType": "contract ITransferStrategyBase", + "name": "transferStrategy", + "type": "address" + } + ], + "name": "setTransferStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/zerolend/StableDebtToken.json b/subgraphs/aave-forks/abis/zerolend/StableDebtToken.json new file mode 100644 index 0000000000..644285cbec --- /dev/null +++ b/subgraphs/aave-forks/abis/zerolend/StableDebtToken.json @@ -0,0 +1,553 @@ +[ + { + "inputs": [ + { "internalType": "contract IPool", "name": "pool", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fromUser", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toUser", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BorrowAllowanceDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "avgStableRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalSupply", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "debtTokenDecimals", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "string", + "name": "debtTokenName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "debtTokenSymbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "avgStableRate", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTotalSupply", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEBT_TOKEN_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DELEGATION_WITH_SIG_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EIP712_REVISION", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL", + "outputs": [ + { "internalType": "contract IPool", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERLYING_ASSET_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegatee", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approveDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "account", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "fromUser", "type": "address" }, + { "internalType": "address", "name": "toUser", "type": "address" } + ], + "name": "borrowAllowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "burn", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAverageStableRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getIncentivesController", + "outputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSupplyData", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint40", "name": "", "type": "uint40" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalSupplyAndAvgRate", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTotalSupplyLastUpdated", + "outputs": [{ "internalType": "uint40", "name": "", "type": "uint40" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserLastUpdated", + "outputs": [{ "internalType": "uint40", "name": "", "type": "uint40" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getUserStableRate", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPool", + "name": "initializingPool", + "type": "address" + }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "internalType": "contract IAaveIncentivesController", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "uint8", "name": "debtTokenDecimals", "type": "uint8" }, + { "internalType": "string", "name": "debtTokenName", "type": "string" }, + { "internalType": "string", "name": "debtTokenSymbol", "type": "string" }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "mint", + "outputs": [ + { "internalType": "bool", "name": "", "type": "bool" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "principalBalanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "controller", + "type": "address" + } + ], + "name": "setIncentivesController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/abis/zerolend/VariableDebtToken.json b/subgraphs/aave-forks/abis/zerolend/VariableDebtToken.json new file mode 100644 index 0000000000..a40b417306 --- /dev/null +++ b/subgraphs/aave-forks/abis/zerolend/VariableDebtToken.json @@ -0,0 +1,500 @@ +[ + { + "inputs": [ + { "internalType": "contract IPool", "name": "pool", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fromUser", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toUser", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "BorrowAllowanceDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Burn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "incentivesController", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "debtTokenDecimals", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "string", + "name": "debtTokenName", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "debtTokenSymbol", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "onBehalfOf", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balanceIncrease", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEBT_TOKEN_REVISION", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DELEGATION_WITH_SIG_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EIP712_REVISION", + "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL", + "outputs": [ + { "internalType": "contract IPool", "name": "", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UNDERLYING_ASSET_ADDRESS", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "delegatee", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approveDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "fromUser", "type": "address" }, + { "internalType": "address", "name": "toUser", "type": "address" } + ], + "name": "borrowAllowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "burn", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getIncentivesController", + "outputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getPreviousIndex", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "getScaledUserBalanceAndSupply", + "outputs": [ + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IPool", + "name": "initializingPool", + "type": "address" + }, + { + "internalType": "address", + "name": "underlyingAsset", + "type": "address" + }, + { + "internalType": "contract IAaveIncentivesController", + "name": "incentivesController", + "type": "address" + }, + { "internalType": "uint8", "name": "debtTokenDecimals", "type": "uint8" }, + { "internalType": "string", "name": "debtTokenName", "type": "string" }, + { "internalType": "string", "name": "debtTokenSymbol", "type": "string" }, + { "internalType": "bytes", "name": "params", "type": "bytes" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" }, + { "internalType": "address", "name": "onBehalfOf", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "index", "type": "uint256" } + ], + "name": "mint", + "outputs": [ + { "internalType": "bool", "name": "", "type": "bool" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "user", "type": "address" } + ], + "name": "scaledBalanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "scaledTotalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAaveIncentivesController", + "name": "controller", + "type": "address" + } + ], + "name": "setIncentivesController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/subgraphs/aave-forks/protocols/kinza-finance/config/deployments/kinza-finance-bsc/configurations.json b/subgraphs/aave-forks/protocols/kinza-finance/config/deployments/kinza-finance-bsc/configurations.json new file mode 100644 index 0000000000..ad25e59cbb --- /dev/null +++ b/subgraphs/aave-forks/protocols/kinza-finance/config/deployments/kinza-finance-bsc/configurations.json @@ -0,0 +1,22 @@ +{ + "network": "bsc", + "factory": { + "startBlock": 29232007, + "address": "0xca20a50ea454bd9f37a895182ff3309f251fd7ce" + }, + "lendingPoolConfigurator": { + "startBlock": 29232426, + "address": "0xa5776459837651ed4de8ed922e123d5898efe5a2" + }, + "LendingPool": { + "startBlock": 29232426, + "address": "0xcb0620b181140e57d1c0d8b724cde623ca963c8c" + }, + "RewardsController": { + "startBlock": 29232522, + "address": "0x30b1a8c1a4a9dd9146d1166f992f4e1962683a67" + }, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": 0 +} diff --git a/subgraphs/aave-forks/protocols/kinza-finance/config/templates/kinza.finance.template.yaml b/subgraphs/aave-forks/protocols/kinza-finance/config/templates/kinza.finance.template.yaml new file mode 100644 index 0000000000..5b406e6ec2 --- /dev/null +++ b/subgraphs/aave-forks/protocols/kinza-finance/config/templates/kinza.finance.template.yaml @@ -0,0 +1,230 @@ +specVersion: 1.0.0 +schema: + file: ./schema.graphql +indexerHints: + prune: auto +{{#graftEnabled}} +description: ... +features: + - grafting +graft: + base: {{subgraphId}} # Subgraph ID of base subgraph + block: {{graftStartBlock}} # Block number +{{/graftEnabled}} +dataSources: + - kind: ethereum + name: LendingPoolAddressesProvider + network: {{ network }} + source: + abi: LendingPoolAddressesProvider + address: "{{ factory.address }}" + startBlock: {{ factory.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: LendingPoolAddressesProvider + file: ./abis/kinza-finance/LendingPoolAddressesProvider.json + eventHandlers: + - event: PriceOracleUpdated(indexed address,indexed address) + handler: handlePriceOracleUpdated + file: ./protocols/kinza-finance/src/mapping.ts + - kind: ethereum + name: LendingPoolConfigurator + network: {{ network }} + source: + abi: LendingPoolConfigurator + address: "{{ lendingPoolConfigurator.address }}" + startBlock: {{ lendingPoolConfigurator.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: LendingPoolConfigurator + file: ./abis/kinza-finance/LendingPoolConfigurator.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + - name: AToken + file: ./abis/kinza-finance/AToken.json + eventHandlers: + - event: CollateralConfigurationChanged(indexed address,uint256,uint256,uint256) + handler: handleCollateralConfigurationChanged + - event: ReserveActive(indexed address,bool) + handler: handleReserveActive + - event: ReserveBorrowing(indexed address,bool) + handler: handleReserveBorrowing + - event: ReserveFrozen(indexed address,bool) + handler: handleReserveFrozen + - event: ReserveInitialized(indexed address,indexed address,address,address,address) + handler: handleReserveInitialized + - event: ReservePaused(indexed address,bool) + handler: handleReservePaused + - event: ReserveFactorChanged(indexed address,uint256,uint256) + handler: handleReserveFactorChanged + - event: LiquidationProtocolFeeChanged(indexed address,uint256,uint256) + handler: handleLiquidationProtocolFeeChanged + - event: FlashloanPremiumTotalUpdated(uint128,uint128) + handler: handleFlashloanPremiumTotalUpdated + - event: FlashloanPremiumToProtocolUpdated(uint128,uint128) + handler: handleFlashloanPremiumToProtocolUpdated + - event: SiloedBorrowingChanged(indexed address,bool,bool) + handler: handleSiloedBorrowingChanged + file: ./protocols/kinza-finance/src/mapping.ts + - kind: ethereum + name: LendingPool + network: {{ network }} + source: + abi: LendingPool + address: "{{ LendingPool.address }}" + startBlock: {{ LendingPool.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: LendingPool + file: ./abis/kinza-finance/LendingPool.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + - name: AaveOracle + file: ./abis/kinza-finance/AaveOracle.json + - name: IPriceOracleGetter + file: ./abis/IPriceOracleGetter.json + - name: AToken + file: ./abis/kinza-finance/AToken.json + - name: StableDebtToken + file: ./abis/kinza-finance/StableDebtToken.json + - name: VariableDebtToken + file: ./abis/kinza-finance/VariableDebtToken.json + eventHandlers: + - event: Borrow(indexed address,address,indexed address,uint256,uint8,uint256,indexed uint16) + handler: handleBorrow + - event: SwapBorrowRateMode(indexed address,indexed address,uint8) + handler: handleSwapBorrowRateMode + - event: LiquidationCall(indexed address,indexed address,indexed address,uint256,uint256,address,bool) + handler: handleLiquidationCall + receipt: true + - event: Repay(indexed address,indexed address,indexed address,uint256,bool) + handler: handleRepay + receipt: true + - event: ReserveDataUpdated(indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleReserveDataUpdated + receipt: true + - event: Supply(indexed address,address,indexed address,uint256,indexed uint16) + handler: handleDeposit + - event: Withdraw(indexed address,indexed address,indexed address,uint256) + handler: handleWithdraw + - event: ReserveUsedAsCollateralEnabled(indexed address,indexed address) + handler: handleReserveUsedAsCollateralEnabled + - event: ReserveUsedAsCollateralDisabled(indexed address,indexed address) + handler: handleReserveUsedAsCollateralDisabled + - event: FlashLoan(indexed address,address,indexed address,uint256,uint8,uint256,indexed uint16) + handler: handleFlashloan + - event: UserEModeSet(indexed address,uint8) + handler: handleUserEModeSet + - event: MintedToTreasury(indexed address,uint256) + handler: handleMintedToTreasury + file: ./protocols/kinza-finance/src/mapping.ts + - kind: ethereum + name: RewardsController + network: {{ network }} + source: + address: "{{ RewardsController.address }}" + abi: RewardsController + startBlock: {{ RewardsController.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - RewardsController + abis: + - name: RewardsController + file: ./abis/kinza-finance/RewardsController.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + - name: AaveOracle + file: ./abis/kinza-finance/AaveOracle.json + - name: IPriceOracleGetter + file: ./abis/IPriceOracleGetter.json + eventHandlers: + - event: AssetConfigUpdated(indexed address,indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleAssetConfigUpdated + file: ./protocols/kinza-finance/src/mapping.ts + +templates: + - kind: ethereum + name: AToken + network: {{ network }} + source: + abi: AToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: AToken + file: ./abis/kinza-finance/AToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleCollateralTransfer + receipt: true + file: ./protocols/kinza-finance/src/mapping.ts + - kind: ethereum + name: StableDebtToken + network: {{ network }} + source: + abi: StableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: StableDebtToken + file: ./abis/kinza-finance/StableDebtToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleStableTransfer + file: ./protocols/kinza-finance/src/mapping.ts + - kind: ethereum + name: VariableDebtToken + network: {{ network }} + source: + abi: VariableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: VariableDebtToken + file: ./abis/kinza-finance/VariableDebtToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleVariableTransfer + file: ./protocols/kinza-finance/src/mapping.ts diff --git a/subgraphs/aave-forks/protocols/kinza-finance/src/constants.ts b/subgraphs/aave-forks/protocols/kinza-finance/src/constants.ts new file mode 100644 index 0000000000..32d9e405da --- /dev/null +++ b/subgraphs/aave-forks/protocols/kinza-finance/src/constants.ts @@ -0,0 +1,68 @@ +import { + Address, + ByteArray, + crypto, + dataSource, + log, +} from "@graphprotocol/graph-ts"; +import { Network, ZERO_ADDRESS } from "../../../src/constants"; + +///////////////////////////// +///// Protocol Specific ///// +///////////////////////////// + +export namespace Protocol { + export const PROTOCOL = "Kinza Finance"; + export const NAME = "Kinza Finance"; + export const SLUG = "kinza-finance"; +} + +export namespace IavsTokenType { + export const ATOKEN = "ATOKEN"; + export const INPUTTOKEN = "INPUTTOKEN"; + export const VTOKEN = "VTOKEN"; + export const STOKEN = "STOKEN"; +} + +export const AAVE_DECIMALS = 8; + +export namespace InterestRateMode { + export const NONE = 0 as i32; + export const STABLE = 1 as i32; + export const VARIABLE = 2 as i32; +} + +//////////////////////////// +///// Network Specific ///// +//////////////////////////// + +export class NetworkSpecificConstant { + constructor( + public readonly protocolAddress: Address, // aka, PoolAddressesProviderRegistry + public readonly network: string + ) {} +} + +export function getNetworkSpecificConstant(): NetworkSpecificConstant { + const network = dataSource.network(); + if (equalsIgnoreCase(network, Network.BSC)) { + return new NetworkSpecificConstant( + Address.fromString("0x37d7eb561e189895e5c8601cd03eeab67c269189"), + Network.BSC + ); + } else { + log.critical("[getNetworkSpecificConstant] Unsupported network: {}", [ + network, + ]); + return new NetworkSpecificConstant(Address.fromString(ZERO_ADDRESS), ""); + } +} + +export function equalsIgnoreCase(a: string, b: string): boolean { + return a.replace("-", "_").toLowerCase() == b.replace("-", "_").toLowerCase(); +} + +export const BALANCE_TRANSFER_SIGNATURE = crypto.keccak256( + ByteArray.fromUTF8("BalanceTransfer(address,address,uint256,uint256)") +); +export const BALANCE_TRANSFER_DATA_TYPE = "(uint256,uint256)"; diff --git a/subgraphs/aave-forks/protocols/kinza-finance/src/mapping.ts b/subgraphs/aave-forks/protocols/kinza-finance/src/mapping.ts new file mode 100644 index 0000000000..be62545450 --- /dev/null +++ b/subgraphs/aave-forks/protocols/kinza-finance/src/mapping.ts @@ -0,0 +1,723 @@ +import { + Address, + BigDecimal, + BigInt, + ByteArray, + Bytes, + crypto, + ethereum, + log, +} from "@graphprotocol/graph-ts"; +import { PriceOracleUpdated } from "../../../generated/LendingPoolAddressesProvider/LendingPoolAddressesProvider"; +import { AssetConfigUpdated } from "../../../generated/RewardsController/RewardsController"; +import { Transfer as CollateralTransfer } from "../../../generated/templates/AToken/AToken"; +import { Transfer as StableTransfer } from "../../../generated/templates/StableDebtToken/StableDebtToken"; +import { Transfer as VariableTransfer } from "../../../generated/templates/VariableDebtToken/VariableDebtToken"; +import { AaveOracle } from "../../../generated/RewardsController/AaveOracle"; +import { + CollateralConfigurationChanged, + ReserveFactorChanged, + ReserveActive, + ReserveBorrowing, + ReserveFrozen, + ReserveInitialized, + ReservePaused, + LiquidationProtocolFeeChanged, + FlashloanPremiumTotalUpdated, + FlashloanPremiumToProtocolUpdated, + SiloedBorrowingChanged, +} from "../../../generated/LendingPoolConfigurator/LendingPoolConfigurator"; +import { + Borrow, + FlashLoan, + LendingPool as LendingPoolContract, + LiquidationCall, + Repay, + ReserveDataUpdated, + ReserveUsedAsCollateralDisabled, + ReserveUsedAsCollateralEnabled, + Supply, + SwapBorrowRateMode, + Withdraw, + UserEModeSet, + MintedToTreasury, +} from "../../../generated/LendingPool/LendingPool"; +import { Market, _DefaultOracle } from "../../../generated/schema"; +import { + AAVE_DECIMALS, + getNetworkSpecificConstant, + InterestRateMode, + Protocol, + BALANCE_TRANSFER_DATA_TYPE, + BALANCE_TRANSFER_SIGNATURE, +} from "./constants"; +import { + _handleAssetConfigUpdated, + _handleBorrow, + _handleBorrowingDisabledOnReserve, + _handleBorrowingEnabledOnReserve, + _handleCollateralConfigurationChanged, + _handleDeposit, + _handleFlashLoan, + _handleFlashloanPremiumToProtocolUpdated, + _handleFlashloanPremiumTotalUpdated, + _handleLiquidate, + _handleLiquidationProtocolFeeChanged, + _handleMintedToTreasury, + _handlePriceOracleUpdated, + _handleRepay, + _handleReserveActivated, + _handleReserveDataUpdated, + _handleReserveDeactivated, + _handleReserveFactorChanged, + _handleReserveInitialized, + _handleReserveUsedAsCollateralDisabled, + _handleReserveUsedAsCollateralEnabled, + _handleSwapBorrowRateMode, + _handleTransfer, + _handleWithdraw, +} from "../../../src/mapping"; +import { + BIGDECIMAL_ZERO, + BIGINT_ONE_RAY, + BIGINT_ZERO, + INT_FOUR, + INT_ONE, + INT_ZERO, +} from "../../../src/constants"; + +import { DataManager, ProtocolData } from "../../../src/sdk/manager"; +import { + readValue, + getMarketFromToken, + exponentToBigDecimal, + getOrCreateFlashloanPremium, + getBorrowBalances, +} from "../../../src/helpers"; +import { + LendingType, + CollateralizationType, + PermissionType, + RiskType, + InterestRateType, + PositionSide, + INT_TEN, + INT_152, + INT_THIRTY_TWO, +} from "../../../src/sdk/constants"; +import { AccountManager } from "../../../src/sdk/account"; + +function getProtocolData(): ProtocolData { + const constants = getNetworkSpecificConstant(); + return new ProtocolData( + constants.protocolAddress, + Protocol.PROTOCOL, + Protocol.NAME, + Protocol.SLUG, + constants.network, + LendingType.POOLED, + PermissionType.PERMISSIONLESS, + PermissionType.PERMISSIONLESS, + PermissionType.ADMIN, + CollateralizationType.OVER_COLLATERALIZED, + RiskType.GLOBAL + ); +} + +const protocolData = getProtocolData(); + +//////////////////////////////////////// +///// PoolAddressProvider Handlers ///// +//////////////////////////////////////// + +export function handlePriceOracleUpdated(event: PriceOracleUpdated): void { + _handlePriceOracleUpdated(event.params.newAddress, protocolData, event); +} + +///////////////////////////////////// +///// RewardController Handlers ///// +///////////////////////////////////// + +export function handleAssetConfigUpdated(event: AssetConfigUpdated): void { + // it is not clear which market.oracle shouild we use + // use the protocol-wide defaultOracle + const defaultOracle = _DefaultOracle.load(protocolData.protocolID); + let rewardTokenPriceUSD = BIGDECIMAL_ZERO; + if (!defaultOracle || !defaultOracle.oracle) { + log.warning( + "[handleAssetConfigUpdated]_DefaultOracle for {} not set; rewardTokenPriceUSD set to default 0.0", + [protocolData.protocolID.toHexString()] + ); + } else { + rewardTokenPriceUSD = getAssetPriceInUSDC( + event.params.reward, + Address.fromBytes(defaultOracle.oracle) + ); + } + + _handleAssetConfigUpdated( + event, + event.params.asset, + event.params.reward, + rewardTokenPriceUSD, + event.params.newEmission, + event.params.newDistributionEnd, + protocolData + ); +} + +///////////////////////////////////// +///// PoolConfigurator Handlers ///// +///////////////////////////////////// + +export function handleReserveInitialized(event: ReserveInitialized): void { + // This function handles market entity from reserve creation event + // Attempt to load or create the market implementation + + _handleReserveInitialized( + event, + event.params.asset, + event.params.aToken, + event.params.variableDebtToken, + protocolData, + event.params.stableDebtToken + ); +} + +export function handleCollateralConfigurationChanged( + event: CollateralConfigurationChanged +): void { + _handleCollateralConfigurationChanged( + event.params.asset, + event.params.liquidationBonus, + event.params.liquidationThreshold, + event.params.ltv, + protocolData + ); +} + +export function handleReserveActive(event: ReserveActive): void { + _handleReserveActivated(event.params.asset, protocolData); +} + +export function handleReserveBorrowing(event: ReserveBorrowing): void { + if (event.params.enabled) { + _handleBorrowingEnabledOnReserve(event.params.asset, protocolData); + } else { + _handleBorrowingDisabledOnReserve(event.params.asset, protocolData); + } +} + +export function handleReserveFrozen(event: ReserveFrozen): void { + _handleReserveDeactivated(event.params.asset, protocolData); +} + +export function handleReservePaused(event: ReservePaused): void { + _handleReserveDeactivated(event.params.asset, protocolData); +} + +export function handleReserveFactorChanged(event: ReserveFactorChanged): void { + _handleReserveFactorChanged( + event.params.asset, + event.params.newReserveFactor, + protocolData + ); +} + +export function handleLiquidationProtocolFeeChanged( + event: LiquidationProtocolFeeChanged +): void { + _handleLiquidationProtocolFeeChanged( + event.params.asset, + event.params.newFee, + protocolData + ); +} + +export function handleFlashloanPremiumTotalUpdated( + event: FlashloanPremiumTotalUpdated +): void { + const rate = event.params.newFlashloanPremiumTotal + .toBigDecimal() + .div(exponentToBigDecimal(INT_FOUR)); + + _handleFlashloanPremiumTotalUpdated(rate, protocolData); +} + +export function handleFlashloanPremiumToProtocolUpdated( + event: FlashloanPremiumToProtocolUpdated +): void { + const rate = event.params.newFlashloanPremiumToProtocol + .toBigDecimal() + .div(exponentToBigDecimal(INT_FOUR)); + _handleFlashloanPremiumToProtocolUpdated(rate, protocolData); +} + +///////////////////////////////// +///// Lending Pool Handlers ///// +///////////////////////////////// + +export function handleReserveDataUpdated(event: ReserveDataUpdated): void { + const market = getMarketFromToken(event.params.reserve, protocolData); + if (!market) { + log.warning("[handleReserveDataUpdated] Market not found for reserve {}", [ + event.params.reserve.toHexString(), + ]); + return; + } + const manager = new DataManager( + market.id, + market.inputToken, + event, + protocolData + ); + + const assetPriceUSD = getAssetPriceInUSDC( + Address.fromBytes(market.inputToken), + manager.getOracleAddress() + ); + + _handleReserveDataUpdated( + event, + event.params.liquidityRate, + event.params.liquidityIndex, + event.params.variableBorrowIndex, + event.params.variableBorrowRate, + event.params.stableBorrowRate, + protocolData, + event.params.reserve, + assetPriceUSD + ); +} + +export function handleReserveUsedAsCollateralEnabled( + event: ReserveUsedAsCollateralEnabled +): void { + // This Event handler enables a reserve/market to be used as collateral + _handleReserveUsedAsCollateralEnabled( + event.params.reserve, + event.params.user, + protocolData + ); +} + +export function handleReserveUsedAsCollateralDisabled( + event: ReserveUsedAsCollateralDisabled +): void { + // This Event handler disables a reserve/market being used as collateral + _handleReserveUsedAsCollateralDisabled( + event.params.reserve, + event.params.user, + protocolData + ); +} + +export function handleDeposit(event: Supply): void { + _handleDeposit( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.onBehalfOf + ); +} + +export function handleWithdraw(event: Withdraw): void { + _handleWithdraw( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.user + ); +} + +export function handleBorrow(event: Borrow): void { + // determine whether the borrow position is in isolated mode + // borrow in isolated mode will have an IsolationModeTotalDebtUpdated event emitted + // before the Borrow event + // https://github.com/aave/aave-v3-core/blob/29ff9b9f89af7cd8255231bc5faf26c3ce0fb7ce/contracts/protocol/libraries/logic/BorrowLogic.sol#L139 + let isIsolated = false; + const receipt = event.receipt; + if (!receipt) { + log.warning( + "[handleBorrow]No receipt for tx {}; cannot set isIsolated flag", + [event.transaction.hash.toHexString()] + ); + } else { + isIsolated = getIsIsolatedFlag(event); + } + + let interestRateType: InterestRateType | null = null; + if (event.params.interestRateMode === InterestRateMode.STABLE) { + interestRateType = InterestRateType.STABLE; + } else if (event.params.interestRateMode === InterestRateMode.VARIABLE) { + interestRateType = InterestRateType.VARIABLE; + } + + _handleBorrow( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.onBehalfOf, + interestRateType, + isIsolated + ); +} + +export function handleRepay(event: Repay): void { + _handleRepay( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.user + ); +} + +export function handleLiquidationCall(event: LiquidationCall): void { + const collateralMarket = getMarketFromToken( + event.params.collateralAsset, + protocolData + ); + if (!collateralMarket) { + log.error("[handleLiquidationCall]Failed to find market for asset {}", [ + event.params.collateralAsset.toHexString(), + ]); + return; + } + + if (!collateralMarket._liquidationProtocolFee) { + storeLiquidationProtocolFee( + collateralMarket, + event.address, + event.params.collateralAsset + ); + } + + let balanceTransferValue = BIGINT_ZERO; + let balanceTransferIndex = BIGINT_ZERO; + if (event.receipt) { + const logs = event.receipt!.logs; + for (let i = 0; i < logs.length; i++) { + const thisLog = logs[i]; + if (!thisLog.topics.length) continue; + + if (thisLog.topics[0] == BALANCE_TRANSFER_SIGNATURE) { + const decoded = ethereum.decode( + BALANCE_TRANSFER_DATA_TYPE, + thisLog.data + ); + if (!decoded) return; + + const logData = decoded.toTuple(); + balanceTransferValue = logData[INT_ZERO].toBigInt(); + balanceTransferIndex = logData[INT_ONE].toBigInt(); + } + } + } + const balanceTransferAmount = balanceTransferValue.times( + balanceTransferIndex.div(BIGINT_ONE_RAY) + ); + + _handleLiquidate( + event, + event.params.liquidatedCollateralAmount, + event.params.collateralAsset, + protocolData, + event.params.liquidator, + event.params.user, + event.params.debtAsset, + event.params.debtToCover, + balanceTransferAmount + ); +} + +export function handleFlashloan(event: FlashLoan): void { + const flashloanPremium = getOrCreateFlashloanPremium(protocolData); + + _handleFlashLoan( + event.params.asset, + event.params.amount, + event.params.initiator, + protocolData, + event, + event.params.premium, + flashloanPremium + ); +} + +export function handleMintedToTreasury(event: MintedToTreasury): void { + _handleMintedToTreasury( + event, + protocolData, + event.params.reserve, + event.params.amountMinted + ); +} + +///////////////////////// +//// Transfer Events //// +///////////////////////// + +export function handleCollateralTransfer(event: CollateralTransfer): void { + // determine the transfer amount because different versions of the AToken contract + // pass discounted and undiscounted amount to Transfer() and BalanceTransfer() event + // here we get the higher of the two amount and use it as the transfer amount + // e.g. https://arbiscan.io/tx/0x7ee837a19f37f0f74acb75be2eb07de85adcf1fcca1b66e8d2118958ce4fe8a1#eventlog + // logIndex 18 and 21 + let amount = event.params.value; + const receipt = event.receipt; + if (!receipt) { + log.warning("[handleBorrow]No receipt for tx {}", [ + event.transaction.hash.toHexString(), + ]); + } else { + const btAmount = getBalanceTransferAmount(event); + amount = btAmount.gt(amount) ? btAmount : amount; + } + + _handleTransfer( + event, + protocolData, + PositionSide.COLLATERAL, + event.params.to, + event.params.from, + amount + ); +} + +export function handleVariableTransfer(event: VariableTransfer): void { + _handleTransfer( + event, + protocolData, + PositionSide.BORROWER, + event.params.to, + event.params.from, + event.params.value + ); +} + +export function handleStableTransfer(event: StableTransfer): void { + _handleTransfer( + event, + protocolData, + PositionSide.BORROWER, + event.params.to, + event.params.from, + event.params.value + ); +} + +export function handleSwapBorrowRateMode(event: SwapBorrowRateMode): void { + const interestRateMode = event.params.interestRateMode; + if ( + ![InterestRateMode.STABLE, InterestRateMode.VARIABLE].includes( + event.params.interestRateMode + ) + ) { + log.error( + "[handleSwapBorrowRateMode]interestRateMode {} is not one of [{}, {}]", + [ + interestRateMode.toString(), + InterestRateMode.STABLE.toString(), + InterestRateMode.VARIABLE.toString(), + ] + ); + return; + return; + } + const interestRateType = + event.params.interestRateMode === InterestRateMode.STABLE + ? InterestRateType.STABLE + : InterestRateType.VARIABLE; + const market = getMarketFromToken(event.params.reserve, protocolData); + if (!market) { + log.error("[handleLiquidationCall]Failed to find market for asset {}", [ + event.params.reserve.toHexString(), + ]); + return; + } + const newBorrowBalances = getBorrowBalances(market, event.params.user); + _handleSwapBorrowRateMode( + event, + market, + event.params.user, + newBorrowBalances, + interestRateType, + protocolData + ); +} + +export function handleSiloedBorrowingChanged( + event: SiloedBorrowingChanged +): void { + const market = getMarketFromToken(event.params.asset, protocolData); + if (!market) { + log.error("[handleSiloedBorrowingChanged]market not found for token {}", [ + event.params.asset.toHexString(), + ]); + return; + } + market._siloedBorrowing = event.params.newState; + market.save(); +} + +export function handleUserEModeSet(event: UserEModeSet): void { + const account = new AccountManager(event.params.user).getAccount(); + account._eMode = true; + account.save(); +} + +/////////////////// +///// Helpers ///// +/////////////////// + +function getAssetPriceInUSDC( + tokenAddress: Address, + priceOracle: Address +): BigDecimal { + const oracle = AaveOracle.bind(priceOracle); + const baseUnit = readValue( + oracle.try_BASE_CURRENCY_UNIT(), + BigInt.fromI32(INT_TEN).pow(AAVE_DECIMALS as u8) + ).toBigDecimal(); + + const oracleResult = readValue( + oracle.try_getAssetPrice(tokenAddress), + BIGINT_ZERO + ); + + if (oracleResult.gt(BIGINT_ZERO)) { + return oracleResult.toBigDecimal().div(baseUnit); + } + + // fall price oracle unimplemented + + return BIGDECIMAL_ZERO; +} + +function storeLiquidationProtocolFee( + market: Market, + poolAddress: Address, + reserve: Address +): void { + // Store LiquidationProtocolFee if not set, as setLiquidationProtocolFee() may be never called + // and no LiquidationProtocolFeeChanged event is emitted + // see https://github.com/aave/aave-v3-core/blob/1e46f1cbb7ace08995cb4c8fa4e4ece96a243be3/contracts/protocol/libraries/configuration/ReserveConfiguration.sol#L491 + // for how to decode configuration data to get _liquidationProtocolFee + const liquidationProtocolFeeMask = + "0xFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; + const liquidationProtocolFeeStartBitPosition = INT_152 as u8; + const pool = LendingPoolContract.bind(poolAddress); + const poolConfigData = pool.getConfiguration(reserve).data; + const liquidationProtocolFee = decodeConfig( + poolConfigData, + liquidationProtocolFeeMask, + liquidationProtocolFeeStartBitPosition + ) + .toBigDecimal() + .div(exponentToBigDecimal(INT_FOUR)); + + log.info("[storeLiquidationProtocolFee]market {} liquidationProtocolFee={}", [ + market.id.toHexString(), + liquidationProtocolFee.toString(), + ]); + market._liquidationProtocolFee = liquidationProtocolFee; + market.save(); +} + +function decodeConfig( + storedData: BigInt, + maskStr: string, + startBitPosition: u8 +): BigInt { + // aave-v3 stores configuration in packed bits (ReserveConfiguration.sol) + // decoding them by applying a bit_not mask and right shift by startBitPosition + // see https://github.com/aave/aave-v3-core/blob/1e46f1cbb7ace08995cb4c8fa4e4ece96a243be3/contracts/protocol/libraries/configuration/ReserveConfiguration.sol#L491 + // for how to decode configuration data to get _liquidationProtocolFee + + const maskArray = new Uint8Array(INT_THIRTY_TWO); + maskArray.set(Bytes.fromHexString(maskStr)); + // BITWISE NOT + for (let i = 0; i < maskArray.length; i++) { + maskArray[i] = ~maskArray[i]; + } + // reverse for little endian + const configMaskBigInt = BigInt.fromUnsignedBytes( + Bytes.fromUint8Array(maskArray.reverse()) + ); + + const config = storedData + .bitAnd(configMaskBigInt) + .rightShift(startBitPosition); + + return config; +} + +function getIsIsolatedFlag(event: ethereum.Event): boolean { + let isIsolated = false; + const ISOLATE_MODE = "IsolationModeTotalDebtUpdated(address,uint256)"; + const eventSignature = crypto.keccak256(ByteArray.fromUTF8(ISOLATE_MODE)); + const logs = event.receipt!.logs; + //IsolationModeTotalDebtUpdated emitted before Borrow's event.logIndex + // e.g. https://etherscan.io/tx/0x4b038b26555d4b6c057cd612057b39e6482a7c60eb44058ee61d299332efdf29#eventlog + const eventLogIndex = event.logIndex; + for (let i = 0; i < logs.length; i++) { + const thisLog = logs[i]; + if (thisLog.topics.length > INT_ZERO) { + if (thisLog.logIndex.gt(eventLogIndex)) { + // no IsolationModeTotalDebtUpdated log before Borrow + break; + } + // topics[0] - signature + const logSignature = thisLog.topics[0]; + if (thisLog.address == event.address && logSignature == eventSignature) { + log.info( + "[getIsIsolatedFlag]found IsolationModeTotalDebtUpdated event isolated=true tx {}", + [event.transaction.hash.toHexString()] + ); + isIsolated = true; + break; + } + } + } + return isIsolated; +} + +function getBalanceTransferAmount(event: ethereum.Event): BigInt { + let btAmount = BIGINT_ZERO; + const BALANCE_TRANSFER = + "BalanceTransfer(address, address, uint256, uint256)"; + const eventSignature = crypto.keccak256(ByteArray.fromUTF8(BALANCE_TRANSFER)); + const logs = event.receipt!.logs; + // BalanceTransfer emitted after Transfer's event.logIndex + // e.g. https://arbiscan.io/tx/0x7ee837a19f37f0f74acb75be2eb07de85adcf1fcca1b66e8d2118958ce4fe8a1#eventlog + const eventLogIndex = event.logIndex; + for (let i = 0; i < logs.length; i++) { + const thisLog = logs[i]; + if (thisLog.topics.length > INT_ZERO) { + if (thisLog.logIndex.le(eventLogIndex)) { + // skip event with logIndex < event.logIndex + continue; + } + // topics[0] - signature + const logSignature = thisLog.topics[0]; + if (thisLog.address == event.address && logSignature == eventSignature) { + const UINT256_UINT256 = "(uint256,uint256)"; + const decoded = ethereum.decode(UINT256_UINT256, thisLog.data); + if (!decoded) continue; + + const logData = decoded.toTuple(); + btAmount = logData[0].toBigInt(); + log.info( + "[handleCollateralTransfer] BalanceTransfer amount= {} tx {}", + [btAmount.toString(), event.transaction.hash.toHexString()] + ); + break; + } + } + } + return btAmount; +} diff --git a/subgraphs/aave-forks/protocols/pac-finance/README.md b/subgraphs/aave-forks/protocols/pac-finance/README.md new file mode 100644 index 0000000000..45cc5be9bc --- /dev/null +++ b/subgraphs/aave-forks/protocols/pac-finance/README.md @@ -0,0 +1,8 @@ +#### Note + +Contracts for: + +- [RewardsController](https://blastscan.io/address/0x13C836bD2dEC4AE49e7F865baaFE02B402013795#code) +- [StableDebtToken](https://blastscan.io/address/0x36584b8b2d3937e4066e6f7777f6cebc1fb5a692#code) + +are not verified on blastscan, hence using Aave-V3's abis for them instead. diff --git a/subgraphs/aave-forks/protocols/pac-finance/config/deployments/pac-finance-blast/configurations.json b/subgraphs/aave-forks/protocols/pac-finance/config/deployments/pac-finance-blast/configurations.json new file mode 100644 index 0000000000..85d68be042 --- /dev/null +++ b/subgraphs/aave-forks/protocols/pac-finance/config/deployments/pac-finance-blast/configurations.json @@ -0,0 +1,22 @@ +{ + "network": "blast-mainnet", + "factory": { + "startBlock": "190055", + "address": "0x688B5fd3C3E3724b4De08C4BCB3A755F9b579c9a" + }, + "lendingPoolConfigurator": { + "startBlock": "190414", + "address": "0xCc24504b36A022D8DEF8E65f3cD3F4899E79FcFc" + }, + "lendingPool": { + "startBlock": "190409", + "address": "0xd2499b3c8611E36ca89A70Fda2A72C49eE19eAa8" + }, + "RewardsController": { + "address": "0x13C836bD2dEC4AE49e7F865baaFE02B402013795", + "startBlock": "190440" + }, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": "" +} diff --git a/subgraphs/aave-forks/protocols/pac-finance/config/templates/pac.finance.template.yaml b/subgraphs/aave-forks/protocols/pac-finance/config/templates/pac.finance.template.yaml new file mode 100644 index 0000000000..8055892bea --- /dev/null +++ b/subgraphs/aave-forks/protocols/pac-finance/config/templates/pac.finance.template.yaml @@ -0,0 +1,237 @@ +specVersion: 1.0.0 +schema: + file: ./schema.graphql +indexerHints: + prune: auto +{{#graftEnabled}} +description: ... +features: + - grafting +graft: + base: {{subgraphId}} # Subgraph ID of base subgraph + block: {{graftStartBlock}} # Block number +{{/graftEnabled}} +dataSources: + - kind: ethereum/contract + name: LendingPoolAddressesProvider + network: {{ network }} + source: + address: "{{ factory.address }}" + abi: LendingPoolAddressesProvider + startBlock: {{ factory.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - LendingProtocol + abis: + - name: LendingPoolAddressesProvider + file: ./abis/pac-finance/LendingPoolAddressesProvider.json + eventHandlers: + - event: PriceOracleUpdated(indexed address,indexed address) + handler: handlePriceOracleUpdated + file: ./protocols/pac-finance/src/mapping.ts + - kind: ethereum/contract + name: LendingPoolConfigurator + network: {{ network }} + source: + address: "{{ lendingPoolConfigurator.address }}" + abi: LendingPoolConfigurator + startBlock: {{ lendingPoolConfigurator.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Market + abis: + - name: LendingPoolConfigurator + file: ./abis/pac-finance/LendingPoolConfigurator.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + - name: AToken + file: ./abis/pac-finance/AToken.json + eventHandlers: + - event: CollateralConfigurationChanged(indexed address,uint256,uint256,uint256) + handler: handleCollateralConfigurationChanged + - event: ReserveActive(indexed address,bool) + handler: handleReserveActive + - event: ReserveBorrowing(indexed address,bool) + handler: handleReserveBorrowing + - event: ReserveFrozen(indexed address,bool) + handler: handleReserveFrozen + - event: ReserveInitialized(indexed address,indexed address,address,address,address) + handler: handleReserveInitialized + - event: ReservePaused(indexed address,bool) + handler: handleReservePaused + - event: ReserveFactorChanged(indexed address,uint256,uint256) + handler: handleReserveFactorChanged + - event: LiquidationProtocolFeeChanged(indexed address,uint256,uint256) + handler: handleLiquidationProtocolFeeChanged + - event: FlashloanPremiumTotalUpdated(uint128,uint128) + handler: handleFlashloanPremiumTotalUpdated + - event: FlashloanPremiumToProtocolUpdated(uint128,uint128) + handler: handleFlashloanPremiumToProtocolUpdated + - event: SiloedBorrowingChanged(indexed address,bool,bool) + handler: handleSiloedBorrowingChanged + file: ./protocols/pac-finance/src/mapping.ts + - kind: ethereum/contract + name: LendingPool + network: {{ network }} + source: + address: "{{ lendingPool.address }}" + abi: LendingPool + startBlock: {{ lendingPool.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Market + - Deposit + - Withdraw + - Repay + - Borrow + - Liquidate + abis: + - name: LendingPool + file: ./abis/pac-finance/LendingPool.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + - name: AaveOracle + file: ./abis/pac-finance/AaveOracle.json + - name: IPriceOracleGetter + file: ./abis/IPriceOracleGetter.json + - name: AToken + file: ./abis/pac-finance/AToken.json + - name: StableDebtToken + file: ./abis/aave-v3/StableDebtToken.json + - name: VariableDebtToken + file: ./abis/pac-finance/VariableDebtToken.json + eventHandlers: + - event: Borrow(indexed address,address,indexed address,uint256,uint8,uint256,indexed uint16) + handler: handleBorrow + receipt: true + - event: LiquidationCall(indexed address,indexed address,indexed address,uint256,uint256,address,bool) + handler: handleLiquidationCall + receipt: true + - event: Repay(indexed address,indexed address,indexed address,uint256,bool) + handler: handleRepay + receipt: true + - event: SwapBorrowRateMode(indexed address,indexed address,uint8) + handler: handleSwapBorrowRateMode + - event: ReserveDataUpdated(indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleReserveDataUpdated + - event: Supply(indexed address,address,indexed address,uint256,indexed uint16) + handler: handleDeposit + - event: Withdraw(indexed address,indexed address,indexed address,uint256) + handler: handleWithdraw + - event: ReserveUsedAsCollateralEnabled(indexed address,indexed address) + handler: handleReserveUsedAsCollateralEnabled + - event: ReserveUsedAsCollateralDisabled(indexed address,indexed address) + handler: handleReserveUsedAsCollateralDisabled + - event: FlashLoan(indexed address,address,indexed address,uint256,uint8,uint256,indexed uint16) + handler: handleFlashloan + - event: UserEModeSet(indexed address,uint8) + handler: handleUserEModeSet + - event: MintedToTreasury(indexed address,uint256) + handler: handleMintedToTreasury + file: ./protocols/pac-finance/src/mapping.ts + - kind: ethereum + name: RewardsController + network: {{ network }} + source: + address: "{{ RewardsController.address }}" + abi: RewardsController + startBlock: {{ RewardsController.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - RewardsController + abis: + - name: RewardsController + file: ./abis/aave-v3/RewardsController.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + - name: AaveOracle + file: ./abis/pac-finance/AaveOracle.json + - name: IPriceOracleGetter + file: ./abis/IPriceOracleGetter.json + eventHandlers: + - event: AssetConfigUpdated(indexed address,indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleAssetConfigUpdated + file: ./protocols/pac-finance/src/mapping.ts +templates: + - kind: ethereum + name: AToken + network: {{ network }} + source: + abi: AToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: AToken + file: ./abis/pac-finance/AToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleCollateralTransfer + receipt: true + file: ./protocols/pac-finance/src/mapping.ts + - kind: ethereum + name: StableDebtToken + network: {{ network }} + source: + abi: StableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: StableDebtToken + file: ./abis/aave-v3/StableDebtToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleStableTransfer + file: ./protocols/pac-finance/src/mapping.ts + - kind: ethereum + name: VariableDebtToken + network: {{ network }} + source: + abi: VariableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: VariableDebtToken + file: ./abis/pac-finance/VariableDebtToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleVariableTransfer + file: ./protocols/pac-finance/src/mapping.ts diff --git a/subgraphs/aave-forks/protocols/pac-finance/src/constants.ts b/subgraphs/aave-forks/protocols/pac-finance/src/constants.ts new file mode 100644 index 0000000000..cdc85fddf8 --- /dev/null +++ b/subgraphs/aave-forks/protocols/pac-finance/src/constants.ts @@ -0,0 +1,68 @@ +import { + Address, + ByteArray, + crypto, + dataSource, + log, +} from "@graphprotocol/graph-ts"; +import { Network, ZERO_ADDRESS } from "../../../src/constants"; + +///////////////////////////// +///// Protocol Specific ///// +///////////////////////////// + +export namespace Protocol { + export const PROTOCOL = "Pac Finance"; + export const NAME = "Pac Finance"; + export const SLUG = "pac-finance"; +} + +export namespace IavsTokenType { + export const ATOKEN = "ATOKEN"; + export const INPUTTOKEN = "INPUTTOKEN"; + export const VTOKEN = "VTOKEN"; + export const STOKEN = "STOKEN"; +} + +export const AAVE_DECIMALS = 8; + +export namespace InterestRateMode { + export const NONE = 0 as i32; + export const STABLE = 1 as i32; + export const VARIABLE = 2 as i32; +} + +//////////////////////////// +///// Network Specific ///// +//////////////////////////// + +export class NetworkSpecificConstant { + constructor( + public readonly protocolAddress: Address, // aka, PoolAddressesProviderRegistry + public readonly network: string + ) {} +} + +export function getNetworkSpecificConstant(): NetworkSpecificConstant { + const network = dataSource.network(); + if (equalsIgnoreCase(network, Network.BLAST_MAINNET)) { + return new NetworkSpecificConstant( + Address.fromString("0xdb3ceaa3ff702242b9aaae63e4ba673ef7a2517d"), + Network.BLAST_MAINNET + ); + } else { + log.critical("[getNetworkSpecificConstant] Unsupported network: {}", [ + network, + ]); + return new NetworkSpecificConstant(Address.fromString(ZERO_ADDRESS), ""); + } +} + +export function equalsIgnoreCase(a: string, b: string): boolean { + return a.replace("-", "_").toLowerCase() == b.replace("-", "_").toLowerCase(); +} + +export const BALANCE_TRANSFER_SIGNATURE = crypto.keccak256( + ByteArray.fromUTF8("BalanceTransfer(address,address,uint256,uint256)") +); +export const BALANCE_TRANSFER_DATA_TYPE = "(uint256,uint256)"; diff --git a/subgraphs/aave-forks/protocols/pac-finance/src/mapping.ts b/subgraphs/aave-forks/protocols/pac-finance/src/mapping.ts new file mode 100644 index 0000000000..be62545450 --- /dev/null +++ b/subgraphs/aave-forks/protocols/pac-finance/src/mapping.ts @@ -0,0 +1,723 @@ +import { + Address, + BigDecimal, + BigInt, + ByteArray, + Bytes, + crypto, + ethereum, + log, +} from "@graphprotocol/graph-ts"; +import { PriceOracleUpdated } from "../../../generated/LendingPoolAddressesProvider/LendingPoolAddressesProvider"; +import { AssetConfigUpdated } from "../../../generated/RewardsController/RewardsController"; +import { Transfer as CollateralTransfer } from "../../../generated/templates/AToken/AToken"; +import { Transfer as StableTransfer } from "../../../generated/templates/StableDebtToken/StableDebtToken"; +import { Transfer as VariableTransfer } from "../../../generated/templates/VariableDebtToken/VariableDebtToken"; +import { AaveOracle } from "../../../generated/RewardsController/AaveOracle"; +import { + CollateralConfigurationChanged, + ReserveFactorChanged, + ReserveActive, + ReserveBorrowing, + ReserveFrozen, + ReserveInitialized, + ReservePaused, + LiquidationProtocolFeeChanged, + FlashloanPremiumTotalUpdated, + FlashloanPremiumToProtocolUpdated, + SiloedBorrowingChanged, +} from "../../../generated/LendingPoolConfigurator/LendingPoolConfigurator"; +import { + Borrow, + FlashLoan, + LendingPool as LendingPoolContract, + LiquidationCall, + Repay, + ReserveDataUpdated, + ReserveUsedAsCollateralDisabled, + ReserveUsedAsCollateralEnabled, + Supply, + SwapBorrowRateMode, + Withdraw, + UserEModeSet, + MintedToTreasury, +} from "../../../generated/LendingPool/LendingPool"; +import { Market, _DefaultOracle } from "../../../generated/schema"; +import { + AAVE_DECIMALS, + getNetworkSpecificConstant, + InterestRateMode, + Protocol, + BALANCE_TRANSFER_DATA_TYPE, + BALANCE_TRANSFER_SIGNATURE, +} from "./constants"; +import { + _handleAssetConfigUpdated, + _handleBorrow, + _handleBorrowingDisabledOnReserve, + _handleBorrowingEnabledOnReserve, + _handleCollateralConfigurationChanged, + _handleDeposit, + _handleFlashLoan, + _handleFlashloanPremiumToProtocolUpdated, + _handleFlashloanPremiumTotalUpdated, + _handleLiquidate, + _handleLiquidationProtocolFeeChanged, + _handleMintedToTreasury, + _handlePriceOracleUpdated, + _handleRepay, + _handleReserveActivated, + _handleReserveDataUpdated, + _handleReserveDeactivated, + _handleReserveFactorChanged, + _handleReserveInitialized, + _handleReserveUsedAsCollateralDisabled, + _handleReserveUsedAsCollateralEnabled, + _handleSwapBorrowRateMode, + _handleTransfer, + _handleWithdraw, +} from "../../../src/mapping"; +import { + BIGDECIMAL_ZERO, + BIGINT_ONE_RAY, + BIGINT_ZERO, + INT_FOUR, + INT_ONE, + INT_ZERO, +} from "../../../src/constants"; + +import { DataManager, ProtocolData } from "../../../src/sdk/manager"; +import { + readValue, + getMarketFromToken, + exponentToBigDecimal, + getOrCreateFlashloanPremium, + getBorrowBalances, +} from "../../../src/helpers"; +import { + LendingType, + CollateralizationType, + PermissionType, + RiskType, + InterestRateType, + PositionSide, + INT_TEN, + INT_152, + INT_THIRTY_TWO, +} from "../../../src/sdk/constants"; +import { AccountManager } from "../../../src/sdk/account"; + +function getProtocolData(): ProtocolData { + const constants = getNetworkSpecificConstant(); + return new ProtocolData( + constants.protocolAddress, + Protocol.PROTOCOL, + Protocol.NAME, + Protocol.SLUG, + constants.network, + LendingType.POOLED, + PermissionType.PERMISSIONLESS, + PermissionType.PERMISSIONLESS, + PermissionType.ADMIN, + CollateralizationType.OVER_COLLATERALIZED, + RiskType.GLOBAL + ); +} + +const protocolData = getProtocolData(); + +//////////////////////////////////////// +///// PoolAddressProvider Handlers ///// +//////////////////////////////////////// + +export function handlePriceOracleUpdated(event: PriceOracleUpdated): void { + _handlePriceOracleUpdated(event.params.newAddress, protocolData, event); +} + +///////////////////////////////////// +///// RewardController Handlers ///// +///////////////////////////////////// + +export function handleAssetConfigUpdated(event: AssetConfigUpdated): void { + // it is not clear which market.oracle shouild we use + // use the protocol-wide defaultOracle + const defaultOracle = _DefaultOracle.load(protocolData.protocolID); + let rewardTokenPriceUSD = BIGDECIMAL_ZERO; + if (!defaultOracle || !defaultOracle.oracle) { + log.warning( + "[handleAssetConfigUpdated]_DefaultOracle for {} not set; rewardTokenPriceUSD set to default 0.0", + [protocolData.protocolID.toHexString()] + ); + } else { + rewardTokenPriceUSD = getAssetPriceInUSDC( + event.params.reward, + Address.fromBytes(defaultOracle.oracle) + ); + } + + _handleAssetConfigUpdated( + event, + event.params.asset, + event.params.reward, + rewardTokenPriceUSD, + event.params.newEmission, + event.params.newDistributionEnd, + protocolData + ); +} + +///////////////////////////////////// +///// PoolConfigurator Handlers ///// +///////////////////////////////////// + +export function handleReserveInitialized(event: ReserveInitialized): void { + // This function handles market entity from reserve creation event + // Attempt to load or create the market implementation + + _handleReserveInitialized( + event, + event.params.asset, + event.params.aToken, + event.params.variableDebtToken, + protocolData, + event.params.stableDebtToken + ); +} + +export function handleCollateralConfigurationChanged( + event: CollateralConfigurationChanged +): void { + _handleCollateralConfigurationChanged( + event.params.asset, + event.params.liquidationBonus, + event.params.liquidationThreshold, + event.params.ltv, + protocolData + ); +} + +export function handleReserveActive(event: ReserveActive): void { + _handleReserveActivated(event.params.asset, protocolData); +} + +export function handleReserveBorrowing(event: ReserveBorrowing): void { + if (event.params.enabled) { + _handleBorrowingEnabledOnReserve(event.params.asset, protocolData); + } else { + _handleBorrowingDisabledOnReserve(event.params.asset, protocolData); + } +} + +export function handleReserveFrozen(event: ReserveFrozen): void { + _handleReserveDeactivated(event.params.asset, protocolData); +} + +export function handleReservePaused(event: ReservePaused): void { + _handleReserveDeactivated(event.params.asset, protocolData); +} + +export function handleReserveFactorChanged(event: ReserveFactorChanged): void { + _handleReserveFactorChanged( + event.params.asset, + event.params.newReserveFactor, + protocolData + ); +} + +export function handleLiquidationProtocolFeeChanged( + event: LiquidationProtocolFeeChanged +): void { + _handleLiquidationProtocolFeeChanged( + event.params.asset, + event.params.newFee, + protocolData + ); +} + +export function handleFlashloanPremiumTotalUpdated( + event: FlashloanPremiumTotalUpdated +): void { + const rate = event.params.newFlashloanPremiumTotal + .toBigDecimal() + .div(exponentToBigDecimal(INT_FOUR)); + + _handleFlashloanPremiumTotalUpdated(rate, protocolData); +} + +export function handleFlashloanPremiumToProtocolUpdated( + event: FlashloanPremiumToProtocolUpdated +): void { + const rate = event.params.newFlashloanPremiumToProtocol + .toBigDecimal() + .div(exponentToBigDecimal(INT_FOUR)); + _handleFlashloanPremiumToProtocolUpdated(rate, protocolData); +} + +///////////////////////////////// +///// Lending Pool Handlers ///// +///////////////////////////////// + +export function handleReserveDataUpdated(event: ReserveDataUpdated): void { + const market = getMarketFromToken(event.params.reserve, protocolData); + if (!market) { + log.warning("[handleReserveDataUpdated] Market not found for reserve {}", [ + event.params.reserve.toHexString(), + ]); + return; + } + const manager = new DataManager( + market.id, + market.inputToken, + event, + protocolData + ); + + const assetPriceUSD = getAssetPriceInUSDC( + Address.fromBytes(market.inputToken), + manager.getOracleAddress() + ); + + _handleReserveDataUpdated( + event, + event.params.liquidityRate, + event.params.liquidityIndex, + event.params.variableBorrowIndex, + event.params.variableBorrowRate, + event.params.stableBorrowRate, + protocolData, + event.params.reserve, + assetPriceUSD + ); +} + +export function handleReserveUsedAsCollateralEnabled( + event: ReserveUsedAsCollateralEnabled +): void { + // This Event handler enables a reserve/market to be used as collateral + _handleReserveUsedAsCollateralEnabled( + event.params.reserve, + event.params.user, + protocolData + ); +} + +export function handleReserveUsedAsCollateralDisabled( + event: ReserveUsedAsCollateralDisabled +): void { + // This Event handler disables a reserve/market being used as collateral + _handleReserveUsedAsCollateralDisabled( + event.params.reserve, + event.params.user, + protocolData + ); +} + +export function handleDeposit(event: Supply): void { + _handleDeposit( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.onBehalfOf + ); +} + +export function handleWithdraw(event: Withdraw): void { + _handleWithdraw( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.user + ); +} + +export function handleBorrow(event: Borrow): void { + // determine whether the borrow position is in isolated mode + // borrow in isolated mode will have an IsolationModeTotalDebtUpdated event emitted + // before the Borrow event + // https://github.com/aave/aave-v3-core/blob/29ff9b9f89af7cd8255231bc5faf26c3ce0fb7ce/contracts/protocol/libraries/logic/BorrowLogic.sol#L139 + let isIsolated = false; + const receipt = event.receipt; + if (!receipt) { + log.warning( + "[handleBorrow]No receipt for tx {}; cannot set isIsolated flag", + [event.transaction.hash.toHexString()] + ); + } else { + isIsolated = getIsIsolatedFlag(event); + } + + let interestRateType: InterestRateType | null = null; + if (event.params.interestRateMode === InterestRateMode.STABLE) { + interestRateType = InterestRateType.STABLE; + } else if (event.params.interestRateMode === InterestRateMode.VARIABLE) { + interestRateType = InterestRateType.VARIABLE; + } + + _handleBorrow( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.onBehalfOf, + interestRateType, + isIsolated + ); +} + +export function handleRepay(event: Repay): void { + _handleRepay( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.user + ); +} + +export function handleLiquidationCall(event: LiquidationCall): void { + const collateralMarket = getMarketFromToken( + event.params.collateralAsset, + protocolData + ); + if (!collateralMarket) { + log.error("[handleLiquidationCall]Failed to find market for asset {}", [ + event.params.collateralAsset.toHexString(), + ]); + return; + } + + if (!collateralMarket._liquidationProtocolFee) { + storeLiquidationProtocolFee( + collateralMarket, + event.address, + event.params.collateralAsset + ); + } + + let balanceTransferValue = BIGINT_ZERO; + let balanceTransferIndex = BIGINT_ZERO; + if (event.receipt) { + const logs = event.receipt!.logs; + for (let i = 0; i < logs.length; i++) { + const thisLog = logs[i]; + if (!thisLog.topics.length) continue; + + if (thisLog.topics[0] == BALANCE_TRANSFER_SIGNATURE) { + const decoded = ethereum.decode( + BALANCE_TRANSFER_DATA_TYPE, + thisLog.data + ); + if (!decoded) return; + + const logData = decoded.toTuple(); + balanceTransferValue = logData[INT_ZERO].toBigInt(); + balanceTransferIndex = logData[INT_ONE].toBigInt(); + } + } + } + const balanceTransferAmount = balanceTransferValue.times( + balanceTransferIndex.div(BIGINT_ONE_RAY) + ); + + _handleLiquidate( + event, + event.params.liquidatedCollateralAmount, + event.params.collateralAsset, + protocolData, + event.params.liquidator, + event.params.user, + event.params.debtAsset, + event.params.debtToCover, + balanceTransferAmount + ); +} + +export function handleFlashloan(event: FlashLoan): void { + const flashloanPremium = getOrCreateFlashloanPremium(protocolData); + + _handleFlashLoan( + event.params.asset, + event.params.amount, + event.params.initiator, + protocolData, + event, + event.params.premium, + flashloanPremium + ); +} + +export function handleMintedToTreasury(event: MintedToTreasury): void { + _handleMintedToTreasury( + event, + protocolData, + event.params.reserve, + event.params.amountMinted + ); +} + +///////////////////////// +//// Transfer Events //// +///////////////////////// + +export function handleCollateralTransfer(event: CollateralTransfer): void { + // determine the transfer amount because different versions of the AToken contract + // pass discounted and undiscounted amount to Transfer() and BalanceTransfer() event + // here we get the higher of the two amount and use it as the transfer amount + // e.g. https://arbiscan.io/tx/0x7ee837a19f37f0f74acb75be2eb07de85adcf1fcca1b66e8d2118958ce4fe8a1#eventlog + // logIndex 18 and 21 + let amount = event.params.value; + const receipt = event.receipt; + if (!receipt) { + log.warning("[handleBorrow]No receipt for tx {}", [ + event.transaction.hash.toHexString(), + ]); + } else { + const btAmount = getBalanceTransferAmount(event); + amount = btAmount.gt(amount) ? btAmount : amount; + } + + _handleTransfer( + event, + protocolData, + PositionSide.COLLATERAL, + event.params.to, + event.params.from, + amount + ); +} + +export function handleVariableTransfer(event: VariableTransfer): void { + _handleTransfer( + event, + protocolData, + PositionSide.BORROWER, + event.params.to, + event.params.from, + event.params.value + ); +} + +export function handleStableTransfer(event: StableTransfer): void { + _handleTransfer( + event, + protocolData, + PositionSide.BORROWER, + event.params.to, + event.params.from, + event.params.value + ); +} + +export function handleSwapBorrowRateMode(event: SwapBorrowRateMode): void { + const interestRateMode = event.params.interestRateMode; + if ( + ![InterestRateMode.STABLE, InterestRateMode.VARIABLE].includes( + event.params.interestRateMode + ) + ) { + log.error( + "[handleSwapBorrowRateMode]interestRateMode {} is not one of [{}, {}]", + [ + interestRateMode.toString(), + InterestRateMode.STABLE.toString(), + InterestRateMode.VARIABLE.toString(), + ] + ); + return; + return; + } + const interestRateType = + event.params.interestRateMode === InterestRateMode.STABLE + ? InterestRateType.STABLE + : InterestRateType.VARIABLE; + const market = getMarketFromToken(event.params.reserve, protocolData); + if (!market) { + log.error("[handleLiquidationCall]Failed to find market for asset {}", [ + event.params.reserve.toHexString(), + ]); + return; + } + const newBorrowBalances = getBorrowBalances(market, event.params.user); + _handleSwapBorrowRateMode( + event, + market, + event.params.user, + newBorrowBalances, + interestRateType, + protocolData + ); +} + +export function handleSiloedBorrowingChanged( + event: SiloedBorrowingChanged +): void { + const market = getMarketFromToken(event.params.asset, protocolData); + if (!market) { + log.error("[handleSiloedBorrowingChanged]market not found for token {}", [ + event.params.asset.toHexString(), + ]); + return; + } + market._siloedBorrowing = event.params.newState; + market.save(); +} + +export function handleUserEModeSet(event: UserEModeSet): void { + const account = new AccountManager(event.params.user).getAccount(); + account._eMode = true; + account.save(); +} + +/////////////////// +///// Helpers ///// +/////////////////// + +function getAssetPriceInUSDC( + tokenAddress: Address, + priceOracle: Address +): BigDecimal { + const oracle = AaveOracle.bind(priceOracle); + const baseUnit = readValue( + oracle.try_BASE_CURRENCY_UNIT(), + BigInt.fromI32(INT_TEN).pow(AAVE_DECIMALS as u8) + ).toBigDecimal(); + + const oracleResult = readValue( + oracle.try_getAssetPrice(tokenAddress), + BIGINT_ZERO + ); + + if (oracleResult.gt(BIGINT_ZERO)) { + return oracleResult.toBigDecimal().div(baseUnit); + } + + // fall price oracle unimplemented + + return BIGDECIMAL_ZERO; +} + +function storeLiquidationProtocolFee( + market: Market, + poolAddress: Address, + reserve: Address +): void { + // Store LiquidationProtocolFee if not set, as setLiquidationProtocolFee() may be never called + // and no LiquidationProtocolFeeChanged event is emitted + // see https://github.com/aave/aave-v3-core/blob/1e46f1cbb7ace08995cb4c8fa4e4ece96a243be3/contracts/protocol/libraries/configuration/ReserveConfiguration.sol#L491 + // for how to decode configuration data to get _liquidationProtocolFee + const liquidationProtocolFeeMask = + "0xFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; + const liquidationProtocolFeeStartBitPosition = INT_152 as u8; + const pool = LendingPoolContract.bind(poolAddress); + const poolConfigData = pool.getConfiguration(reserve).data; + const liquidationProtocolFee = decodeConfig( + poolConfigData, + liquidationProtocolFeeMask, + liquidationProtocolFeeStartBitPosition + ) + .toBigDecimal() + .div(exponentToBigDecimal(INT_FOUR)); + + log.info("[storeLiquidationProtocolFee]market {} liquidationProtocolFee={}", [ + market.id.toHexString(), + liquidationProtocolFee.toString(), + ]); + market._liquidationProtocolFee = liquidationProtocolFee; + market.save(); +} + +function decodeConfig( + storedData: BigInt, + maskStr: string, + startBitPosition: u8 +): BigInt { + // aave-v3 stores configuration in packed bits (ReserveConfiguration.sol) + // decoding them by applying a bit_not mask and right shift by startBitPosition + // see https://github.com/aave/aave-v3-core/blob/1e46f1cbb7ace08995cb4c8fa4e4ece96a243be3/contracts/protocol/libraries/configuration/ReserveConfiguration.sol#L491 + // for how to decode configuration data to get _liquidationProtocolFee + + const maskArray = new Uint8Array(INT_THIRTY_TWO); + maskArray.set(Bytes.fromHexString(maskStr)); + // BITWISE NOT + for (let i = 0; i < maskArray.length; i++) { + maskArray[i] = ~maskArray[i]; + } + // reverse for little endian + const configMaskBigInt = BigInt.fromUnsignedBytes( + Bytes.fromUint8Array(maskArray.reverse()) + ); + + const config = storedData + .bitAnd(configMaskBigInt) + .rightShift(startBitPosition); + + return config; +} + +function getIsIsolatedFlag(event: ethereum.Event): boolean { + let isIsolated = false; + const ISOLATE_MODE = "IsolationModeTotalDebtUpdated(address,uint256)"; + const eventSignature = crypto.keccak256(ByteArray.fromUTF8(ISOLATE_MODE)); + const logs = event.receipt!.logs; + //IsolationModeTotalDebtUpdated emitted before Borrow's event.logIndex + // e.g. https://etherscan.io/tx/0x4b038b26555d4b6c057cd612057b39e6482a7c60eb44058ee61d299332efdf29#eventlog + const eventLogIndex = event.logIndex; + for (let i = 0; i < logs.length; i++) { + const thisLog = logs[i]; + if (thisLog.topics.length > INT_ZERO) { + if (thisLog.logIndex.gt(eventLogIndex)) { + // no IsolationModeTotalDebtUpdated log before Borrow + break; + } + // topics[0] - signature + const logSignature = thisLog.topics[0]; + if (thisLog.address == event.address && logSignature == eventSignature) { + log.info( + "[getIsIsolatedFlag]found IsolationModeTotalDebtUpdated event isolated=true tx {}", + [event.transaction.hash.toHexString()] + ); + isIsolated = true; + break; + } + } + } + return isIsolated; +} + +function getBalanceTransferAmount(event: ethereum.Event): BigInt { + let btAmount = BIGINT_ZERO; + const BALANCE_TRANSFER = + "BalanceTransfer(address, address, uint256, uint256)"; + const eventSignature = crypto.keccak256(ByteArray.fromUTF8(BALANCE_TRANSFER)); + const logs = event.receipt!.logs; + // BalanceTransfer emitted after Transfer's event.logIndex + // e.g. https://arbiscan.io/tx/0x7ee837a19f37f0f74acb75be2eb07de85adcf1fcca1b66e8d2118958ce4fe8a1#eventlog + const eventLogIndex = event.logIndex; + for (let i = 0; i < logs.length; i++) { + const thisLog = logs[i]; + if (thisLog.topics.length > INT_ZERO) { + if (thisLog.logIndex.le(eventLogIndex)) { + // skip event with logIndex < event.logIndex + continue; + } + // topics[0] - signature + const logSignature = thisLog.topics[0]; + if (thisLog.address == event.address && logSignature == eventSignature) { + const UINT256_UINT256 = "(uint256,uint256)"; + const decoded = ethereum.decode(UINT256_UINT256, thisLog.data); + if (!decoded) continue; + + const logData = decoded.toTuple(); + btAmount = logData[0].toBigInt(); + log.info( + "[handleCollateralTransfer] BalanceTransfer amount= {} tx {}", + [btAmount.toString(), event.transaction.hash.toHexString()] + ); + break; + } + } + } + return btAmount; +} diff --git a/subgraphs/aave-forks/protocols/seismic/README.md b/subgraphs/aave-forks/protocols/seismic/README.md new file mode 100644 index 0000000000..d4ffa3c818 --- /dev/null +++ b/subgraphs/aave-forks/protocols/seismic/README.md @@ -0,0 +1,10 @@ +#### Note + +Contracts for: + +- [AaveOracle](https://blastscan.io/address/0xB67549C3339CAAD84b923b6953eaea4918d93426#code) +- [AToken](https://blastscan.io/address/0x4C933dF7D4916ad7a7924119cbb812b694f024da#code) +- [StableDebtToken](https://blastscan.io/address/0x226033e18e87852C5C8721C6a62D7cEdD55D810d#code) +- [VariableDebtToken](https://blastscan.io/address/0xe7A8225eB6F923482972fFC53851D3aC053c7e98#code) + +are not verified on blastscan, hence using Aave-V2's abis for them instead. diff --git a/subgraphs/aave-forks/protocols/seismic/config/deployments/seismic-blast/configurations.json b/subgraphs/aave-forks/protocols/seismic/config/deployments/seismic-blast/configurations.json new file mode 100644 index 0000000000..102dd35e40 --- /dev/null +++ b/subgraphs/aave-forks/protocols/seismic/config/deployments/seismic-blast/configurations.json @@ -0,0 +1,18 @@ +{ + "network": "blast-mainnet", + "factory": { + "startBlock": "2586743", + "address": "0x98eCDB245dC5cc0D8F4A6E8a42C953e0DE5cb133" + }, + "lendingPoolConfigurator": { + "startBlock": "2586786", + "address": "0x2270735CB61D1dF462dbd4c49EC5BD5482e82312" + }, + "lendingPool": { + "startBlock": "2586778", + "address": "0x83d55e27b8033b6D5874CBb3c9252c4Bfdb2bC75" + }, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": "" +} diff --git a/subgraphs/aave-forks/protocols/seismic/config/templates/seismic.template.yaml b/subgraphs/aave-forks/protocols/seismic/config/templates/seismic.template.yaml new file mode 100644 index 0000000000..2bf7f97981 --- /dev/null +++ b/subgraphs/aave-forks/protocols/seismic/config/templates/seismic.template.yaml @@ -0,0 +1,200 @@ +specVersion: 1.0.0 +schema: + file: ./schema.graphql +indexerHints: + prune: auto +{{#graftEnabled}} +description: ... +features: + - grafting +graft: + base: {{subgraphId}} # Subgraph ID of base subgraph + block: {{graftStartBlock}} # Block number +{{/graftEnabled}} +dataSources: + - kind: ethereum/contract + name: LendingPoolAddressesProvider + network: {{ network }} + source: + address: "{{ factory.address }}" + abi: LendingPoolAddressesProvider + startBlock: {{ factory.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - LendingProtocol + abis: + - name: LendingPoolAddressesProvider + file: ./abis/seismic/LendingPoolAddressesProvider.json + eventHandlers: + - event: PriceOracleUpdated(indexed address) + handler: handlePriceOracleUpdated + file: ./protocols/seismic/src/mapping.ts + - kind: ethereum/contract + name: LendingPoolConfigurator + network: {{ network }} + source: + address: "{{ lendingPoolConfigurator.address }}" + abi: LendingPoolConfigurator + startBlock: {{ lendingPoolConfigurator.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Market + abis: + - name: AToken + file: ./abis/aave-v2/AToken.json + - name: LendingPoolConfigurator + file: ./abis/seismic/LendingPoolConfigurator.json + - name: LendingPool + file: ./abis/seismic/LendingPool.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + eventHandlers: + - event: ReserveInitialized(indexed address,indexed address,address,address,address) + handler: handleReserveInitialized + - event: CollateralConfigurationChanged(indexed address,uint256,uint256,uint256) + handler: handleCollateralConfigurationChanged + - event: BorrowingEnabledOnReserve(indexed address,bool) + handler: handleBorrowingEnabledOnReserve + - event: BorrowingDisabledOnReserve(indexed address) + handler: handleBorrowingDisabledOnReserve + - event: ReserveActivated(indexed address) + handler: handleReserveActivated + - event: ReserveDeactivated(indexed address) + handler: handleReserveDeactivated + - event: ReserveFactorChanged(indexed address,uint256) + handler: handleReserveFactorChanged + file: ./protocols/seismic/src/mapping.ts + - kind: ethereum/contract + name: LendingPool + network: {{ network }} + source: + address: "{{ lendingPool.address }}" + abi: LendingPool + startBlock: {{ lendingPool.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Market + - Deposit + - Withdraw + - Repay + - Borrow + - Liquidate + abis: + - name: AaveIncentivesController + file: ./abis/aave-v2/AaveIncentivesController.json + - name: StakedAave + file: ./abis/aave-v2/StakedAave.json + - name: AToken + file: ./abis/aave-v2/AToken.json + - name: VariableDebtToken + file: ./abis/VariableDebtToken.json + - name: StableDebtToken + file: ./abis/StableDebtToken.json + - name: LendingPool + file: ./abis/seismic/LendingPool.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + - name: IPriceOracleGetter + file: ./abis/IPriceOracleGetter.json + eventHandlers: + - event: Deposit(indexed address,address,indexed address,uint256,indexed uint16) + handler: handleDeposit + - event: Withdraw(indexed address,indexed address,indexed address,uint256) + handler: handleWithdraw + - event: Borrow(indexed address,address,indexed address,uint256,uint256,uint256,indexed uint16) + handler: handleBorrow + - event: Repay(indexed address,indexed address,indexed address,uint256) + handler: handleRepay + receipt: true + - event: Swap(indexed address,indexed address,uint256) + handler: handleSwapBorrowRateMode + - event: LiquidationCall(indexed address,indexed address,indexed address,uint256,uint256,address,bool) + handler: handleLiquidationCall + - event: ReserveDataUpdated(indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleReserveDataUpdated + - event: ReserveUsedAsCollateralEnabled(indexed address,indexed address) + handler: handleReserveUsedAsCollateralEnabled + - event: ReserveUsedAsCollateralDisabled(indexed address,indexed address) + handler: handleReserveUsedAsCollateralDisabled + - event: Paused() + handler: handlePaused + - event: Unpaused() + handler: handleUnpaused + - event: FlashLoan(indexed address,indexed address,indexed address,uint256,uint256,uint16) + handler: handleFlashloan + file: ./protocols/seismic/src/mapping.ts +templates: + - kind: ethereum + name: AToken + network: {{ network }} + source: + abi: AToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: AToken + file: ./abis/aave-v2/AToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: BalanceTransfer(indexed address,indexed address,uint256,uint256) + handler: handleCollateralTransfer + file: ./protocols/seismic/src/mapping.ts + - kind: ethereum + name: StableDebtToken + network: {{ network }} + source: + abi: StableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: StableDebtToken + file: ./abis/StableDebtToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleStableTransfer + file: ./protocols/seismic/src/mapping.ts + - kind: ethereum + name: VariableDebtToken + network: {{ network }} + source: + abi: VariableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: VariableDebtToken + file: ./abis/VariableDebtToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleVariableTransfer + file: ./protocols/seismic/src/mapping.ts diff --git a/subgraphs/aave-forks/protocols/seismic/src/constants.ts b/subgraphs/aave-forks/protocols/seismic/src/constants.ts new file mode 100644 index 0000000000..ca39a2a0ef --- /dev/null +++ b/subgraphs/aave-forks/protocols/seismic/src/constants.ts @@ -0,0 +1,55 @@ +import { Address, BigDecimal, dataSource, log } from "@graphprotocol/graph-ts"; +import { Network, ZERO_ADDRESS } from "../../../src/constants"; + +////////////////////////////// +///// Ethereum Addresses ///// +////////////////////////////// + +export const USDC_TOKEN_ADDRESS = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"; // ETH +export const USDC_POS_TOKEN_ADDRESS = + "0x2791bca1f2de4661ed88a30c99a7a9449aa84174"; // Polygon + +///////////////////////////// +///// Protocol Specific ///// +///////////////////////////// + +export namespace Protocol { + export const PROTOCOL = "Seismic Protocol"; + export const NAME = "Seismic Protocol"; + export const SLUG = "seismic"; +} +export const AAVE_DECIMALS = 8; + +// This is hardcoded and can not be changed, so it is set as a constant here +// https://etherscan.io/address/0x05bfa9157e92690b179033ca2f6dd1e86b25ea4d#code#F96#L89 +export const FLASHLOAN_PREMIUM_TOTAL = BigDecimal.fromString("0.0009"); // = 9/10000 + +//////////////////////////// +///// Network Specific ///// +//////////////////////////// + +export class NetworkSpecificConstant { + constructor( + public readonly protocolAddress: Address, // aka, LendingPoolAddressesProvider + public readonly network: string + ) {} +} + +export function getNetworkSpecificConstant(): NetworkSpecificConstant { + const network = dataSource.network(); + if (equalsIgnoreCase(network, Network.BLAST_MAINNET)) { + return new NetworkSpecificConstant( + Address.fromString("0xeeca436a6d4aff6f0d55d71e9b1c271abf511cd0"), + Network.BLAST_MAINNET + ); + } else { + log.critical("[getNetworkSpecificConstant] Unsupported network: {}", [ + network, + ]); + return new NetworkSpecificConstant(Address.fromString(ZERO_ADDRESS), ""); + } +} + +export function equalsIgnoreCase(a: string, b: string): boolean { + return a.replace("-", "_").toLowerCase() == b.replace("-", "_").toLowerCase(); +} diff --git a/subgraphs/aave-forks/protocols/seismic/src/mapping.ts b/subgraphs/aave-forks/protocols/seismic/src/mapping.ts new file mode 100644 index 0000000000..6abaead03b --- /dev/null +++ b/subgraphs/aave-forks/protocols/seismic/src/mapping.ts @@ -0,0 +1,616 @@ +import { + Address, + BigDecimal, + BigInt, + dataSource, + ethereum, + log, +} from "@graphprotocol/graph-ts"; +import { PriceOracleUpdated } from "../../../generated/LendingPoolAddressesProvider/LendingPoolAddressesProvider"; +import { + AAVE_DECIMALS, + FLASHLOAN_PREMIUM_TOTAL, + getNetworkSpecificConstant, + Protocol, + USDC_POS_TOKEN_ADDRESS, + USDC_TOKEN_ADDRESS, +} from "./constants"; +import { + BorrowingDisabledOnReserve, + BorrowingEnabledOnReserve, + CollateralConfigurationChanged, + ReserveActivated, + ReserveDeactivated, + ReserveFactorChanged, + ReserveInitialized, +} from "../../../generated/LendingPoolConfigurator/LendingPoolConfigurator"; +import { + Borrow, + Deposit, + FlashLoan, + LiquidationCall, + Paused, + Repay, + ReserveDataUpdated, + ReserveUsedAsCollateralDisabled, + ReserveUsedAsCollateralEnabled, + Unpaused, + Withdraw, + Swap, +} from "../../../generated/LendingPool/LendingPool"; +import { AToken } from "../../../generated/LendingPool/AToken"; +import { + _handleBorrow, + _handleBorrowingDisabledOnReserve, + _handleBorrowingEnabledOnReserve, + _handleCollateralConfigurationChanged, + _handleDeposit, + _handleFlashLoan, + _handleLiquidate, + _handlePaused, + _handlePriceOracleUpdated, + _handleRepay, + _handleReserveActivated, + _handleReserveDataUpdated, + _handleReserveDeactivated, + _handleReserveFactorChanged, + _handleReserveInitialized, + _handleReserveUsedAsCollateralDisabled, + _handleReserveUsedAsCollateralEnabled, + _handleSwapBorrowRateMode, + _handleTransfer, + _handleUnpaused, + _handleWithdraw, +} from "../../../src/mapping"; +import { + BIGDECIMAL_ZERO, + BIGINT_ZERO, + InterestRateMode, + Network, + SECONDS_PER_DAY, +} from "../../../src/constants"; +import { Token, _DefaultOracle } from "../../../generated/schema"; +import { AaveIncentivesController } from "../../../generated/LendingPool/AaveIncentivesController"; +import { StakedAave } from "../../../generated/LendingPool/StakedAave"; +import { IPriceOracleGetter } from "../../../generated/LendingPool/IPriceOracleGetter"; +import { BalanceTransfer as CollateralTransfer } from "../../../generated/templates/AToken/AToken"; +import { Transfer as StableTransfer } from "../../../generated/templates/StableDebtToken/StableDebtToken"; +import { Transfer as VariableTransfer } from "../../../generated/templates/VariableDebtToken/VariableDebtToken"; +import { + DataManager, + ProtocolData, + RewardData, +} from "../../../src/sdk/manager"; +import { + equalsIgnoreCase, + exponentToBigDecimal, + getBorrowBalances, + getMarketFromToken, + getOrCreateFlashloanPremium, + readValue, +} from "../../../src/helpers"; +import { + CollateralizationType, + InterestRateType, + LendingType, + PermissionType, + PositionSide, + RewardTokenType, + RiskType, +} from "../../../src/sdk/constants"; +import { TokenManager } from "../../../src/sdk/token"; + +function getProtocolData(): ProtocolData { + const constants = getNetworkSpecificConstant(); + return new ProtocolData( + constants.protocolAddress, + Protocol.PROTOCOL, + Protocol.NAME, + Protocol.SLUG, + constants.network, + LendingType.POOLED, + PermissionType.PERMISSIONLESS, + PermissionType.PERMISSIONLESS, + PermissionType.ADMIN, + CollateralizationType.OVER_COLLATERALIZED, + RiskType.GLOBAL + ); +} + +const protocolData = getProtocolData(); + +/////////////////////////////////////////////// +///// LendingPoolAddressProvider Handlers ///// +/////////////////////////////////////////////// + +export function handlePriceOracleUpdated(event: PriceOracleUpdated): void { + _handlePriceOracleUpdated(event.params.newAddress, protocolData, event); +} + +////////////////////////////////////// +///// Lending Pool Configuration ///// +////////////////////////////////////// + +export function handleReserveInitialized(event: ReserveInitialized): void { + // This function handles market entity from reserve creation event + // Attempt to load or create the market implementation + + _handleReserveInitialized( + event, + event.params.asset, + event.params.aToken, + event.params.variableDebtToken, + protocolData, + event.params.stableDebtToken + ); +} + +export function handleCollateralConfigurationChanged( + event: CollateralConfigurationChanged +): void { + _handleCollateralConfigurationChanged( + event.params.asset, + event.params.liquidationBonus, + event.params.liquidationThreshold, + event.params.ltv, + protocolData + ); +} + +export function handleBorrowingEnabledOnReserve( + event: BorrowingEnabledOnReserve +): void { + _handleBorrowingEnabledOnReserve(event.params.asset, protocolData); +} + +export function handleBorrowingDisabledOnReserve( + event: BorrowingDisabledOnReserve +): void { + _handleBorrowingDisabledOnReserve(event.params.asset, protocolData); +} + +export function handleReserveActivated(event: ReserveActivated): void { + _handleReserveActivated(event.params.asset, protocolData); +} + +export function handleReserveDeactivated(event: ReserveDeactivated): void { + _handleReserveDeactivated(event.params.asset, protocolData); +} + +export function handleReserveFactorChanged(event: ReserveFactorChanged): void { + _handleReserveFactorChanged( + event.params.asset, + event.params.factor, + protocolData + ); +} + +///////////////////////////////// +///// Lending Pool Handlers ///// +///////////////////////////////// + +export function handleReserveDataUpdated(event: ReserveDataUpdated): void { + const market = getMarketFromToken(event.params.reserve, protocolData); + if (!market) { + log.warning("[handleReserveDataUpdated] Market not found for reserve {}", [ + event.params.reserve.toHexString(), + ]); + return; + } + const manager = new DataManager( + market.id, + market.inputToken, + event, + protocolData + ); + + updateRewards(manager, event); + + const assetPriceUSD = getAssetPriceInUSDC( + Address.fromBytes(market.inputToken), + manager.getOracleAddress(), + event.block.number + ); + + _handleReserveDataUpdated( + event, + event.params.liquidityRate, + event.params.liquidityIndex, + event.params.variableBorrowIndex, + event.params.variableBorrowRate, + event.params.stableBorrowRate, + protocolData, + event.params.reserve, + assetPriceUSD + ); +} + +export function handleReserveUsedAsCollateralEnabled( + event: ReserveUsedAsCollateralEnabled +): void { + // This Event handler enables a reserve/market to be used as collateral + _handleReserveUsedAsCollateralEnabled( + event.params.reserve, + event.params.user, + protocolData + ); +} + +export function handleReserveUsedAsCollateralDisabled( + event: ReserveUsedAsCollateralDisabled +): void { + // This Event handler disables a reserve/market being used as collateral + _handleReserveUsedAsCollateralDisabled( + event.params.reserve, + event.params.user, + protocolData + ); +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export function handlePaused(event: Paused): void { + _handlePaused(protocolData); +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export function handleUnpaused(event: Unpaused): void { + _handleUnpaused(protocolData); +} + +export function handleDeposit(event: Deposit): void { + _handleDeposit( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.onBehalfOf + ); +} + +export function handleWithdraw(event: Withdraw): void { + _handleWithdraw( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.user + ); +} + +export function handleBorrow(event: Borrow): void { + _handleBorrow( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.onBehalfOf + ); +} + +export function handleRepay(event: Repay): void { + _handleRepay( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.user + ); +} + +export function handleLiquidationCall(event: LiquidationCall): void { + _handleLiquidate( + event, + event.params.liquidatedCollateralAmount, + event.params.collateralAsset, + protocolData, + event.params.liquidator, + event.params.user, + event.params.debtAsset, + event.params.debtToCover + ); +} + +export function handleFlashloan(event: FlashLoan): void { + const flashloanPremium = getOrCreateFlashloanPremium(protocolData); + flashloanPremium.premiumRateTotal = FLASHLOAN_PREMIUM_TOTAL; + flashloanPremium.save(); + + _handleFlashLoan( + event.params.asset, + event.params.amount, + event.params.initiator, + protocolData, + event, + event.params.premium, + flashloanPremium + ); +} + +export function handleSwapBorrowRateMode(event: Swap): void { + const interestRateMode = event.params.rateMode.toI32(); + if ( + ![InterestRateMode.STABLE, InterestRateMode.VARIABLE].includes( + interestRateMode + ) + ) { + log.error( + "[handleSwapBorrowRateMode]interestRateMode {} is not one of [{}, {}]", + [ + interestRateMode.toString(), + InterestRateMode.STABLE.toString(), + InterestRateMode.VARIABLE.toString(), + ] + ); + return; + } + + const interestRateType = + interestRateMode === InterestRateMode.STABLE + ? InterestRateType.STABLE + : InterestRateType.VARIABLE; + const market = getMarketFromToken(event.params.reserve, protocolData); + if (!market) { + log.error("[handleLiquidationCall]Failed to find market for asset {}", [ + event.params.reserve.toHexString(), + ]); + return; + } + + const newBorrowBalances = getBorrowBalances(market, event.params.user); + _handleSwapBorrowRateMode( + event, + market, + event.params.user, + newBorrowBalances, + interestRateType, + protocolData + ); +} + +///////////////////////// +//// Transfer Events //// +///////////////////////// + +export function handleCollateralTransfer(event: CollateralTransfer): void { + _handleTransfer( + event, + protocolData, + PositionSide.COLLATERAL, + event.params.to, + event.params.from, + event.params.value + ); +} + +export function handleVariableTransfer(event: VariableTransfer): void { + _handleTransfer( + event, + protocolData, + PositionSide.BORROWER, + event.params.to, + event.params.from, + event.params.value + ); +} + +export function handleStableTransfer(event: StableTransfer): void { + _handleTransfer( + event, + protocolData, + PositionSide.BORROWER, + event.params.to, + event.params.from, + event.params.value + ); +} + +/////////////////// +///// Helpers ///// +/////////////////// + +function getAssetPriceInUSDC( + tokenAddress: Address, + priceOracle: Address, + blockNumber: BigInt +): BigDecimal { + const oracle = IPriceOracleGetter.bind(priceOracle); + let oracleResult = readValue( + oracle.try_getAssetPrice(tokenAddress), + BIGINT_ZERO + ); + + // if the result is zero or less, try the fallback oracle + if (!oracleResult.gt(BIGINT_ZERO)) { + const tryFallback = oracle.try_getFallbackOracle(); + if (tryFallback) { + const fallbackOracle = IPriceOracleGetter.bind(tryFallback.value); + oracleResult = readValue( + fallbackOracle.try_getAssetPrice(tokenAddress), + BIGINT_ZERO + ); + } + } + + // Mainnet Oracles return the price in eth, must convert to USD through the following method + if (equalsIgnoreCase(dataSource.network(), Network.MAINNET)) { + const priceUSDCInEth = readValue( + oracle.try_getAssetPrice(Address.fromString(USDC_TOKEN_ADDRESS)), + BIGINT_ZERO + ); + + if (priceUSDCInEth.equals(BIGINT_ZERO)) { + return BIGDECIMAL_ZERO; + } else { + return oracleResult.toBigDecimal().div(priceUSDCInEth.toBigDecimal()); + } + } + + // Polygon Oracle returns price in ETH, must convert to USD with following method + if (equalsIgnoreCase(dataSource.network(), Network.MATIC)) { + // there was misprice at block 15783457 that affects 2 transactions + // we will override the price at this block to $1.55615781978 + // this price is derived using the following method on that block using historical contract calls + // The contract calls return 634291527055835 / 407601027988722 = our new price + const MISPRICE_BLOCK_NUMBER = 15783457; + if (blockNumber.equals(BigInt.fromI32(MISPRICE_BLOCK_NUMBER))) { + return BigDecimal.fromString("1.55615781978"); + } + + const priceUSDCInEth = readValue( + oracle.try_getAssetPrice(Address.fromString(USDC_POS_TOKEN_ADDRESS)), + BIGINT_ZERO + ); + + if (priceUSDCInEth.equals(BIGINT_ZERO)) { + return BIGDECIMAL_ZERO; + } else { + // USD price = token oracle result / USDC POS oracle result + return oracleResult.toBigDecimal().div(priceUSDCInEth.toBigDecimal()); + } + } + + // Avalanche Oracle return the price offset by 8 decimals + if ( + equalsIgnoreCase(dataSource.network(), Network.AVALANCHE) || + equalsIgnoreCase(dataSource.network(), Network.BLAST_MAINNET) + ) { + return oracleResult.toBigDecimal().div(exponentToBigDecimal(AAVE_DECIMALS)); + } + + // last resort, should not be touched + const inputToken = Token.load(tokenAddress); + if (!inputToken) { + log.warning( + "[getAssetPriceInUSDC]token {} not found in Token entity; return BIGDECIMAL_ZERO", + [tokenAddress.toHexString()] + ); + return BIGDECIMAL_ZERO; + } + return oracleResult + .toBigDecimal() + .div(exponentToBigDecimal(inputToken.decimals)); +} + +function updateRewards(manager: DataManager, event: ethereum.Event): void { + // Reward rate (rewards/second) in a market comes from try_assets(to) + // Supply side the to address is the aToken + // Borrow side the to address is the variableDebtToken + const market = manager.getMarket(); + const aTokenContract = AToken.bind(Address.fromBytes(market.outputToken!)); + const tryIncentiveController = aTokenContract.try_getIncentivesController(); + if (tryIncentiveController.reverted) { + log.warning( + "[updateRewards]getIncentivesController() call for aToken {} is reverted", + [market.outputToken!.toHexString()] + ); + return; + } + const incentiveControllerContract = AaveIncentivesController.bind( + tryIncentiveController.value + ); + const tryBorrowRewards = incentiveControllerContract.try_assets( + Address.fromBytes(market._vToken!) + ); + const trySupplyRewards = incentiveControllerContract.try_assets( + Address.fromBytes(market.outputToken!) + ); + const tryRewardAsset = incentiveControllerContract.try_REWARD_TOKEN(); + + if (tryRewardAsset.reverted) { + log.warning( + "[updateRewards]REWARD_TOKEN() call for AaveIncentivesController contract {} is reverted", + [tryIncentiveController.value.toHexString()] + ); + return; + } + // create reward tokens + const tokenManager = new TokenManager(tryRewardAsset.value, event); + const rewardToken = tokenManager.getToken(); + const vBorrowRewardToken = tokenManager.getOrCreateRewardToken( + RewardTokenType.VARIABLE_BORROW + ); + const sBorrowRewardToken = tokenManager.getOrCreateRewardToken( + RewardTokenType.STABLE_BORROW + ); + const depositRewardToken = tokenManager.getOrCreateRewardToken( + RewardTokenType.DEPOSIT + ); + + const rewardDecimals = rewardToken.decimals; + const defaultOracle = _DefaultOracle.load(protocolData.protocolID); + // get reward token price + // get price of reward token (if stkAAVE it is tied to the price of AAVE) + let rewardTokenPriceUSD = BIGDECIMAL_ZERO; + if ( + equalsIgnoreCase(dataSource.network(), Network.MAINNET) && + defaultOracle && + defaultOracle.oracle + ) { + // get staked token if possible to grab price of staked token + const stakedTokenContract = StakedAave.bind(tryRewardAsset.value); + const tryStakedToken = stakedTokenContract.try_STAKED_TOKEN(); + if (!tryStakedToken.reverted) { + rewardTokenPriceUSD = getAssetPriceInUSDC( + tryStakedToken.value, + Address.fromBytes(defaultOracle.oracle), + event.block.number + ); + } + } + + // if reward token price was not found then use old method + if ( + rewardTokenPriceUSD.equals(BIGDECIMAL_ZERO) && + defaultOracle && + defaultOracle.oracle + ) { + rewardTokenPriceUSD = getAssetPriceInUSDC( + tryRewardAsset.value, + Address.fromBytes(defaultOracle.oracle), + event.block.number + ); + } + + // we check borrow first since it will show up first in graphql ordering + // see explanation in docs/Mapping.md#Array Sorting When Querying + if (!tryBorrowRewards.reverted) { + // update borrow rewards + const borrowRewardsPerDay = tryBorrowRewards.value.value0.times( + BigInt.fromI32(SECONDS_PER_DAY) + ); + const borrowRewardsPerDayUSD = borrowRewardsPerDay + .toBigDecimal() + .div(exponentToBigDecimal(rewardDecimals)) + .times(rewardTokenPriceUSD); + + const vBorrowRewardData = new RewardData( + vBorrowRewardToken, + borrowRewardsPerDay, + borrowRewardsPerDayUSD + ); + const sBorrowRewardData = new RewardData( + sBorrowRewardToken, + borrowRewardsPerDay, + borrowRewardsPerDayUSD + ); + manager.updateRewards(vBorrowRewardData); + manager.updateRewards(sBorrowRewardData); + } + + if (!trySupplyRewards.reverted) { + // update deposit rewards + const supplyRewardsPerDay = trySupplyRewards.value.value0.times( + BigInt.fromI32(SECONDS_PER_DAY) + ); + const supplyRewardsPerDayUSD = supplyRewardsPerDay + .toBigDecimal() + .div(exponentToBigDecimal(rewardDecimals)) + .times(rewardTokenPriceUSD); + const depositRewardData = new RewardData( + depositRewardToken, + supplyRewardsPerDay, + supplyRewardsPerDayUSD + ); + manager.updateRewards(depositRewardData); + } +} diff --git a/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-blast/configurations.json b/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-blast/configurations.json new file mode 100644 index 0000000000..2da86d185d --- /dev/null +++ b/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-blast/configurations.json @@ -0,0 +1,22 @@ +{ + "network": "blast-mainnet", + "factory": { + "startBlock": "191999", + "address": "0xb0811a1fc9fb9972ee683ba04c32cb828bcf587b" + }, + "lendingPoolConfigurator": { + "startBlock": "192056", + "address": "0x22d3cdb2fbd1528a0ebb047ec4de369098efcda1" + }, + "lendingPool": { + "startBlock": "192053", + "address": "0xa70b0f3c2470abbe104bdb3f3aaa9c7c54bea7a8" + }, + "RewardsController": { + "startBlock": "192076", + "address": "0x94dc19a5bd17e84d90e63ff3fba9c3b76e5e4012" + }, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": "" +} diff --git a/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-ethereum/configurations.json b/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-ethereum/configurations.json new file mode 100644 index 0000000000..0adbbb0ae8 --- /dev/null +++ b/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-ethereum/configurations.json @@ -0,0 +1,22 @@ +{ + "network": "mainnet", + "factory": { + "startBlock": "19356906", + "address": "0xfd856e1a33225b86f70d686f9280435e3ff75fcf" + }, + "lendingPoolConfigurator": { + "startBlock": "19356923", + "address": "0x09edc8f101897aa693932c1966725e05d6d68b5f" + }, + "lendingPool": { + "startBlock": "19356922", + "address": "0x3bc3d34c32cc98bf098d832364df8a222bbab4c0" + }, + "RewardsController": { + "startBlock": "19356929", + "address": "0x5be89bb10e2234204a2607765714916ed95a73a2" + }, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": "" +} diff --git a/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-linea/configurations.json b/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-linea/configurations.json new file mode 100644 index 0000000000..d9ba4b0989 --- /dev/null +++ b/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-linea/configurations.json @@ -0,0 +1,22 @@ +{ + "network": "linea", + "factory": { + "startBlock": "2786927", + "address": "0xc44827c51d00381ed4c52646aeab45b455d200eb" + }, + "lendingPoolConfigurator": { + "startBlock": "2786950", + "address": "0xf17218b09699d0f7145e40e771e72130ff616498" + }, + "lendingPool": { + "startBlock": "2786948", + "address": "0x2f9bb73a8e98793e26cb2f6c4ad037bdf1c6b269" + }, + "RewardsController": { + "startBlock": "2786958", + "address": "0x28f6899ff643261ca9766ddc251b359a2d00b945" + }, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": "" +} diff --git a/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-xlayer/configurations.json b/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-xlayer/configurations.json new file mode 100644 index 0000000000..eb049a54f1 --- /dev/null +++ b/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-xlayer/configurations.json @@ -0,0 +1,22 @@ +{ + "network": "xlayer-mainnet", + "factory": { + "startBlock": "721077", + "address": "0x2f7e54ff5d45f77bFfa11f2aee67bD7621Eb8a93" + }, + "lendingPoolConfigurator": { + "startBlock": "721127", + "address": "0x92eb7A4000Bd4A9045aa8a9d633718f8058FC2a7" + }, + "lendingPool": { + "startBlock": "721124", + "address": "0xfFd79D05D5dc37E221ed7d3971E75ed5930c6580" + }, + "RewardsController": { + "startBlock": "721139", + "address": "0x6d0BCD00b3ecd8Cd15729beDBC88Be60F4a75543" + }, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": "" +} diff --git a/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-zksync-era/configurations.json b/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-zksync-era/configurations.json new file mode 100644 index 0000000000..ff5c986b1e --- /dev/null +++ b/subgraphs/aave-forks/protocols/zerolend/config/deployments/zerolend-zksync-era/configurations.json @@ -0,0 +1,22 @@ +{ + "network": "zksync-era", + "factory": { + "startBlock": "8776200", + "address": "0x4f285ea117ef0067b59853d6d16a5de8088ba259" + }, + "lendingPoolConfigurator": { + "startBlock": "8776623", + "address": "0x9c3058f7bfca6139ac3013999f57d7aa6a3ab1ed" + }, + "lendingPool": { + "startBlock": "8776619", + "address": "0x4d9429246ea989c9cee203b43f6d1c7d83e3b8f8" + }, + "RewardsController": { + "startBlock": "8776729", + "address": "0x54ab34ab3c723bd2674c7082aa6ffcdfd3a5bedc" + }, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": "" +} diff --git a/subgraphs/aave-forks/protocols/zerolend/config/templates/zerolend.template.yaml b/subgraphs/aave-forks/protocols/zerolend/config/templates/zerolend.template.yaml new file mode 100644 index 0000000000..418b6af5ae --- /dev/null +++ b/subgraphs/aave-forks/protocols/zerolend/config/templates/zerolend.template.yaml @@ -0,0 +1,237 @@ +specVersion: 1.0.0 +schema: + file: ./schema.graphql +indexerHints: + prune: auto +{{#graftEnabled}} +description: ... +features: + - grafting +graft: + base: {{subgraphId}} # Subgraph ID of base subgraph + block: {{graftStartBlock}} # Block number +{{/graftEnabled}} +dataSources: + - kind: ethereum/contract + name: LendingPoolAddressesProvider + network: {{ network }} + source: + address: "{{ factory.address }}" + abi: LendingPoolAddressesProvider + startBlock: {{ factory.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - LendingProtocol + abis: + - name: LendingPoolAddressesProvider + file: ./abis/zerolend/LendingPoolAddressesProvider.json + eventHandlers: + - event: PriceOracleUpdated(indexed address,indexed address) + handler: handlePriceOracleUpdated + file: ./protocols/zerolend/src/mapping.ts + - kind: ethereum/contract + name: LendingPoolConfigurator + network: {{ network }} + source: + address: "{{ lendingPoolConfigurator.address }}" + abi: LendingPoolConfigurator + startBlock: {{ lendingPoolConfigurator.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Market + abis: + - name: LendingPoolConfigurator + file: ./abis/zerolend/LendingPoolConfigurator.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + - name: AToken + file: ./abis/zerolend/AToken.json + eventHandlers: + - event: CollateralConfigurationChanged(indexed address,uint256,uint256,uint256) + handler: handleCollateralConfigurationChanged + - event: ReserveActive(indexed address,bool) + handler: handleReserveActive + - event: ReserveBorrowing(indexed address,bool) + handler: handleReserveBorrowing + - event: ReserveFrozen(indexed address,bool) + handler: handleReserveFrozen + - event: ReserveInitialized(indexed address,indexed address,address,address,address) + handler: handleReserveInitialized + - event: ReservePaused(indexed address,bool) + handler: handleReservePaused + - event: ReserveFactorChanged(indexed address,uint256,uint256) + handler: handleReserveFactorChanged + - event: LiquidationProtocolFeeChanged(indexed address,uint256,uint256) + handler: handleLiquidationProtocolFeeChanged + - event: FlashloanPremiumTotalUpdated(uint128,uint128) + handler: handleFlashloanPremiumTotalUpdated + - event: FlashloanPremiumToProtocolUpdated(uint128,uint128) + handler: handleFlashloanPremiumToProtocolUpdated + - event: SiloedBorrowingChanged(indexed address,bool,bool) + handler: handleSiloedBorrowingChanged + file: ./protocols/zerolend/src/mapping.ts + - kind: ethereum/contract + name: LendingPool + network: {{ network }} + source: + address: "{{ lendingPool.address }}" + abi: LendingPool + startBlock: {{ lendingPool.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Market + - Deposit + - Withdraw + - Repay + - Borrow + - Liquidate + abis: + - name: LendingPool + file: ./abis/zerolend/LendingPool.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + - name: AaveOracle + file: ./abis/zerolend/AaveOracle.json + - name: IPriceOracleGetter + file: ./abis/IPriceOracleGetter.json + - name: AToken + file: ./abis/zerolend/AToken.json + - name: StableDebtToken + file: ./abis/zerolend/StableDebtToken.json + - name: VariableDebtToken + file: ./abis/zerolend/VariableDebtToken.json + eventHandlers: + - event: Borrow(indexed address,address,indexed address,uint256,uint8,uint256,indexed uint16) + handler: handleBorrow + receipt: true + - event: LiquidationCall(indexed address,indexed address,indexed address,uint256,uint256,address,bool) + handler: handleLiquidationCall + receipt: true + - event: Repay(indexed address,indexed address,indexed address,uint256,bool) + handler: handleRepay + receipt: true + - event: SwapBorrowRateMode(indexed address,indexed address,uint8) + handler: handleSwapBorrowRateMode + - event: ReserveDataUpdated(indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleReserveDataUpdated + - event: Supply(indexed address,address,indexed address,uint256,indexed uint16) + handler: handleDeposit + - event: Withdraw(indexed address,indexed address,indexed address,uint256) + handler: handleWithdraw + - event: ReserveUsedAsCollateralEnabled(indexed address,indexed address) + handler: handleReserveUsedAsCollateralEnabled + - event: ReserveUsedAsCollateralDisabled(indexed address,indexed address) + handler: handleReserveUsedAsCollateralDisabled + - event: FlashLoan(indexed address,address,indexed address,uint256,uint8,uint256,indexed uint16) + handler: handleFlashloan + - event: UserEModeSet(indexed address,uint8) + handler: handleUserEModeSet + - event: MintedToTreasury(indexed address,uint256) + handler: handleMintedToTreasury + file: ./protocols/zerolend/src/mapping.ts + - kind: ethereum + name: RewardsController + network: {{ network }} + source: + address: "{{ RewardsController.address }}" + abi: RewardsController + startBlock: {{ RewardsController.startBlock }} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - RewardsController + abis: + - name: RewardsController + file: ./abis/zerolend/RewardsController.json + - name: ERC20 + file: ./abis/ERC20.json + - name: ERC20NameBytes + file: ./abis/ERC20NameBytes.json + - name: ERC20SymbolBytes + file: ./abis/ERC20SymbolBytes.json + - name: AaveOracle + file: ./abis/zerolend/AaveOracle.json + - name: IPriceOracleGetter + file: ./abis/IPriceOracleGetter.json + eventHandlers: + - event: AssetConfigUpdated(indexed address,indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleAssetConfigUpdated + file: ./protocols/zerolend/src/mapping.ts +templates: + - kind: ethereum + name: AToken + network: {{ network }} + source: + abi: AToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: AToken + file: ./abis/zerolend/AToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleCollateralTransfer + receipt: true + file: ./protocols/zerolend/src/mapping.ts + - kind: ethereum + name: StableDebtToken + network: {{ network }} + source: + abi: StableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: StableDebtToken + file: ./abis/zerolend/StableDebtToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleStableTransfer + file: ./protocols/zerolend/src/mapping.ts + - kind: ethereum + name: VariableDebtToken + network: {{ network }} + source: + abi: VariableDebtToken + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: [] + abis: + - name: VariableDebtToken + file: ./abis/zerolend/VariableDebtToken.json + - name: ERC20 + file: ./abis/ERC20.json + eventHandlers: + - event: Transfer(indexed address,indexed address,uint256) + handler: handleVariableTransfer + file: ./protocols/zerolend/src/mapping.ts diff --git a/subgraphs/aave-forks/protocols/zerolend/src/constants.ts b/subgraphs/aave-forks/protocols/zerolend/src/constants.ts new file mode 100644 index 0000000000..2d7921fd25 --- /dev/null +++ b/subgraphs/aave-forks/protocols/zerolend/src/constants.ts @@ -0,0 +1,88 @@ +import { + Address, + ByteArray, + crypto, + dataSource, + log, +} from "@graphprotocol/graph-ts"; +import { Network, ZERO_ADDRESS } from "../../../src/constants"; + +///////////////////////////// +///// Protocol Specific ///// +///////////////////////////// + +export namespace Protocol { + export const PROTOCOL = "Zero Lend"; + export const NAME = "Zero Lend"; + export const SLUG = "zerolend"; +} + +export namespace IavsTokenType { + export const ATOKEN = "ATOKEN"; + export const INPUTTOKEN = "INPUTTOKEN"; + export const VTOKEN = "VTOKEN"; + export const STOKEN = "STOKEN"; +} + +export const AAVE_DECIMALS = 8; + +export namespace InterestRateMode { + export const NONE = 0 as i32; + export const STABLE = 1 as i32; + export const VARIABLE = 2 as i32; +} + +//////////////////////////// +///// Network Specific ///// +//////////////////////////// + +export class NetworkSpecificConstant { + constructor( + public readonly protocolAddress: Address, // aka, PoolAddressesProviderRegistry + public readonly network: string + ) {} +} + +export function getNetworkSpecificConstant(): NetworkSpecificConstant { + const network = dataSource.network(); + if (equalsIgnoreCase(network, Network.MAINNET)) { + return new NetworkSpecificConstant( + Address.fromString("0x7503a8823b523629e28587317901ba4c055791eb"), + Network.MAINNET + ); + } else if (equalsIgnoreCase(network, Network.BLAST_MAINNET)) { + return new NetworkSpecificConstant( + Address.fromString("0xbbaef34d75e15c5d04a078fc2634245842eabdc7"), + Network.BLAST_MAINNET + ); + } else if (equalsIgnoreCase(network, Network.ZKSYNC_ERA)) { + return new NetworkSpecificConstant( + Address.fromString("0x78b93fbb35c97b32c7381c81fa3a620b3fb7787b"), + Network.ZKSYNC_ERA + ); + } else if (equalsIgnoreCase(network, Network.LINEA)) { + return new NetworkSpecificConstant( + Address.fromString("0x5046c3c0d7a362709df433d5431d64973c7f08cb"), + Network.LINEA + ); + } else if (equalsIgnoreCase(network, Network.XLAYER_MAINNET)) { + return new NetworkSpecificConstant( + Address.fromString("0xbbaef34d75e15c5d04a078fc2634245842eabdc7"), + Network.XLAYER_MAINNET + ); + } else { + log.critical("[getNetworkSpecificConstant] Unsupported network: {}", [ + network, + ]); + return new NetworkSpecificConstant(Address.fromString(ZERO_ADDRESS), ""); + } +} + +export function equalsIgnoreCase(a: string, b: string): boolean { + return a.replace("-", "_").toLowerCase() == b.replace("-", "_").toLowerCase(); +} + +export const BALANCE_TRANSFER_SIGNATURE = crypto.keccak256( + ByteArray.fromUTF8("BalanceTransfer(address,address,uint256,uint256)") +); +export const BALANCE_TRANSFER_DATA_TYPE = "(uint256,uint256)"; diff --git a/subgraphs/aave-forks/protocols/zerolend/src/mapping.ts b/subgraphs/aave-forks/protocols/zerolend/src/mapping.ts new file mode 100644 index 0000000000..be62545450 --- /dev/null +++ b/subgraphs/aave-forks/protocols/zerolend/src/mapping.ts @@ -0,0 +1,723 @@ +import { + Address, + BigDecimal, + BigInt, + ByteArray, + Bytes, + crypto, + ethereum, + log, +} from "@graphprotocol/graph-ts"; +import { PriceOracleUpdated } from "../../../generated/LendingPoolAddressesProvider/LendingPoolAddressesProvider"; +import { AssetConfigUpdated } from "../../../generated/RewardsController/RewardsController"; +import { Transfer as CollateralTransfer } from "../../../generated/templates/AToken/AToken"; +import { Transfer as StableTransfer } from "../../../generated/templates/StableDebtToken/StableDebtToken"; +import { Transfer as VariableTransfer } from "../../../generated/templates/VariableDebtToken/VariableDebtToken"; +import { AaveOracle } from "../../../generated/RewardsController/AaveOracle"; +import { + CollateralConfigurationChanged, + ReserveFactorChanged, + ReserveActive, + ReserveBorrowing, + ReserveFrozen, + ReserveInitialized, + ReservePaused, + LiquidationProtocolFeeChanged, + FlashloanPremiumTotalUpdated, + FlashloanPremiumToProtocolUpdated, + SiloedBorrowingChanged, +} from "../../../generated/LendingPoolConfigurator/LendingPoolConfigurator"; +import { + Borrow, + FlashLoan, + LendingPool as LendingPoolContract, + LiquidationCall, + Repay, + ReserveDataUpdated, + ReserveUsedAsCollateralDisabled, + ReserveUsedAsCollateralEnabled, + Supply, + SwapBorrowRateMode, + Withdraw, + UserEModeSet, + MintedToTreasury, +} from "../../../generated/LendingPool/LendingPool"; +import { Market, _DefaultOracle } from "../../../generated/schema"; +import { + AAVE_DECIMALS, + getNetworkSpecificConstant, + InterestRateMode, + Protocol, + BALANCE_TRANSFER_DATA_TYPE, + BALANCE_TRANSFER_SIGNATURE, +} from "./constants"; +import { + _handleAssetConfigUpdated, + _handleBorrow, + _handleBorrowingDisabledOnReserve, + _handleBorrowingEnabledOnReserve, + _handleCollateralConfigurationChanged, + _handleDeposit, + _handleFlashLoan, + _handleFlashloanPremiumToProtocolUpdated, + _handleFlashloanPremiumTotalUpdated, + _handleLiquidate, + _handleLiquidationProtocolFeeChanged, + _handleMintedToTreasury, + _handlePriceOracleUpdated, + _handleRepay, + _handleReserveActivated, + _handleReserveDataUpdated, + _handleReserveDeactivated, + _handleReserveFactorChanged, + _handleReserveInitialized, + _handleReserveUsedAsCollateralDisabled, + _handleReserveUsedAsCollateralEnabled, + _handleSwapBorrowRateMode, + _handleTransfer, + _handleWithdraw, +} from "../../../src/mapping"; +import { + BIGDECIMAL_ZERO, + BIGINT_ONE_RAY, + BIGINT_ZERO, + INT_FOUR, + INT_ONE, + INT_ZERO, +} from "../../../src/constants"; + +import { DataManager, ProtocolData } from "../../../src/sdk/manager"; +import { + readValue, + getMarketFromToken, + exponentToBigDecimal, + getOrCreateFlashloanPremium, + getBorrowBalances, +} from "../../../src/helpers"; +import { + LendingType, + CollateralizationType, + PermissionType, + RiskType, + InterestRateType, + PositionSide, + INT_TEN, + INT_152, + INT_THIRTY_TWO, +} from "../../../src/sdk/constants"; +import { AccountManager } from "../../../src/sdk/account"; + +function getProtocolData(): ProtocolData { + const constants = getNetworkSpecificConstant(); + return new ProtocolData( + constants.protocolAddress, + Protocol.PROTOCOL, + Protocol.NAME, + Protocol.SLUG, + constants.network, + LendingType.POOLED, + PermissionType.PERMISSIONLESS, + PermissionType.PERMISSIONLESS, + PermissionType.ADMIN, + CollateralizationType.OVER_COLLATERALIZED, + RiskType.GLOBAL + ); +} + +const protocolData = getProtocolData(); + +//////////////////////////////////////// +///// PoolAddressProvider Handlers ///// +//////////////////////////////////////// + +export function handlePriceOracleUpdated(event: PriceOracleUpdated): void { + _handlePriceOracleUpdated(event.params.newAddress, protocolData, event); +} + +///////////////////////////////////// +///// RewardController Handlers ///// +///////////////////////////////////// + +export function handleAssetConfigUpdated(event: AssetConfigUpdated): void { + // it is not clear which market.oracle shouild we use + // use the protocol-wide defaultOracle + const defaultOracle = _DefaultOracle.load(protocolData.protocolID); + let rewardTokenPriceUSD = BIGDECIMAL_ZERO; + if (!defaultOracle || !defaultOracle.oracle) { + log.warning( + "[handleAssetConfigUpdated]_DefaultOracle for {} not set; rewardTokenPriceUSD set to default 0.0", + [protocolData.protocolID.toHexString()] + ); + } else { + rewardTokenPriceUSD = getAssetPriceInUSDC( + event.params.reward, + Address.fromBytes(defaultOracle.oracle) + ); + } + + _handleAssetConfigUpdated( + event, + event.params.asset, + event.params.reward, + rewardTokenPriceUSD, + event.params.newEmission, + event.params.newDistributionEnd, + protocolData + ); +} + +///////////////////////////////////// +///// PoolConfigurator Handlers ///// +///////////////////////////////////// + +export function handleReserveInitialized(event: ReserveInitialized): void { + // This function handles market entity from reserve creation event + // Attempt to load or create the market implementation + + _handleReserveInitialized( + event, + event.params.asset, + event.params.aToken, + event.params.variableDebtToken, + protocolData, + event.params.stableDebtToken + ); +} + +export function handleCollateralConfigurationChanged( + event: CollateralConfigurationChanged +): void { + _handleCollateralConfigurationChanged( + event.params.asset, + event.params.liquidationBonus, + event.params.liquidationThreshold, + event.params.ltv, + protocolData + ); +} + +export function handleReserveActive(event: ReserveActive): void { + _handleReserveActivated(event.params.asset, protocolData); +} + +export function handleReserveBorrowing(event: ReserveBorrowing): void { + if (event.params.enabled) { + _handleBorrowingEnabledOnReserve(event.params.asset, protocolData); + } else { + _handleBorrowingDisabledOnReserve(event.params.asset, protocolData); + } +} + +export function handleReserveFrozen(event: ReserveFrozen): void { + _handleReserveDeactivated(event.params.asset, protocolData); +} + +export function handleReservePaused(event: ReservePaused): void { + _handleReserveDeactivated(event.params.asset, protocolData); +} + +export function handleReserveFactorChanged(event: ReserveFactorChanged): void { + _handleReserveFactorChanged( + event.params.asset, + event.params.newReserveFactor, + protocolData + ); +} + +export function handleLiquidationProtocolFeeChanged( + event: LiquidationProtocolFeeChanged +): void { + _handleLiquidationProtocolFeeChanged( + event.params.asset, + event.params.newFee, + protocolData + ); +} + +export function handleFlashloanPremiumTotalUpdated( + event: FlashloanPremiumTotalUpdated +): void { + const rate = event.params.newFlashloanPremiumTotal + .toBigDecimal() + .div(exponentToBigDecimal(INT_FOUR)); + + _handleFlashloanPremiumTotalUpdated(rate, protocolData); +} + +export function handleFlashloanPremiumToProtocolUpdated( + event: FlashloanPremiumToProtocolUpdated +): void { + const rate = event.params.newFlashloanPremiumToProtocol + .toBigDecimal() + .div(exponentToBigDecimal(INT_FOUR)); + _handleFlashloanPremiumToProtocolUpdated(rate, protocolData); +} + +///////////////////////////////// +///// Lending Pool Handlers ///// +///////////////////////////////// + +export function handleReserveDataUpdated(event: ReserveDataUpdated): void { + const market = getMarketFromToken(event.params.reserve, protocolData); + if (!market) { + log.warning("[handleReserveDataUpdated] Market not found for reserve {}", [ + event.params.reserve.toHexString(), + ]); + return; + } + const manager = new DataManager( + market.id, + market.inputToken, + event, + protocolData + ); + + const assetPriceUSD = getAssetPriceInUSDC( + Address.fromBytes(market.inputToken), + manager.getOracleAddress() + ); + + _handleReserveDataUpdated( + event, + event.params.liquidityRate, + event.params.liquidityIndex, + event.params.variableBorrowIndex, + event.params.variableBorrowRate, + event.params.stableBorrowRate, + protocolData, + event.params.reserve, + assetPriceUSD + ); +} + +export function handleReserveUsedAsCollateralEnabled( + event: ReserveUsedAsCollateralEnabled +): void { + // This Event handler enables a reserve/market to be used as collateral + _handleReserveUsedAsCollateralEnabled( + event.params.reserve, + event.params.user, + protocolData + ); +} + +export function handleReserveUsedAsCollateralDisabled( + event: ReserveUsedAsCollateralDisabled +): void { + // This Event handler disables a reserve/market being used as collateral + _handleReserveUsedAsCollateralDisabled( + event.params.reserve, + event.params.user, + protocolData + ); +} + +export function handleDeposit(event: Supply): void { + _handleDeposit( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.onBehalfOf + ); +} + +export function handleWithdraw(event: Withdraw): void { + _handleWithdraw( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.user + ); +} + +export function handleBorrow(event: Borrow): void { + // determine whether the borrow position is in isolated mode + // borrow in isolated mode will have an IsolationModeTotalDebtUpdated event emitted + // before the Borrow event + // https://github.com/aave/aave-v3-core/blob/29ff9b9f89af7cd8255231bc5faf26c3ce0fb7ce/contracts/protocol/libraries/logic/BorrowLogic.sol#L139 + let isIsolated = false; + const receipt = event.receipt; + if (!receipt) { + log.warning( + "[handleBorrow]No receipt for tx {}; cannot set isIsolated flag", + [event.transaction.hash.toHexString()] + ); + } else { + isIsolated = getIsIsolatedFlag(event); + } + + let interestRateType: InterestRateType | null = null; + if (event.params.interestRateMode === InterestRateMode.STABLE) { + interestRateType = InterestRateType.STABLE; + } else if (event.params.interestRateMode === InterestRateMode.VARIABLE) { + interestRateType = InterestRateType.VARIABLE; + } + + _handleBorrow( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.onBehalfOf, + interestRateType, + isIsolated + ); +} + +export function handleRepay(event: Repay): void { + _handleRepay( + event, + event.params.amount, + event.params.reserve, + protocolData, + event.params.user + ); +} + +export function handleLiquidationCall(event: LiquidationCall): void { + const collateralMarket = getMarketFromToken( + event.params.collateralAsset, + protocolData + ); + if (!collateralMarket) { + log.error("[handleLiquidationCall]Failed to find market for asset {}", [ + event.params.collateralAsset.toHexString(), + ]); + return; + } + + if (!collateralMarket._liquidationProtocolFee) { + storeLiquidationProtocolFee( + collateralMarket, + event.address, + event.params.collateralAsset + ); + } + + let balanceTransferValue = BIGINT_ZERO; + let balanceTransferIndex = BIGINT_ZERO; + if (event.receipt) { + const logs = event.receipt!.logs; + for (let i = 0; i < logs.length; i++) { + const thisLog = logs[i]; + if (!thisLog.topics.length) continue; + + if (thisLog.topics[0] == BALANCE_TRANSFER_SIGNATURE) { + const decoded = ethereum.decode( + BALANCE_TRANSFER_DATA_TYPE, + thisLog.data + ); + if (!decoded) return; + + const logData = decoded.toTuple(); + balanceTransferValue = logData[INT_ZERO].toBigInt(); + balanceTransferIndex = logData[INT_ONE].toBigInt(); + } + } + } + const balanceTransferAmount = balanceTransferValue.times( + balanceTransferIndex.div(BIGINT_ONE_RAY) + ); + + _handleLiquidate( + event, + event.params.liquidatedCollateralAmount, + event.params.collateralAsset, + protocolData, + event.params.liquidator, + event.params.user, + event.params.debtAsset, + event.params.debtToCover, + balanceTransferAmount + ); +} + +export function handleFlashloan(event: FlashLoan): void { + const flashloanPremium = getOrCreateFlashloanPremium(protocolData); + + _handleFlashLoan( + event.params.asset, + event.params.amount, + event.params.initiator, + protocolData, + event, + event.params.premium, + flashloanPremium + ); +} + +export function handleMintedToTreasury(event: MintedToTreasury): void { + _handleMintedToTreasury( + event, + protocolData, + event.params.reserve, + event.params.amountMinted + ); +} + +///////////////////////// +//// Transfer Events //// +///////////////////////// + +export function handleCollateralTransfer(event: CollateralTransfer): void { + // determine the transfer amount because different versions of the AToken contract + // pass discounted and undiscounted amount to Transfer() and BalanceTransfer() event + // here we get the higher of the two amount and use it as the transfer amount + // e.g. https://arbiscan.io/tx/0x7ee837a19f37f0f74acb75be2eb07de85adcf1fcca1b66e8d2118958ce4fe8a1#eventlog + // logIndex 18 and 21 + let amount = event.params.value; + const receipt = event.receipt; + if (!receipt) { + log.warning("[handleBorrow]No receipt for tx {}", [ + event.transaction.hash.toHexString(), + ]); + } else { + const btAmount = getBalanceTransferAmount(event); + amount = btAmount.gt(amount) ? btAmount : amount; + } + + _handleTransfer( + event, + protocolData, + PositionSide.COLLATERAL, + event.params.to, + event.params.from, + amount + ); +} + +export function handleVariableTransfer(event: VariableTransfer): void { + _handleTransfer( + event, + protocolData, + PositionSide.BORROWER, + event.params.to, + event.params.from, + event.params.value + ); +} + +export function handleStableTransfer(event: StableTransfer): void { + _handleTransfer( + event, + protocolData, + PositionSide.BORROWER, + event.params.to, + event.params.from, + event.params.value + ); +} + +export function handleSwapBorrowRateMode(event: SwapBorrowRateMode): void { + const interestRateMode = event.params.interestRateMode; + if ( + ![InterestRateMode.STABLE, InterestRateMode.VARIABLE].includes( + event.params.interestRateMode + ) + ) { + log.error( + "[handleSwapBorrowRateMode]interestRateMode {} is not one of [{}, {}]", + [ + interestRateMode.toString(), + InterestRateMode.STABLE.toString(), + InterestRateMode.VARIABLE.toString(), + ] + ); + return; + return; + } + const interestRateType = + event.params.interestRateMode === InterestRateMode.STABLE + ? InterestRateType.STABLE + : InterestRateType.VARIABLE; + const market = getMarketFromToken(event.params.reserve, protocolData); + if (!market) { + log.error("[handleLiquidationCall]Failed to find market for asset {}", [ + event.params.reserve.toHexString(), + ]); + return; + } + const newBorrowBalances = getBorrowBalances(market, event.params.user); + _handleSwapBorrowRateMode( + event, + market, + event.params.user, + newBorrowBalances, + interestRateType, + protocolData + ); +} + +export function handleSiloedBorrowingChanged( + event: SiloedBorrowingChanged +): void { + const market = getMarketFromToken(event.params.asset, protocolData); + if (!market) { + log.error("[handleSiloedBorrowingChanged]market not found for token {}", [ + event.params.asset.toHexString(), + ]); + return; + } + market._siloedBorrowing = event.params.newState; + market.save(); +} + +export function handleUserEModeSet(event: UserEModeSet): void { + const account = new AccountManager(event.params.user).getAccount(); + account._eMode = true; + account.save(); +} + +/////////////////// +///// Helpers ///// +/////////////////// + +function getAssetPriceInUSDC( + tokenAddress: Address, + priceOracle: Address +): BigDecimal { + const oracle = AaveOracle.bind(priceOracle); + const baseUnit = readValue( + oracle.try_BASE_CURRENCY_UNIT(), + BigInt.fromI32(INT_TEN).pow(AAVE_DECIMALS as u8) + ).toBigDecimal(); + + const oracleResult = readValue( + oracle.try_getAssetPrice(tokenAddress), + BIGINT_ZERO + ); + + if (oracleResult.gt(BIGINT_ZERO)) { + return oracleResult.toBigDecimal().div(baseUnit); + } + + // fall price oracle unimplemented + + return BIGDECIMAL_ZERO; +} + +function storeLiquidationProtocolFee( + market: Market, + poolAddress: Address, + reserve: Address +): void { + // Store LiquidationProtocolFee if not set, as setLiquidationProtocolFee() may be never called + // and no LiquidationProtocolFeeChanged event is emitted + // see https://github.com/aave/aave-v3-core/blob/1e46f1cbb7ace08995cb4c8fa4e4ece96a243be3/contracts/protocol/libraries/configuration/ReserveConfiguration.sol#L491 + // for how to decode configuration data to get _liquidationProtocolFee + const liquidationProtocolFeeMask = + "0xFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; + const liquidationProtocolFeeStartBitPosition = INT_152 as u8; + const pool = LendingPoolContract.bind(poolAddress); + const poolConfigData = pool.getConfiguration(reserve).data; + const liquidationProtocolFee = decodeConfig( + poolConfigData, + liquidationProtocolFeeMask, + liquidationProtocolFeeStartBitPosition + ) + .toBigDecimal() + .div(exponentToBigDecimal(INT_FOUR)); + + log.info("[storeLiquidationProtocolFee]market {} liquidationProtocolFee={}", [ + market.id.toHexString(), + liquidationProtocolFee.toString(), + ]); + market._liquidationProtocolFee = liquidationProtocolFee; + market.save(); +} + +function decodeConfig( + storedData: BigInt, + maskStr: string, + startBitPosition: u8 +): BigInt { + // aave-v3 stores configuration in packed bits (ReserveConfiguration.sol) + // decoding them by applying a bit_not mask and right shift by startBitPosition + // see https://github.com/aave/aave-v3-core/blob/1e46f1cbb7ace08995cb4c8fa4e4ece96a243be3/contracts/protocol/libraries/configuration/ReserveConfiguration.sol#L491 + // for how to decode configuration data to get _liquidationProtocolFee + + const maskArray = new Uint8Array(INT_THIRTY_TWO); + maskArray.set(Bytes.fromHexString(maskStr)); + // BITWISE NOT + for (let i = 0; i < maskArray.length; i++) { + maskArray[i] = ~maskArray[i]; + } + // reverse for little endian + const configMaskBigInt = BigInt.fromUnsignedBytes( + Bytes.fromUint8Array(maskArray.reverse()) + ); + + const config = storedData + .bitAnd(configMaskBigInt) + .rightShift(startBitPosition); + + return config; +} + +function getIsIsolatedFlag(event: ethereum.Event): boolean { + let isIsolated = false; + const ISOLATE_MODE = "IsolationModeTotalDebtUpdated(address,uint256)"; + const eventSignature = crypto.keccak256(ByteArray.fromUTF8(ISOLATE_MODE)); + const logs = event.receipt!.logs; + //IsolationModeTotalDebtUpdated emitted before Borrow's event.logIndex + // e.g. https://etherscan.io/tx/0x4b038b26555d4b6c057cd612057b39e6482a7c60eb44058ee61d299332efdf29#eventlog + const eventLogIndex = event.logIndex; + for (let i = 0; i < logs.length; i++) { + const thisLog = logs[i]; + if (thisLog.topics.length > INT_ZERO) { + if (thisLog.logIndex.gt(eventLogIndex)) { + // no IsolationModeTotalDebtUpdated log before Borrow + break; + } + // topics[0] - signature + const logSignature = thisLog.topics[0]; + if (thisLog.address == event.address && logSignature == eventSignature) { + log.info( + "[getIsIsolatedFlag]found IsolationModeTotalDebtUpdated event isolated=true tx {}", + [event.transaction.hash.toHexString()] + ); + isIsolated = true; + break; + } + } + } + return isIsolated; +} + +function getBalanceTransferAmount(event: ethereum.Event): BigInt { + let btAmount = BIGINT_ZERO; + const BALANCE_TRANSFER = + "BalanceTransfer(address, address, uint256, uint256)"; + const eventSignature = crypto.keccak256(ByteArray.fromUTF8(BALANCE_TRANSFER)); + const logs = event.receipt!.logs; + // BalanceTransfer emitted after Transfer's event.logIndex + // e.g. https://arbiscan.io/tx/0x7ee837a19f37f0f74acb75be2eb07de85adcf1fcca1b66e8d2118958ce4fe8a1#eventlog + const eventLogIndex = event.logIndex; + for (let i = 0; i < logs.length; i++) { + const thisLog = logs[i]; + if (thisLog.topics.length > INT_ZERO) { + if (thisLog.logIndex.le(eventLogIndex)) { + // skip event with logIndex < event.logIndex + continue; + } + // topics[0] - signature + const logSignature = thisLog.topics[0]; + if (thisLog.address == event.address && logSignature == eventSignature) { + const UINT256_UINT256 = "(uint256,uint256)"; + const decoded = ethereum.decode(UINT256_UINT256, thisLog.data); + if (!decoded) continue; + + const logData = decoded.toTuple(); + btAmount = logData[0].toBigInt(); + log.info( + "[handleCollateralTransfer] BalanceTransfer amount= {} tx {}", + [btAmount.toString(), event.transaction.hash.toHexString()] + ); + break; + } + } + } + return btAmount; +} diff --git a/subgraphs/aave-forks/schema.graphql b/subgraphs/aave-forks/schema.graphql index 95a8dd10e6..f37d1c2bc9 100644 --- a/subgraphs/aave-forks/schema.graphql +++ b/subgraphs/aave-forks/schema.graphql @@ -3,29 +3,34 @@ # See https://github.com/messari/subgraphs/blob/master/docs/SCHEMA.md for details enum Network { + ANDROMEDA # metis node ARBITRUM_ONE ARWEAVE_MAINNET AURORA AVALANCHE + BASE + BLAST_MAINNET BOBA BSC # aka BNB Chain CELO COSMOS CRONOS - MAINNET # Ethereum Mainnet FANTOM FUSE + GNOSIS HARMONY JUNO + LINEA + MAINNET # Ethereum Mainnet + MATIC # aka Polygon MOONBEAM MOONRIVER NEAR_MAINNET OPTIMISM OSMOSIS - MATIC # aka Polygon - GNOSIS - ANDROMEDA # metis node - BASE + SCROLL + XLAYER_MAINNET + ZKSYNC_ERA } enum ProtocolType { diff --git a/subgraphs/aave-forks/src/constants.ts b/subgraphs/aave-forks/src/constants.ts index 5e0e0b52c1..d5e51c0387 100644 --- a/subgraphs/aave-forks/src/constants.ts +++ b/subgraphs/aave-forks/src/constants.ts @@ -9,27 +9,30 @@ export namespace Network { export const ARWEAVE_MAINNET = "ARWEAVE_MAINNET"; export const AURORA = "AURORA"; export const AVALANCHE = "AVALANCHE"; + export const BASE = "BASE"; + export const BLAST_MAINNET = "BLAST_MAINNET"; export const BOBA = "BOBA"; export const BSC = "BSC"; // aka BNB Chain export const CELO = "CELO"; export const COSMOS = "COSMOS"; export const CRONOS = "CRONOS"; - export const MAINNET = "MAINNET"; // Ethereum mainnet export const FANTOM = "FANTOM"; export const FUSE = "FUSE"; + export const GNOSIS = "GNOSIS"; // aka xDAI export const HARMONY = "HARMONY"; export const JUNO = "JUNO"; + export const LINEA = "LINEA"; + export const MAINNET = "MAINNET"; // Ethereum mainnet + export const MATIC = "MATIC"; // aka Polygon + export const METIS = "ANDROMEDA"; export const MOONBEAM = "MOONBEAM"; export const MOONRIVER = "MOONRIVER"; export const NEAR_MAINNET = "NEAR_MAINNET"; export const OPTIMISM = "OPTIMISM"; export const OSMOSIS = "OSMOSIS"; - export const MATIC = "MATIC"; // aka Polygon - export const GNOSIS = "GNOSIS"; // aka xDAI - - export const METIS = "ANDROMEDA"; - export const BASE = "BASE"; export const SCROLL = "SCROLL"; + export const XLAYER_MAINNET = "XLAYER_MAINNET"; + export const ZKSYNC_ERA = "ZKSYNC_ERA"; } export namespace ProtocolType {