Vault Sync Implementation
Smart Vault sync is the last step of the "flush-DHW-sync" Smart Vault flow; The Vault Sync focuses on applying Strategy-level changes, done during DHW, to the Smart Vault level.
The system does not allow for multiple consecutive "flush" actions; for a Smart Vault to be flushed again, the previous flush cycle needs to be completed (i.e. all respective DHWs need to be executed).
Execution Timing: When a Smart Vault is flushed, all pending deposit and withdrawal requests are made available to be processed by DHW. At that time the system also records which individual strategy DHW indexes the flush will be part of; this helps with resolving whether an individual "flush cycle" has already been finished or not.
To apply strategy-level changes made during DHW, Smart Vaults need to be synced - if all DHW runs had been executed, based on strategy DHW indexes attached to the given smart vault flush.
This ensures that the synchronization process aligns with the updated state of the system post-flush and post-strategy execution and avoids iterating unbounded arrays (i.e. Smart Vaults, users) during DHW.
Synchronization of Deposits and Withdrawals: The feature syncs up deposits and withdrawals. This means it aligns the records of assets deposited into and withdrawn from the vault, ensuring consistency and accuracy in transaction records.
Vault Fee Collection: Vault Sync collects all types of vault fees. The amount of fees to be collected is based on the time interval from the last up until the current Smart Vault sync action.
When collecting fees, the system dilutes the Smart Vault Token (SVT) supply by minting new SVTs directly to the vault owner.
Automatic or Manual Execution: The process is designed to be user-friendly and efficient. It can be executed automatically during the next user interaction with the system, offering convenience and ensuring timely updates. Alternatively, for more control, it can be triggered manually as needed.
Minting of Newly Deposited SVTs: Upon the deposit of new assets into the vault, the system will mint newly deposited SVTs. This feature emphasizes the dynamic nature of the vault with its capacity to expand its token supply in response to incoming assets.
This implies that the SmartVault.balanceOf(address)
and SmartVault.totalSupply()
will not return up to date amounts, if the smart vault hasn't been synchronized beforehand. Use ISpoolLens.getUserSVTBalance(address smartVault, address user, uint256[] calldata nftIds)
and ISpoolLens.getSVTTotalSupply(address smartVault)
to get latest SVT information, as these simulate Smart Vault synchronization when computing balances.
Initial SVT Minting Ratio: Initially, the system mints 1e21
SVTs times the USD amount deposited. This ratio establishes a foundational value for the SVTs in relation to the deposited amount.
Initial Minting to a "Dead Address": To maintain market stability and prevent price manipulation, the system mints 1e12
SVTs to the 0xdead000000000000000000000000000000000000
address as forever locked shares; this is to safeguard against artificial inflation of the SVT price.
Last updated