JITU (Just In Time Underwriter)

Just-In-Time Underwriter (JITU) is a smart contract that monitors and protects loans made on lending platforms.

KeeperDAO's Just-In-Time Underwriter (JITU) is a smart contract which monitors and protects loans made on lending platforms supported by Hiding Vaults and helps protect borrowers from liquidation. JITU is an evolution of KeeperDAO's liquidity pools, combining KeeperDAO's flash lending functionality with new methods for safe underwriting. This gives keepers one-stop access to liquidity and distributes rewards back to liquidity providers.

Liquidation Mechanics

When a borrowing position goes underwater, JITU provides additional collateral to the borrower's Vault, which acts a a buffer to prevent liquidation. In the eyes of non-KeeperDAO Keepers, the Vault appears to have a healthy debt ratio. The threshold for which JITU will add collateral to a Vault depends on the underlying lending protocol the position utilizes. In the case of the current Compound integration, JITU will underwrite a vault when the ratio of borrowed assets to collateral assets reaches 0.95, and the value of the added buffer will be equal to 5% of the position value. If the Vault health contiues to degrade after JITU has added additional collateral, the Vault will become eligible for liquidation. In the case of the current Compound integration, if the ration of borrowed assets to collateral assets reaches 1, JITU will flag the Vault for liquidation. When this happens, only whitelisted Keepers within the KeeperDAO ecosystem will have access to perform the liquidation. External Keepers will still see the Vault's lending position as healthy due to the extra collateral provided by JITU. This protects the liquidation profit from MEV caused by gas wars common in liquidations in the wild.

The collateral and debt values within a Vault are determined by the underlying lending protocol being utilized. To learn more about how Compound calculates position health, check out the Compound Finance docs.

Currently, in the event of a liquidation, the vault user will not see a difference between being liquidated by a KeeperDAO Keeper vs. an external Keeper in the wild. However in a future update, a portion of the liquidation profits earned by the KeeperDAO Keeper will be distributed back to the Vault user. The parameters of this mechanic will be decided by KeeperDAO's governance.

JITU is currently powered by Gelato's smart contract automation framework


Scenario 1: JITU saves Vault from liquidation

  1. Say a user opens a Hiding Vault and supplies 10 ETH as collateral to Compound. Assuming the current market price of ETH is $3,000, and taking into account the Compound collateral factor for ETH of 0.75, the user's total collateral value would be $30,000 * 0.75 = $22,50, meaning the user can borrow at a maximum $22,500 worth of assets before being liquidated.

  2. Say the user then borrows $20,000 of USDC from Compound. The user's Vault heath would be calculated from the ratio of total borrowed value to total collateral value, in this case $20,000 / $22,500 = 0.8889.

  3. Say the price of ETH then falls to $2,800. The Vault's collateral value would now equal $28,000 * 0.75 = $21,000, causing the Vault's health to be $20,000 / $21,000 = 0.9524.

  4. Since this ratio is above 0.95, JITU would automatically underwrite the Vault with a 5% collateral buffer. From an external Keeper's point of view, the borrowing position would appear well below the threshold for liquidation.

  5. Upon noticing JITU has been activated, the user then deposits an additional 2 ETH into the vault as collateral, causing the new collateral value and health ratio to be $25,200 and 0.7937 respectively.

  6. Since the Vault is now healthy again, JITU reclaims the added funds, and the user's position has been saved from a potential liquidation by an external Keeper.

Scenario 2: Vault is Liquidated

Say steps 1-4 happen exactly as in the first scenario. However in this case, the user is unable to provide additional collateral, and the price of ETH continues to drop. When ETH reaches $2,666.67, the Vault's collateral value will be $26,666.67 * 0.75 = $20,000, causing the health ratio to equal 1, thus making it eligible for liquidation by KeeperDAO Keepers. From an external Keeper's perspective, the position is still not liquidatable due to the buffer provided by JITU. A KeeperDAO Keeper performs the liquidation on the Vault, without having to compete with any other Keepers in the wild, significantly increasing the profit margin for the liquidation. A share of these profits are then returned to the user who's Vault was liquidated, resulting in a best-case liquidation scenario for both the user and Keeper relative to liquidations in the wild.

For any questions relating to Hiding Vaults or JITU, feel free to contact the team through our Discord channel