UI Integration

The UI should have the following addresses available to make calls to.

  • BoringVault

  • TellerWithMultiAssetSupport

  • AccountantWithRateProviders

  • ArcticArchitectureLens

  • Atomic Queue


Overall Metrics

  • To get the Total Value Locked call ArcticArchitectureLens.totalAssets(BoringVault *boringVault*, AccountantWithRateProviders *accountant)*) This will return the ERC20 asset, as well as the amount of assets in the BoringVault in terms of asset.

  • To get a users share balance call ArcticArchitectureLens.balanceOf(*address* *account*, BoringVault *boringVault*)

  • To get a users balance in terms of asset call *ArcticArchitectureLens.*balanceOfInAssets(*address* *account*, BoringVault *boringVault*, AccountantWithRateProviders *accountant*)

  • To get a users share unlock time call ArcticArchitectureLens.userUnlockTime(address user)


deposit Flow

depositAsset: The asset the user is trying to deposit with.

depositAmount: The amount of depositAsset the user wants to deposit.

  1. The BoringVault must be approved to spend at least depositAmount of depositAsset.

    1. If not the user should be prompted to approve

  2. The user needs at least depositAmount of depositAsset in their wallet.

  3. You can call ArcticArchitectureLens.checkUserDeposit to see if a users deposit will succeed, if the function returns true it will succeed, if it returns false, the deposit will revert.

    1. This function checks the users balance, allowance, if the Teller is paused, and if depositAsset is supported.

  4. You can call ArcticArchitectureLens.previewDeposit to see how many shares the user will receive from the deposit.

  5. Determine the minimumMint for the user deposit. You can use the value from previewDeposit, and lower it by a few bps.

  6. Call Teller.deposit(depositAsset, depositAmount, minimumMint)


depositWithPermit Flow

depositAsset: The asset the user is trying to deposit with.

depositAmount: The amount of depositAsset the user wants to deposit.

  1. The BoringVault must be permitted to spend at least depositAmount of depositAsset.

    1. If not the user should be prompted to sign a permit message

  2. The user needs at least depositAmount of depositAsset in their wallet.

  3. You can call ArcticArchitectureLens.checkUserDepositWithPermit to see if a users deposit will succeed, if the function returns true it will succeed, if it returns false, the deposit will revert.

    1. This function checks the users balance, if the Teller is paused, and if depositAsset is supported.

  4. You can call ArcticArchitectureLens.previewDeposit to see how many shares the user will receive from the deposit.

  5. Determine the minimumMint for the user deposit. You can use the value from previewDeposit, and lower it by a few bps.

  6. Call Teller.depositWithPermit(depositAsset, depositAmount, minimumMint, deadline, v, r, s)


💡 After a deposit using deposit or depositWithPermit, all of the users shares will be locked to their address until ArcticArchitectureLens.userUnlockTime time has passed.


Withdraw Flow

User withdraws are processed using the Atomic Queue.

  1. User should approve the atomic queue to spend their BoringVault share.

  2. The user must have enough BoringVault shares to cover the amount they are trying to withdraw

  3. The UI can call Accountant.getRateInQuoteSafe(ERC20 want) then apply an appropriate discount to the answer to determine the atomicPrice to use for the request.

  4. The UI can call AtomicQueue.isAtomicRequestValid which returns a bool indicating whether or not the request is valid

  5. The user should call AtomicQueue.updateAtomicRequest once there request is valid

💡 Withdraw requests are usually fulfilled in 1-3 days depending on the discount applied to the users shares.

Last updated