diff --git a/src/adaptors/tokemak/abis/Autopool.js b/src/adaptors/tokemak/abis/Autopool.js new file mode 100644 index 000000000..8652c196f --- /dev/null +++ b/src/adaptors/tokemak/abis/Autopool.js @@ -0,0 +1,1393 @@ +module.exports = { + autopoolAbi: [ + { + inputs: [ + { + internalType: 'contract ISystemRegistry', + name: 'systemRegistry', + type: 'address', + }, + { internalType: 'address', name: '_vaultAsset', type: 'address' }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { inputs: [], name: 'AccessDenied', type: 'error' }, + { inputs: [], name: 'DepositFailed', type: 'error' }, + { + inputs: [ + { internalType: 'uint256', name: 'assets', type: 'uint256' }, + { internalType: 'uint256', name: 'maxDeposit', type: 'uint256' }, + ], + name: 'ERC4626DepositExceedsMax', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'uint256', name: 'shares', type: 'uint256' }, + { internalType: 'uint256', name: 'max', type: 'uint256' }, + ], + name: 'ERC4626ExceededMaxRedeem', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'uint256', name: 'assets', type: 'uint256' }, + { internalType: 'uint256', name: 'max', type: 'uint256' }, + ], + name: 'ERC4626ExceededMaxWithdraw', + type: 'error', + }, + { + inputs: [ + { internalType: 'uint256', name: 'shares', type: 'uint256' }, + { internalType: 'uint256', name: 'maxMint', type: 'uint256' }, + ], + name: 'ERC4626MintExceedsMax', + type: 'error', + }, + { + inputs: [{ internalType: 'uint256', name: 'deficit', type: 'uint256' }], + name: 'InsufficientFundsInDestinations', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'destination', type: 'address' }, + ], + name: 'InvalidDestination', + type: 'error', + }, + { inputs: [], name: 'InvalidDestinationVault', type: 'error' }, + { + inputs: [{ internalType: 'string', name: 'paramName', type: 'string' }], + name: 'InvalidParam', + type: 'error', + }, + { inputs: [], name: 'InvalidParams', type: 'error' }, + { + inputs: [ + { + internalType: 'enum IAutopool.VaultShutdownStatus', + name: 'status', + type: 'uint8', + }, + ], + name: 'InvalidShutdownStatus', + type: 'error', + }, + { inputs: [], name: 'InvalidUser', type: 'error' }, + { inputs: [], name: 'IsNotPaused', type: 'error' }, + { inputs: [], name: 'IsPaused', type: 'error' }, + { inputs: [], name: 'ItemExists', type: 'error' }, + { + inputs: [ + { internalType: 'uint256', name: 'oldNav', type: 'uint256' }, + { internalType: 'uint256', name: 'newNav', type: 'uint256' }, + ], + name: 'NavChanged', + type: 'error', + }, + { + inputs: [ + { internalType: 'uint256', name: 'oldNav', type: 'uint256' }, + { internalType: 'uint256', name: 'newNav', type: 'uint256' }, + ], + name: 'NavDecreased', + type: 'error', + }, + { inputs: [], name: 'NavOpsInProgress', type: 'error' }, + { + inputs: [ + { internalType: 'address', name: 'destinationVault', type: 'address' }, + ], + name: 'RebalanceDestinationsMatch', + type: 'error', + }, + { + inputs: [{ internalType: 'string', name: 'message', type: 'string' }], + name: 'RebalanceFailed', + type: 'error', + }, + { inputs: [], name: 'ReentrancyGuardReentrantCall', type: 'error' }, + { + inputs: [{ internalType: 'string', name: 'item', type: 'string' }], + name: 'RegistryItemMissing', + type: 'error', + }, + { inputs: [], name: 'RewarderAlreadySet', type: 'error' }, + { inputs: [], name: 'UndefinedAddress', type: 'error' }, + { + inputs: [ + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'uint256', name: 'shares', type: 'uint256' }, + ], + name: 'ValueSharesMismatch', + type: 'error', + }, + { inputs: [], name: 'VaultShutdown', type: 'error' }, + { + inputs: [ + { internalType: 'uint256', name: 'currentShares', type: 'uint256' }, + { internalType: 'uint256', name: 'cachedShares', type: 'uint256' }, + ], + name: 'WithdrawShareCalcInvalid', + type: 'error', + }, + { inputs: [], name: 'WithdrawalFailed', type: 'error' }, + { inputs: [], name: 'WithdrawalIncomplete', type: 'error' }, + { + inputs: [{ internalType: 'string', name: 'paramName', type: 'string' }], + name: 'ZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'destination', + type: 'address', + }, + ], + name: 'AddedToRemovalQueue', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + name: 'Deposit', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'destination', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'debtValue', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'claimed', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'claimGasUsed', + type: 'uint256', + }, + ], + name: 'DestinationDebtReporting', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'destination', + type: 'address', + }, + ], + name: 'DestinationVaultAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'destination', + type: 'address', + }, + ], + name: 'DestinationVaultRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'fees', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'feeSink', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'mintedShares', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'profit', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'idle', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'debt', + type: 'uint256', + }, + ], + name: 'FeeCollected', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'idle', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'debt', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalSupply', + type: 'uint256', + }, + ], + name: 'Nav', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Paused', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'fees', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'feeSink', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'mintedShares', + type: 'uint256', + }, + ], + name: 'PeriodicFeeCollected', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'destination', + type: 'address', + }, + ], + name: 'RemovedFromRemovalQueue', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newRewarder', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'oldRewarder', + type: 'address', + }, + ], + name: 'RewarderSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'enum IAutopool.VaultShutdownStatus', + name: 'reason', + type: 'uint8', + }, + ], + name: 'Shutdown', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + indexed: false, + internalType: 'string', + name: 'desc', + type: 'string', + }, + ], + name: 'SymbolAndDescSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address[]', + name: 'tokens', + type: 'address[]', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'address[]', + name: 'destinations', + type: 'address[]', + }, + ], + name: 'TokensPulled', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address[]', + name: 'tokens', + type: 'address[]', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'address[]', + name: 'destinations', + type: 'address[]', + }, + ], + name: 'TokensRecovered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Unpaused', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + name: 'Withdraw', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address[]', + name: 'destinations', + type: 'address[]', + }, + ], + name: 'WithdrawalQueueSet', + type: 'event', + }, + { + inputs: [], + name: 'DEAD_ADDRESS', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'FEE_DIVISOR', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'ONE', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'WETH_INIT_DEPOSIT', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'accessController', + outputs: [ + { + internalType: 'contract IAccessController', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address[]', name: 'destinations', type: 'address[]' }, + ], + name: 'addDestinations', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'spender', type: 'address' }, + ], + name: 'allowance', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + ], + name: 'approve', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'asset', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'autoPoolStrategy', + outputs: [ + { + internalType: 'contract IAutopoolStrategy', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'account', type: 'address' }], + name: 'balanceOf', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'account', type: 'address' }], + name: 'balanceOfActual', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + name: 'convertToAssets', + outputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'shares', type: 'uint256' }, + { + internalType: 'uint256', + name: 'totalAssetsForPurpose', + type: 'uint256', + }, + { internalType: 'uint256', name: 'supply', type: 'uint256' }, + { internalType: 'enum Math.Rounding', name: 'rounding', type: 'uint8' }, + ], + name: 'convertToAssets', + outputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'assets', type: 'uint256' }, + { + internalType: 'uint256', + name: 'totalAssetsForPurpose', + type: 'uint256', + }, + { internalType: 'uint256', name: 'supply', type: 'uint256' }, + { internalType: 'enum Math.Rounding', name: 'rounding', type: 'uint8' }, + ], + name: 'convertToShares', + outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }], + name: 'convertToShares', + outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'assets', type: 'uint256' }, + { internalType: 'address', name: 'receiver', type: 'address' }, + ], + name: 'deposit', + outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'factory', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC3156FlashBorrower', + name: 'receiver', + type: 'address', + }, + { + components: [ + { internalType: 'address', name: 'destinationIn', type: 'address' }, + { internalType: 'address', name: 'tokenIn', type: 'address' }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { + internalType: 'address', + name: 'destinationOut', + type: 'address', + }, + { internalType: 'address', name: 'tokenOut', type: 'address' }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + ], + internalType: 'struct IStrategy.RebalanceParams', + name: 'rebalanceParams', + type: 'tuple', + }, + { internalType: 'bytes', name: 'data', type: 'bytes' }, + ], + name: 'flashRebalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getAssetBreakdown', + outputs: [ + { + components: [ + { internalType: 'uint256', name: 'totalIdle', type: 'uint256' }, + { internalType: 'uint256', name: 'totalDebt', type: 'uint256' }, + { internalType: 'uint256', name: 'totalDebtMin', type: 'uint256' }, + { internalType: 'uint256', name: 'totalDebtMax', type: 'uint256' }, + ], + internalType: 'struct IAutopool.AssetBreakdown', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getDebtReportingQueue', + outputs: [{ internalType: 'address[]', name: '', type: 'address[]' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'destVault', type: 'address' }], + name: 'getDestinationInfo', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'cachedDebtValue', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'cachedMinDebtValue', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'cachedMaxDebtValue', + type: 'uint256', + }, + { internalType: 'uint256', name: 'lastReport', type: 'uint256' }, + { internalType: 'uint256', name: 'ownedShares', type: 'uint256' }, + ], + internalType: 'struct AutopoolDebt.DestinationInfo', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getDestinations', + outputs: [{ internalType: 'address[]', name: '', type: 'address[]' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getFeeSettings', + outputs: [ + { + components: [ + { internalType: 'address', name: 'feeSink', type: 'address' }, + { + internalType: 'uint256', + name: 'totalAssetsHighMark', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'totalAssetsHighMarkTimestamp', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastPeriodicFeeTake', + type: 'uint256', + }, + { + internalType: 'address', + name: 'periodicFeeSink', + type: 'address', + }, + { + internalType: 'uint256', + name: 'periodicFeeBps', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'streamingFeeBps', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'navPerShareLastFeeMark', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'navPerShareLastFeeMarkTimestamp', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'rebalanceFeeHighWaterMarkEnabled', + type: 'bool', + }, + ], + internalType: 'struct IAutopool.AutopoolFeeSettings', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPastRewarders', + outputs: [{ internalType: 'address[]', name: '', type: 'address[]' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getProfitUnlockSettings', + outputs: [ + { + components: [ + { + internalType: 'uint48', + name: 'unlockPeriodInSeconds', + type: 'uint48', + }, + { + internalType: 'uint48', + name: 'fullProfitUnlockTime', + type: 'uint48', + }, + { + internalType: 'uint48', + name: 'lastProfitUnlockTime', + type: 'uint48', + }, + { + internalType: 'uint256', + name: 'profitUnlockRate', + type: 'uint256', + }, + ], + internalType: 'struct IAutopool.ProfitUnlockSettings', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRemovalQueue', + outputs: [{ internalType: 'address[]', name: '', type: 'address[]' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getSystemRegistry', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getWithdrawalQueue', + outputs: [{ internalType: 'address[]', name: '', type: 'address[]' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'strategy', type: 'address' }, + { internalType: 'string', name: 'symbolSuffix', type: 'string' }, + { internalType: 'string', name: 'descPrefix', type: 'string' }, + { internalType: 'bytes', name: '', type: 'bytes' }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'dest', type: 'address' }], + name: 'isDestinationQueuedForRemoval', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'destination', type: 'address' }, + ], + name: 'isDestinationRegistered', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: '_pastRewarder', type: 'address' }, + ], + name: 'isPastRewarder', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'isShutdown', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'wallet', type: 'address' }], + name: 'maxDeposit', + outputs: [ + { internalType: 'uint256', name: 'maxAssets', type: 'uint256' }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'wallet', type: 'address' }], + name: 'maxMint', + outputs: [ + { internalType: 'uint256', name: 'maxShares', type: 'uint256' }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'owner', type: 'address' }], + name: 'maxRedeem', + outputs: [ + { internalType: 'uint256', name: 'maxShares', type: 'uint256' }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'owner', type: 'address' }], + name: 'maxWithdraw', + outputs: [ + { internalType: 'uint256', name: 'maxAssets', type: 'uint256' }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'shares', type: 'uint256' }, + { internalType: 'address', name: 'receiver', type: 'address' }, + ], + name: 'mint', + outputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: 'owner', type: 'address' }], + name: 'nonces', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'oldestDebtReporting', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'paused', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'uint256', name: 'deadline', type: 'uint256' }, + { internalType: 'uint8', name: 'v', type: 'uint8' }, + { internalType: 'bytes32', name: 'r', type: 'bytes32' }, + { internalType: 'bytes32', name: 's', type: 'bytes32' }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }], + name: 'previewDeposit', + outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + name: 'previewMint', + outputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + name: 'previewRedeem', + outputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }], + name: 'previewWithdraw', + outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address[]', name: 'tokens', type: 'address[]' }, + { internalType: 'uint256[]', name: 'amounts', type: 'uint256[]' }, + { internalType: 'address[]', name: 'destinations', type: 'address[]' }, + ], + name: 'recover', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'shares', type: 'uint256' }, + { internalType: 'address', name: 'receiver', type: 'address' }, + { internalType: 'address', name: 'owner', type: 'address' }, + ], + name: 'redeem', + outputs: [{ internalType: 'uint256', name: 'assets', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address[]', name: 'destinations', type: 'address[]' }, + ], + name: 'removeDestinations', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'rewarder', + outputs: [ + { internalType: 'contract IMainRewarder', name: '', type: 'address' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'newFeeSink', type: 'address' }, + ], + name: 'setFeeSink', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'fee', type: 'uint256' }], + name: 'setPeriodicFeeBps', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newPeriodicFeeSink', + type: 'address', + }, + ], + name: 'setPeriodicFeeSink', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint48', + name: 'newUnlockPeriodSeconds', + type: 'uint48', + }, + ], + name: 'setProfitUnlockPeriod', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'bool', name: 'enabled', type: 'bool' }], + name: 'setRebalanceFeeHighWaterMarkEnabled', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_rewarder', type: 'address' }], + name: 'setRewarder', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'fee', type: 'uint256' }], + name: 'setStreamingFeeBps', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'string', name: 'newSymbol', type: 'string' }, + { internalType: 'string', name: 'newName', type: 'string' }, + ], + name: 'setSymbolAndDescAfterShutdown', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum IAutopool.VaultShutdownStatus', + name: 'reason', + type: 'uint8', + }, + ], + name: 'shutdown', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'shutdownStatus', + outputs: [ + { + internalType: 'enum IAutopool.VaultShutdownStatus', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalAssets', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'enum IAutopool.TotalAssetPurpose', + name: 'purpose', + type: 'uint8', + }, + ], + name: 'totalAssets', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + ], + name: 'transfer', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + ], + name: 'transferFrom', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'unlockedShares', + outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'unpause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'numToProcess', type: 'uint256' }, + ], + name: 'updateDebtReporting', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'vaultType', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'assets', type: 'uint256' }, + { internalType: 'address', name: 'receiver', type: 'address' }, + { internalType: 'address', name: 'owner', type: 'address' }, + ], + name: 'withdraw', + outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'function', + }, + ], +}; diff --git a/src/adaptors/tokemak/abis/AutopoolETHStrategy.js b/src/adaptors/tokemak/abis/AutopoolETHStrategy.js new file mode 100644 index 000000000..524c763e0 --- /dev/null +++ b/src/adaptors/tokemak/abis/AutopoolETHStrategy.js @@ -0,0 +1,1108 @@ +module.exports = { + autopoolETHStrategyAbi: [ + { + inputs: [ + { + internalType: 'contract ISystemRegistry', + name: '_systemRegistry', + type: 'address', + }, + { + components: [ + { + components: [ + { internalType: 'uint16', name: 'initInDays', type: 'uint16' }, + { + internalType: 'uint16', + name: 'tightenThresholdInViolations', + type: 'uint16', + }, + { + internalType: 'uint16', + name: 'tightenStepInDays', + type: 'uint16', + }, + { + internalType: 'uint16', + name: 'relaxThresholdInDays', + type: 'uint16', + }, + { + internalType: 'uint16', + name: 'relaxStepInDays', + type: 'uint16', + }, + { internalType: 'uint16', name: 'maxInDays', type: 'uint16' }, + { internalType: 'uint16', name: 'minInDays', type: 'uint16' }, + ], + internalType: + 'struct AutopoolETHStrategyConfig.SwapCostOffsetConfig', + name: 'swapCostOffset', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint8', + name: 'lookback1InDays', + type: 'uint8', + }, + { + internalType: 'uint8', + name: 'lookback2InDays', + type: 'uint8', + }, + { + internalType: 'uint8', + name: 'lookback3InDays', + type: 'uint8', + }, + ], + internalType: + 'struct AutopoolETHStrategyConfig.NavLookbackConfig', + name: 'navLookback', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'maxNormalOperationSlippage', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxTrimOperationSlippage', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxEmergencyOperationSlippage', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'maxShutdownOperationSlippage', + type: 'uint256', + }, + ], + internalType: 'struct AutopoolETHStrategyConfig.SlippageConfig', + name: 'slippage', + type: 'tuple', + }, + { + components: [ + { internalType: 'uint256', name: 'baseYield', type: 'uint256' }, + { internalType: 'uint256', name: 'feeYield', type: 'uint256' }, + { + internalType: 'uint256', + name: 'incentiveYield', + type: 'uint256', + }, + { + internalType: 'int256', + name: 'priceDiscountExit', + type: 'int256', + }, + { + internalType: 'int256', + name: 'priceDiscountEnter', + type: 'int256', + }, + { + internalType: 'int256', + name: 'pricePremium', + type: 'int256', + }, + ], + internalType: 'struct AutopoolETHStrategyConfig.ModelWeights', + name: 'modelWeights', + type: 'tuple', + }, + { + internalType: 'uint16', + name: 'pauseRebalancePeriodInDays', + type: 'uint16', + }, + { + internalType: 'uint256', + name: 'rebalanceTimeGapInSeconds', + type: 'uint256', + }, + { internalType: 'int256', name: 'maxPremium', type: 'int256' }, + { internalType: 'int256', name: 'maxDiscount', type: 'int256' }, + { + internalType: 'uint40', + name: 'staleDataToleranceInSeconds', + type: 'uint40', + }, + { + internalType: 'int256', + name: 'maxAllowedDiscount', + type: 'int256', + }, + { + internalType: 'uint256', + name: 'lstPriceGapTolerance', + type: 'uint256', + }, + { internalType: 'address[5]', name: 'hooks', type: 'address[5]' }, + ], + internalType: 'struct AutopoolETHStrategyConfig.StrategyConfig', + name: 'conf', + type: 'tuple', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { inputs: [], name: 'AccessDenied', type: 'error' }, + { inputs: [], name: 'CannotConvertUintToInt', type: 'error' }, + { inputs: [], name: 'CannotConvertUintToInt', type: 'error' }, + { inputs: [], name: 'IdleHighThresholdViolated', type: 'error' }, + { inputs: [], name: 'InconsistentIdleThresholds', type: 'error' }, + { + inputs: [{ internalType: 'address', name: 'asset', type: 'address' }], + name: 'InsufficientAssets', + type: 'error', + }, + { + inputs: [{ internalType: 'string', name: 'paramName', type: 'string' }], + name: 'InvalidConfig', + type: 'error', + }, + { + inputs: [ + { internalType: 'uint40', name: 'current', type: 'uint40' }, + { internalType: 'uint40', name: 'provided', type: 'uint40' }, + ], + name: 'InvalidNavTimestamp', + type: 'error', + }, + { + inputs: [{ internalType: 'string', name: 'paramName', type: 'string' }], + name: 'InvalidParam', + type: 'error', + }, + { inputs: [], name: 'InvalidRebalanceToIdle', type: 'error' }, + { inputs: [], name: 'LSTPriceGapToleranceExceeded', type: 'error' }, + { inputs: [], name: 'MaxDiscountExceeded', type: 'error' }, + { inputs: [], name: 'MaxPremiumExceeded', type: 'error' }, + { inputs: [], name: 'MaxSlippageExceeded', type: 'error' }, + { inputs: [], name: 'NavHistoryInsufficient', type: 'error' }, + { inputs: [], name: 'NotAutopoolETH', type: 'error' }, + { inputs: [], name: 'OnlyRebalanceToIdleAvailable', type: 'error' }, + { + inputs: [ + { internalType: 'address', name: 'destination', type: 'address' }, + { internalType: 'address', name: 'trueUnderlyer', type: 'address' }, + { internalType: 'address', name: 'providedUnderlyer', type: 'address' }, + ], + name: 'RebalanceDestinationUnderlyerMismatch', + type: 'error', + }, + { inputs: [], name: 'RebalanceDestinationsMatch', type: 'error' }, + { inputs: [], name: 'RebalanceTimeGapNotMet', type: 'error' }, + { + inputs: [{ internalType: 'string', name: 'name', type: 'string' }], + name: 'StaleData', + type: 'error', + }, + { inputs: [], name: 'StrategyPaused', type: 'error' }, + { inputs: [], name: 'SwapCostExceeded', type: 'error' }, + { inputs: [], name: 'SystemRegistryMismatch', type: 'error' }, + { inputs: [], name: 'UndefinedAddress', type: 'error' }, + { + inputs: [{ internalType: 'address', name: 'dest', type: 'address' }], + name: 'UnregisteredDestination', + type: 'error', + }, + { + inputs: [{ internalType: 'string', name: 'paramName', type: 'string' }], + name: 'ZeroAddress', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'assetIndex', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'numViolationsOne', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'numViolationsTwo', + type: 'uint256', + }, + { + indexed: false, + internalType: 'int256', + name: 'discount', + type: 'int256', + }, + ], + name: 'DestTrimRebalanceDetails', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'trimAmount', + type: 'uint256', + }, + ], + name: 'DestViolationMaxTrimAmount', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newValue', + type: 'uint256', + }, + ], + name: 'DustPositionPortionSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newLowValue', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'newHighValue', + type: 'uint256', + }, + ], + name: 'IdleThresholdsSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'newPriceGap', + type: 'uint256', + }, + ], + name: 'LstPriceGapSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'navPerShare', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'nav1', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'nav2', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'nav3', + type: 'uint256', + }, + ], + name: 'PauseStart', + type: 'event', + }, + { anonymous: false, inputs: [], name: 'PauseStop', type: 'event' }, + { + anonymous: false, + inputs: [ + { + components: [ + { internalType: 'uint256', name: 'inPrice', type: 'uint256' }, + { internalType: 'uint256', name: 'outPrice', type: 'uint256' }, + { internalType: 'uint256', name: 'inEthValue', type: 'uint256' }, + { internalType: 'uint256', name: 'outEthValue', type: 'uint256' }, + { internalType: 'uint256', name: 'swapCost', type: 'uint256' }, + { internalType: 'uint256', name: 'slippage', type: 'uint256' }, + ], + indexed: false, + internalType: 'struct SummaryStats.RebalanceValueStats', + name: 'valueStats', + type: 'tuple', + }, + { + components: [ + { internalType: 'address', name: 'destinationIn', type: 'address' }, + { internalType: 'address', name: 'tokenIn', type: 'address' }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { + internalType: 'address', + name: 'destinationOut', + type: 'address', + }, + { internalType: 'address', name: 'tokenOut', type: 'address' }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + ], + indexed: false, + internalType: 'struct IStrategy.RebalanceParams', + name: 'params', + type: 'tuple', + }, + { + components: [ + { internalType: 'address', name: 'destination', type: 'address' }, + { internalType: 'uint256', name: 'baseApr', type: 'uint256' }, + { internalType: 'uint256', name: 'feeApr', type: 'uint256' }, + { internalType: 'uint256', name: 'incentiveApr', type: 'uint256' }, + { + internalType: 'uint256', + name: 'safeTotalSupply', + type: 'uint256', + }, + { internalType: 'int256', name: 'priceReturn', type: 'int256' }, + { internalType: 'int256', name: 'maxDiscount', type: 'int256' }, + { internalType: 'int256', name: 'maxPremium', type: 'int256' }, + { internalType: 'uint256', name: 'ownedShares', type: 'uint256' }, + { internalType: 'int256', name: 'compositeReturn', type: 'int256' }, + { internalType: 'uint256', name: 'pricePerShare', type: 'uint256' }, + ], + indexed: false, + internalType: 'struct IStrategy.SummaryStats', + name: 'outSummaryStats', + type: 'tuple', + }, + { + components: [ + { internalType: 'address', name: 'destination', type: 'address' }, + { internalType: 'uint256', name: 'baseApr', type: 'uint256' }, + { internalType: 'uint256', name: 'feeApr', type: 'uint256' }, + { internalType: 'uint256', name: 'incentiveApr', type: 'uint256' }, + { + internalType: 'uint256', + name: 'safeTotalSupply', + type: 'uint256', + }, + { internalType: 'int256', name: 'priceReturn', type: 'int256' }, + { internalType: 'int256', name: 'maxDiscount', type: 'int256' }, + { internalType: 'int256', name: 'maxPremium', type: 'int256' }, + { internalType: 'uint256', name: 'ownedShares', type: 'uint256' }, + { internalType: 'int256', name: 'compositeReturn', type: 'int256' }, + { internalType: 'uint256', name: 'pricePerShare', type: 'uint256' }, + ], + indexed: false, + internalType: 'struct IStrategy.SummaryStats', + name: 'inSummaryStats', + type: 'tuple', + }, + { + indexed: false, + internalType: 'uint256', + name: 'swapOffsetPeriod', + type: 'uint256', + }, + { + indexed: false, + internalType: 'int256', + name: 'predictedAnnualizedGain', + type: 'int256', + }, + ], + name: 'RebalanceBetweenDestinations', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + components: [ + { internalType: 'uint256', name: 'inPrice', type: 'uint256' }, + { internalType: 'uint256', name: 'outPrice', type: 'uint256' }, + { internalType: 'uint256', name: 'inEthValue', type: 'uint256' }, + { internalType: 'uint256', name: 'outEthValue', type: 'uint256' }, + { internalType: 'uint256', name: 'swapCost', type: 'uint256' }, + { internalType: 'uint256', name: 'slippage', type: 'uint256' }, + ], + indexed: false, + internalType: 'struct SummaryStats.RebalanceValueStats', + name: 'valueStats', + type: 'tuple', + }, + { + components: [ + { internalType: 'address', name: 'destination', type: 'address' }, + { internalType: 'uint256', name: 'baseApr', type: 'uint256' }, + { internalType: 'uint256', name: 'feeApr', type: 'uint256' }, + { internalType: 'uint256', name: 'incentiveApr', type: 'uint256' }, + { + internalType: 'uint256', + name: 'safeTotalSupply', + type: 'uint256', + }, + { internalType: 'int256', name: 'priceReturn', type: 'int256' }, + { internalType: 'int256', name: 'maxDiscount', type: 'int256' }, + { internalType: 'int256', name: 'maxPremium', type: 'int256' }, + { internalType: 'uint256', name: 'ownedShares', type: 'uint256' }, + { internalType: 'int256', name: 'compositeReturn', type: 'int256' }, + { internalType: 'uint256', name: 'pricePerShare', type: 'uint256' }, + ], + indexed: false, + internalType: 'struct IStrategy.SummaryStats', + name: 'outSummary', + type: 'tuple', + }, + { + components: [ + { internalType: 'address', name: 'destinationIn', type: 'address' }, + { internalType: 'address', name: 'tokenIn', type: 'address' }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { + internalType: 'address', + name: 'destinationOut', + type: 'address', + }, + { internalType: 'address', name: 'tokenOut', type: 'address' }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + ], + indexed: false, + internalType: 'struct IStrategy.RebalanceParams', + name: 'params', + type: 'tuple', + }, + ], + name: 'RebalanceToIdle', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'enum AutopoolETHStrategy.RebalanceToIdleReasonEnum', + name: 'reason', + type: 'uint8', + }, + { + indexed: false, + internalType: 'uint256', + name: 'maxSlippage', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'slippage', + type: 'uint256', + }, + ], + name: 'RebalanceToIdleReason', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'destinationOut', + type: 'address', + }, + { + indexed: false, + internalType: 'uint40', + name: 'lastRebalanceTimestamp', + type: 'uint40', + }, + { + indexed: false, + internalType: 'uint40', + name: 'lastTimestampAddedToDestination', + type: 'uint40', + }, + { + indexed: false, + internalType: 'uint40', + name: 'swapCostOffsetPeriod', + type: 'uint40', + }, + ], + name: 'SuccessfulRebalanceBetweenDestinations', + type: 'event', + }, + { + inputs: [], + name: 'accessController', + outputs: [ + { + internalType: 'contract IAccessController', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'autoPool', + outputs: [ + { internalType: 'contract IAutopool', name: '', type: 'address' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'defaultLstPriceGapTolerance', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'dustPositionPortions', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'expiredRewardTolerance', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'destAddress', type: 'address' }, + { + internalType: 'enum IAutopoolStrategy.RebalanceDirection', + name: 'direction', + type: 'uint8', + }, + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + ], + name: 'getDestinationSummaryStats', + outputs: [ + { + components: [ + { internalType: 'address', name: 'destination', type: 'address' }, + { internalType: 'uint256', name: 'baseApr', type: 'uint256' }, + { internalType: 'uint256', name: 'feeApr', type: 'uint256' }, + { internalType: 'uint256', name: 'incentiveApr', type: 'uint256' }, + { + internalType: 'uint256', + name: 'safeTotalSupply', + type: 'uint256', + }, + { internalType: 'int256', name: 'priceReturn', type: 'int256' }, + { internalType: 'int256', name: 'maxDiscount', type: 'int256' }, + { internalType: 'int256', name: 'maxPremium', type: 'int256' }, + { internalType: 'uint256', name: 'ownedShares', type: 'uint256' }, + { internalType: 'int256', name: 'compositeReturn', type: 'int256' }, + { internalType: 'uint256', name: 'pricePerShare', type: 'uint256' }, + ], + internalType: 'struct IStrategy.SummaryStats', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getHooks', + outputs: [ + { internalType: 'address[]', name: 'hooks', type: 'address[]' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'address', name: 'destinationIn', type: 'address' }, + { internalType: 'address', name: 'tokenIn', type: 'address' }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { + internalType: 'address', + name: 'destinationOut', + type: 'address', + }, + { internalType: 'address', name: 'tokenOut', type: 'address' }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + ], + internalType: 'struct IStrategy.RebalanceParams', + name: 'rebalanceParams', + type: 'tuple', + }, + ], + name: 'getRebalanceOutSummaryStats', + outputs: [ + { + components: [ + { internalType: 'address', name: 'destination', type: 'address' }, + { internalType: 'uint256', name: 'baseApr', type: 'uint256' }, + { internalType: 'uint256', name: 'feeApr', type: 'uint256' }, + { internalType: 'uint256', name: 'incentiveApr', type: 'uint256' }, + { + internalType: 'uint256', + name: 'safeTotalSupply', + type: 'uint256', + }, + { internalType: 'int256', name: 'priceReturn', type: 'int256' }, + { internalType: 'int256', name: 'maxDiscount', type: 'int256' }, + { internalType: 'int256', name: 'maxPremium', type: 'int256' }, + { internalType: 'uint256', name: 'ownedShares', type: 'uint256' }, + { internalType: 'int256', name: 'compositeReturn', type: 'int256' }, + { internalType: 'uint256', name: 'pricePerShare', type: 'uint256' }, + ], + internalType: 'struct IStrategy.SummaryStats', + name: 'outSummary', + type: 'tuple', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getSystemRegistry', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'idleHighThreshold', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'idleLowThreshold', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '_autoPool', type: 'address' }], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'lastAddTimestampByDestination', + outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'lastPausedTimestamp', + outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'lastRebalanceTimestamp', + outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'lstPriceGapTolerance', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxAllowedDiscount', + outputs: [{ internalType: 'int256', name: '', type: 'int256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxDiscount', + outputs: [{ internalType: 'int256', name: '', type: 'int256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxEmergencyOperationSlippage', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxNormalOperationSlippage', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxPremium', + outputs: [{ internalType: 'int256', name: '', type: 'int256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxShutdownOperationSlippage', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxTrimOperationSlippage', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'navLookback1InDays', + outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'navLookback2InDays', + outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'navLookback3InDays', + outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'navTrackingState', + outputs: [ + { internalType: 'uint8', name: 'len', type: 'uint8' }, + { internalType: 'uint8', name: 'currentIndex', type: 'uint8' }, + { + internalType: 'uint40', + name: 'lastFinalizedTimestamp', + type: 'uint40', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'navPerShare', type: 'uint256' }, + ], + name: 'navUpdate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'pauseRebalancePeriodInDays', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'paused', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'address', name: 'destinationIn', type: 'address' }, + { internalType: 'address', name: 'tokenIn', type: 'address' }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { + internalType: 'address', + name: 'destinationOut', + type: 'address', + }, + { internalType: 'address', name: 'tokenOut', type: 'address' }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + ], + internalType: 'struct IStrategy.RebalanceParams', + name: 'params', + type: 'tuple', + }, + ], + name: 'rebalanceSuccessfullyExecuted', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'rebalanceTimeGapInSeconds', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'newValue', type: 'uint256' }], + name: 'setDustPositionPortions', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'newLowValue', type: 'uint256' }, + { internalType: 'uint256', name: 'newHighValue', type: 'uint256' }, + ], + name: 'setIdleThresholds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'priceGapTolerance', type: 'uint256' }, + ], + name: 'setLstPriceGapTolerance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'staleDataToleranceInSeconds', + outputs: [{ internalType: 'uint40', name: '', type: 'uint40' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'swapCostOffsetInit', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'swapCostOffsetInitInDays', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'swapCostOffsetMaxInDays', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'swapCostOffsetMinInDays', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'swapCostOffsetPeriodInDays', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'swapCostOffsetRelaxStepInDays', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'swapCostOffsetRelaxThresholdInDays', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'swapCostOffsetTightenStepInDays', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'swapCostOffsetTightenThresholdInViolations', + outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'address', name: 'destinationIn', type: 'address' }, + { internalType: 'address', name: 'tokenIn', type: 'address' }, + { internalType: 'uint256', name: 'amountIn', type: 'uint256' }, + { + internalType: 'address', + name: 'destinationOut', + type: 'address', + }, + { internalType: 'address', name: 'tokenOut', type: 'address' }, + { internalType: 'uint256', name: 'amountOut', type: 'uint256' }, + ], + internalType: 'struct IStrategy.RebalanceParams', + name: 'params', + type: 'tuple', + }, + { + components: [ + { internalType: 'address', name: 'destination', type: 'address' }, + { internalType: 'uint256', name: 'baseApr', type: 'uint256' }, + { internalType: 'uint256', name: 'feeApr', type: 'uint256' }, + { internalType: 'uint256', name: 'incentiveApr', type: 'uint256' }, + { + internalType: 'uint256', + name: 'safeTotalSupply', + type: 'uint256', + }, + { internalType: 'int256', name: 'priceReturn', type: 'int256' }, + { internalType: 'int256', name: 'maxDiscount', type: 'int256' }, + { internalType: 'int256', name: 'maxPremium', type: 'int256' }, + { internalType: 'uint256', name: 'ownedShares', type: 'uint256' }, + { internalType: 'int256', name: 'compositeReturn', type: 'int256' }, + { internalType: 'uint256', name: 'pricePerShare', type: 'uint256' }, + ], + internalType: 'struct IStrategy.SummaryStats', + name: 'outSummary', + type: 'tuple', + }, + ], + name: 'verifyRebalance', + outputs: [ + { internalType: 'bool', name: 'success', type: 'bool' }, + { internalType: 'string', name: 'message', type: 'string' }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'violationTrackingState', + outputs: [ + { internalType: 'uint8', name: 'violationCount', type: 'uint8' }, + { internalType: 'uint8', name: 'len', type: 'uint8' }, + { internalType: 'uint16', name: 'violations', type: 'uint16' }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'weightBase', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'weightFee', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'weightIncentive', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'weightPriceDiscountEnter', + outputs: [{ internalType: 'int256', name: '', type: 'int256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'weightPriceDiscountExit', + outputs: [{ internalType: 'int256', name: '', type: 'int256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'weightPricePremium', + outputs: [{ internalType: 'int256', name: '', type: 'int256' }], + stateMutability: 'view', + type: 'function', + }, + ], +}; diff --git a/src/adaptors/tokemak/index.js b/src/adaptors/tokemak/index.js index c3ec2a41f..0172a1ed3 100644 --- a/src/adaptors/tokemak/index.js +++ b/src/adaptors/tokemak/index.js @@ -1,67 +1,151 @@ const sdk = require('@defillama/sdk'); -const { default: BigNumber } = require('bignumber.js'); -const poolAbi = require('./poolAbi.json'); -const reactors = require('./reactors.json'); -const { fetchURL } = require('../../helper/utils'); - -const PRICE_DECIMALS = 8; - -async function lpBalances() { - const totalSupplies = (await sdk.api.abi.multiCall({ - abi: poolAbi.find(({ name }) => name === 'totalSupply'), - calls: reactors.map((reactor) => ({ - target: reactor.poolAddress - })) - })).output.map(({ output }) => new BigNumber(output)); - - const withdrawals = (await sdk.api.abi.multiCall({ - abi: poolAbi.find(({ name }) => name === 'withheldLiquidity'), - calls: reactors.map((reactor) => ({ - target: reactor.poolAddress - })) - })).output.map(({ output }) => new BigNumber(output)); - - const balances = totalSupplies.map((totalSupply, i) => totalSupply.minus(withdrawals[i])); - - return balances; -} - -async function getPrices() { - return await fetchURL('https://tokemakmarketdata.s3.amazonaws.com/current.json'); -} +const { BigNumber, utils: etherUtils } = require('ethers'); +const { request, gql } = require('graphql-request'); +const axios = require('axios'); -async function getAprData() { - return await fetchURL('https://auto-rewards-prod-bucket-pool-stats-api-tokemakxyz.s3.amazonaws.com/current.json'); -} +const { autopoolAbi } = require('./abis/Autopool'); +const { autopoolETHStrategyAbi } = require('./abis/AutopoolETHStrategy'); -function calculateTvl(totalSupply, decimals, price) { - const priceInUSD = new BigNumber(price * (10 ** PRICE_DECIMALS)); +const WETH = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'; +const V2_GEN3_ETH_MAINNET_SUBGRAPH_URL = + 'https://subgraph.satsuma-prod.com/56ca3b0c9fd0/tokemak/v2-gen3-eth-mainnet/api'; - const divisor = new BigNumber(10 ** decimals); +const autopoolsQuery = gql` + query AutopoolsQuery { + autopools { + name + id + nav + symbol + nav + baseAsset { + id + decimals + } + day7MAApy + day30MAApy + periodicFee + streamingFee + rewarder { + currentApy + rewardToken { + id + } + } + destinationVaults { + id + underlyer { + decimals + } + } + strategy { + id + } + } + } +`; - const tvl = totalSupply.multipliedBy(priceInUSD).dividedBy(divisor); - return tvl.dividedBy(10 ** PRICE_DECIMALS).toNumber(); -} +const getAutopools = async () => { + const { autopools } = await request( + V2_GEN3_ETH_MAINNET_SUBGRAPH_URL, + autopoolsQuery, + {} + ); + return autopools; +}; -function poolApr(aprData, reactor) { - const apr = aprData.find(({ address }) => address.toLowerCase() === reactor.poolAddress.toLowerCase())?.liquidityProviderApr; - return apr ? parseFloat(apr) * 100 : 0; -} +const getWethPrice = async () => { + const wethPriceKey = `ethereum:${WETH}`; + const wethPrice = ( + await axios.get(`https://coins.llama.fi/prices/current/${wethPriceKey}`) + ).data.coins[wethPriceKey]?.price; + return wethPrice; +}; async function main() { - const balances = await lpBalances(); - const { data: { prices } } = await getPrices(); - const { data: { chains: [{ pools: aprData }]} } = await getAprData(); + const autopools = await getAutopools(); + + // Get the summary stats for all autopools and destinations + const results = await sdk.api.abi.multiCall({ + abi: autopoolETHStrategyAbi.find( + ({ name }) => name === 'getDestinationSummaryStats' + ), + calls: autopools.flatMap((autopool) => { + return autopool.destinationVaults.map((destVault) => { + return { + target: autopool.strategy.id, + params: [ + destVault.id, + 1, + BigNumber.from(10).pow(destVault.underlyer.decimals).toString(), + ], + }; + }); + }), + chain: 'ethereum', + permitFailure: false, + }); + + // Determine the max compositeReturn for each Autopool + let ix = 0; + const autopoolCRs = {}; + for (let a = 0; a < autopools.length; a++) { + const autopool = autopools[a]; + const dl = autopool.destinationVaults.length; + let maxCompositeReturn = 0; + for (let d = 0; d < dl; d++) { + const result = results.output[ix + d]; + + let cr = Number( + etherUtils.formatUnits(result.output.compositeReturn, 18) + ); + + // Calculate compositeReturn net of estimated fees + cr = + (cr - Number(etherUtils.formatUnits(autopool.periodicFee, 4))) * + (1 - Number(etherUtils.formatUnits(autopool.streamingFee, 4))); + + if (cr > maxCompositeReturn) { + maxCompositeReturn = cr; + } + } + autopoolCRs[autopool.id] = maxCompositeReturn; + + ix += dl; + } + + const wethPrice = await getWethPrice(); - const pools = reactors.map((reactor, i) => ({ - pool: reactor.poolAddress, + const pools = autopools.map((pool, i) => ({ + pool: pool.id, chain: 'Ethereum', project: 'tokemak', - symbol: reactor.symbol, - tvlUsd: calculateTvl(balances[i], reactor.decimals, prices[reactor.symbol.toLowerCase()]), - rewardTokens: ['0x2e9d63788249371f1DFC918a52f8d799F4a38C94'], // TOKEMAK reward - underlyingTokens: [reactor.tokenAddress], - apyReward: poolApr(aprData, reactor), + symbol: pool.symbol, + tvlUsd: + Number(etherUtils.formatUnits(pool.nav, pool.baseAsset.decimals)) * + wethPrice, + rewardTokens: [pool.rewarder.rewardToken.id], + underlyingTokens: [pool.baseAsset.id], + apyBase: + // Use the 30 day MA when we have it, falling back to the 7 when we don't, and finally to the max compositeReturn + (pool.day30MAApy + ? Number( + etherUtils.formatUnits(pool.day30MAApy, pool.baseAsset.decimals) + ) + : pool.day7MAApy + ? Number( + etherUtils.formatUnits(pool.day7MAApy, pool.baseAsset.decimals) + ) + : autopoolCRs[pool.id]) || 0, + apyReward: pool.rewarder.currentApy + ? Number( + etherUtils.formatUnits( + pool.rewarder.currentApy, + pool.baseAsset.decimals + ) + ) + : 0, + url: 'https://app.tokemak.xyz/autopool?id=' + pool.id, })); return pools; @@ -70,5 +154,5 @@ async function main() { module.exports = { timeTravel: false, apy: main, - url: 'https://app.tokemak.xyz' + url: 'https://app.tokemak.xyz', }; diff --git a/src/adaptors/tokemak/poolAbi.json b/src/adaptors/tokemak/poolAbi.json deleted file mode 100644 index 3c4ff25dd..000000000 --- a/src/adaptors/tokemak/poolAbi.json +++ /dev/null @@ -1,538 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approveManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "depositFor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20Upgradeable", - "name": "_underlyer", - "type": "address" - }, - { - "internalType": "contract IManager", - "name": "_manager", - "type": "address" - }, - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "contract IManager", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "requestWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "requestedWithdrawals", - "outputs": [ - { - "internalType": "uint256", - "name": "minCycle", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "underlyer", - "outputs": [ - { - "internalType": "contract IERC20Upgradeable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "requestedAmount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withheldLiquidity", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/adaptors/tokemak/reactors.json b/src/adaptors/tokemak/reactors.json deleted file mode 100644 index 0738da5d9..000000000 --- a/src/adaptors/tokemak/reactors.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - { - "symbol": "ETH", - "tokenAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - "poolAddress": "0xD3D13a578a53685B4ac36A1Bab31912D2B2A2F36", - "decimals": 18 - }, - { - "symbol": "USDC", - "tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", - "poolAddress": "0x04bDA0CF6Ad025948Af830E75228ED420b0e860d", - "decimals": 6 - }, - { - "symbol": "FRAX", - "tokenAddress": "0x853d955aCEf822Db058eb8505911ED77F175b99e", - "poolAddress": "0x94671A3ceE8C7A12Ea72602978D1Bb84E920eFB2", - "decimals": 18 - }, - { - "symbol": "DAI", - "tokenAddress": "0x6B175474E89094C44Da98b954EedeAC495271d0F", - "poolAddress": "0x0CE34F4c26bA69158BC2eB8Bf513221e44FDfB75", - "decimals": 18 - }, - { - "symbol": "LUSD", - "tokenAddress": "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0", - "poolAddress": "0x9eEe9eE0CBD35014e12E1283d9388a40f69797A3", - "decimals": 18 - }, - { - "symbol": "ALUSD", - "tokenAddress": "0xBC6DA0FE9aD5f3b0d58160288917AA56653660E9", - "poolAddress": "0x7211508D283353e77b9A7ed2f22334C219AD4b4C", - "decimals": 18 - }, - { - "symbol": "gOHM", - "tokenAddress": "0x0ab87046fBb341D058F17CBC4c1133F25a20a52f", - "poolAddress": "0x41f6a95Bacf9bC43704c4A4902BA5473A8B00263", - "decimals": 18 - }, - { - "symbol": "ALCX", - "tokenAddress": "0xdBdb4d16EdA451D0503b854CF79D55697F90c8DF", - "poolAddress": "0xD3B5D9a561c293Fb42b446FE7e237DaA9BF9AA84", - "decimals": 18 - }, - { - "symbol": "FXS", - "tokenAddress": "0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0", - "poolAddress": "0xADF15Ec41689fc5b6DcA0db7c53c9bFE7981E655", - "decimals": 18 - }, - { - "symbol": "MYC", - "tokenAddress": "0x4b13006980aCB09645131b91D259eaA111eaF5Ba", - "poolAddress": "0x061aee9ab655e73719577EA1df116D7139b2A7E7", - "decimals": 18 - }, - { - "symbol": "SUSHI", - "tokenAddress": "0x6B3595068778DD592e39A122f4f5a5cF09C90fE2", - "poolAddress": "0xf49764c9C5d644ece6aE2d18Ffd9F1E902629777", - "decimals": 18 - }, - { - "symbol": "FOX", - "tokenAddress": "0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d", - "poolAddress": "0x808D3E6b23516967ceAE4f17a5F9038383ED5311", - "decimals": 18 - }, - { - "symbol": "APW", - "tokenAddress": "0x4104b135DBC9609Fc1A9490E61369036497660c8", - "poolAddress": "0xDc0b02849Bb8E0F126a216A2840275Da829709B0", - "decimals": 18 - }, - { - "symbol": "SNX", - "tokenAddress": "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F", - "poolAddress": "0xeff721Eae19885e17f5B80187d6527aad3fFc8DE", - "decimals": 18 - }, - { - "symbol": "GAMMA", - "tokenAddress": "0x6BeA7CFEF803D1e3d5f7C0103f7ded065644e197", - "poolAddress": "0x2Fc6e9c1b2C07E18632eFE51879415a580AD22E1", - "decimals": 18 - } -] \ No newline at end of file