# Vat

### **Purpose**

The core accounting contract of the protocol, VAT tracks system-wide balances, including user Vaults, collateral types, and debt. It ensures that all collateral and debt are properly accounted for and enforces system solvency.

### Key Responsibilities

* Tracks collateral and debt balances for all users and collateral types.
* Ensures Vault operations (e.g., minting and repaying USDD) adhere to protocol parameters.
* Integrates with other contracts to trigger auctions or manage liquidations.

### Key Methods

* `slip(ilk, usr, wad)`\
  Adjusts the balance of a specific collateral type (`ilk`) for a user (`usr`).
  * Example Use: Adding or removing collateral from a user's Vault.
* `frob(ilk, u, v, w, dink, dart)`\
  Adjusts collateral (`dink`) and debt (`dart`) for a Vault.
  * Example Use: Minting new USDD or repaying debt.
* `grab(ilk, u, v, w, dink, dart)`\
  Executes adjustments on collateral and debt during liquidation.
* `fold(ilk, u, rate)`\
  Increase the `Ilk.rate` with rate, and hence the debt balances of all Vaults collateralized with the specified Ilk are updated implicitly.
* `file(what, data) / file(what, ilk, data)`\
  Sets or updates system-wide parameters like debt ceilings, stability fees, or collateralization thresholds.
  * Example Use: Setting a collateral type’s maximum mintable USDD.


---

# Agent Instructions: 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:

```
GET https://docs.usdd.io/developers/core-contracts/vat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
