# Game fund balancing mechanism

Game smart contract holds two types of funds:

* active game fund — UST collected from the users’ lost bets and used to settle&#x20;
* savings fund — **`aUST`** obtained by depositing all UST collected in each game round above the certain threshold <br>

Active game fund is initially formed by the proceeds from both private and public token sale stages. Once the game is launched, all bets made by the users are collected in the active fund, and the same fund is used for payouts to the winners.<br>

**`MAX_CASHFLOW`** parameter, which is initially set by the admin and later will be decided by the DAO, determines how much excess UST is deposited into the savings fund after each game round. If the difference between the lost bets and the winning payouts in a given round is more than **`MAX_CASHFLOW`**, then this difference is [converted into aUST through the Anchor protocol](https://app.anchorprotocol.com/earn).<br>

If the active game fund is insufficient to pay out all the winners, the required UST amount will be withdrawn from the savings fund on the Anchor protocol.

Details of the balancing process are outlined in the Game fund balancing process diagram.

![Game fund balancing process diagram](https://lh6.googleusercontent.com/bSG9X2db2k8xrhkeDFUMNRi2nL0WMwgsAEAZduDitrW1E6qzQfQQrJ9vINlOBSsbhleLCYca5NqClaj6hB5EY-uy-BGOQq0B5gyLFGrpnxSwca7dFulqp47xqU2Itr0bQS2YjhVN)


---

# 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://terra-vegas.gitbook.io/docs/resources/game-fund-balancing-mechanism.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.
