Vault

VaultManager contract

The VaultManager contract is the core component of the Tab Protocol, responsible for managing and executing various vault operations:

  1. createVault: Create a vault for depositing reserves into the protocol and minting Tabs from the deposited reserves. The QWERTY application retrieves the signed median rate from an authorized source and submits it to the createVault function.

Note: Before calling the createVault function, the QWERTY application will invoke theapprovefunction on the reserve token to grant sufficient allowance to the VaultManager.

  1. withdrawTab: Mint additional Tabs from the user's vault. The signed median rate is included in the submission.

  2. paybackTab: Burn Tabs from the user's wallet to reduce the outstanding Tab balance of the user's vault.

Note: Before calling the paybackTab function, the QWERTY application will invoke theapprovefunction on the Tab token to grant sufficient allowance to the VaultManager.

  1. withdrawReserve: Withdraw reserves from the user's vault. The signed median rate is included in the submission.

  2. depositReserve: Deposit additional reserves into the user's vault.

Note: Before calling the depositReserve function, the QWERTY application will invoke the approve function on the reserve token to grant sufficient allowance to the VaultManager.

chargeRiskPenalty function

The Tab Keeper module continuously monitors the reserve ratios of all vaults. If a vault's reserve ratio falls below the configured threshold, the system calculates the corresponding risk penalty and adds it to the vault's outstanding Tab balance.

If unaddressed, this risk penalty can further deteriorate the vault's reserve ratio, potentially leading to liquidation, especially if the market value of the reserve assets continues to decline.

To improve the reserve ratio of an existing vault, users can either use the paybackTab function to reduce the vault's outstanding Tab balance or the depositReserve function to increase the vault's reserve amount.

liquidateVault function

When a vault's reserve ratio drops below the liquidation threshold (default 120%), the system triggers a liquidation process via the liquidateVault function. The vault's assets are auctioned off to cover the outstanding Tabs.

Any excess reserves remaining after the auction are returned to the vault. The vault owner can then use the withdrawReserve function to claim the remaining reserves.

ctrlAltDel function

The ShiftCTRL Tab Protocol community has the option to propose and vote to re-peg a Tab from its fiat currency to Bitcoin using the ctrlAltDel function.

Once the community successfully executes a Ctrl-Alt-Del re-peg, all excess reserves remain in their respective vaults. These vaults remain open until the vault owner claims the excess reserves using the withdrawReserve function.

ProtocolVault contract

Following a successful Ctrl-Alt-Del re-peg action, a new Protocol Vault is created to consolidate the reserves from all re-pegged Tab vaults. The protocol then manages all future Tab minting and burning actions based on the newly defined BTC peg (e.g., 1 BTC : 55,000,000 sARS).

buyTab function

The buyTab function allows users to mint Tabs by depositing reserves into the protocol vault.

Note: Since the BTC peg is fixed and does not fluctuate, there is no need for excess reserves. Metrics such as minimum reserve ratios, liquidation thresholds, and risk penalties do not apply to Tabs that have been successfully re-pegged.

sellTab function

The sellTab function enables users to withdraw reserves from the protocol vault by burning their Tabs.

Last updated