diff --git a/abi/oeth-vault.json b/abi/oeth-vault.json new file mode 100644 index 0000000..3d8da5f --- /dev/null +++ b/abi/oeth-vault.json @@ -0,0 +1,1648 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "AllocateThresholdUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_strategy", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "AssetAllocated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_strategy", + "type": "address" + } + ], + "name": "AssetDefaultStrategyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_asset", + "type": "address" + } + ], + "name": "AssetSupported", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "CapitalPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "CapitalUnpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_dripper", + "type": "address" + } + ], + "name": "DripperChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "maxSupplyDiff", + "type": "uint256" + } + ], + "name": "MaxSupplyDiffChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "Mint", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_priceProvider", + "type": "address" + } + ], + "name": "PriceProviderUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "RebasePaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "RebaseThresholdUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "RebaseUnpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_addr", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "Redeem", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_redeemFeeBps", + "type": "uint256" + } + ], + "name": "RedeemFeeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "StrategistUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "name": "StrategyApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "name": "StrategyRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_basis", + "type": "uint256" + } + ], + "name": "SwapAllowedUndervalueChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_basis", + "type": "uint256" + } + ], + "name": "SwapSlippageChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_fromAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_toAsset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_fromAssetAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toAssetAmount", + "type": "uint256" + } + ], + "name": "Swapped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "SwapperChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "TrusteeAddressChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_basis", + "type": "uint256" + } + ], + "name": "TrusteeFeeBpsChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_vaultBuffer", + "type": "uint256" + } + ], + "name": "VaultBufferUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_claimable", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_newClaimable", + "type": "uint256" + } + ], + "name": "WithdrawalClaimable", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_withdrawer", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "WithdrawalClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_withdrawer", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_queued", + "type": "uint256" + } + ], + "name": "WithdrawalRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_yield", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "name": "YieldDistribution", + "type": "event" + }, + { + "inputs": [], + "name": "addWithdrawalQueueLiquidity", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "allocate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "allowedSwapUndervalue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "name": "approveStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_asset", + "type": "address" + } + ], + "name": "assetDefaultStrategies", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "autoAllocateThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "burnForStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cacheWETHAssetIndex", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "calculateRedeemOutputs", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "capitalPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_asset", + "type": "address" + } + ], + "name": "checkBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "claimGovernance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "name": "claimWithdrawal", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "requestIds", + "type": "uint256[]" + } + ], + "name": "claimWithdrawals", + "outputs": [ + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "totalAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_strategyToAddress", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_assets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_amounts", + "type": "uint256[]" + } + ], + "name": "depositToStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllAssets", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllStrategies", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_asset", + "type": "address" + } + ], + "name": "getAssetConfig", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "isSupported", + "type": "bool" + }, + { + "internalType": "enum VaultStorage.UnitConversion", + "name": "unitConversion", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "allowedOracleSlippageBps", + "type": "uint16" + } + ], + "internalType": "struct VaultStorage.Asset", + "name": "config", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAssetCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getStrategyCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_asset", + "type": "address" + } + ], + "name": "isSupportedAsset", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxSupplyDiff", + "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": "_minimumOusdAmount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mintForStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "netOusdMintForStrategyThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "netOusdMintedForStrategy", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ousdMetaStrategy", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseCapital", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pauseRebase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "priceProvider", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "priceUnitMint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "priceUnitRedeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rebase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rebasePaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rebaseThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_minimumUnitAmount", + "type": "uint256" + } + ], + "name": "redeem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_minimumUnitAmount", + "type": "uint256" + } + ], + "name": "redeemAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "redeemFeeBps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_asset", + "type": "address" + } + ], + "name": "removeAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "name": "removeStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "requestWithdrawal", + "outputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "queued", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "setAdminImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_asset", + "type": "address" + }, + { + "internalType": "address", + "name": "_strategy", + "type": "address" + } + ], + "name": "setAssetDefaultStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "setAutoAllocateThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dripper", + "type": "address" + } + ], + "name": "setDripper", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxSupplyDiff", + "type": "uint256" + } + ], + "name": "setMaxSupplyDiff", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "setNetOusdMintForStrategyThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_asset", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_allowedOracleSlippageBps", + "type": "uint16" + } + ], + "name": "setOracleSlippage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_ousdMetaStrategy", + "type": "address" + } + ], + "name": "setOusdMetaStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_priceProvider", + "type": "address" + } + ], + "name": "setPriceProvider", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "setRebaseThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_redeemFeeBps", + "type": "uint256" + } + ], + "name": "setRedeemFeeBps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "setStrategistAddr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_percentageBps", + "type": "uint16" + } + ], + "name": "setSwapAllowedUndervalue", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_swapperAddr", + "type": "address" + } + ], + "name": "setSwapper", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "setTrusteeAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_basis", + "type": "uint256" + } + ], + "name": "setTrusteeFeeBps", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_vaultBuffer", + "type": "uint256" + } + ], + "name": "setVaultBuffer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "strategistAddr", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_asset", + "type": "address" + }, + { + "internalType": "uint8", + "name": "_supportsAsset", + "type": "uint8" + } + ], + "name": "supportAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "fromAsset", + "type": "address" + }, + { + "internalType": "address", + "name": "toAsset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "fromAssetAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minToAssetAmount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "swapCollateral", + "outputs": [ + { + "internalType": "uint256", + "name": "toAssetAmount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "swapper", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalValue", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newGovernor", + "type": "address" + } + ], + "name": "transferGovernance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "trusteeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "trusteeFeeBps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unpauseCapital", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpauseRebase", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultBuffer", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "weth", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "wethAssetIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawAllFromStrategies", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_strategyAddr", + "type": "address" + } + ], + "name": "withdrawAllFromStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_strategyFromAddress", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_assets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_amounts", + "type": "uint256[]" + } + ], + "name": "withdrawFromStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawalQueueMetadata", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "queued", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "claimable", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "claimed", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "nextWithdrawalIndex", + "type": "uint128" + } + ], + "internalType": "struct VaultStorage.WithdrawalQueueMetadata", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "name": "withdrawalRequests", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "withdrawer", + "type": "address" + }, + { + "internalType": "bool", + "name": "claimed", + "type": "bool" + }, + { + "internalType": "uint128", + "name": "amount", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "queued", + "type": "uint128" + } + ], + "internalType": "struct VaultStorage.WithdrawalRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/db/migrations/1721737477772-Data.js b/db/migrations/1721737477772-Data.js new file mode 100644 index 0000000..83b7229 --- /dev/null +++ b/db/migrations/1721737477772-Data.js @@ -0,0 +1,715 @@ +module.exports = class Data1721737477772 { + name = 'Data1721737477772' + + async up(db) { + await db.query(`CREATE TABLE "es_token" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "circulating" numeric NOT NULL, "staked" numeric NOT NULL, "total" numeric NOT NULL, CONSTRAINT "PK_69bef9eb94d9a5d42d726d1e661" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_a234e56547c4f8b9135d80444b" ON "es_token" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_588f0be9f9bdc1d8dd29797fec" ON "es_token" ("block_number") `) + await db.query(`CREATE TABLE "es_account" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "account" text NOT NULL, "asset_balance" numeric NOT NULL, "staked_balance" numeric NOT NULL, "balance" numeric NOT NULL, "voting_power" numeric NOT NULL, "delegate_to_id" character varying, CONSTRAINT "PK_819b7e05161fa9d1f724b31e1b7" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_eb97a0d869e67af870987d6d85" ON "es_account" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_93fea1d847b38c9982626e5fd1" ON "es_account" ("address") `) + await db.query(`CREATE INDEX "IDX_bc09480c9d1b13806f82337b5e" ON "es_account" ("account") `) + await db.query(`CREATE INDEX "IDX_7b43e7bb90d3b435d074112f57" ON "es_account" ("delegate_to_id") `) + await db.query(`CREATE TABLE "es_yield" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "asset_balance" numeric NOT NULL, "rewards_per_second" numeric NOT NULL, "apr" numeric NOT NULL, "apy" numeric NOT NULL, CONSTRAINT "PK_52ad2363a2797ab8ce74fa9765a" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_aa3649a103464d797c959294d1" ON "es_yield" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_700ebb527927ee781c0750b0dc" ON "es_yield" ("address") `) + await db.query(`CREATE INDEX "IDX_e2d3a1ddc3f0886f51556442bb" ON "es_yield" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_4fdca11723165347776a9a7110" ON "es_yield" ("block_number") `) + await db.query(`CREATE TABLE "es_lockup_event" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "event" character varying(8) NOT NULL, "lockup_id" character varying, CONSTRAINT "PK_67e28e7f997fad22a59f8fd71c1" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_512bb02117d66720b0c72fe2d2" ON "es_lockup_event" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_953fc73b0a9873292b633601e0" ON "es_lockup_event" ("address") `) + await db.query(`CREATE INDEX "IDX_9584d0dce1144609a1a9a0c579" ON "es_lockup_event" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_bb14524b2db1cbbf66d1729aba" ON "es_lockup_event" ("block_number") `) + await db.query(`CREATE INDEX "IDX_e1eb81715da4d4a8281616a39f" ON "es_lockup_event" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_46d53d4fad340d593995583600" ON "es_lockup_event" ("lockup_id") `) + await db.query(`CREATE TABLE "es_lockup" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "account" text NOT NULL, "lockup_id" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "tx_hash" text NOT NULL, "last_updated" TIMESTAMP WITH TIME ZONE NOT NULL, "amount" numeric NOT NULL, "end" TIMESTAMP WITH TIME ZONE NOT NULL, "points" numeric NOT NULL, "withdraw_amount" numeric NOT NULL, "penalty" numeric NOT NULL, "state" character varying(6), CONSTRAINT "PK_5b189f92ac5becc0db1e5d1f8ad" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_15e9dc0d375d6f2687def01843" ON "es_lockup" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_f3c10b1e75f626e1aaeaa3cfc3" ON "es_lockup" ("address") `) + await db.query(`CREATE INDEX "IDX_5dd7ffdf1c625829f7eb79ee27" ON "es_lockup" ("account") `) + await db.query(`CREATE INDEX "IDX_31b53c3e4649bde773d707b2a0" ON "es_lockup" ("lockup_id") `) + await db.query(`CREATE INDEX "IDX_2434b29d48e045849fc12cef7c" ON "es_lockup" ("tx_hash") `) + await db.query(`CREATE TABLE "es_delegate_changed" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "delegator" text NOT NULL, "from_delegate" text NOT NULL, "to_delegate" text NOT NULL, CONSTRAINT "PK_4d5857f4fe4904dea337644e603" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_76c1740192ed8b589f7b5a21c8" ON "es_delegate_changed" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_ed5ea936cde8d62b485ce45a13" ON "es_delegate_changed" ("address") `) + await db.query(`CREATE INDEX "IDX_22f639893bc36efe524a3bbca7" ON "es_delegate_changed" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_ed12aa7ace584cc494012a0e5b" ON "es_delegate_changed" ("block_number") `) + await db.query(`CREATE INDEX "IDX_e234755c68bb8d7f9cfd511126" ON "es_delegate_changed" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_cda0b80789007b35cf5430966f" ON "es_delegate_changed" ("delegator") `) + await db.query(`CREATE TABLE "es_delegate_votes_changed" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "delegate" text NOT NULL, "previous_balance" numeric NOT NULL, "new_balance" numeric NOT NULL, CONSTRAINT "PK_4e8cd459830447ee5dd3a7e802b" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_4e20cdc38777932fadd008f6e4" ON "es_delegate_votes_changed" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_076fb50935afa2f319f1d16752" ON "es_delegate_votes_changed" ("address") `) + await db.query(`CREATE INDEX "IDX_338d2483a33dc74d360d2a44c5" ON "es_delegate_votes_changed" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_e0e6b12e50b95fb9b99c28df90" ON "es_delegate_votes_changed" ("block_number") `) + await db.query(`CREATE INDEX "IDX_60ea37f13fc3b16e491926314f" ON "es_delegate_votes_changed" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_bd6f657c57e5a92a8dd3fe6b4e" ON "es_delegate_votes_changed" ("delegate") `) + await db.query(`CREATE TABLE "es_penalty" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "account" text NOT NULL, "amount" numeric NOT NULL, CONSTRAINT "PK_41b7961c4867c2d18f8afa921cc" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_59fa17e121ecd2bead0a71cf85" ON "es_penalty" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_785a65f92c61edd176415e22ad" ON "es_penalty" ("address") `) + await db.query(`CREATE INDEX "IDX_7402aa565f5e2023e310610240" ON "es_penalty" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_8595139811169d26aa210f8a8d" ON "es_penalty" ("block_number") `) + await db.query(`CREATE INDEX "IDX_9f560f23bcdd81e13141c02125" ON "es_penalty" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_adc7f2fe26e4a36690a343339b" ON "es_penalty" ("account") `) + await db.query(`CREATE TABLE "es_reward" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "account" text NOT NULL, "amount" numeric NOT NULL, CONSTRAINT "PK_52643252c6b05e1a6d337081d9b" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_e05d0476721dfcf9152b58fc30" ON "es_reward" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_f01dea25da96f8d8eaec9b6f60" ON "es_reward" ("address") `) + await db.query(`CREATE INDEX "IDX_2f3b61cc072d95ad0796b9caa3" ON "es_reward" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_a3d39d7235e278255a5217d1df" ON "es_reward" ("block_number") `) + await db.query(`CREATE INDEX "IDX_d17aab47907d6816138ab2a7fa" ON "es_reward" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_b623db55430fefda84dfdf2949" ON "es_reward" ("account") `) + await db.query(`CREATE TABLE "es_stake" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "account" text NOT NULL, "lockup_id" numeric NOT NULL, "amount" numeric NOT NULL, "end" numeric NOT NULL, "points" numeric NOT NULL, CONSTRAINT "PK_86bb48f03d8a3ca01f8d0339c66" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_385357cc5f41796615d8880190" ON "es_stake" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_e7bcc8120e2c256db6ebd01575" ON "es_stake" ("address") `) + await db.query(`CREATE INDEX "IDX_b95e58860bb9ba46d0ec41d246" ON "es_stake" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_d059ea472eb9d10f6be2025d40" ON "es_stake" ("block_number") `) + await db.query(`CREATE INDEX "IDX_f629f87d82890ea6f515e1a7a7" ON "es_stake" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_2d2f6b568b3145fe6095da5afa" ON "es_stake" ("account") `) + await db.query(`CREATE INDEX "IDX_bcb392795674b2cc0af394864c" ON "es_stake" ("lockup_id") `) + await db.query(`CREATE TABLE "es_unstake" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "account" text NOT NULL, "lockup_id" numeric NOT NULL, "amount" numeric NOT NULL, "end" numeric NOT NULL, "points" numeric NOT NULL, CONSTRAINT "PK_649003a33f9fb327e2f72d8e5df" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_0c51c706a778668dbd5ed9c817" ON "es_unstake" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_9301687673c195770cdd543049" ON "es_unstake" ("address") `) + await db.query(`CREATE INDEX "IDX_13fbe169018991ddcfeb4912cb" ON "es_unstake" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_06c024c53472178d0f5292330a" ON "es_unstake" ("block_number") `) + await db.query(`CREATE INDEX "IDX_7d988d60b55dc08addc58835d6" ON "es_unstake" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_0adcdd08da131e76d618b73db7" ON "es_unstake" ("account") `) + await db.query(`CREATE INDEX "IDX_cc43898a790e6e1d4bbf145097" ON "es_unstake" ("lockup_id") `) + await db.query(`CREATE TABLE "frrs_reward_collected" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "amount_collected" numeric NOT NULL, CONSTRAINT "PK_638be8eac1ed06396ae15065985" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_41ff7fbd84f0e932ddff4aaeda" ON "frrs_reward_collected" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_6f8728cf12eedec371ec2b5ac3" ON "frrs_reward_collected" ("address") `) + await db.query(`CREATE INDEX "IDX_fe9c300aa3739b7fedae19bee8" ON "frrs_reward_collected" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_748e8278aa0f4327fdb375ce39" ON "frrs_reward_collected" ("block_number") `) + await db.query(`CREATE INDEX "IDX_76682d76550c1908c0edbf80d6" ON "frrs_reward_collected" ("tx_hash") `) + await db.query(`CREATE TABLE "frrs_rewards_per_second_changed" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "new_rps" numeric NOT NULL, "old_rps" numeric NOT NULL, CONSTRAINT "PK_2673e74455a61c199ae6b457c9e" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_51112ae6ed7acfe5fea9041736" ON "frrs_rewards_per_second_changed" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_27777adfd6d67ce69177e76777" ON "frrs_rewards_per_second_changed" ("address") `) + await db.query(`CREATE INDEX "IDX_0f439534e934e9114e93fe0e0e" ON "frrs_rewards_per_second_changed" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_af32902afcc6d0e38d55b29e68" ON "frrs_rewards_per_second_changed" ("block_number") `) + await db.query(`CREATE INDEX "IDX_7a5afd8ca41d81f9841db0f602" ON "frrs_rewards_per_second_changed" ("tx_hash") `) + await db.query(`CREATE TABLE "frrs_rewards_target_change" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "target" text NOT NULL, "previous_target" text NOT NULL, CONSTRAINT "PK_a55f976a8f537dff9d4ed24047f" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_a6f19822f0e09c509963463fbd" ON "frrs_rewards_target_change" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_598a7d310b076cf239ae7bcb51" ON "frrs_rewards_target_change" ("address") `) + await db.query(`CREATE INDEX "IDX_d593e4b975ae4f8d60303b2ba9" ON "frrs_rewards_target_change" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_9410930fcb952fb4003dc2b2be" ON "frrs_rewards_target_change" ("block_number") `) + await db.query(`CREATE INDEX "IDX_14cbad89905ceeb715f8e1a2c8" ON "frrs_rewards_target_change" ("tx_hash") `) + await db.query(`CREATE TABLE "frrs_strategist_updated" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "strategist_address" text NOT NULL, CONSTRAINT "PK_c71ac16e8ede7acbd61b846676a" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_47dfa32c5be0528074dcf093d6" ON "frrs_strategist_updated" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_2f910a0f9c75adc401d7aa8c0f" ON "frrs_strategist_updated" ("address") `) + await db.query(`CREATE INDEX "IDX_301322e4df8e766e7f4cd892fd" ON "frrs_strategist_updated" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_7f49f2839212126c3d42fb4bf1" ON "frrs_strategist_updated" ("block_number") `) + await db.query(`CREATE INDEX "IDX_aab8ae0cb29505a7014438675b" ON "frrs_strategist_updated" ("tx_hash") `) + await db.query(`CREATE TABLE "processing_status" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, CONSTRAINT "PK_85f5e2467b74fb70fac1a053021" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "exchange_rate" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "pair" text NOT NULL, "base" text NOT NULL, "quote" text NOT NULL, "rate" numeric NOT NULL, CONSTRAINT "PK_5c5d27d2b900ef6cdeef0398472" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_9e23a3f1bf3634820c873a0fe8" ON "exchange_rate" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_c61a93768eed9e58ce399bbe01" ON "exchange_rate" ("block_number") `) + await db.query(`CREATE TABLE "strategy_balance" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "strategy" text NOT NULL, "asset" text NOT NULL, "balance" numeric NOT NULL, CONSTRAINT "PK_ca6f93229d1392e9546d01dae4f" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_bb5bbdf054deadf169e9e0330a" ON "strategy_balance" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_0113bf0b63183bea0d22cd0d08" ON "strategy_balance" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_a88065dcd92011698bbe7df7b1" ON "strategy_balance" ("block_number") `) + await db.query(`CREATE TABLE "strategy_yield" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "strategy" text NOT NULL, "asset" text NOT NULL, "balance" numeric NOT NULL, "balance_weight" numeric NOT NULL, "earnings" numeric NOT NULL, "earnings_change" numeric NOT NULL, CONSTRAINT "PK_e87c46575e870fe2202190c2728" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_5108f2a2563d5665892d0c06b0" ON "strategy_yield" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_41c3567c9d43c598e07a0029c5" ON "strategy_yield" ("block_number") `) + await db.query(`CREATE TABLE "strategy_daily_yield" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "strategy" text NOT NULL, "asset" text NOT NULL, "balance" numeric NOT NULL, "balance_weight" numeric NOT NULL, "earnings" numeric NOT NULL, "earnings_change" numeric NOT NULL, "apr" numeric NOT NULL, "apy" numeric NOT NULL, CONSTRAINT "PK_b0dd2686bc95bb032ff532b3a0e" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_0ba1974747f1906e0c102cd2cd" ON "strategy_daily_yield" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_df364fb6e82d1feeed2a5dfffa" ON "strategy_daily_yield" ("block_number") `) + await db.query(`CREATE TABLE "native_balance" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "account" text NOT NULL, "balance" numeric NOT NULL, CONSTRAINT "PK_62f6bdfe058e52d1914d0c2c1ce" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_45fb48f831ccadcf29f404824a" ON "native_balance" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_82d827c3b96fb3c5ab43068502" ON "native_balance" ("block_number") `) + await db.query(`CREATE TABLE "erc20" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "name" text NOT NULL, "decimals" integer NOT NULL, "symbol" text NOT NULL, CONSTRAINT "PK_8d43ce15401ba044c55a72a8ceb" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_905ff854e6782fc32dc4268a25" ON "erc20" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_40fd11c1a0d0f2562824894e85" ON "erc20" ("address") `) + await db.query(`CREATE TABLE "erc20_holder" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "account" text NOT NULL, "balance" numeric NOT NULL, CONSTRAINT "PK_3adce7edbac4bcb03c662c3a1ac" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_51b9e7c44702ef3a6f05d3702e" ON "erc20_holder" ("chain_id") `) + await db.query(`CREATE TABLE "erc20_state" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "address" text NOT NULL, "total_supply" numeric NOT NULL, "holder_count" integer NOT NULL, CONSTRAINT "PK_eac1124b07bbdedafd4fff2f7b7" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_2b69abb250c647c7a4b5a5a715" ON "erc20_state" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_c3d08eb2dafe4b5b188924d835" ON "erc20_state" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_29e8edc6ba8cc37c0c16ff0baf" ON "erc20_state" ("block_number") `) + await db.query(`CREATE TABLE "erc20_balance" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "address" text NOT NULL, "account" text NOT NULL, "balance" numeric NOT NULL, CONSTRAINT "PK_069b6549e7a9938cc89f32063a6" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_bb6a884e702f2887037d5a7eec" ON "erc20_balance" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_c9fbe21a3411d93ea586af2a4c" ON "erc20_balance" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_d1f50dc39003331b76fad8a640" ON "erc20_balance" ("block_number") `) + await db.query(`CREATE TABLE "erc20_transfer" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "tx_hash" text NOT NULL, "block_number" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "address" text NOT NULL, "from" text NOT NULL, "from_balance" numeric NOT NULL, "to" text NOT NULL, "to_balance" numeric NOT NULL, "value" numeric NOT NULL, CONSTRAINT "PK_12764843146818a31e3d28fc577" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_f914d2e140eb88375a5a2ef6c7" ON "erc20_transfer" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_6350ddb2def19c1e3a06d8b3ec" ON "erc20_transfer" ("address") `) + await db.query(`CREATE INDEX "IDX_eca70565083880d00e9110b000" ON "erc20_transfer" ("from") `) + await db.query(`CREATE INDEX "IDX_9fdc9d58b6ae0cb13b9c7f8226" ON "erc20_transfer" ("to") `) + await db.query(`CREATE TABLE "curve_pool" ("id" character varying NOT NULL, "address" text NOT NULL, "name" text NOT NULL, "token_count" integer NOT NULL, "token0" text NOT NULL, "token1" text NOT NULL, "token2" text, CONSTRAINT "PK_c04bba36a8aa877d6efa4eafd6c" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_76c9202c1160ce818f7a29d131" ON "curve_pool" ("address") `) + await db.query(`CREATE TABLE "curve_pool_balance" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "address" text NOT NULL, "balance0" numeric NOT NULL, "balance1" numeric NOT NULL, "balance2" numeric NOT NULL, CONSTRAINT "PK_40412750bb910ca560aa084dd88" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_ffb0d0f86f03faacef7cb3e092" ON "curve_pool_balance" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_db5522c865eb8ed76fa7aeb4a8" ON "curve_pool_balance" ("block_number") `) + await db.query(`CREATE TABLE "curve_pool_rate" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "address" text NOT NULL, "name" text NOT NULL, "rate" numeric NOT NULL, CONSTRAINT "PK_91a04fe55298abe8abd8da1b813" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_561faf9883f4bb00ae6df34cc1" ON "curve_pool_rate" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_cefe6315e78e235fa4ab3de663" ON "curve_pool_rate" ("block_number") `) + await db.query(`CREATE TABLE "balancer_pool" ("id" character varying NOT NULL, "address" text NOT NULL, "name" text NOT NULL, "token_count" integer NOT NULL, "token0" text NOT NULL, "token1" text NOT NULL, "token2" text, "token3" text, CONSTRAINT "PK_d7d096bf445ae226ec938f8bb6a" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_0c5b4cc12b9d8b80ac5d983848" ON "balancer_pool" ("address") `) + await db.query(`CREATE TABLE "balancer_pool_balance" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "address" text NOT NULL, "balance0" numeric NOT NULL, "balance1" numeric NOT NULL, "balance2" numeric NOT NULL, "balance3" numeric NOT NULL, CONSTRAINT "PK_441c7de293266414608c8e9de4c" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_642115282f1c3026edbc4bc2a7" ON "balancer_pool_balance" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_eecdc2d6132041e3806d77c7b4" ON "balancer_pool_balance" ("block_number") `) + await db.query(`CREATE TABLE "balancer_pool_rate" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "address" text NOT NULL, "rate0" numeric NOT NULL, "rate1" numeric NOT NULL, "rate2" numeric NOT NULL, "rate3" numeric NOT NULL, CONSTRAINT "PK_3ca9825db8d15c7850b715d9121" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_b1656f8d048f72b38bb637ea24" ON "balancer_pool_rate" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_c55345ef048232dfe36e60e4c5" ON "balancer_pool_rate" ("block_number") `) + await db.query(`CREATE TABLE "maverick_pool" ("id" character varying NOT NULL, "address" text NOT NULL, "name" text NOT NULL, "token_a" text NOT NULL, "token_b" text NOT NULL, CONSTRAINT "PK_17580e27fedc439b0c145f11510" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_f04c4b9133d5c21af35b6f23d3" ON "maverick_pool" ("address") `) + await db.query(`CREATE TABLE "maverick_pool_balance" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "address" text NOT NULL, "bin_balance_a" numeric NOT NULL, "bin_balance_b" numeric NOT NULL, CONSTRAINT "PK_e3c7008ecb64838c320f82e7036" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_e8046e8a298610b97bea2e6241" ON "maverick_pool_balance" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_6034a437728a8ccb3b49f4a348" ON "maverick_pool_balance" ("block_number") `) + await db.query(`CREATE TABLE "liquidity_source" ("id" character varying NOT NULL, "address" text NOT NULL, "type" character varying(12) NOT NULL, "token" text NOT NULL, CONSTRAINT "PK_5d25173fd367a0a7a901ee2f738" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "liquidity_daily_balance" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "address" text NOT NULL, "token" text NOT NULL, "balance" numeric NOT NULL, CONSTRAINT "PK_bf1de97f9815d851f7b4abca9ca" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_c5116bd4f5406fc2848552f0ba" ON "liquidity_daily_balance" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_58d14205a5e9ad1d05f94d7bb6" ON "liquidity_daily_balance" ("block_number") `) + await db.query(`CREATE TABLE "bridge_transfer" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash_in" text NOT NULL, "tx_hash_out" text, "message_id" text NOT NULL, "bridge" text NOT NULL, "transactor" text NOT NULL, "sender" text NOT NULL, "receiver" text NOT NULL, "chain_in" integer NOT NULL, "chain_out" integer NOT NULL, "token_in" text NOT NULL, "token_out" text NOT NULL, "amount_in" numeric NOT NULL, "amount_out" numeric NOT NULL, "state" integer NOT NULL, CONSTRAINT "PK_fab0727701656a3e6c320fca6e9" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_aaedc42eda914e44a21e8eac72" ON "bridge_transfer" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_f8d8d410f058f0bae15eefbc81" ON "bridge_transfer" ("block_number") `) + await db.query(`CREATE INDEX "IDX_85994c1ee045b713bbcbcccc8b" ON "bridge_transfer" ("message_id") `) + await db.query(`CREATE INDEX "IDX_7ff6ab2147f80a465d3752e79f" ON "bridge_transfer" ("bridge") `) + await db.query(`CREATE INDEX "IDX_aaec7d9bb08b9ef8fb1b419c5d" ON "bridge_transfer" ("transactor") `) + await db.query(`CREATE INDEX "IDX_3cbd3eea30bc62ebc91c276e73" ON "bridge_transfer" ("sender") `) + await db.query(`CREATE INDEX "IDX_54f4abe8f2eb80204637ce328e" ON "bridge_transfer" ("receiver") `) + await db.query(`CREATE INDEX "IDX_12fa326ec2496a964493f2a7bc" ON "bridge_transfer" ("chain_in") `) + await db.query(`CREATE TABLE "bridge_transfer_state" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "state" integer NOT NULL, CONSTRAINT "PK_00ca26906171755e6fc01882c68" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_374659ae3bd149042388e132be" ON "bridge_transfer_state" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_74f93b10ec560e63792dcc877e" ON "bridge_transfer_state" ("block_number") `) + await db.query(`CREATE INDEX "IDX_df99bdbf11d4ed57bec0e6c511" ON "bridge_transfer_state" ("tx_hash") `) + await db.query(`CREATE TABLE "governance_proposal" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "proposal_id" numeric NOT NULL, "description" text, "proposer" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "tx_hash" text NOT NULL, "start_block" numeric NOT NULL, "end_block" numeric NOT NULL, "targets" text array NOT NULL, "values" text array NOT NULL, "signatures" text array NOT NULL, "calldatas" text array NOT NULL, "last_updated" TIMESTAMP WITH TIME ZONE NOT NULL, "status" character varying(9) NOT NULL, "quorum" numeric NOT NULL, "choices" text array NOT NULL, "scores" text array NOT NULL, CONSTRAINT "PK_d71b4171baf362416ecfc414531" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_fe8a40923244f99e670b62c14d" ON "governance_proposal" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_eea14b5ba6065f9484dfaa00c6" ON "governance_proposal" ("address") `) + await db.query(`CREATE INDEX "IDX_f5e7947b0d485de963eca0567b" ON "governance_proposal" ("tx_hash") `) + await db.query(`CREATE TABLE "governance_proposal_event" ("id" character varying NOT NULL, "tx_hash" text NOT NULL, "event" character varying(8) NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "proposal_id" character varying, CONSTRAINT "PK_94661d292cb01ea76ba8871ec2b" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_89f2a1078c9c9d8f63c270ba39" ON "governance_proposal_event" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_ce984d23fc99c537b8f22fd663" ON "governance_proposal_event" ("proposal_id") `) + await db.query(`CREATE TABLE "governance_proposal_vote" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "voter" text NOT NULL, "weight" numeric NOT NULL, "type" character varying(7) NOT NULL, "tx_hash" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "proposal_id" character varying, CONSTRAINT "PK_e13a15bfb5ccfdec4c19975de87" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_5531af241c24a09c854ead9d55" ON "governance_proposal_vote" ("proposal_id") `) + await db.query(`CREATE INDEX "IDX_adc6eb148ad48697e74d23c722" ON "governance_proposal_vote" ("voter") `) + await db.query(`CREATE TABLE "legacy_staker" ("id" character varying NOT NULL, "input_amount" numeric NOT NULL, "output_amount" numeric NOT NULL, "balance" numeric NOT NULL, "reward_amount" numeric NOT NULL, CONSTRAINT "PK_11a12e3c39ce22c9a05990c9a56" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "beacon_deposit_pubkey" ("id" character varying NOT NULL, "create_date" TIMESTAMP WITH TIME ZONE NOT NULL, "last_updated" TIMESTAMP WITH TIME ZONE NOT NULL, "count" integer NOT NULL, CONSTRAINT "PK_4741993dcf81760e9777dec18a7" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "beacon_deposit_event" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "address" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "caller" text NOT NULL, "withdrawal_credentials" text NOT NULL, "amount" text NOT NULL, "signature" text NOT NULL, "index" text NOT NULL, "pubkey_id" character varying, CONSTRAINT "PK_1ebc083560d266f487bd7098f43" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_4b157d82fc2a709b1cdd1b056a" ON "beacon_deposit_event" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_92a49797f76dbbacf77bbc5291" ON "beacon_deposit_event" ("address") `) + await db.query(`CREATE INDEX "IDX_682ca401d8eb6b21267621c349" ON "beacon_deposit_event" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_14a73117a1c3655d0df3e246df" ON "beacon_deposit_event" ("block_number") `) + await db.query(`CREATE INDEX "IDX_5a85c2519463653ac015291db4" ON "beacon_deposit_event" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_c27461303e85eb671a3cb730b4" ON "beacon_deposit_event" ("caller") `) + await db.query(`CREATE INDEX "IDX_dff55f23cfcfa0ff664964572f" ON "beacon_deposit_event" ("pubkey_id") `) + await db.query(`CREATE TABLE "oeth_vault" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "weth" numeric NOT NULL, "st_eth" numeric NOT NULL, "r_eth" numeric NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_9debaa84944fe2be9dc4219ba8f" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_d6298a294864b4eaf793cf35a4" ON "oeth_vault" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_e20cb507a673817b2c68720415" ON "oeth_vault" ("block_number") `) + await db.query(`CREATE TABLE "oeth_curve_lp" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "total_supply" numeric NOT NULL, "eth" numeric NOT NULL, "oeth" numeric NOT NULL, "total_supply_owned" numeric NOT NULL, "eth_owned" numeric NOT NULL, "oeth_owned" numeric NOT NULL, CONSTRAINT "PK_2b055044664e80f44d6172fdf54" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_d9bbd20e888fa1b4b2c5d2f039" ON "oeth_curve_lp" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_7617d593c36dce1b1565a8d74a" ON "oeth_curve_lp" ("block_number") `) + await db.query(`CREATE TABLE "oeth_frax_staking" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "sfrx_eth" numeric NOT NULL, CONSTRAINT "PK_694f53c8600ae88c7bdcf7305dd" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_ce6c2c65e90967dfeaac97025b" ON "oeth_frax_staking" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_1a7f7d650390e2f9c212651e05" ON "oeth_frax_staking" ("block_number") `) + await db.query(`CREATE TABLE "oeth_morpho_aave" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "weth" numeric NOT NULL, CONSTRAINT "PK_86de8f846e9335c92b8ad7df3a1" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_25e239b985844f1d33fac79981" ON "oeth_morpho_aave" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_a6662224e95eb6921bb14cb5f9" ON "oeth_morpho_aave" ("block_number") `) + await db.query(`CREATE TABLE "oeth_dripper" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "weth" numeric NOT NULL, "last_collect_timestamp" integer NOT NULL, "drip_rate_per_block" numeric NOT NULL, "drip_duration" numeric NOT NULL, CONSTRAINT "PK_77731281c1564c24eff0c265984" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_16ac742ceeb05d28e530da9649" ON "oeth_dripper" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_d356832c14603916a492608e7b" ON "oeth_dripper" ("block_number") `) + await db.query(`CREATE TABLE "oeth_balancer_meta_pool_strategy" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "r_eth" numeric NOT NULL, "weth" numeric NOT NULL, CONSTRAINT "PK_6ddf5b8ba878e6d706e59bd6de0" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_5e7ef383756fa18cb602f50089" ON "oeth_balancer_meta_pool_strategy" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_11d344b3e0e03cdb6697dd61f7" ON "oeth_balancer_meta_pool_strategy" ("block_number") `) + await db.query(`CREATE TABLE "oeth_strategy_holding_daily_stat" ("id" character varying NOT NULL, "symbol" text NOT NULL, "amount" numeric NOT NULL, "value" numeric NOT NULL, "strategy_daily_stat_id_id" character varying, CONSTRAINT "PK_7f1a62da5e53cf264c2f39b4acf" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_4e867f220975e615e6077d860c" ON "oeth_strategy_holding_daily_stat" ("strategy_daily_stat_id_id") `) + await db.query(`CREATE TABLE "oeth_strategy_daily_stat" ("id" character varying NOT NULL, "name" text NOT NULL, "total" numeric NOT NULL, "tvl" numeric NOT NULL, "daily_stat_id_id" character varying, CONSTRAINT "PK_8af1a0c60e67b05baf928787a8e" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_6c7096c96a000d8471256ca8fc" ON "oeth_strategy_daily_stat" ("daily_stat_id_id") `) + await db.query(`CREATE TABLE "oeth_collateral_daily_stat" ("id" character varying NOT NULL, "symbol" text NOT NULL, "amount" numeric NOT NULL, "price" numeric NOT NULL, "value" numeric NOT NULL, "daily_stat_id_id" character varying, CONSTRAINT "PK_5fb23d7bae30dffe4543e7aa069" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_a90045de50406be7bd56efd3ea" ON "oeth_collateral_daily_stat" ("daily_stat_id_id") `) + await db.query(`CREATE TABLE "oeth_daily_stat" ("id" character varying NOT NULL, "block_number" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "apr" numeric NOT NULL, "apy" numeric NOT NULL, "apy7_day_avg" numeric NOT NULL, "apy14_day_avg" numeric NOT NULL, "apy30_day_avg" numeric NOT NULL, "total_supply" numeric NOT NULL, "total_supply_usd" numeric NOT NULL, "rebasing_supply" numeric NOT NULL, "non_rebasing_supply" numeric NOT NULL, "amo_supply" numeric NOT NULL, "dripper_weth" numeric NOT NULL, "wrapped_supply" numeric NOT NULL, "trading_volume_usd" numeric NOT NULL, "yield_eth" numeric NOT NULL, "yield_eth7_day" numeric NOT NULL, "yield_eth_all_time" numeric NOT NULL, "yield_usd" numeric NOT NULL, "yield_usd7_day" numeric NOT NULL, "yield_usd_all_time" numeric NOT NULL, "fees_eth" numeric NOT NULL, "fees_eth7_day" numeric NOT NULL, "fees_eth_all_time" numeric NOT NULL, "fees_usd" numeric NOT NULL, "fees_usd7_day" numeric NOT NULL, "fees_usd_all_time" numeric NOT NULL, "peg_price" numeric NOT NULL, "market_cap_usd" numeric NOT NULL, "holders_over_threshold" integer NOT NULL, CONSTRAINT "PK_9144a02ab13b1baa818a7d5eae5" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_98d9001013aa37425ca47b7126" ON "oeth_daily_stat" ("block_number") `) + await db.query(`CREATE INDEX "IDX_c3e66051c7df4efd6a8fa8f9c1" ON "oeth_daily_stat" ("timestamp") `) + await db.query(`CREATE TABLE "oeth_reward_token_collected" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "strategy" text NOT NULL, "recipient" text NOT NULL, "reward_token" text NOT NULL, "amount" numeric NOT NULL, CONSTRAINT "PK_47098cc5fbc7cb95c2374fa33cd" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_81a9fa43ae4a6ae63e4103127b" ON "oeth_reward_token_collected" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_d36c78b9c3e9d737f067638bc4" ON "oeth_reward_token_collected" ("block_number") `) + await db.query(`CREATE TABLE "oeth_withdrawal_request" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "request_id" numeric NOT NULL, "withdrawer" text NOT NULL, "amount" numeric NOT NULL, "queued" numeric NOT NULL, "claimed" boolean NOT NULL, "tx_hash" text NOT NULL, CONSTRAINT "PK_93e4b80f8ae8723a3b38f94b26a" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_22ebb6be552c90b2c99b165cde" ON "oeth_withdrawal_request" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_fd1acb337d03a48f775c22edcd" ON "oeth_withdrawal_request" ("block_number") `) + await db.query(`CREATE INDEX "IDX_2733a93f9fc9cf900ac1de1a0d" ON "oeth_withdrawal_request" ("tx_hash") `) + await db.query(`CREATE TABLE "ogv" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "circulating" numeric NOT NULL, "staked" numeric NOT NULL, "total" numeric NOT NULL, CONSTRAINT "PK_f16038abf451ce82bd03ea54ee7" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_2418a8b8b92b2f5977be761cf9" ON "ogv" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_b8f20bcf48e4aa77e0f48d77db" ON "ogv" ("block_number") `) + await db.query(`CREATE TABLE "ogv_address" ("id" character varying NOT NULL, "balance" numeric NOT NULL, "staked" numeric NOT NULL, "veogv_balance" numeric NOT NULL, "voting_power" numeric NOT NULL, "last_updated" TIMESTAMP WITH TIME ZONE NOT NULL, "delegatee_id" character varying, CONSTRAINT "PK_f13c77575687ef480ca0b7de5d8" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_49d26f287904b8b1aef6e9ac2b" ON "ogv_address" ("delegatee_id") `) + await db.query(`CREATE TABLE "ogv_lockup" ("id" character varying NOT NULL, "lockup_id" text NOT NULL, "amount" numeric NOT NULL, "end" TIMESTAMP WITH TIME ZONE NOT NULL, "veogv" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "address_id" character varying, CONSTRAINT "PK_6b6d5ed3a004dd3f546c1b11fa4" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_8114101b53d9d6bc26fe80838a" ON "ogv_lockup" ("lockup_id") `) + await db.query(`CREATE INDEX "IDX_8be94cd63e35b91adf1301a156" ON "ogv_lockup" ("address_id") `) + await db.query(`CREATE TABLE "ogv_lockup_tx_log" ("id" character varying NOT NULL, "hash" text NOT NULL, "event" character varying(8) NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "total_supply" numeric NOT NULL, "ogv_lockup_id" character varying, CONSTRAINT "PK_1c4a8425ce42f0c9da10056adee" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_b49fca291c97d9b55cd91f935f" ON "ogv_lockup_tx_log" ("ogv_lockup_id") `) + await db.query(`CREATE TABLE "ogv_proposal" ("id" character varying NOT NULL, "description" text, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "start_block" numeric NOT NULL, "end_block" numeric NOT NULL, "last_updated" TIMESTAMP WITH TIME ZONE NOT NULL, "status" character varying(9) NOT NULL, "quorum" numeric NOT NULL, "choices" text array NOT NULL, "scores" text array NOT NULL, "proposer_id" character varying, CONSTRAINT "PK_b06db02b26fa37882e013579407" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_c62be3f16dfb3e4a09525c85af" ON "ogv_proposal" ("proposer_id") `) + await db.query(`CREATE TABLE "ogv_proposal_tx_log" ("id" character varying NOT NULL, "hash" text NOT NULL, "event" character varying(8) NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "proposal_id" character varying, CONSTRAINT "PK_da43c287069bba678ca5c60b1ad" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_5d5f5e10892290ee366d26de7d" ON "ogv_proposal_tx_log" ("proposal_id") `) + await db.query(`CREATE TABLE "ogv_proposal_vote" ("id" character varying NOT NULL, "weight" numeric NOT NULL, "type" character varying(7) NOT NULL, "tx_hash" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "proposal_id" character varying, "voter_id" character varying, CONSTRAINT "PK_93c03f35b95221586cb8b83f523" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_58d732bc6523c2609d2725cc0a" ON "ogv_proposal_vote" ("proposal_id") `) + await db.query(`CREATE INDEX "IDX_2fd621aea353448fb3f17721bc" ON "ogv_proposal_vote" ("voter_id") `) + await db.query(`CREATE TABLE "ogv_daily_stat" ("id" character varying NOT NULL, "block_number" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "total_supply" numeric NOT NULL, "total_supply_usd" numeric NOT NULL, "total_staked" numeric NOT NULL, "trading_volume_usd" numeric NOT NULL, "market_cap_usd" numeric NOT NULL, "price_usd" numeric NOT NULL, "holders_over_threshold" integer NOT NULL, CONSTRAINT "PK_69bc6d866711151e2712481794c" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_c974bde87107cacae6d3654972" ON "ogv_daily_stat" ("block_number") `) + await db.query(`CREATE INDEX "IDX_b62fa80951183bb0acf8a5e8b9" ON "ogv_daily_stat" ("timestamp") `) + await db.query(`CREATE TABLE "o_token" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "otoken" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "total_supply" numeric NOT NULL, "rebasing_supply" numeric NOT NULL, "non_rebasing_supply" numeric NOT NULL, CONSTRAINT "PK_4450ef96d5e51ef55bc8ea0b53e" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_1da06ba7d2c0a02d01d1b7a6c0" ON "o_token" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_0851d95d178f682d279a04ebf9" ON "o_token" ("otoken") `) + await db.query(`CREATE INDEX "IDX_7889d6ce061da066df89309e51" ON "o_token" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_4633929013f5ba465cb00e5a95" ON "o_token" ("block_number") `) + await db.query(`CREATE TABLE "o_token_asset" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "otoken" text NOT NULL, "address" text NOT NULL, "symbol" text NOT NULL, CONSTRAINT "PK_eb502dc2745e676b217ea3e0323" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_2eb2f24563a058f9d6e746ed47" ON "o_token_asset" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_7a26c80564bf5fe4e414125e99" ON "o_token_asset" ("otoken") `) + await db.query(`CREATE INDEX "IDX_53e8f932900b50984e1c30e7c0" ON "o_token_asset" ("address") `) + await db.query(`CREATE TABLE "o_token_history" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "otoken" text NOT NULL, "value" numeric NOT NULL, "balance" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "type" character varying(8) NOT NULL, "address_id" character varying, CONSTRAINT "PK_adba161a29081a0a47532807da8" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_3200b91c04a72dda2312eb518c" ON "o_token_history" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_b4b39e42a6d2604b34082c4c80" ON "o_token_history" ("otoken") `) + await db.query(`CREATE INDEX "IDX_2f1457755464ec5951d1e96542" ON "o_token_history" ("address_id") `) + await db.query(`CREATE INDEX "IDX_42142d191ea0408fb511f9f576" ON "o_token_history" ("block_number") `) + await db.query(`CREATE INDEX "IDX_f87d86cfca9ef211ba1b18d2bc" ON "o_token_history" ("tx_hash") `) + await db.query(`CREATE TABLE "o_token_address" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "otoken" text NOT NULL, "address" text NOT NULL, "is_contract" boolean NOT NULL, "rebasing_option" character varying(6) NOT NULL, "balance" numeric NOT NULL, "earned" numeric NOT NULL, "credits" numeric NOT NULL, "last_updated" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_5d5d2b6f8a94da6ed63aac85194" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_7cbc465ce1e9ae06dfe3a8c625" ON "o_token_address" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_5342c499e930e396bade7faeb6" ON "o_token_address" ("otoken") `) + await db.query(`CREATE INDEX "IDX_75c7d29bf71b393e99c4407885" ON "o_token_address" ("address") `) + await db.query(`CREATE TABLE "o_token_apy" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "otoken" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "date" text NOT NULL, "apr" numeric NOT NULL, "apy" numeric NOT NULL, "apy7_day_avg" numeric NOT NULL, "apy14_day_avg" numeric NOT NULL, "apy30_day_avg" numeric NOT NULL, "rebasing_credits_per_token" numeric NOT NULL, CONSTRAINT "PK_132f1c9570d48b38184ca5ac4cc" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_5d9294486b1c57df8c3aad5145" ON "o_token_apy" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_4d4f1b0d9e7f6903a2038c6c38" ON "o_token_apy" ("otoken") `) + await db.query(`CREATE INDEX "IDX_5b81f5a25e913cc7bf1d4c145a" ON "o_token_apy" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_79f0934481fe045319c864cd84" ON "o_token_apy" ("block_number") `) + await db.query(`CREATE INDEX "IDX_f5f416a1490ee2007a9c7593d0" ON "o_token_apy" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_a98d74fc6af6f3a599fe1ba7fb" ON "o_token_apy" ("date") `) + await db.query(`CREATE TABLE "o_token_rebase" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "otoken" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "total_supply" numeric NOT NULL, "rebasing_credits" numeric NOT NULL, "rebasing_credits_per_token" numeric NOT NULL, "fee_eth" numeric NOT NULL, "fee_usd" numeric NOT NULL, "yield_eth" numeric NOT NULL, "yield_usd" numeric NOT NULL, "apy_id" character varying, CONSTRAINT "PK_f8e636dc692c399dd1ead98c720" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_83666ab47ff5ef0c56bf40d122" ON "o_token_rebase" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_3fb75a6c8b831ca4d201d60e01" ON "o_token_rebase" ("otoken") `) + await db.query(`CREATE INDEX "IDX_15ef53e2bdcc3034ab8adea1f1" ON "o_token_rebase" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_b0c6feb890a83dcca572302371" ON "o_token_rebase" ("block_number") `) + await db.query(`CREATE INDEX "IDX_7170f89052507f34d8563f7016" ON "o_token_rebase" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_b8653270b96fc932f077b26441" ON "o_token_rebase" ("apy_id") `) + await db.query(`CREATE TABLE "o_token_rebase_option" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "otoken" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "status" character varying(6) NOT NULL, "address_id" character varying, CONSTRAINT "PK_8b52df258c40e8347a66922f63e" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_5dfc53108b110d42994d02a832" ON "o_token_rebase_option" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_5936af713ee8131983812703b2" ON "o_token_rebase_option" ("otoken") `) + await db.query(`CREATE INDEX "IDX_cb07bc901206c5da63eacff7df" ON "o_token_rebase_option" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_95bab764e1a63ea0778dca4038" ON "o_token_rebase_option" ("block_number") `) + await db.query(`CREATE INDEX "IDX_00fff31b07544c1739afce542c" ON "o_token_rebase_option" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_da7296f8011232dc8675477b84" ON "o_token_rebase_option" ("address_id") `) + await db.query(`CREATE TABLE "o_token_vault" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "otoken" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "address" text NOT NULL, "total_value" numeric NOT NULL, CONSTRAINT "PK_90bb3a4df699017439cd6a44a0c" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_6990f4cd71ea8db6d9d27a0db5" ON "o_token_vault" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_2c88ea3e889e76b037d8f59c96" ON "o_token_vault" ("otoken") `) + await db.query(`CREATE INDEX "IDX_091cfbe0d977006e05144bd1fe" ON "o_token_vault" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_fa92b36d011441a02d9a231860" ON "o_token_vault" ("block_number") `) + await db.query(`CREATE INDEX "IDX_3a2bfb2808c1d7cbb0a568910c" ON "o_token_vault" ("address") `) + await db.query(`CREATE TABLE "o_token_activity" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "otoken" text NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "call_data_last4_bytes" text NOT NULL, "address" text, "sighash" text, "action" text, "exchange" text, "interface" text, "from_symbol" text, "to_symbol" text, "amount" numeric, CONSTRAINT "PK_a6e9207d04e252b4de591283276" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_9c617918c3dc521bed5220a185" ON "o_token_activity" ("chain_id") `) + await db.query(`CREATE INDEX "IDX_62bfeb1dee3bcefffdbd10172a" ON "o_token_activity" ("otoken") `) + await db.query(`CREATE INDEX "IDX_57bb1f7d2fd6fe063b9cd434b2" ON "o_token_activity" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_d6cba0877ee9f5332e6d97e758" ON "o_token_activity" ("block_number") `) + await db.query(`CREATE INDEX "IDX_b5826e68934ff671bbe28836ec" ON "o_token_activity" ("tx_hash") `) + await db.query(`CREATE TABLE "ousd_vault" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "dai" numeric NOT NULL, "usdt" numeric NOT NULL, "usdc" numeric NOT NULL, CONSTRAINT "PK_343f5538c71a1cd78f1659ef9d3" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_6860186ea2f56e2c7d54c22107" ON "ousd_vault" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_0d0a7113a505cf7f7adea9ca81" ON "ousd_vault" ("block_number") `) + await db.query(`CREATE TABLE "ousd_morpho_aave" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "dai" numeric NOT NULL, "usdt" numeric NOT NULL, "usdc" numeric NOT NULL, CONSTRAINT "PK_60676cde905a822ba73ff3a5c85" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_78e0701c2e9a28242db37bd8f8" ON "ousd_morpho_aave" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_46ccf673b376d654052fbd53e6" ON "ousd_morpho_aave" ("block_number") `) + await db.query(`CREATE TABLE "ousd_morpho_compound" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "dai" numeric NOT NULL, "usdt" numeric NOT NULL, "usdc" numeric NOT NULL, CONSTRAINT "PK_5f715d53ef8fc0fad595cacf4fa" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_9e7bd0d8ae23b877d5979ef80c" ON "ousd_morpho_compound" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_0bb3a0ad84071f1d80f6d4e90f" ON "ousd_morpho_compound" ("block_number") `) + await db.query(`CREATE TABLE "maker_dsr_strategy" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "dai" numeric NOT NULL, CONSTRAINT "PK_196da2d6910009ae04e3542fe22" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_a35308a3c5dbaab2d321eb1525" ON "maker_dsr_strategy" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_844b219d8faf9b1d24ab2dba9a" ON "maker_dsr_strategy" ("block_number") `) + await db.query(`CREATE TABLE "ousd_flux_strategy" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "dai" numeric NOT NULL, "usdt" numeric NOT NULL, "usdc" numeric NOT NULL, CONSTRAINT "PK_ac977221429e50e4de1ce253a8b" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_5b165b5d30b13e363d33a66e14" ON "ousd_flux_strategy" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_80f3392968fde7b99cccb805ac" ON "ousd_flux_strategy" ("block_number") `) + await db.query(`CREATE TABLE "ousd_compound_strategy" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "dai" numeric NOT NULL, "usdt" numeric NOT NULL, "usdc" numeric NOT NULL, CONSTRAINT "PK_9030e82bf3479d03c04e0d1919c" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_6920b1db5dc577295ac4d1379d" ON "ousd_compound_strategy" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_89c6d7d3104bd36dc88a37add4" ON "ousd_compound_strategy" ("block_number") `) + await db.query(`CREATE TABLE "ousd_convex_strategy" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "dai" numeric NOT NULL, "usdt" numeric NOT NULL, "usdc" numeric NOT NULL, CONSTRAINT "PK_2b8f6e749e15e49d8816f1ac949" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_2deac473cd0b2dd7082e7da148" ON "ousd_convex_strategy" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_157bf74171817dc5c60ee37036" ON "ousd_convex_strategy" ("block_number") `) + await db.query(`CREATE TABLE "ousd_aave_strategy" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "dai" numeric NOT NULL, "usdt" numeric NOT NULL, "usdc" numeric NOT NULL, CONSTRAINT "PK_b4b7ac6e395aa722df500f93623" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_ca34b5a0a33bc9abdd8213c2fa" ON "ousd_aave_strategy" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_dacd7c98223d7bc8be074d71e4" ON "ousd_aave_strategy" ("block_number") `) + await db.query(`CREATE TABLE "ousd_meta_strategy" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "dai" numeric NOT NULL, "usdt" numeric NOT NULL, "usdc" numeric NOT NULL, CONSTRAINT "PK_d99170af73d86fe74460bbfacc4" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_7e998dcf775263bc5df76ef987" ON "ousd_meta_strategy" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_55ce185680512d6a5b9fb0af89" ON "ousd_meta_strategy" ("block_number") `) + await db.query(`CREATE TABLE "ousd_convex_lusd_plus3_crv" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "dai" numeric NOT NULL, "usdt" numeric NOT NULL, "usdc" numeric NOT NULL, CONSTRAINT "PK_47290aa5dfa3cc5595f468e2f39" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_0783af95efb35fb3f13cde1656" ON "ousd_convex_lusd_plus3_crv" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_74ae01fb596a4f2733087ba454" ON "ousd_convex_lusd_plus3_crv" ("block_number") `) + await db.query(`CREATE TABLE "ousd_strategy_holding_daily_stat" ("id" character varying NOT NULL, "symbol" text NOT NULL, "amount" numeric NOT NULL, "value" numeric NOT NULL, "strategy_daily_stat_id_id" character varying, CONSTRAINT "PK_ef2f51867e1d465c554262efd1b" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_e1a93bab3d12271dc114234d3a" ON "ousd_strategy_holding_daily_stat" ("strategy_daily_stat_id_id") `) + await db.query(`CREATE TABLE "ousd_strategy_daily_stat" ("id" character varying NOT NULL, "name" text NOT NULL, "total" numeric NOT NULL, "tvl" numeric NOT NULL, "daily_stat_id_id" character varying, CONSTRAINT "PK_ac65d3f28f290211ddeb950e157" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_3edda581683682257159cb0863" ON "ousd_strategy_daily_stat" ("daily_stat_id_id") `) + await db.query(`CREATE TABLE "ousd_collateral_daily_stat" ("id" character varying NOT NULL, "symbol" text NOT NULL, "amount" numeric NOT NULL, "price" numeric NOT NULL, "value" numeric NOT NULL, "daily_stat_id_id" character varying, CONSTRAINT "PK_85a804677f14a0784914e27b7b9" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_78be9d3f3dc1f31cf17ae810fe" ON "ousd_collateral_daily_stat" ("daily_stat_id_id") `) + await db.query(`CREATE TABLE "ousd_daily_stat" ("id" character varying NOT NULL, "block_number" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "apr" numeric NOT NULL, "apy" numeric NOT NULL, "apy7_day_avg" numeric NOT NULL, "apy14_day_avg" numeric NOT NULL, "apy30_day_avg" numeric NOT NULL, "total_supply" numeric NOT NULL, "total_supply_usd" numeric NOT NULL, "rebasing_supply" numeric NOT NULL, "non_rebasing_supply" numeric NOT NULL, "amo_supply" numeric NOT NULL, "dripper_weth" numeric NOT NULL, "wrapped_supply" numeric NOT NULL, "trading_volume_usd" numeric NOT NULL, "yield_eth" numeric NOT NULL, "yield_eth7_day" numeric NOT NULL, "yield_eth_all_time" numeric NOT NULL, "yield_usd" numeric NOT NULL, "yield_usd7_day" numeric NOT NULL, "yield_usd_all_time" numeric NOT NULL, "fees_eth" numeric NOT NULL, "fees_eth7_day" numeric NOT NULL, "fees_eth_all_time" numeric NOT NULL, "fees_usd" numeric NOT NULL, "fees_usd7_day" numeric NOT NULL, "fees_usd_all_time" numeric NOT NULL, "peg_price" numeric NOT NULL, "market_cap_usd" numeric NOT NULL, "holders_over_threshold" integer NOT NULL, CONSTRAINT "PK_f8adaf321a99f2b4b877c262880" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_f9020d89932aad2d0de8923490" ON "ousd_daily_stat" ("block_number") `) + await db.query(`CREATE INDEX "IDX_0bb5f72bf5fa59ce8c232caa4c" ON "ousd_daily_stat" ("timestamp") `) + await db.query(`ALTER TABLE "es_account" ADD CONSTRAINT "FK_7b43e7bb90d3b435d074112f572" FOREIGN KEY ("delegate_to_id") REFERENCES "es_account"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "es_lockup_event" ADD CONSTRAINT "FK_46d53d4fad340d5939955836004" FOREIGN KEY ("lockup_id") REFERENCES "es_lockup"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "governance_proposal_event" ADD CONSTRAINT "FK_ce984d23fc99c537b8f22fd663a" FOREIGN KEY ("proposal_id") REFERENCES "governance_proposal"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "governance_proposal_vote" ADD CONSTRAINT "FK_5531af241c24a09c854ead9d551" FOREIGN KEY ("proposal_id") REFERENCES "governance_proposal"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "beacon_deposit_event" ADD CONSTRAINT "FK_dff55f23cfcfa0ff664964572ff" FOREIGN KEY ("pubkey_id") REFERENCES "beacon_deposit_pubkey"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "oeth_strategy_holding_daily_stat" ADD CONSTRAINT "FK_4e867f220975e615e6077d860c1" FOREIGN KEY ("strategy_daily_stat_id_id") REFERENCES "oeth_strategy_daily_stat"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "oeth_strategy_daily_stat" ADD CONSTRAINT "FK_6c7096c96a000d8471256ca8fc3" FOREIGN KEY ("daily_stat_id_id") REFERENCES "oeth_daily_stat"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "oeth_collateral_daily_stat" ADD CONSTRAINT "FK_a90045de50406be7bd56efd3ea4" FOREIGN KEY ("daily_stat_id_id") REFERENCES "oeth_daily_stat"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ogv_address" ADD CONSTRAINT "FK_49d26f287904b8b1aef6e9ac2b3" FOREIGN KEY ("delegatee_id") REFERENCES "ogv_address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ogv_lockup" ADD CONSTRAINT "FK_8be94cd63e35b91adf1301a156c" FOREIGN KEY ("address_id") REFERENCES "ogv_address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ogv_lockup_tx_log" ADD CONSTRAINT "FK_b49fca291c97d9b55cd91f935f3" FOREIGN KEY ("ogv_lockup_id") REFERENCES "ogv_lockup"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ogv_proposal" ADD CONSTRAINT "FK_c62be3f16dfb3e4a09525c85af8" FOREIGN KEY ("proposer_id") REFERENCES "ogv_address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ogv_proposal_tx_log" ADD CONSTRAINT "FK_5d5f5e10892290ee366d26de7dc" FOREIGN KEY ("proposal_id") REFERENCES "ogv_proposal"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ogv_proposal_vote" ADD CONSTRAINT "FK_58d732bc6523c2609d2725cc0ac" FOREIGN KEY ("proposal_id") REFERENCES "ogv_proposal"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ogv_proposal_vote" ADD CONSTRAINT "FK_2fd621aea353448fb3f17721bc8" FOREIGN KEY ("voter_id") REFERENCES "ogv_address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "o_token_history" ADD CONSTRAINT "FK_2f1457755464ec5951d1e96542a" FOREIGN KEY ("address_id") REFERENCES "o_token_address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "o_token_rebase" ADD CONSTRAINT "FK_b8653270b96fc932f077b26441d" FOREIGN KEY ("apy_id") REFERENCES "o_token_apy"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "o_token_rebase_option" ADD CONSTRAINT "FK_da7296f8011232dc8675477b841" FOREIGN KEY ("address_id") REFERENCES "o_token_address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ousd_strategy_holding_daily_stat" ADD CONSTRAINT "FK_e1a93bab3d12271dc114234d3ae" FOREIGN KEY ("strategy_daily_stat_id_id") REFERENCES "ousd_strategy_daily_stat"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ousd_strategy_daily_stat" ADD CONSTRAINT "FK_3edda581683682257159cb08638" FOREIGN KEY ("daily_stat_id_id") REFERENCES "ousd_daily_stat"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "ousd_collateral_daily_stat" ADD CONSTRAINT "FK_78be9d3f3dc1f31cf17ae810fee" FOREIGN KEY ("daily_stat_id_id") REFERENCES "ousd_daily_stat"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + } + + async down(db) { + await db.query(`DROP TABLE "es_token"`) + await db.query(`DROP INDEX "public"."IDX_a234e56547c4f8b9135d80444b"`) + await db.query(`DROP INDEX "public"."IDX_588f0be9f9bdc1d8dd29797fec"`) + await db.query(`DROP TABLE "es_account"`) + await db.query(`DROP INDEX "public"."IDX_eb97a0d869e67af870987d6d85"`) + await db.query(`DROP INDEX "public"."IDX_93fea1d847b38c9982626e5fd1"`) + await db.query(`DROP INDEX "public"."IDX_bc09480c9d1b13806f82337b5e"`) + await db.query(`DROP INDEX "public"."IDX_7b43e7bb90d3b435d074112f57"`) + await db.query(`DROP TABLE "es_yield"`) + await db.query(`DROP INDEX "public"."IDX_aa3649a103464d797c959294d1"`) + await db.query(`DROP INDEX "public"."IDX_700ebb527927ee781c0750b0dc"`) + await db.query(`DROP INDEX "public"."IDX_e2d3a1ddc3f0886f51556442bb"`) + await db.query(`DROP INDEX "public"."IDX_4fdca11723165347776a9a7110"`) + await db.query(`DROP TABLE "es_lockup_event"`) + await db.query(`DROP INDEX "public"."IDX_512bb02117d66720b0c72fe2d2"`) + await db.query(`DROP INDEX "public"."IDX_953fc73b0a9873292b633601e0"`) + await db.query(`DROP INDEX "public"."IDX_9584d0dce1144609a1a9a0c579"`) + await db.query(`DROP INDEX "public"."IDX_bb14524b2db1cbbf66d1729aba"`) + await db.query(`DROP INDEX "public"."IDX_e1eb81715da4d4a8281616a39f"`) + await db.query(`DROP INDEX "public"."IDX_46d53d4fad340d593995583600"`) + await db.query(`DROP TABLE "es_lockup"`) + await db.query(`DROP INDEX "public"."IDX_15e9dc0d375d6f2687def01843"`) + await db.query(`DROP INDEX "public"."IDX_f3c10b1e75f626e1aaeaa3cfc3"`) + await db.query(`DROP INDEX "public"."IDX_5dd7ffdf1c625829f7eb79ee27"`) + await db.query(`DROP INDEX "public"."IDX_31b53c3e4649bde773d707b2a0"`) + await db.query(`DROP INDEX "public"."IDX_2434b29d48e045849fc12cef7c"`) + await db.query(`DROP TABLE "es_delegate_changed"`) + await db.query(`DROP INDEX "public"."IDX_76c1740192ed8b589f7b5a21c8"`) + await db.query(`DROP INDEX "public"."IDX_ed5ea936cde8d62b485ce45a13"`) + await db.query(`DROP INDEX "public"."IDX_22f639893bc36efe524a3bbca7"`) + await db.query(`DROP INDEX "public"."IDX_ed12aa7ace584cc494012a0e5b"`) + await db.query(`DROP INDEX "public"."IDX_e234755c68bb8d7f9cfd511126"`) + await db.query(`DROP INDEX "public"."IDX_cda0b80789007b35cf5430966f"`) + await db.query(`DROP TABLE "es_delegate_votes_changed"`) + await db.query(`DROP INDEX "public"."IDX_4e20cdc38777932fadd008f6e4"`) + await db.query(`DROP INDEX "public"."IDX_076fb50935afa2f319f1d16752"`) + await db.query(`DROP INDEX "public"."IDX_338d2483a33dc74d360d2a44c5"`) + await db.query(`DROP INDEX "public"."IDX_e0e6b12e50b95fb9b99c28df90"`) + await db.query(`DROP INDEX "public"."IDX_60ea37f13fc3b16e491926314f"`) + await db.query(`DROP INDEX "public"."IDX_bd6f657c57e5a92a8dd3fe6b4e"`) + await db.query(`DROP TABLE "es_penalty"`) + await db.query(`DROP INDEX "public"."IDX_59fa17e121ecd2bead0a71cf85"`) + await db.query(`DROP INDEX "public"."IDX_785a65f92c61edd176415e22ad"`) + await db.query(`DROP INDEX "public"."IDX_7402aa565f5e2023e310610240"`) + await db.query(`DROP INDEX "public"."IDX_8595139811169d26aa210f8a8d"`) + await db.query(`DROP INDEX "public"."IDX_9f560f23bcdd81e13141c02125"`) + await db.query(`DROP INDEX "public"."IDX_adc7f2fe26e4a36690a343339b"`) + await db.query(`DROP TABLE "es_reward"`) + await db.query(`DROP INDEX "public"."IDX_e05d0476721dfcf9152b58fc30"`) + await db.query(`DROP INDEX "public"."IDX_f01dea25da96f8d8eaec9b6f60"`) + await db.query(`DROP INDEX "public"."IDX_2f3b61cc072d95ad0796b9caa3"`) + await db.query(`DROP INDEX "public"."IDX_a3d39d7235e278255a5217d1df"`) + await db.query(`DROP INDEX "public"."IDX_d17aab47907d6816138ab2a7fa"`) + await db.query(`DROP INDEX "public"."IDX_b623db55430fefda84dfdf2949"`) + await db.query(`DROP TABLE "es_stake"`) + await db.query(`DROP INDEX "public"."IDX_385357cc5f41796615d8880190"`) + await db.query(`DROP INDEX "public"."IDX_e7bcc8120e2c256db6ebd01575"`) + await db.query(`DROP INDEX "public"."IDX_b95e58860bb9ba46d0ec41d246"`) + await db.query(`DROP INDEX "public"."IDX_d059ea472eb9d10f6be2025d40"`) + await db.query(`DROP INDEX "public"."IDX_f629f87d82890ea6f515e1a7a7"`) + await db.query(`DROP INDEX "public"."IDX_2d2f6b568b3145fe6095da5afa"`) + await db.query(`DROP INDEX "public"."IDX_bcb392795674b2cc0af394864c"`) + await db.query(`DROP TABLE "es_unstake"`) + await db.query(`DROP INDEX "public"."IDX_0c51c706a778668dbd5ed9c817"`) + await db.query(`DROP INDEX "public"."IDX_9301687673c195770cdd543049"`) + await db.query(`DROP INDEX "public"."IDX_13fbe169018991ddcfeb4912cb"`) + await db.query(`DROP INDEX "public"."IDX_06c024c53472178d0f5292330a"`) + await db.query(`DROP INDEX "public"."IDX_7d988d60b55dc08addc58835d6"`) + await db.query(`DROP INDEX "public"."IDX_0adcdd08da131e76d618b73db7"`) + await db.query(`DROP INDEX "public"."IDX_cc43898a790e6e1d4bbf145097"`) + await db.query(`DROP TABLE "frrs_reward_collected"`) + await db.query(`DROP INDEX "public"."IDX_41ff7fbd84f0e932ddff4aaeda"`) + await db.query(`DROP INDEX "public"."IDX_6f8728cf12eedec371ec2b5ac3"`) + await db.query(`DROP INDEX "public"."IDX_fe9c300aa3739b7fedae19bee8"`) + await db.query(`DROP INDEX "public"."IDX_748e8278aa0f4327fdb375ce39"`) + await db.query(`DROP INDEX "public"."IDX_76682d76550c1908c0edbf80d6"`) + await db.query(`DROP TABLE "frrs_rewards_per_second_changed"`) + await db.query(`DROP INDEX "public"."IDX_51112ae6ed7acfe5fea9041736"`) + await db.query(`DROP INDEX "public"."IDX_27777adfd6d67ce69177e76777"`) + await db.query(`DROP INDEX "public"."IDX_0f439534e934e9114e93fe0e0e"`) + await db.query(`DROP INDEX "public"."IDX_af32902afcc6d0e38d55b29e68"`) + await db.query(`DROP INDEX "public"."IDX_7a5afd8ca41d81f9841db0f602"`) + await db.query(`DROP TABLE "frrs_rewards_target_change"`) + await db.query(`DROP INDEX "public"."IDX_a6f19822f0e09c509963463fbd"`) + await db.query(`DROP INDEX "public"."IDX_598a7d310b076cf239ae7bcb51"`) + await db.query(`DROP INDEX "public"."IDX_d593e4b975ae4f8d60303b2ba9"`) + await db.query(`DROP INDEX "public"."IDX_9410930fcb952fb4003dc2b2be"`) + await db.query(`DROP INDEX "public"."IDX_14cbad89905ceeb715f8e1a2c8"`) + await db.query(`DROP TABLE "frrs_strategist_updated"`) + await db.query(`DROP INDEX "public"."IDX_47dfa32c5be0528074dcf093d6"`) + await db.query(`DROP INDEX "public"."IDX_2f910a0f9c75adc401d7aa8c0f"`) + await db.query(`DROP INDEX "public"."IDX_301322e4df8e766e7f4cd892fd"`) + await db.query(`DROP INDEX "public"."IDX_7f49f2839212126c3d42fb4bf1"`) + await db.query(`DROP INDEX "public"."IDX_aab8ae0cb29505a7014438675b"`) + await db.query(`DROP TABLE "processing_status"`) + await db.query(`DROP TABLE "exchange_rate"`) + await db.query(`DROP INDEX "public"."IDX_9e23a3f1bf3634820c873a0fe8"`) + await db.query(`DROP INDEX "public"."IDX_c61a93768eed9e58ce399bbe01"`) + await db.query(`DROP TABLE "strategy_balance"`) + await db.query(`DROP INDEX "public"."IDX_bb5bbdf054deadf169e9e0330a"`) + await db.query(`DROP INDEX "public"."IDX_0113bf0b63183bea0d22cd0d08"`) + await db.query(`DROP INDEX "public"."IDX_a88065dcd92011698bbe7df7b1"`) + await db.query(`DROP TABLE "strategy_yield"`) + await db.query(`DROP INDEX "public"."IDX_5108f2a2563d5665892d0c06b0"`) + await db.query(`DROP INDEX "public"."IDX_41c3567c9d43c598e07a0029c5"`) + await db.query(`DROP TABLE "strategy_daily_yield"`) + await db.query(`DROP INDEX "public"."IDX_0ba1974747f1906e0c102cd2cd"`) + await db.query(`DROP INDEX "public"."IDX_df364fb6e82d1feeed2a5dfffa"`) + await db.query(`DROP TABLE "native_balance"`) + await db.query(`DROP INDEX "public"."IDX_45fb48f831ccadcf29f404824a"`) + await db.query(`DROP INDEX "public"."IDX_82d827c3b96fb3c5ab43068502"`) + await db.query(`DROP TABLE "erc20"`) + await db.query(`DROP INDEX "public"."IDX_905ff854e6782fc32dc4268a25"`) + await db.query(`DROP INDEX "public"."IDX_40fd11c1a0d0f2562824894e85"`) + await db.query(`DROP TABLE "erc20_holder"`) + await db.query(`DROP INDEX "public"."IDX_51b9e7c44702ef3a6f05d3702e"`) + await db.query(`DROP TABLE "erc20_state"`) + await db.query(`DROP INDEX "public"."IDX_2b69abb250c647c7a4b5a5a715"`) + await db.query(`DROP INDEX "public"."IDX_c3d08eb2dafe4b5b188924d835"`) + await db.query(`DROP INDEX "public"."IDX_29e8edc6ba8cc37c0c16ff0baf"`) + await db.query(`DROP TABLE "erc20_balance"`) + await db.query(`DROP INDEX "public"."IDX_bb6a884e702f2887037d5a7eec"`) + await db.query(`DROP INDEX "public"."IDX_c9fbe21a3411d93ea586af2a4c"`) + await db.query(`DROP INDEX "public"."IDX_d1f50dc39003331b76fad8a640"`) + await db.query(`DROP TABLE "erc20_transfer"`) + await db.query(`DROP INDEX "public"."IDX_f914d2e140eb88375a5a2ef6c7"`) + await db.query(`DROP INDEX "public"."IDX_6350ddb2def19c1e3a06d8b3ec"`) + await db.query(`DROP INDEX "public"."IDX_eca70565083880d00e9110b000"`) + await db.query(`DROP INDEX "public"."IDX_9fdc9d58b6ae0cb13b9c7f8226"`) + await db.query(`DROP TABLE "curve_pool"`) + await db.query(`DROP INDEX "public"."IDX_76c9202c1160ce818f7a29d131"`) + await db.query(`DROP TABLE "curve_pool_balance"`) + await db.query(`DROP INDEX "public"."IDX_ffb0d0f86f03faacef7cb3e092"`) + await db.query(`DROP INDEX "public"."IDX_db5522c865eb8ed76fa7aeb4a8"`) + await db.query(`DROP TABLE "curve_pool_rate"`) + await db.query(`DROP INDEX "public"."IDX_561faf9883f4bb00ae6df34cc1"`) + await db.query(`DROP INDEX "public"."IDX_cefe6315e78e235fa4ab3de663"`) + await db.query(`DROP TABLE "balancer_pool"`) + await db.query(`DROP INDEX "public"."IDX_0c5b4cc12b9d8b80ac5d983848"`) + await db.query(`DROP TABLE "balancer_pool_balance"`) + await db.query(`DROP INDEX "public"."IDX_642115282f1c3026edbc4bc2a7"`) + await db.query(`DROP INDEX "public"."IDX_eecdc2d6132041e3806d77c7b4"`) + await db.query(`DROP TABLE "balancer_pool_rate"`) + await db.query(`DROP INDEX "public"."IDX_b1656f8d048f72b38bb637ea24"`) + await db.query(`DROP INDEX "public"."IDX_c55345ef048232dfe36e60e4c5"`) + await db.query(`DROP TABLE "maverick_pool"`) + await db.query(`DROP INDEX "public"."IDX_f04c4b9133d5c21af35b6f23d3"`) + await db.query(`DROP TABLE "maverick_pool_balance"`) + await db.query(`DROP INDEX "public"."IDX_e8046e8a298610b97bea2e6241"`) + await db.query(`DROP INDEX "public"."IDX_6034a437728a8ccb3b49f4a348"`) + await db.query(`DROP TABLE "liquidity_source"`) + await db.query(`DROP TABLE "liquidity_daily_balance"`) + await db.query(`DROP INDEX "public"."IDX_c5116bd4f5406fc2848552f0ba"`) + await db.query(`DROP INDEX "public"."IDX_58d14205a5e9ad1d05f94d7bb6"`) + await db.query(`DROP TABLE "bridge_transfer"`) + await db.query(`DROP INDEX "public"."IDX_aaedc42eda914e44a21e8eac72"`) + await db.query(`DROP INDEX "public"."IDX_f8d8d410f058f0bae15eefbc81"`) + await db.query(`DROP INDEX "public"."IDX_85994c1ee045b713bbcbcccc8b"`) + await db.query(`DROP INDEX "public"."IDX_7ff6ab2147f80a465d3752e79f"`) + await db.query(`DROP INDEX "public"."IDX_aaec7d9bb08b9ef8fb1b419c5d"`) + await db.query(`DROP INDEX "public"."IDX_3cbd3eea30bc62ebc91c276e73"`) + await db.query(`DROP INDEX "public"."IDX_54f4abe8f2eb80204637ce328e"`) + await db.query(`DROP INDEX "public"."IDX_12fa326ec2496a964493f2a7bc"`) + await db.query(`DROP TABLE "bridge_transfer_state"`) + await db.query(`DROP INDEX "public"."IDX_374659ae3bd149042388e132be"`) + await db.query(`DROP INDEX "public"."IDX_74f93b10ec560e63792dcc877e"`) + await db.query(`DROP INDEX "public"."IDX_df99bdbf11d4ed57bec0e6c511"`) + await db.query(`DROP TABLE "governance_proposal"`) + await db.query(`DROP INDEX "public"."IDX_fe8a40923244f99e670b62c14d"`) + await db.query(`DROP INDEX "public"."IDX_eea14b5ba6065f9484dfaa00c6"`) + await db.query(`DROP INDEX "public"."IDX_f5e7947b0d485de963eca0567b"`) + await db.query(`DROP TABLE "governance_proposal_event"`) + await db.query(`DROP INDEX "public"."IDX_89f2a1078c9c9d8f63c270ba39"`) + await db.query(`DROP INDEX "public"."IDX_ce984d23fc99c537b8f22fd663"`) + await db.query(`DROP TABLE "governance_proposal_vote"`) + await db.query(`DROP INDEX "public"."IDX_5531af241c24a09c854ead9d55"`) + await db.query(`DROP INDEX "public"."IDX_adc6eb148ad48697e74d23c722"`) + await db.query(`DROP TABLE "legacy_staker"`) + await db.query(`DROP TABLE "beacon_deposit_pubkey"`) + await db.query(`DROP TABLE "beacon_deposit_event"`) + await db.query(`DROP INDEX "public"."IDX_4b157d82fc2a709b1cdd1b056a"`) + await db.query(`DROP INDEX "public"."IDX_92a49797f76dbbacf77bbc5291"`) + await db.query(`DROP INDEX "public"."IDX_682ca401d8eb6b21267621c349"`) + await db.query(`DROP INDEX "public"."IDX_14a73117a1c3655d0df3e246df"`) + await db.query(`DROP INDEX "public"."IDX_5a85c2519463653ac015291db4"`) + await db.query(`DROP INDEX "public"."IDX_c27461303e85eb671a3cb730b4"`) + await db.query(`DROP INDEX "public"."IDX_dff55f23cfcfa0ff664964572f"`) + await db.query(`DROP TABLE "oeth_vault"`) + await db.query(`DROP INDEX "public"."IDX_d6298a294864b4eaf793cf35a4"`) + await db.query(`DROP INDEX "public"."IDX_e20cb507a673817b2c68720415"`) + await db.query(`DROP TABLE "oeth_curve_lp"`) + await db.query(`DROP INDEX "public"."IDX_d9bbd20e888fa1b4b2c5d2f039"`) + await db.query(`DROP INDEX "public"."IDX_7617d593c36dce1b1565a8d74a"`) + await db.query(`DROP TABLE "oeth_frax_staking"`) + await db.query(`DROP INDEX "public"."IDX_ce6c2c65e90967dfeaac97025b"`) + await db.query(`DROP INDEX "public"."IDX_1a7f7d650390e2f9c212651e05"`) + await db.query(`DROP TABLE "oeth_morpho_aave"`) + await db.query(`DROP INDEX "public"."IDX_25e239b985844f1d33fac79981"`) + await db.query(`DROP INDEX "public"."IDX_a6662224e95eb6921bb14cb5f9"`) + await db.query(`DROP TABLE "oeth_dripper"`) + await db.query(`DROP INDEX "public"."IDX_16ac742ceeb05d28e530da9649"`) + await db.query(`DROP INDEX "public"."IDX_d356832c14603916a492608e7b"`) + await db.query(`DROP TABLE "oeth_balancer_meta_pool_strategy"`) + await db.query(`DROP INDEX "public"."IDX_5e7ef383756fa18cb602f50089"`) + await db.query(`DROP INDEX "public"."IDX_11d344b3e0e03cdb6697dd61f7"`) + await db.query(`DROP TABLE "oeth_strategy_holding_daily_stat"`) + await db.query(`DROP INDEX "public"."IDX_4e867f220975e615e6077d860c"`) + await db.query(`DROP TABLE "oeth_strategy_daily_stat"`) + await db.query(`DROP INDEX "public"."IDX_6c7096c96a000d8471256ca8fc"`) + await db.query(`DROP TABLE "oeth_collateral_daily_stat"`) + await db.query(`DROP INDEX "public"."IDX_a90045de50406be7bd56efd3ea"`) + await db.query(`DROP TABLE "oeth_daily_stat"`) + await db.query(`DROP INDEX "public"."IDX_98d9001013aa37425ca47b7126"`) + await db.query(`DROP INDEX "public"."IDX_c3e66051c7df4efd6a8fa8f9c1"`) + await db.query(`DROP TABLE "oeth_reward_token_collected"`) + await db.query(`DROP INDEX "public"."IDX_81a9fa43ae4a6ae63e4103127b"`) + await db.query(`DROP INDEX "public"."IDX_d36c78b9c3e9d737f067638bc4"`) + await db.query(`DROP TABLE "oeth_withdrawal_request"`) + await db.query(`DROP INDEX "public"."IDX_22ebb6be552c90b2c99b165cde"`) + await db.query(`DROP INDEX "public"."IDX_fd1acb337d03a48f775c22edcd"`) + await db.query(`DROP INDEX "public"."IDX_2733a93f9fc9cf900ac1de1a0d"`) + await db.query(`DROP TABLE "ogv"`) + await db.query(`DROP INDEX "public"."IDX_2418a8b8b92b2f5977be761cf9"`) + await db.query(`DROP INDEX "public"."IDX_b8f20bcf48e4aa77e0f48d77db"`) + await db.query(`DROP TABLE "ogv_address"`) + await db.query(`DROP INDEX "public"."IDX_49d26f287904b8b1aef6e9ac2b"`) + await db.query(`DROP TABLE "ogv_lockup"`) + await db.query(`DROP INDEX "public"."IDX_8114101b53d9d6bc26fe80838a"`) + await db.query(`DROP INDEX "public"."IDX_8be94cd63e35b91adf1301a156"`) + await db.query(`DROP TABLE "ogv_lockup_tx_log"`) + await db.query(`DROP INDEX "public"."IDX_b49fca291c97d9b55cd91f935f"`) + await db.query(`DROP TABLE "ogv_proposal"`) + await db.query(`DROP INDEX "public"."IDX_c62be3f16dfb3e4a09525c85af"`) + await db.query(`DROP TABLE "ogv_proposal_tx_log"`) + await db.query(`DROP INDEX "public"."IDX_5d5f5e10892290ee366d26de7d"`) + await db.query(`DROP TABLE "ogv_proposal_vote"`) + await db.query(`DROP INDEX "public"."IDX_58d732bc6523c2609d2725cc0a"`) + await db.query(`DROP INDEX "public"."IDX_2fd621aea353448fb3f17721bc"`) + await db.query(`DROP TABLE "ogv_daily_stat"`) + await db.query(`DROP INDEX "public"."IDX_c974bde87107cacae6d3654972"`) + await db.query(`DROP INDEX "public"."IDX_b62fa80951183bb0acf8a5e8b9"`) + await db.query(`DROP TABLE "o_token"`) + await db.query(`DROP INDEX "public"."IDX_1da06ba7d2c0a02d01d1b7a6c0"`) + await db.query(`DROP INDEX "public"."IDX_0851d95d178f682d279a04ebf9"`) + await db.query(`DROP INDEX "public"."IDX_7889d6ce061da066df89309e51"`) + await db.query(`DROP INDEX "public"."IDX_4633929013f5ba465cb00e5a95"`) + await db.query(`DROP TABLE "o_token_asset"`) + await db.query(`DROP INDEX "public"."IDX_2eb2f24563a058f9d6e746ed47"`) + await db.query(`DROP INDEX "public"."IDX_7a26c80564bf5fe4e414125e99"`) + await db.query(`DROP INDEX "public"."IDX_53e8f932900b50984e1c30e7c0"`) + await db.query(`DROP TABLE "o_token_history"`) + await db.query(`DROP INDEX "public"."IDX_3200b91c04a72dda2312eb518c"`) + await db.query(`DROP INDEX "public"."IDX_b4b39e42a6d2604b34082c4c80"`) + await db.query(`DROP INDEX "public"."IDX_2f1457755464ec5951d1e96542"`) + await db.query(`DROP INDEX "public"."IDX_42142d191ea0408fb511f9f576"`) + await db.query(`DROP INDEX "public"."IDX_f87d86cfca9ef211ba1b18d2bc"`) + await db.query(`DROP TABLE "o_token_address"`) + await db.query(`DROP INDEX "public"."IDX_7cbc465ce1e9ae06dfe3a8c625"`) + await db.query(`DROP INDEX "public"."IDX_5342c499e930e396bade7faeb6"`) + await db.query(`DROP INDEX "public"."IDX_75c7d29bf71b393e99c4407885"`) + await db.query(`DROP TABLE "o_token_apy"`) + await db.query(`DROP INDEX "public"."IDX_5d9294486b1c57df8c3aad5145"`) + await db.query(`DROP INDEX "public"."IDX_4d4f1b0d9e7f6903a2038c6c38"`) + await db.query(`DROP INDEX "public"."IDX_5b81f5a25e913cc7bf1d4c145a"`) + await db.query(`DROP INDEX "public"."IDX_79f0934481fe045319c864cd84"`) + await db.query(`DROP INDEX "public"."IDX_f5f416a1490ee2007a9c7593d0"`) + await db.query(`DROP INDEX "public"."IDX_a98d74fc6af6f3a599fe1ba7fb"`) + await db.query(`DROP TABLE "o_token_rebase"`) + await db.query(`DROP INDEX "public"."IDX_83666ab47ff5ef0c56bf40d122"`) + await db.query(`DROP INDEX "public"."IDX_3fb75a6c8b831ca4d201d60e01"`) + await db.query(`DROP INDEX "public"."IDX_15ef53e2bdcc3034ab8adea1f1"`) + await db.query(`DROP INDEX "public"."IDX_b0c6feb890a83dcca572302371"`) + await db.query(`DROP INDEX "public"."IDX_7170f89052507f34d8563f7016"`) + await db.query(`DROP INDEX "public"."IDX_b8653270b96fc932f077b26441"`) + await db.query(`DROP TABLE "o_token_rebase_option"`) + await db.query(`DROP INDEX "public"."IDX_5dfc53108b110d42994d02a832"`) + await db.query(`DROP INDEX "public"."IDX_5936af713ee8131983812703b2"`) + await db.query(`DROP INDEX "public"."IDX_cb07bc901206c5da63eacff7df"`) + await db.query(`DROP INDEX "public"."IDX_95bab764e1a63ea0778dca4038"`) + await db.query(`DROP INDEX "public"."IDX_00fff31b07544c1739afce542c"`) + await db.query(`DROP INDEX "public"."IDX_da7296f8011232dc8675477b84"`) + await db.query(`DROP TABLE "o_token_vault"`) + await db.query(`DROP INDEX "public"."IDX_6990f4cd71ea8db6d9d27a0db5"`) + await db.query(`DROP INDEX "public"."IDX_2c88ea3e889e76b037d8f59c96"`) + await db.query(`DROP INDEX "public"."IDX_091cfbe0d977006e05144bd1fe"`) + await db.query(`DROP INDEX "public"."IDX_fa92b36d011441a02d9a231860"`) + await db.query(`DROP INDEX "public"."IDX_3a2bfb2808c1d7cbb0a568910c"`) + await db.query(`DROP TABLE "o_token_activity"`) + await db.query(`DROP INDEX "public"."IDX_9c617918c3dc521bed5220a185"`) + await db.query(`DROP INDEX "public"."IDX_62bfeb1dee3bcefffdbd10172a"`) + await db.query(`DROP INDEX "public"."IDX_57bb1f7d2fd6fe063b9cd434b2"`) + await db.query(`DROP INDEX "public"."IDX_d6cba0877ee9f5332e6d97e758"`) + await db.query(`DROP INDEX "public"."IDX_b5826e68934ff671bbe28836ec"`) + await db.query(`DROP TABLE "ousd_vault"`) + await db.query(`DROP INDEX "public"."IDX_6860186ea2f56e2c7d54c22107"`) + await db.query(`DROP INDEX "public"."IDX_0d0a7113a505cf7f7adea9ca81"`) + await db.query(`DROP TABLE "ousd_morpho_aave"`) + await db.query(`DROP INDEX "public"."IDX_78e0701c2e9a28242db37bd8f8"`) + await db.query(`DROP INDEX "public"."IDX_46ccf673b376d654052fbd53e6"`) + await db.query(`DROP TABLE "ousd_morpho_compound"`) + await db.query(`DROP INDEX "public"."IDX_9e7bd0d8ae23b877d5979ef80c"`) + await db.query(`DROP INDEX "public"."IDX_0bb3a0ad84071f1d80f6d4e90f"`) + await db.query(`DROP TABLE "maker_dsr_strategy"`) + await db.query(`DROP INDEX "public"."IDX_a35308a3c5dbaab2d321eb1525"`) + await db.query(`DROP INDEX "public"."IDX_844b219d8faf9b1d24ab2dba9a"`) + await db.query(`DROP TABLE "ousd_flux_strategy"`) + await db.query(`DROP INDEX "public"."IDX_5b165b5d30b13e363d33a66e14"`) + await db.query(`DROP INDEX "public"."IDX_80f3392968fde7b99cccb805ac"`) + await db.query(`DROP TABLE "ousd_compound_strategy"`) + await db.query(`DROP INDEX "public"."IDX_6920b1db5dc577295ac4d1379d"`) + await db.query(`DROP INDEX "public"."IDX_89c6d7d3104bd36dc88a37add4"`) + await db.query(`DROP TABLE "ousd_convex_strategy"`) + await db.query(`DROP INDEX "public"."IDX_2deac473cd0b2dd7082e7da148"`) + await db.query(`DROP INDEX "public"."IDX_157bf74171817dc5c60ee37036"`) + await db.query(`DROP TABLE "ousd_aave_strategy"`) + await db.query(`DROP INDEX "public"."IDX_ca34b5a0a33bc9abdd8213c2fa"`) + await db.query(`DROP INDEX "public"."IDX_dacd7c98223d7bc8be074d71e4"`) + await db.query(`DROP TABLE "ousd_meta_strategy"`) + await db.query(`DROP INDEX "public"."IDX_7e998dcf775263bc5df76ef987"`) + await db.query(`DROP INDEX "public"."IDX_55ce185680512d6a5b9fb0af89"`) + await db.query(`DROP TABLE "ousd_convex_lusd_plus3_crv"`) + await db.query(`DROP INDEX "public"."IDX_0783af95efb35fb3f13cde1656"`) + await db.query(`DROP INDEX "public"."IDX_74ae01fb596a4f2733087ba454"`) + await db.query(`DROP TABLE "ousd_strategy_holding_daily_stat"`) + await db.query(`DROP INDEX "public"."IDX_e1a93bab3d12271dc114234d3a"`) + await db.query(`DROP TABLE "ousd_strategy_daily_stat"`) + await db.query(`DROP INDEX "public"."IDX_3edda581683682257159cb0863"`) + await db.query(`DROP TABLE "ousd_collateral_daily_stat"`) + await db.query(`DROP INDEX "public"."IDX_78be9d3f3dc1f31cf17ae810fe"`) + await db.query(`DROP TABLE "ousd_daily_stat"`) + await db.query(`DROP INDEX "public"."IDX_f9020d89932aad2d0de8923490"`) + await db.query(`DROP INDEX "public"."IDX_0bb5f72bf5fa59ce8c232caa4c"`) + await db.query(`ALTER TABLE "es_account" DROP CONSTRAINT "FK_7b43e7bb90d3b435d074112f572"`) + await db.query(`ALTER TABLE "es_lockup_event" DROP CONSTRAINT "FK_46d53d4fad340d5939955836004"`) + await db.query(`ALTER TABLE "governance_proposal_event" DROP CONSTRAINT "FK_ce984d23fc99c537b8f22fd663a"`) + await db.query(`ALTER TABLE "governance_proposal_vote" DROP CONSTRAINT "FK_5531af241c24a09c854ead9d551"`) + await db.query(`ALTER TABLE "beacon_deposit_event" DROP CONSTRAINT "FK_dff55f23cfcfa0ff664964572ff"`) + await db.query(`ALTER TABLE "oeth_strategy_holding_daily_stat" DROP CONSTRAINT "FK_4e867f220975e615e6077d860c1"`) + await db.query(`ALTER TABLE "oeth_strategy_daily_stat" DROP CONSTRAINT "FK_6c7096c96a000d8471256ca8fc3"`) + await db.query(`ALTER TABLE "oeth_collateral_daily_stat" DROP CONSTRAINT "FK_a90045de50406be7bd56efd3ea4"`) + await db.query(`ALTER TABLE "ogv_address" DROP CONSTRAINT "FK_49d26f287904b8b1aef6e9ac2b3"`) + await db.query(`ALTER TABLE "ogv_lockup" DROP CONSTRAINT "FK_8be94cd63e35b91adf1301a156c"`) + await db.query(`ALTER TABLE "ogv_lockup_tx_log" DROP CONSTRAINT "FK_b49fca291c97d9b55cd91f935f3"`) + await db.query(`ALTER TABLE "ogv_proposal" DROP CONSTRAINT "FK_c62be3f16dfb3e4a09525c85af8"`) + await db.query(`ALTER TABLE "ogv_proposal_tx_log" DROP CONSTRAINT "FK_5d5f5e10892290ee366d26de7dc"`) + await db.query(`ALTER TABLE "ogv_proposal_vote" DROP CONSTRAINT "FK_58d732bc6523c2609d2725cc0ac"`) + await db.query(`ALTER TABLE "ogv_proposal_vote" DROP CONSTRAINT "FK_2fd621aea353448fb3f17721bc8"`) + await db.query(`ALTER TABLE "o_token_history" DROP CONSTRAINT "FK_2f1457755464ec5951d1e96542a"`) + await db.query(`ALTER TABLE "o_token_rebase" DROP CONSTRAINT "FK_b8653270b96fc932f077b26441d"`) + await db.query(`ALTER TABLE "o_token_rebase_option" DROP CONSTRAINT "FK_da7296f8011232dc8675477b841"`) + await db.query(`ALTER TABLE "ousd_strategy_holding_daily_stat" DROP CONSTRAINT "FK_e1a93bab3d12271dc114234d3ae"`) + await db.query(`ALTER TABLE "ousd_strategy_daily_stat" DROP CONSTRAINT "FK_3edda581683682257159cb08638"`) + await db.query(`ALTER TABLE "ousd_collateral_daily_stat" DROP CONSTRAINT "FK_78be9d3f3dc1f31cf17ae810fee"`) + } +} diff --git a/schema.graphql b/schema.graphql index bca6308..5160ae0 100644 --- a/schema.graphql +++ b/schema.graphql @@ -702,8 +702,7 @@ type OETHStrategyDailyStat @entity { """ Total ETH value """ - holdings: [OETHStrategyHoldingDailyStat] - @derivedFrom(field: "strategyDailyStatId") + holdings: [OETHStrategyHoldingDailyStat] @derivedFrom(field: "strategyDailyStatId") } type OETHStrategyHoldingDailyStat @entity { @@ -742,7 +741,20 @@ type OETHRewardTokenCollected @entity { recipient: String! rewardToken: String! amount: BigInt! -}type OGV @entity { +} + +type OETHWithdrawalRequest @entity { + id: ID! + timestamp: DateTime! @index + blockNumber: Int! @index + requestId: BigInt! + withdrawer: String! + amount: BigInt! + queued: BigInt! + claimed: Boolean! + txHash: String! @index +} +type OGV @entity { id: ID! timestamp: DateTime! @index blockNumber: Int! @index diff --git a/schema/oeth.graphql b/schema/oeth.graphql index 4e25418..7172b80 100644 --- a/schema/oeth.graphql +++ b/schema/oeth.graphql @@ -130,8 +130,7 @@ type OETHStrategyDailyStat @entity { """ Total ETH value """ - holdings: [OETHStrategyHoldingDailyStat] - @derivedFrom(field: "strategyDailyStatId") + holdings: [OETHStrategyHoldingDailyStat] @derivedFrom(field: "strategyDailyStatId") } type OETHStrategyHoldingDailyStat @entity { @@ -170,4 +169,16 @@ type OETHRewardTokenCollected @entity { recipient: String! rewardToken: String! amount: BigInt! -} \ No newline at end of file +} + +type OETHWithdrawalRequest @entity { + id: ID! + timestamp: DateTime! @index + blockNumber: Int! @index + requestId: BigInt! + withdrawer: String! + amount: BigInt! + queued: BigInt! + claimed: Boolean! + txHash: String! @index +} diff --git a/src/abi/oeth-vault.ts b/src/abi/oeth-vault.ts new file mode 100644 index 0000000..ecfbe0f --- /dev/null +++ b/src/abi/oeth-vault.ts @@ -0,0 +1,522 @@ +import * as p from '@subsquid/evm-codec' +import { event, fun, viewFun, indexed, ContractBase } from '@subsquid/evm-abi' +import type { EventParams as EParams, FunctionArguments, FunctionReturn } from '@subsquid/evm-abi' + +export const events = { + AllocateThresholdUpdated: event("0x2ec5fb5a3d2703edc461252d92ccd2799c3c74f01d97212b20388207fa17ae45", "AllocateThresholdUpdated(uint256)", {"_threshold": p.uint256}), + AssetAllocated: event("0x41b99659f6ba0803f444aff29e5bf6e26dd86a3219aff92119d69710a956ba8d", "AssetAllocated(address,address,uint256)", {"_asset": p.address, "_strategy": p.address, "_amount": p.uint256}), + AssetDefaultStrategyUpdated: event("0xba58ce12801c949fa65f41c46ed108671c219baf945fa48d21026cea99ff252a", "AssetDefaultStrategyUpdated(address,address)", {"_asset": p.address, "_strategy": p.address}), + AssetSupported: event("0x4f1ac48525e50059cc1cc6e0e1940ece0dd653a4db4841538d6aef036be2fb7b", "AssetSupported(address)", {"_asset": p.address}), + CapitalPaused: event("0x71f0e5b62f846a22e0b4d159e516e62fa9c2b8eb570be15f83e67d98a2ee51e0", "CapitalPaused()", {}), + CapitalUnpaused: event("0x891ebab18da80ebeeea06b1b1cede098329c4c008906a98370c2ac7a80b571cb", "CapitalUnpaused()", {}), + DripperChanged: event("0xaf2910d9759321733de15af1827a49830692912adeb2b3646334861f2cd2eed4", "DripperChanged(address)", {"_dripper": indexed(p.address)}), + MaxSupplyDiffChanged: event("0x95201f9c21f26877223b1ff4073936a6484c35495649e60e55730497aeb60d93", "MaxSupplyDiffChanged(uint256)", {"maxSupplyDiff": p.uint256}), + Mint: event("0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885", "Mint(address,uint256)", {"_addr": p.address, "_value": p.uint256}), + PriceProviderUpdated: event("0xb266add5f3044b17d27db796af992cecbe413921b4e8aaaee03c719e16b9806a", "PriceProviderUpdated(address)", {"_priceProvider": p.address}), + RebasePaused: event("0x8cff26a5985614b3d30629cc4ab83824bf115aec971b718d8f2f99562032e972", "RebasePaused()", {}), + RebaseThresholdUpdated: event("0x39367850377ac04920a9a670f2180e7a94d83b15ad302e59875ec58fd10bd37d", "RebaseThresholdUpdated(uint256)", {"_threshold": p.uint256}), + RebaseUnpaused: event("0xbc044409505c95b6b851433df96e1beae715c909d8e7c1d6d7ab783300d4e3b9", "RebaseUnpaused()", {}), + Redeem: event("0x222838db2794d11532d940e8dec38ae307ed0b63cd97c233322e221f998767a6", "Redeem(address,uint256)", {"_addr": p.address, "_value": p.uint256}), + RedeemFeeUpdated: event("0xd6c7508d6658ccee36b7b7d7fd72e5cbaeefb40c64eff24e9ae7470e846304ee", "RedeemFeeUpdated(uint256)", {"_redeemFeeBps": p.uint256}), + StrategistUpdated: event("0x869e0abd13cc3a975de7b93be3df1cb2255c802b1cead85963cc79d99f131bee", "StrategistUpdated(address)", {"_address": p.address}), + StrategyApproved: event("0x960dd94cbb79169f09a4e445d58b895df2d9bffa5b31055d0932d801724a20d1", "StrategyApproved(address)", {"_addr": p.address}), + StrategyRemoved: event("0x09a1db4b80c32706328728508c941a6b954f31eb5affd32f236c1fd405f8fea4", "StrategyRemoved(address)", {"_addr": p.address}), + SwapAllowedUndervalueChanged: event("0xf12c00256bee2b6facb111a88a9b1cff86e79132939b44f1353212d6f7469557", "SwapAllowedUndervalueChanged(uint256)", {"_basis": p.uint256}), + SwapSlippageChanged: event("0x8d22e9d2cbe8bb65a3c4412bd8970743864512a1a0e004e8d00fb96277b78b94", "SwapSlippageChanged(address,uint256)", {"_asset": p.address, "_basis": p.uint256}), + Swapped: event("0xa078c4190abe07940190effc1846be0ccf03ad6007bc9e93f9697d0b460befbb", "Swapped(address,address,uint256,uint256)", {"_fromAsset": indexed(p.address), "_toAsset": indexed(p.address), "_fromAssetAmount": p.uint256, "_toAssetAmount": p.uint256}), + SwapperChanged: event("0x7d7719313229e558c5a3893cad2eb86a86a049156d1d9ebd5c63a8eedefd1c03", "SwapperChanged(address)", {"_address": p.address}), + TrusteeAddressChanged: event("0x1e4af5ac389e8cde1bdaa6830881b6c987c62a45cfb3b33d27d805cde3b57750", "TrusteeAddressChanged(address)", {"_address": p.address}), + TrusteeFeeBpsChanged: event("0x56287a45051933ea374811b3d5d165033047be5572cac676f7c28b8be4f746c7", "TrusteeFeeBpsChanged(uint256)", {"_basis": p.uint256}), + VaultBufferUpdated: event("0x41ecb23a0e7865b25f38c268b7c3012220d822929e9edff07326e89d5bb822b5", "VaultBufferUpdated(uint256)", {"_vaultBuffer": p.uint256}), + WithdrawalClaimable: event("0xee79a0c43d3993055690b54e074b5153e8bae8d1a872b656dedb64aa8f463333", "WithdrawalClaimable(uint256,uint256)", {"_claimable": p.uint256, "_newClaimable": p.uint256}), + WithdrawalClaimed: event("0x2d43eb174787155132b52ddb6b346e2dca99302eac3df4466dbeff953d3c84d1", "WithdrawalClaimed(address,uint256,uint256)", {"_withdrawer": indexed(p.address), "_requestId": indexed(p.uint256), "_amount": p.uint256}), + WithdrawalRequested: event("0x38e3d972947cfef94205163d483d6287ef27eb312e20cb8e0b13a49989db232e", "WithdrawalRequested(address,uint256,uint256,uint256)", {"_withdrawer": indexed(p.address), "_requestId": indexed(p.uint256), "_amount": p.uint256, "_queued": p.uint256}), + YieldDistribution: event("0x09516ecf4a8a86e59780a9befc6dee948bc9e60a36e3be68d31ea817ee8d2c80", "YieldDistribution(address,uint256,uint256)", {"_to": p.address, "_yield": p.uint256, "_fee": p.uint256}), +} + +export const functions = { + addWithdrawalQueueLiquidity: fun("0xb9b17f9f", "addWithdrawalQueueLiquidity()", {}, ), + allocate: fun("0xabaa9916", "allocate()", {}, ), + allowedSwapUndervalue: viewFun("0x4bed3bc0", "allowedSwapUndervalue()", {}, p.uint256), + approveStrategy: fun("0x3b8ae397", "approveStrategy(address)", {"_addr": p.address}, ), + assetDefaultStrategies: viewFun("0xa403e4d5", "assetDefaultStrategies(address)", {"_asset": p.address}, p.address), + autoAllocateThreshold: viewFun("0x9fa1826e", "autoAllocateThreshold()", {}, p.uint256), + burnForStrategy: fun("0x6217f3ea", "burnForStrategy(uint256)", {"_amount": p.uint256}, ), + cacheWETHAssetIndex: fun("0x44c54707", "cacheWETHAssetIndex()", {}, ), + calculateRedeemOutputs: viewFun("0x67bd7ba3", "calculateRedeemOutputs(uint256)", {"_amount": p.uint256}, p.array(p.uint256)), + capitalPaused: viewFun("0xe6cc5432", "capitalPaused()", {}, p.bool), + checkBalance: viewFun("0x5f515226", "checkBalance(address)", {"_asset": p.address}, p.uint256), + claimGovernance: fun("0x5d36b190", "claimGovernance()", {}, ), + claimWithdrawal: fun("0xf8444436", "claimWithdrawal(uint256)", {"requestId": p.uint256}, p.uint256), + claimWithdrawals: fun("0x48e30f54", "claimWithdrawals(uint256[])", {"requestIds": p.array(p.uint256)}, {"amounts": p.array(p.uint256), "totalAmount": p.uint256}), + depositToStrategy: fun("0x840c4c7a", "depositToStrategy(address,address[],uint256[])", {"_strategyToAddress": p.address, "_assets": p.array(p.address), "_amounts": p.array(p.uint256)}, ), + getAllAssets: viewFun("0x2acada4d", "getAllAssets()", {}, p.array(p.address)), + getAllStrategies: viewFun("0xc3b28864", "getAllStrategies()", {}, p.array(p.address)), + getAssetConfig: viewFun("0x6ec3ab67", "getAssetConfig(address)", {"_asset": p.address}, p.struct({"isSupported": p.bool, "unitConversion": p.uint8, "decimals": p.uint8, "allowedOracleSlippageBps": p.uint16})), + getAssetCount: viewFun("0xa0aead4d", "getAssetCount()", {}, p.uint256), + getStrategyCount: viewFun("0x31e19cfa", "getStrategyCount()", {}, p.uint256), + governor: viewFun("0x0c340a24", "governor()", {}, p.address), + initialize: fun("0x485cc955", "initialize(address,address)", {"_0": p.address, "_1": p.address}, ), + isSupportedAsset: viewFun("0x9be918e6", "isSupportedAsset(address)", {"_asset": p.address}, p.bool), + maxSupplyDiff: viewFun("0x8e510b52", "maxSupplyDiff()", {}, p.uint256), + mint: fun("0x156e29f6", "mint(address,uint256,uint256)", {"_asset": p.address, "_amount": p.uint256, "_minimumOusdAmount": p.uint256}, ), + mintForStrategy: fun("0xab80dafb", "mintForStrategy(uint256)", {"_amount": p.uint256}, ), + netOusdMintForStrategyThreshold: viewFun("0x7a2202f3", "netOusdMintForStrategyThreshold()", {}, p.uint256), + netOusdMintedForStrategy: viewFun("0xe45cc9f0", "netOusdMintedForStrategy()", {}, p.int256), + ousdMetaStrategy: viewFun("0x18ce56bd", "ousdMetaStrategy()", {}, p.address), + pauseCapital: fun("0x3dbc911f", "pauseCapital()", {}, ), + pauseRebase: fun("0xc5f00841", "pauseRebase()", {}, ), + priceProvider: viewFun("0xb888879e", "priceProvider()", {}, p.address), + priceUnitMint: viewFun("0x3b8fe28d", "priceUnitMint(address)", {"asset": p.address}, p.uint256), + priceUnitRedeem: viewFun("0x5b60f9fc", "priceUnitRedeem(address)", {"asset": p.address}, p.uint256), + rebase: fun("0xaf14052c", "rebase()", {}, ), + rebasePaused: viewFun("0x53ca9f24", "rebasePaused()", {}, p.bool), + rebaseThreshold: viewFun("0x52d38e5d", "rebaseThreshold()", {}, p.uint256), + redeem: fun("0x7cbc2373", "redeem(uint256,uint256)", {"_amount": p.uint256, "_minimumUnitAmount": p.uint256}, ), + redeemAll: fun("0x7136a7a6", "redeemAll(uint256)", {"_minimumUnitAmount": p.uint256}, ), + redeemFeeBps: viewFun("0x09f6442c", "redeemFeeBps()", {}, p.uint256), + removeAsset: fun("0x4a5e42b1", "removeAsset(address)", {"_asset": p.address}, ), + removeStrategy: fun("0x175188e8", "removeStrategy(address)", {"_addr": p.address}, ), + requestWithdrawal: fun("0x9ee679e8", "requestWithdrawal(uint256)", {"_amount": p.uint256}, {"requestId": p.uint256, "queued": p.uint256}), + setAdminImpl: fun("0xfc0cfeee", "setAdminImpl(address)", {"_0": p.address}, ), + setAssetDefaultStrategy: fun("0xbc90106b", "setAssetDefaultStrategy(address,address)", {"_asset": p.address, "_strategy": p.address}, ), + setAutoAllocateThreshold: fun("0xb2c9336d", "setAutoAllocateThreshold(uint256)", {"_threshold": p.uint256}, ), + setDripper: fun("0x2e9958ab", "setDripper(address)", {"_dripper": p.address}, ), + setMaxSupplyDiff: fun("0x663e64ce", "setMaxSupplyDiff(uint256)", {"_maxSupplyDiff": p.uint256}, ), + setNetOusdMintForStrategyThreshold: fun("0x636e6c40", "setNetOusdMintForStrategyThreshold(uint256)", {"_threshold": p.uint256}, ), + setOracleSlippage: fun("0x7b9a7096", "setOracleSlippage(address,uint16)", {"_asset": p.address, "_allowedOracleSlippageBps": p.uint16}, ), + setOusdMetaStrategy: fun("0xd58e3b3a", "setOusdMetaStrategy(address)", {"_ousdMetaStrategy": p.address}, ), + setPriceProvider: fun("0x372aa224", "setPriceProvider(address)", {"_priceProvider": p.address}, ), + setRebaseThreshold: fun("0xb890ebf6", "setRebaseThreshold(uint256)", {"_threshold": p.uint256}, ), + setRedeemFeeBps: fun("0xeb03654b", "setRedeemFeeBps(uint256)", {"_redeemFeeBps": p.uint256}, ), + setStrategistAddr: fun("0x773540b3", "setStrategistAddr(address)", {"_address": p.address}, ), + setSwapAllowedUndervalue: fun("0xe829cc16", "setSwapAllowedUndervalue(uint16)", {"_percentageBps": p.uint16}, ), + setSwapper: fun("0x9c82f2a4", "setSwapper(address)", {"_swapperAddr": p.address}, ), + setTrusteeAddress: fun("0x2da845a8", "setTrusteeAddress(address)", {"_address": p.address}, ), + setTrusteeFeeBps: fun("0x0acbda75", "setTrusteeFeeBps(uint256)", {"_basis": p.uint256}, ), + setVaultBuffer: fun("0x8ec489a2", "setVaultBuffer(uint256)", {"_vaultBuffer": p.uint256}, ), + strategistAddr: viewFun("0x570d8e1d", "strategistAddr()", {}, p.address), + supportAsset: fun("0x6c7561e8", "supportAsset(address,uint8)", {"_asset": p.address, "_supportsAsset": p.uint8}, ), + swapCollateral: fun("0x50ba711c", "swapCollateral(address,address,uint256,uint256,bytes)", {"fromAsset": p.address, "toAsset": p.address, "fromAssetAmount": p.uint256, "minToAssetAmount": p.uint256, "data": p.bytes}, p.uint256), + swapper: viewFun("0x2b3297f9", "swapper()", {}, p.address), + totalValue: viewFun("0xd4c3eea0", "totalValue()", {}, p.uint256), + transferGovernance: fun("0xd38bfff4", "transferGovernance(address)", {"_newGovernor": p.address}, ), + transferToken: fun("0x1072cbea", "transferToken(address,uint256)", {"_asset": p.address, "_amount": p.uint256}, ), + trusteeAddress: viewFun("0x49c1d54d", "trusteeAddress()", {}, p.address), + trusteeFeeBps: viewFun("0x207134b0", "trusteeFeeBps()", {}, p.uint256), + unpauseCapital: fun("0x94828ffd", "unpauseCapital()", {}, ), + unpauseRebase: fun("0x09f49bf5", "unpauseRebase()", {}, ), + vaultBuffer: viewFun("0x1edfe3da", "vaultBuffer()", {}, p.uint256), + weth: viewFun("0x3fc8cef3", "weth()", {}, p.address), + wethAssetIndex: viewFun("0x54c6d858", "wethAssetIndex()", {}, p.uint256), + withdrawAllFromStrategies: fun("0xc9919112", "withdrawAllFromStrategies()", {}, ), + withdrawAllFromStrategy: fun("0x597c8910", "withdrawAllFromStrategy(address)", {"_strategyAddr": p.address}, ), + withdrawFromStrategy: fun("0xae69f3cb", "withdrawFromStrategy(address,address[],uint256[])", {"_strategyFromAddress": p.address, "_assets": p.array(p.address), "_amounts": p.array(p.uint256)}, ), + withdrawalQueueMetadata: viewFun("0x362bd1a3", "withdrawalQueueMetadata()", {}, p.struct({"queued": p.uint128, "claimable": p.uint128, "claimed": p.uint128, "nextWithdrawalIndex": p.uint128})), + withdrawalRequests: viewFun("0x937b2581", "withdrawalRequests(uint256)", {"requestId": p.uint256}, p.struct({"withdrawer": p.address, "claimed": p.bool, "amount": p.uint128, "queued": p.uint128})), +} + +export class Contract extends ContractBase { + + allowedSwapUndervalue() { + return this.eth_call(functions.allowedSwapUndervalue, {}) + } + + assetDefaultStrategies(_asset: AssetDefaultStrategiesParams["_asset"]) { + return this.eth_call(functions.assetDefaultStrategies, {_asset}) + } + + autoAllocateThreshold() { + return this.eth_call(functions.autoAllocateThreshold, {}) + } + + calculateRedeemOutputs(_amount: CalculateRedeemOutputsParams["_amount"]) { + return this.eth_call(functions.calculateRedeemOutputs, {_amount}) + } + + capitalPaused() { + return this.eth_call(functions.capitalPaused, {}) + } + + checkBalance(_asset: CheckBalanceParams["_asset"]) { + return this.eth_call(functions.checkBalance, {_asset}) + } + + getAllAssets() { + return this.eth_call(functions.getAllAssets, {}) + } + + getAllStrategies() { + return this.eth_call(functions.getAllStrategies, {}) + } + + getAssetConfig(_asset: GetAssetConfigParams["_asset"]) { + return this.eth_call(functions.getAssetConfig, {_asset}) + } + + getAssetCount() { + return this.eth_call(functions.getAssetCount, {}) + } + + getStrategyCount() { + return this.eth_call(functions.getStrategyCount, {}) + } + + governor() { + return this.eth_call(functions.governor, {}) + } + + isSupportedAsset(_asset: IsSupportedAssetParams["_asset"]) { + return this.eth_call(functions.isSupportedAsset, {_asset}) + } + + maxSupplyDiff() { + return this.eth_call(functions.maxSupplyDiff, {}) + } + + netOusdMintForStrategyThreshold() { + return this.eth_call(functions.netOusdMintForStrategyThreshold, {}) + } + + netOusdMintedForStrategy() { + return this.eth_call(functions.netOusdMintedForStrategy, {}) + } + + ousdMetaStrategy() { + return this.eth_call(functions.ousdMetaStrategy, {}) + } + + priceProvider() { + return this.eth_call(functions.priceProvider, {}) + } + + priceUnitMint(asset: PriceUnitMintParams["asset"]) { + return this.eth_call(functions.priceUnitMint, {asset}) + } + + priceUnitRedeem(asset: PriceUnitRedeemParams["asset"]) { + return this.eth_call(functions.priceUnitRedeem, {asset}) + } + + rebasePaused() { + return this.eth_call(functions.rebasePaused, {}) + } + + rebaseThreshold() { + return this.eth_call(functions.rebaseThreshold, {}) + } + + redeemFeeBps() { + return this.eth_call(functions.redeemFeeBps, {}) + } + + strategistAddr() { + return this.eth_call(functions.strategistAddr, {}) + } + + swapper() { + return this.eth_call(functions.swapper, {}) + } + + totalValue() { + return this.eth_call(functions.totalValue, {}) + } + + trusteeAddress() { + return this.eth_call(functions.trusteeAddress, {}) + } + + trusteeFeeBps() { + return this.eth_call(functions.trusteeFeeBps, {}) + } + + vaultBuffer() { + return this.eth_call(functions.vaultBuffer, {}) + } + + weth() { + return this.eth_call(functions.weth, {}) + } + + wethAssetIndex() { + return this.eth_call(functions.wethAssetIndex, {}) + } + + withdrawalQueueMetadata() { + return this.eth_call(functions.withdrawalQueueMetadata, {}) + } + + withdrawalRequests(requestId: WithdrawalRequestsParams["requestId"]) { + return this.eth_call(functions.withdrawalRequests, {requestId}) + } +} + +/// Event types +export type AllocateThresholdUpdatedEventArgs = EParams +export type AssetAllocatedEventArgs = EParams +export type AssetDefaultStrategyUpdatedEventArgs = EParams +export type AssetSupportedEventArgs = EParams +export type CapitalPausedEventArgs = EParams +export type CapitalUnpausedEventArgs = EParams +export type DripperChangedEventArgs = EParams +export type MaxSupplyDiffChangedEventArgs = EParams +export type MintEventArgs = EParams +export type PriceProviderUpdatedEventArgs = EParams +export type RebasePausedEventArgs = EParams +export type RebaseThresholdUpdatedEventArgs = EParams +export type RebaseUnpausedEventArgs = EParams +export type RedeemEventArgs = EParams +export type RedeemFeeUpdatedEventArgs = EParams +export type StrategistUpdatedEventArgs = EParams +export type StrategyApprovedEventArgs = EParams +export type StrategyRemovedEventArgs = EParams +export type SwapAllowedUndervalueChangedEventArgs = EParams +export type SwapSlippageChangedEventArgs = EParams +export type SwappedEventArgs = EParams +export type SwapperChangedEventArgs = EParams +export type TrusteeAddressChangedEventArgs = EParams +export type TrusteeFeeBpsChangedEventArgs = EParams +export type VaultBufferUpdatedEventArgs = EParams +export type WithdrawalClaimableEventArgs = EParams +export type WithdrawalClaimedEventArgs = EParams +export type WithdrawalRequestedEventArgs = EParams +export type YieldDistributionEventArgs = EParams + +/// Function types +export type AddWithdrawalQueueLiquidityParams = FunctionArguments +export type AddWithdrawalQueueLiquidityReturn = FunctionReturn + +export type AllocateParams = FunctionArguments +export type AllocateReturn = FunctionReturn + +export type AllowedSwapUndervalueParams = FunctionArguments +export type AllowedSwapUndervalueReturn = FunctionReturn + +export type ApproveStrategyParams = FunctionArguments +export type ApproveStrategyReturn = FunctionReturn + +export type AssetDefaultStrategiesParams = FunctionArguments +export type AssetDefaultStrategiesReturn = FunctionReturn + +export type AutoAllocateThresholdParams = FunctionArguments +export type AutoAllocateThresholdReturn = FunctionReturn + +export type BurnForStrategyParams = FunctionArguments +export type BurnForStrategyReturn = FunctionReturn + +export type CacheWETHAssetIndexParams = FunctionArguments +export type CacheWETHAssetIndexReturn = FunctionReturn + +export type CalculateRedeemOutputsParams = FunctionArguments +export type CalculateRedeemOutputsReturn = FunctionReturn + +export type CapitalPausedParams = FunctionArguments +export type CapitalPausedReturn = FunctionReturn + +export type CheckBalanceParams = FunctionArguments +export type CheckBalanceReturn = FunctionReturn + +export type ClaimGovernanceParams = FunctionArguments +export type ClaimGovernanceReturn = FunctionReturn + +export type ClaimWithdrawalParams = FunctionArguments +export type ClaimWithdrawalReturn = FunctionReturn + +export type ClaimWithdrawalsParams = FunctionArguments +export type ClaimWithdrawalsReturn = FunctionReturn + +export type DepositToStrategyParams = FunctionArguments +export type DepositToStrategyReturn = FunctionReturn + +export type GetAllAssetsParams = FunctionArguments +export type GetAllAssetsReturn = FunctionReturn + +export type GetAllStrategiesParams = FunctionArguments +export type GetAllStrategiesReturn = FunctionReturn + +export type GetAssetConfigParams = FunctionArguments +export type GetAssetConfigReturn = FunctionReturn + +export type GetAssetCountParams = FunctionArguments +export type GetAssetCountReturn = FunctionReturn + +export type GetStrategyCountParams = FunctionArguments +export type GetStrategyCountReturn = FunctionReturn + +export type GovernorParams = FunctionArguments +export type GovernorReturn = FunctionReturn + +export type InitializeParams = FunctionArguments +export type InitializeReturn = FunctionReturn + +export type IsSupportedAssetParams = FunctionArguments +export type IsSupportedAssetReturn = FunctionReturn + +export type MaxSupplyDiffParams = FunctionArguments +export type MaxSupplyDiffReturn = FunctionReturn + +export type MintParams = FunctionArguments +export type MintReturn = FunctionReturn + +export type MintForStrategyParams = FunctionArguments +export type MintForStrategyReturn = FunctionReturn + +export type NetOusdMintForStrategyThresholdParams = FunctionArguments +export type NetOusdMintForStrategyThresholdReturn = FunctionReturn + +export type NetOusdMintedForStrategyParams = FunctionArguments +export type NetOusdMintedForStrategyReturn = FunctionReturn + +export type OusdMetaStrategyParams = FunctionArguments +export type OusdMetaStrategyReturn = FunctionReturn + +export type PauseCapitalParams = FunctionArguments +export type PauseCapitalReturn = FunctionReturn + +export type PauseRebaseParams = FunctionArguments +export type PauseRebaseReturn = FunctionReturn + +export type PriceProviderParams = FunctionArguments +export type PriceProviderReturn = FunctionReturn + +export type PriceUnitMintParams = FunctionArguments +export type PriceUnitMintReturn = FunctionReturn + +export type PriceUnitRedeemParams = FunctionArguments +export type PriceUnitRedeemReturn = FunctionReturn + +export type RebaseParams = FunctionArguments +export type RebaseReturn = FunctionReturn + +export type RebasePausedParams = FunctionArguments +export type RebasePausedReturn = FunctionReturn + +export type RebaseThresholdParams = FunctionArguments +export type RebaseThresholdReturn = FunctionReturn + +export type RedeemParams = FunctionArguments +export type RedeemReturn = FunctionReturn + +export type RedeemAllParams = FunctionArguments +export type RedeemAllReturn = FunctionReturn + +export type RedeemFeeBpsParams = FunctionArguments +export type RedeemFeeBpsReturn = FunctionReturn + +export type RemoveAssetParams = FunctionArguments +export type RemoveAssetReturn = FunctionReturn + +export type RemoveStrategyParams = FunctionArguments +export type RemoveStrategyReturn = FunctionReturn + +export type RequestWithdrawalParams = FunctionArguments +export type RequestWithdrawalReturn = FunctionReturn + +export type SetAdminImplParams = FunctionArguments +export type SetAdminImplReturn = FunctionReturn + +export type SetAssetDefaultStrategyParams = FunctionArguments +export type SetAssetDefaultStrategyReturn = FunctionReturn + +export type SetAutoAllocateThresholdParams = FunctionArguments +export type SetAutoAllocateThresholdReturn = FunctionReturn + +export type SetDripperParams = FunctionArguments +export type SetDripperReturn = FunctionReturn + +export type SetMaxSupplyDiffParams = FunctionArguments +export type SetMaxSupplyDiffReturn = FunctionReturn + +export type SetNetOusdMintForStrategyThresholdParams = FunctionArguments +export type SetNetOusdMintForStrategyThresholdReturn = FunctionReturn + +export type SetOracleSlippageParams = FunctionArguments +export type SetOracleSlippageReturn = FunctionReturn + +export type SetOusdMetaStrategyParams = FunctionArguments +export type SetOusdMetaStrategyReturn = FunctionReturn + +export type SetPriceProviderParams = FunctionArguments +export type SetPriceProviderReturn = FunctionReturn + +export type SetRebaseThresholdParams = FunctionArguments +export type SetRebaseThresholdReturn = FunctionReturn + +export type SetRedeemFeeBpsParams = FunctionArguments +export type SetRedeemFeeBpsReturn = FunctionReturn + +export type SetStrategistAddrParams = FunctionArguments +export type SetStrategistAddrReturn = FunctionReturn + +export type SetSwapAllowedUndervalueParams = FunctionArguments +export type SetSwapAllowedUndervalueReturn = FunctionReturn + +export type SetSwapperParams = FunctionArguments +export type SetSwapperReturn = FunctionReturn + +export type SetTrusteeAddressParams = FunctionArguments +export type SetTrusteeAddressReturn = FunctionReturn + +export type SetTrusteeFeeBpsParams = FunctionArguments +export type SetTrusteeFeeBpsReturn = FunctionReturn + +export type SetVaultBufferParams = FunctionArguments +export type SetVaultBufferReturn = FunctionReturn + +export type StrategistAddrParams = FunctionArguments +export type StrategistAddrReturn = FunctionReturn + +export type SupportAssetParams = FunctionArguments +export type SupportAssetReturn = FunctionReturn + +export type SwapCollateralParams = FunctionArguments +export type SwapCollateralReturn = FunctionReturn + +export type SwapperParams = FunctionArguments +export type SwapperReturn = FunctionReturn + +export type TotalValueParams = FunctionArguments +export type TotalValueReturn = FunctionReturn + +export type TransferGovernanceParams = FunctionArguments +export type TransferGovernanceReturn = FunctionReturn + +export type TransferTokenParams = FunctionArguments +export type TransferTokenReturn = FunctionReturn + +export type TrusteeAddressParams = FunctionArguments +export type TrusteeAddressReturn = FunctionReturn + +export type TrusteeFeeBpsParams = FunctionArguments +export type TrusteeFeeBpsReturn = FunctionReturn + +export type UnpauseCapitalParams = FunctionArguments +export type UnpauseCapitalReturn = FunctionReturn + +export type UnpauseRebaseParams = FunctionArguments +export type UnpauseRebaseReturn = FunctionReturn + +export type VaultBufferParams = FunctionArguments +export type VaultBufferReturn = FunctionReturn + +export type WethParams = FunctionArguments +export type WethReturn = FunctionReturn + +export type WethAssetIndexParams = FunctionArguments +export type WethAssetIndexReturn = FunctionReturn + +export type WithdrawAllFromStrategiesParams = FunctionArguments +export type WithdrawAllFromStrategiesReturn = FunctionReturn + +export type WithdrawAllFromStrategyParams = FunctionArguments +export type WithdrawAllFromStrategyReturn = FunctionReturn + +export type WithdrawFromStrategyParams = FunctionArguments +export type WithdrawFromStrategyReturn = FunctionReturn + +export type WithdrawalQueueMetadataParams = FunctionArguments +export type WithdrawalQueueMetadataReturn = FunctionReturn + +export type WithdrawalRequestsParams = FunctionArguments +export type WithdrawalRequestsReturn = FunctionReturn + diff --git a/src/main-oeth.ts b/src/main-oeth.ts index 6b8fcb3..33ed4ca 100644 --- a/src/main-oeth.ts +++ b/src/main-oeth.ts @@ -15,6 +15,7 @@ import * as fraxStaking from './oeth/processors/frax-staking' import * as morphoAave from './oeth/processors/morpho-aave' import * as strategies from './oeth/processors/strategies' import * as vault from './oeth/processors/vault' +import * as withdrawals from './oeth/processors/withdrawals' import * as validateOeth from './oeth/validators/validate-oeth' export const processor = { @@ -30,6 +31,7 @@ export const processor = { balancerMetaPoolStrategy, strategies, exchangeRates, + withdrawals, ], postProcessors: [exchangeRatesPostProcessor, dailyStats, processStatus('oeth')], validators: [validateOeth], diff --git a/src/model/generated/index.ts b/src/model/generated/index.ts index ed1a278..1a746a5 100644 --- a/src/model/generated/index.ts +++ b/src/model/generated/index.ts @@ -59,6 +59,7 @@ export * from "./oethStrategyDailyStat.model" export * from "./oethStrategyHoldingDailyStat.model" export * from "./oethCollateralDailyStat.model" export * from "./oethRewardTokenCollected.model" +export * from "./oethWithdrawalRequest.model" export * from "./ogv.model" export * from "./ogvAddress.model" export * from "./ogvLockupTxLog.model" diff --git a/src/model/generated/oethWithdrawalRequest.model.ts b/src/model/generated/oethWithdrawalRequest.model.ts new file mode 100644 index 0000000..982d170 --- /dev/null +++ b/src/model/generated/oethWithdrawalRequest.model.ts @@ -0,0 +1,38 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, DateTimeColumn as DateTimeColumn_, Index as Index_, IntColumn as IntColumn_, BigIntColumn as BigIntColumn_, StringColumn as StringColumn_, BooleanColumn as BooleanColumn_} from "@subsquid/typeorm-store" + +@Entity_() +export class OETHWithdrawalRequest { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Index_() + @DateTimeColumn_({nullable: false}) + timestamp!: Date + + @Index_() + @IntColumn_({nullable: false}) + blockNumber!: number + + @BigIntColumn_({nullable: false}) + requestId!: bigint + + @StringColumn_({nullable: false}) + withdrawer!: string + + @BigIntColumn_({nullable: false}) + amount!: bigint + + @BigIntColumn_({nullable: false}) + queued!: bigint + + @BooleanColumn_({nullable: false}) + claimed!: boolean + + @Index_() + @StringColumn_({nullable: false}) + txHash!: string +} diff --git a/src/oeth/processors/withdrawals.ts b/src/oeth/processors/withdrawals.ts new file mode 100644 index 0000000..bfcfb2f --- /dev/null +++ b/src/oeth/processors/withdrawals.ts @@ -0,0 +1,88 @@ +import * as oethVault from '@abi/oeth-vault' +import { OETHWithdrawalRequest } from '@model' +import { Context } from '@processor' +import { EvmBatchProcessor } from '@subsquid/evm-processor' +import { OETH_VAULT_ADDRESS } from '@utils/addresses' +import { logFilter } from '@utils/logFilter' + +export const from = 20428558 + +interface ProcessResult { + withdrawalRequests: Map +} + +const withdrawalRequestedFilter = logFilter({ + address: [OETH_VAULT_ADDRESS], + topic0: [oethVault.events.WithdrawalRequested.topic], + range: { from }, +}) +const withdrawalClaimedFilter = logFilter({ + address: [OETH_VAULT_ADDRESS], + topic0: [oethVault.events.WithdrawalClaimed.topic], + range: { from }, +}) + +export const setup = (processor: EvmBatchProcessor) => { + processor.addLog(withdrawalRequestedFilter.value) + processor.addLog(withdrawalClaimedFilter.value) +} + +export const process = async (ctx: Context) => { + const result: ProcessResult = { + withdrawalRequests: new Map(), + } + + for (const block of ctx.blocks) { + for (const log of block.logs) { + if (withdrawalRequestedFilter.matches(log)) { + await processWithdrawalRequested(ctx, result, block, log) + } else if (withdrawalClaimedFilter.matches(log)) { + await processWithdrawalClaimed(ctx, result, block, log) + } + } + } + + await ctx.store.upsert([...result.withdrawalRequests.values()]) +} + +const processWithdrawalRequested = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks'][number], + log: Context['blocks'][number]['logs'][number], +) => { + const data = oethVault.events.WithdrawalRequested.decode(log) + + const withdrawalRequest = new OETHWithdrawalRequest({ + id: `${data._withdrawer.toLowerCase()}:${data._requestId}`, + blockNumber: block.header.height, + timestamp: new Date(block.header.timestamp), + requestId: data._requestId, + amount: data._amount, + claimed: false, + queued: data._queued, + withdrawer: data._withdrawer.toLowerCase(), + txHash: log.transactionHash, + }) + result.withdrawalRequests.set(withdrawalRequest.id, withdrawalRequest) +} + +const processWithdrawalClaimed = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks'][number], + log: Context['blocks'][number]['logs'][number], +) => { + const data = oethVault.events.WithdrawalClaimed.decode(log) + const id = `${data._withdrawer.toLowerCase()}:${data._requestId}` + let updated + if (result.withdrawalRequests.has(id)) { + updated = result.withdrawalRequests.get(id) + } else { + updated = await ctx.store.findOneBy(OETHWithdrawalRequest, { id }) + } + if (updated) { + updated.claimed = true + result.withdrawalRequests.set(id, updated) + } +} diff --git a/src/processor.ts b/src/processor.ts index 435e24c..bfabdb0 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -22,8 +22,8 @@ export const createSquidProcessor = ( ) => { const url = process.env[rpc_env] || 'http://localhost:8545' console.log(`RPC URL: ${url}`) - return new EvmBatchProcessor() - .setGateway(lookupArchive(archive)) + + const processor = new EvmBatchProcessor() .setRpcEndpoint({ url, maxBatchCallSize: url.includes('alchemy.com') ? 1 : 100, @@ -59,6 +59,15 @@ export const createSquidProcessor = ( createResultAddress: true, }, }) + + if (process.env.DISABLE_ARCHIVE !== 'true') { + console.log(`Archive: ${archive}`) + processor.setGateway(lookupArchive(archive)) + }else{ + console.log(`Archive disabled`) + } + + return processor } interface Processor {