Skip to main content

Untangled Vault

Inheriting and extending from ERC4626, Untangled Vault's goal is to gather liquidity and invest it effectively across different EVM-based blockchains.

Extensions from ERC4626 include asynchronous withdrawal and retrieving information from different chains.

  • Asynchronous withdrawal:

    • Users will create withdrawal requests by calling the withdraw function.
    • At the end of the epoch, the safe wallet will decide the fulfillment percentage of all withdrawal requests in that epoch.
    • After the epoch is fulfilled, users can call claimWithdraw to burn their shares and receive their assets back.
  • cross-chain interactions:

    • Allow investors to deposit to a Vault that opens on a different chain
    • Cross-chain state is synchronised by Axelar GMP service.

Variables

VariableTypeDescription
totalWithdrawuint256Total withdrawal (in currency) of the current epoch
safeWalletaddressSafe address of this vault
goaddressAddress of the KYC validation contract
gasServiceaddressAddress of the Axelar gas service contract
gatewayaddressAddress of the Axelar gateway for GMP communication
currentEpochIdxuint32Index of the current epoch
tokenInfomapping(address => Investment)Stores information (balance, price, decimal) of tokens invested by this vault
remoteSafeAddressmapping(uint => address)Stores information of the safe wallet on other chains
isTransmittermapping(address => bool)Stores information on whether an address is a transmitter contract or not
fulfillmentmapping(uint256 => uint256)Stores the fulfillment percentage of an epoch
tokenInvestedaddress[]List of tokens invested by this vault

Methods

MethodTypeDescription
depositexternalDeposit liquidity into the vault in exchange for vault shares
withdrawexternalRequest to withdraw liquidity from the pool
claimableRequestviewView the amount of liquidity available to claim from a withdrawal request
cancelWithdrawexternalSet the withdrawal amount of the corresponding request to 0
claimWithdrawexternalClaim the amount of liquidity available to claim from a withdrawal request
totalAssetsviewReturn vault liquidity + the value of investments
closeEpochexternalTemporarily disable creating withdrawal requests to snapshot and fulfill withdrawRequest in the current epoch
fulfillWithdrawRequestexternalFulfill all withdrawRequest in the current epoch and move to the new epoch
addAssetexternalAdd a token to the investment list of the current vault
removeAssetexternalRemove a token to the investment list of the current vault
updateAssetexternalUpdate information (balance, price, decimals) of a token in the portfolio
setRemoteSafeAddresexternalSet the safe wallet to represent the vault to invest on a given chain id
setCrosschainHookexternalWhitelist a cross-chain hook contract to allow user from different chain deposit into the vault
setBeneficiaryexternalSet the beneficiary of the fee accrued from the vault
setFeeIndexexternalSet the fee index to calculate fee
claimFeeexternalClaim the accrued fee to the beneficiary
executeexternalAxelar GMP execution function