# Staking

With all the concepts above covered, it is now possible to walk through the process of staking AOVR. For this example, we will assume that there is an available slot in a pool, and that there are no amounts owing to that pool (no rebalancing required).

* The stake function on the ovr-program is called with the following parameters
  * Stakeholder account (payer)
  * AOVR Staking Pool Treasury account
  * Staking Pool Registry account
  * Staking Pool account
  * Staking Account
  * Amount of AOVR to stake
  * Index of staking pool
  * Index of slot
  * Whether to rebalance (default to false)
* By reading the Staking Registry data, the ovr-program checks that the Staking Pool at the staking pool index provided is registered and that the address stored on the registry matches the staking pool account address passed in
* The staking pool data is read next, and the ovr-program checks that the slot at the provided slot index is free, meaning the balance is 0
* The stake account PDA as described above in the Stake Account section is generated, and checked against what is passed into the function
  * If account does not exist it is created, and the appropriate values are stored inside
  * If the account does exist, the pool and slot indexes are compared, and if they match execution can proceed
* The specified amount of AOVR is withdrawn from the stakeholder’s account and sent to the AOVR Staking Pool Treasury
* The pool account totals, and slot balance are updated
* The pool registry account totals and pool balance are updated


---

# 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://allovr.gitbook.io/docs/whitepaper/a-next-generation-decentralized-autonomous-art-network/appendix-1-proposed-allovr-staking-mechanism/staking.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.
