Decentralized algorithmic stablecoin with automated liquidation
This project is a decentralized algorithmic stablecoin pegged to the USD system, built on Ethereum, featuring automated liquidation via Lit Protocol's Vincent App framework and real-time price feeds from the Pyth Network.
An algorithmic stablecoin is not governed by any entity. Vincent Algorithmic Stablecoin (VAS) has an "engine" that governs the minting and burning of VAS to ensure it stays stable. To mint VAS, one must deposit collateral, and the engine verifies the total value deposited using Pyth's Pull Oracle for price feed. The amount of VAS a user can mint depends on their total collateral value deposit, and the protocol/engine guarantees that the user must be overcollateralized.
However, because the assets used as collateral are volatile, a user may become undercollateralized. When this happens, the engine allows anyone to liquidate that user's debt and, in return, receive a portion of the collateral. The liquidation process is permissionless, but to act as a liquidator, someone must constantly monitor the health of other users —and that is where Vincent comes in.
The Vincent App allows its users to register themselves as liquidators for the Vincent Algorithmic Stablecoin. The App tracks the user base and monitors their health. The App then randomly selects a user to liquidate an undercollateralized user. Essentially, anyone can be a liquidator without effort and be rewarded for it. All you need to do is deposit collateral to the PKP Address, and the Vincent App will manage the liquidation process for you to ensure you receive the rewards!
The stablecoin and its engine comprise the on-chain part, which was developed using Hardhat tools for development, testing, and deployment. The off-chain components include the Vincent App and the custom Vincent Ability.
Vincent App is a NextJS application paired with a SQL database for registering the stablecoin users and the liquidators. To ensure continuous health checks for users and liquidation processes, we leverage Vercel's cron job functionality. The NextJS application exposes two API endpoints that are activated by these cron jobs. One to update the user list, and the other to find an undercollateralized user, draw a liquidator, and execute the Vincent ability.
The Custom Vincent Ability developed receives the following parameters in the precheck step: a rpcUrl, the undercollaterized userAddress, and the VAS engine address. A successful precheck returns the debt to liquidate, the collateral address, and Pyth's Network price feed. Using these values, the execute step can perform a liquidation operation.

