> For the complete documentation index, see [llms.txt](https://docs.shiftctrl.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shiftctrl.money/developer/tab-protocol-smart-contract/keeper.md).

# Keeper

## VaultKeeper contract

The VaultKeeper contract manages the examination of vaults, including charging and managing risk penalties or triggering vault liquidations.

* #### Setting: riskPenaltyFrameInSecond

  Default is set to 86,400 seconds (24 hours). This defines the interval at which the risk penalty is calculated and accrued.

### checkVault function

The Tab Keeper module performs offchain monitoring and calculations of vault conditions at fixed intervals. When a vault's reserve ratio drops below the configured minimum reserve ratio (default 180%) established by the protocol, the Keeper triggers the `checkVault` function on-chain with the signed live median rate.

The on-chain `checkVault` function verifies the vault's reserve ratio and records the highest calculated risk penalty amount for the current time frame associated with the under-reserved vault.

Upon the maturity of the risk penalty time frame, or if the reserve ratio no longer breaches the minimum threshold, the accumulated risk penalty amount is applied to the corresponding vaults and reflected in the vault's outstanding Tabs.

If the vault's reserve ratio falls below the liquidation threshold, the `checkVault` function will immediately apply the highest recorded risk penalty and initiate vault liquidation.

### pushVaultRiskPenalty function

This function calculates the risk penalty amount and charges it to the vault.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.shiftctrl.money/developer/tab-protocol-smart-contract/keeper.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
