# Vault Account

The **Vault Account** is a struct used for accounting in the Fraxlend Pair:

```solidity
struct VaultAccount {
    uint128 amount;
    uint128 shares;
}
```

The **Vault Account** contains two elements:

1. **`amount`** - represents a total amount
2. **`shares`** - represents claims against the amount

#### Lending Accounting

In lending, **`amount`** represents the total amount of assets deposited and the interest accrued.

When lenders deposit assets, the amount of assets deposited increases **`amount`,** the **`shares`** value is also increased by an amount such that the ratio between **`amount`**/**`shares`** remains unchanged.

When interest is accrued, **`amount`** is increased and **`shares`** remains the same.  Each lender's share of the underlying assets are measured in shares.

When lenders remove liquidity, they redeem shares for the underlying asset.  The **`shares`** amount will be decreased by the number of shares redeemed, the **`amount`** will be decreased such that the ratio between **`amount`**/**`shares`** remains unchanged.

**Borrow Accounting**

In borrowing, **`amount`** represents the total amount of assets borrowed and the interest accrued.

When borrowers receive assets, the number of tokens received increases **`amount`,** the **`shares`** value is also increased by an amount such that the ratio between **`amount`**/**`shares`** remains unchanged.

When interest is accrued, **`amount`** is increased and **`shares`** remains the same.  Each borrower's debt is measured in shares.

When borrower's repay debt, **`amount`** is decremented by the amount of assets returned, **`shares`** is decreased by an amount such that the ratio of **`amount`**/**`shares`** remain unchanged.  An individual borrowers shares balance is decremented by this number of shares.


---

# 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.frax.finance/fraxlend/advanced-concepts/vault-account.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.
