> For the complete documentation index, see [llms.txt](https://docs.knox.premia.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.knox.premia.finance/developers/epoch-mechanics.md).

# Epoch Mechanics

As discussed in the [epoch timeline](/overview/vault-system.md#epoch-timeline) section, the epoch is a series of operations which occur on a 7-day schedule. These operations are handled by an authorized keeper account, and enable actions such as purchasing options, withdrawals, fee collection, etc. The epoch can be broken down into three operations, auction initialization, epoch initialization, auction processing.

![](/files/As2JpfPVmzXJD4SbCNrp)

### Auction Initialization

On Thursday at approximately 8am UTC the keeper calls `initializeAuction`:

1. the option expiry timestamp, long and short token ids, and strike price are set, strike price is calculated using the [delta strike formula](/overview/vault-system.md#delta-strike-selection)
2. the auction start and end times are set
3. `Vault` calls `initialize` on `Auction`

### Epoch Initialization

On Friday at approximately 8am UTC the keeper calls `initializeEpoch`. It is assumed if the vault previously underwrote an option, it will already have been expired and processed prior:

1. if the epoch id is greater than 0, `Vault` will remove reserved liquidity from the Premia pool
2. if the epoch id is greater than 0 and `Vault` earns a positive net income a [performance fee](/overview/fee-structure.md#performance-fee) is calculated and transferred to the fee recipient account.
3. `Vault` calls `processDeposits` on `Queue`, transferring all of the collateral held in `Queue` to `Vault`. In exchange for the deposited collateral, `Vault` will mint and transfer vault shares to `Queue`.
4. the option max/min prices are calculated and set for the next auction
5. the epoch id is incremented

Once the epoch is initialization process completes there will be an 8 hour gap before the auction begins.

### Auction Processing

On Friday at approximately 4:30pm UTC or when the auction has been finialized the keeper will call `processAuction`:

1. `Vault` stores the total assets held in `Vault`, this value represents the amount of assets held before premiums are sent to `Vault`.
2. if the auction has not been finalized, `Vault` finializes it
3. `Auction` transfers the premiums earned during the auction to `Vault`
4. `Vault` underwrites the options sold during the auction via Premia's option pool, the long token is sent to `Auction` and the short tokens is sent to `Vault`
5. `Vault` sets the divestment timestamp to prevent the collateral from entering the "free liquidity queue" upon exercise or expiration
6. `Vault` processes the auction, after 24 hours the option buyers may withdraw their long tokens from `Auction`
7. `Vault` removes the withdrawal lock, users may withdraw or redeem from `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.knox.premia.finance/developers/epoch-mechanics.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.
