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 ERC20asset
, as well as the amount ofassets
in the BoringVault in terms ofasset
. -
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
deposit
FlowdepositAsset
:
The asset the user is trying to deposit with.
depositAmount
:
The amount of depositAsset
the user wants to deposit.
-
The BoringVault must be approved to spend at least
depositAmount
ofdepositAsset
.-
If not the user should be prompted to approve
-
-
The user needs at least
depositAmount
ofdepositAsset
in their wallet. -
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.-
This function checks the users balance, allowance, if the Teller is paused, and if
depositAsset
is supported.
-
-
You can call
ArcticArchitectureLens.previewDeposit
to see how many shares the user will receive from the deposit. -
Determine the
minimumMint
for the user deposit. You can use the value from previewDeposit, and lower it by a few bps. -
Call
Teller.deposit(depositAsset, depositAmount, minimumMint)
depositWithPermit
Flow
depositWithPermit
FlowdepositAsset
:
The asset the user is trying to deposit with.
depositAmount
:
The amount of depositAsset
the user wants to deposit.
-
The BoringVault must be permitted to spend at least
depositAmount
ofdepositAsset
.-
If not the user should be prompted to sign a permit message
-
-
The user needs at least
depositAmount
ofdepositAsset
in their wallet. -
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.-
This function checks the users balance, if the Teller is paused, and if
depositAsset
is supported.
-
-
You can call
ArcticArchitectureLens.previewDeposit
to see how many shares the user will receive from the deposit. -
Determine the
minimumMint
for the user deposit. You can use the value from previewDeposit, and lower it by a few bps. -
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.
-
User should approve the atomic queue to spend their BoringVault share.
-
The user must have enough BoringVault shares to cover the amount they are trying to withdraw
-
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. -
The UI can call
AtomicQueue.isAtomicRequestValid
which returns a bool indicating whether or not the request is valid -
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