The Tab Keeper module is a part of Tab Protocol that performs health check on all active vaults.
If the active vault's reserve ratio fall below configured minimum reserve rate, an on-chain function checkVault
will be called to the underperformed vault.
As part of the checkVault
process, if the vault's reserve ratio fall below liquidation ratio, liquidateVault
function will be trigerred immediately.
An on-chain Dutch auction is started to recover outstanding Tabs and vault is closed, with remaining reserves claimable by vault owner (if any).
Name | Description | Scheduler |
---|---|---|
Check vault job | Check on each active vaults on-chain and call its checkVault function if it is underperformed |
Run on every 6 minutes |
Push all risk penalties job | Flush all cached risk penalty and update vault's outstanding tab amount on-chain | Run on every hour and 2 minutes |
- EVM blockchain with Node URL
- Tab protocol deployment, smart contract address for VaultManager, TabRegistry, and VaultKeeper.
- Node.js
Refer steps below:
-
Clone the repo
git clone [repo]
-
cd into tab-keeper directory
cd tab-keeper
-
Install NPM packages
npm install
-
Edit .env.local file to suit your environment.
-
Start application
npm run local
You may execute this module in docker environment. Docker swarm mode is preferred so that we can utilize docker secret to hide sensitive data.
-
Install docker and run
docker swarm init docker network create --driver overlay tab-net
-
Clone the repo
git clone [repo]
-
Switch into tab-keeper directory
cd tab-keeper
-
Create and edit .env file by referring to .env.local file based on your environment. The .env file will be saved as docker secret in following step.
-
Run commands to start docker,
docker volume create tab-keeper-log docker secret create tab-keeper-env .env docker build . -t tab-keeper docker service create --name tab-keeper --network tab-net --replicas 1 \ --hostname tab-keeper --secret src=tab-keeper-env,target=".env" \ --mount src=tab-keeper-log,dst=/usr/src/app/logs tab-keeper:latest
-
Visit Docker swarm for reference.
Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.md
for more information.
Project Link: https://shiftctrl.money - contact@shiftctrl.money
Twitter @shiftCTRL_money
Discord shiftctrl_money