Architecture

BoringVault

The PXL Vault framework is built around the BoringVault and its surrounding modules.

The BoringVault is the ERC20 token contract that represents a tokenized share of the Vault. The other contracts rely on permissions granted by the BoringVault to execute certain actions.

The BoringVault is completely immutable upon deployment, though the external modules—the Teller, Accountant, Manager—that handles key functionalities can be upgraded to support new features or security improvements.

Teller

The Teller defines the logic for minting shares upon a deposit. The Teller checks whether the given asset is part of its list of supported assets, queries the assets' value via the Accountant, and determines how many shares to mint for the given amount of deposit tokens.

The Teller also can be extended to support different types of bridges. For example, the Teller may use the LayerZero or Hyperlane messaging protocols to transfer its minted shares from one blockchain to another.

Accountant

The Accountant is the source of truth for the vault's exchange rate as well as the value of each whitelisted deposit assets.

Because the Teller is able to accept an arbitrary number of whitelisted assets, in order to determine how many shares to mint given an asset, it needs to query both the vault's base exchange rate and the specific price of the asset.

For Stablecoins, however, the Accountant will always report a consistent value of 1 USD = 1 Stablecoin token, as the stablecoin's fundamental value does not change assuming there are enough assets backing the stablecoin.

Manager

The Manager contract allows the BoringVault to securely interact with external services.

The Manager contract uses a permissioning system based on Merkle Trees. By assigning a merkle root to a specific address that can initiate transactions on behalf of the vault, the owner of the vault can whitelist specific target addresses, function calls, and function parameters for specific addresses. The leaves of this merkle root defines the type of transaction that the strategist is able to call on behalf of the BoringVault. This enables secure on-chain automation without relying on centralized trust assumptions outside of the vault owner.

Crosschain Bridging

The vault can also be deployed on multiple networks. Once deployed, the vault shares can be bridged directly between the supported chains using underlying cross chain messaging protocols.

Last updated