# Tables

This page lists all tables on the dapp.fusion contract, including their descriptions and a breakdown of each datapoint stored in the table.

## Quick Links

[#account](#account "mention")

[#delegated\_bandwidth](#delegated_bandwidth "mention")

[#epochs](#epochs "mention")

[#global](#global "mention")

[#incentives](#incentives "mention")

[#lpfarms](#lpfarms "mention")

[#pools\_struct](#pools_struct "mention")

[#producer\_info](#producer_info "mention")

[#redeem\_requests](#redeem_requests "mention")

[#refund\_request](#refund_request "mention")

[#renters\_table](#renters_table "mention")

[#rewards](#rewards "mention")

[#stakers](#stakers "mention")

[#state2-pol\_contract-namespace](#state2-pol_contract-namespace "mention")

[#top21](#top21 "mention")

### account

> The account table is a table that is used on all standard token contracts. It is referenced in this contract in order to look up WAX balances for various contracts, allowing this contract to aggregate data related to the protocol's TVL

### delegated\_bandwidth

> This table is actually on the eosio system contract, and keeps track of who has CPU/NET staked. It is referred to in our contracts for CPU rental management.

### epochs

> The epochs table keeps track of each epoch that has ever taken place.

| Column                               | Type      | Description                                                                                                                                                                                  |
| ------------------------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| start\_time                          | uint64\_t | The epoch timestamp when the epoch started. This is used as an epoch\_id to reference the epoch in other parts of the contract                                                               |
| time\_to\_unstake                    | uint64\_t | The epoch timestamp when the contract is able to unstake all WAX associated with an epoch, in order to ensure that funds are returned to the main contract in time for the redemption period |
| cpu\_wallet                          | name      | The CPU contract that holds the funds for this particular epoch                                                                                                                              |
| wax\_bucket                          | asset     | The amount of WAX that has been transferred to the CPU contract related to this epoch                                                                                                        |
| wax\_to\_refund                      | asset     | The amount of WAX that has been requested by sWAX holders for redemptions from this epoch's wax\_bucket                                                                                      |
| redemption\_period\_start\_time      | uint64\_t | The epoch timestamp when redemptions begin for this epoch (this is also the epoch's end time)                                                                                                |
| redemption\_period\_end\_time        | uint64\_t | redemption\_period\_start\_time + redemption\_period\_length\_seconds from the config table. After this timestamp, unclaimed redemption funds are cycled back into the main pool             |
| total\_cpu\_funds\_returned          | asset     | The amount of WAX that has been returned to the dapp contract, from the CPU contract assigned to this epoch                                                                                  |
| total\_added\_to\_redemption\_bucket | asset     | The amount of WAX that has been added to this epoch's redemption pool, so sWAX holders who requested redemptions can claim their WAX                                                         |

### global

> The global singleton keeps a record of the global state and configuration of the contract

| Column                              | Type          | Description                                                                                                                                                                       |
| ----------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| swax\_currently\_earning            | asset         | The amount of sWAX that is issued, but has not been liquified                                                                                                                     |
| swax\_currently\_backing\_lswax     | asset         | The amount of sWAX that is currently being used as the backing of lsWAX                                                                                                           |
| liquified\_swax                     | asset         | The amount of sWAX that has been liquified, which is also the total supply of lsWAX                                                                                               |
| revenue\_awaiting\_distribution     | asset         | The amount of rewards that have been earned by the protocol, but have not yet been distributed                                                                                    |
| total\_revenue\_distributed         | asset         | The total amount of rewards generated/distributed by the protocol in its lifetime                                                                                                 |
| wax\_for\_redemption                | asset         | The amount of WAX that is currently allocated to redemption requests. If they go unclaimed for 48 hours, they will be moved into wax\_available\_for\_rentals                     |
| last\_epoch\_start\_time            | uint64\_t     | The start\_time of the most recently started epoch                                                                                                                                |
| wax\_available\_for\_rentals        | asset         | The amount of WAX that can currently be used for renting CPU, and instant redemptions                                                                                             |
| cost\_to\_rent\_1\_wax              | asset         | The WAX price that CPU renters will pay for 1 full day of 1 WAX staked to their wallet                                                                                            |
| current\_cpu\_contract              | name          | The CPU contract that is associated with the most recently started epoch                                                                                                          |
| next\_stakeall\_time                | uint64\_t     | The next timestamp that the contract can send wax\_available\_for\_rentals to one of the CPU contracts and stake it to maximize rewards                                           |
| last\_incentive\_distribution       | uint64\_t     | The epoch timestamp of the last time that new LP farms were created on Alcor                                                                                                      |
| incentives\_bucket                  | asset         | The amount of lsWAX currently available for farming rewards                                                                                                                       |
| total\_value\_locked                | asset         | The total amount of WAX locked across WaxFusion's contracts (not including liquidity on Alcor)                                                                                    |
| total\_shares\_allocated            | uint64\_t     | The total amount of combined shares allocated to LP farms on Alcor                                                                                                                |
| last\_compound\_time                | uint64\_t     | The timestamp of the last time the compound action was called                                                                                                                     |
| minimum\_stake\_amount              | asset         | The minimum amount of WAX that a user has to deposit in order to mint sWAX/lsWAX                                                                                                  |
| minimum\_unliquify\_amount          | asset         | The minimum amount of lsWAX that must be sent to the contract in order to unliquify (convert to sWAX)                                                                             |
| initial\_epoch\_start\_time         | uint64\_t     | The epoch timestamp of the first epoch that was created at the launch of WaxFusion                                                                                                |
| cpu\_rental\_epoch\_length\_seconds | uint64\_t     | The length of an epoch, in seconds                                                                                                                                                |
| seconds\_between\_epochs            | uint64\_t     | Amount of seconds that must elapse in the current epoch before a new epoch is created                                                                                             |
| user\_share\_1e6                    | uint64\_t     | The percentage of platform revenue that is allocated to sWAX/lsWAX holders, scaled by 1e6                                                                                         |
| pol\_share\_1e6                     | uint64\_t     | The percentage of platform revenue that is allocated to protocol owned liquidity, scaled by 1e6                                                                                   |
| ecosystem\_share\_1e6               | uint64\_t     | The percentage of platform revenue that is allocated to LP incentives, scaled by 1e6                                                                                              |
| admin\_wallets                      | vector\<name> | A list of approved wallets that can call actions that don't pose any risk to user funds, but shouldn't be accessible by everyone (changing the price of CPU rentals, for example) |
| cpu\_contracts                      | vector\<name> | A list of proxy contracts that are used for staking WAX (each epoch is tied to a CPU contract)                                                                                    |
| redemption\_period\_length\_seconds | uint64\_t     | The amount of seconds that a redemption period lasts before the unclaimed WAX is reallocated for CPU rentals, instant redemptions etc                                             |
| seconds\_between\_stakeall          | uint64\_t     | The amount of seconds that must pass before unrented funds are automatically staked for CPU, in order to maximize rewards generated by the protocol                               |
| fallback\_cpu\_receiver             | name          | If funds are not rented by the stakeall action is ready to be called, those funds will stake CPU for this wallet                                                                  |
| protocol\_fee\_1e6                  | uint64\_t     | The 1e6 scaled percentage fee charged by the protocol for instant redemptions                                                                                                     |

### incentives

> The incentives table is stored on the swap.alcor contract, and is referenced in our contract in order to manage the creation of new LP incentives

### lpfarms

> The lpfarms table stores a list of which token pairs on Alcor will receive farming rewards from our ecosystem fund

| Column                    | Type      | Description                                                                 |
| ------------------------- | --------- | --------------------------------------------------------------------------- |
| poolId                    | uint64\_t | The pool ID of the trading pair on Alcor that we want to incentivize        |
| symbol\_to\_incentivize   | symbol    | The token symbol of the token paired against lsWAX                          |
| contract\_to\_incentivize | name      | The token contract of the token paired against lsWAX                        |
| percent\_share\_1e6       | uint64\_t | The portion of the ecosystem\_share that goes to this pair's incentive pool |

### pools\_struct

> The pools struct is located on the swap.alcor contract, and is referenced in our contract in order to manage the creation of new LP incentives

### producer\_info

> The producer info table is stored on the eosio system contract, and stores info about block producers. This table is necessary in order for our contracts to automatically vote for the top 21 block producers each day, and avoid any bias when selecting producers to vote for.

### redeem\_requests

> This table stores all redemption requests made by sWAX holders. It is scoped by the wallet who made the request(s).

| Column                 | Type      | Description                                                                       |
| ---------------------- | --------- | --------------------------------------------------------------------------------- |
| epoch\_id              | uint64\_t | The start\_time of the epoch that the user requested a redemption from            |
| wax\_amount\_requested | asset     | The amount of WAX the user has requested from this particular epoch's wax\_bucket |

### refund\_request

> This is another table stored on the eosio system contract. It is referenced in WaxFusion's contracts in order to keep track of our pending refunds from unstaking WAX via our CPU contracts

### renters\_table

> The renters table stores information about which users are renting CPU from the short term rental system. It is scoped by the epoch ID that they are renting from. Contract pays its own RAM on these rows instead of charging users.

| Column            | Type      | Description                                                                           |
| ----------------- | --------- | ------------------------------------------------------------------------------------- |
| ID                | uint64\_t | A unique ID to identify this table row. It uses available\_primary\_key               |
| renter            | name      | The WAX address of the account who paid for the rental                                |
| rent\_to\_account | name      | The WAX address of the CPU recipient                                                  |
| amount\_staked    | asset     | The total amount of WAX staked from the renter to the rent\_to\_account in this epoch |

### rewards

> The rewards singleton stores the staking farm data for rewarding sWAX holders

| Column               | Type       | Description                                                                                                                                                                     |
| -------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| periodStart          | uint64\_t  | The time when the farm was first initialized                                                                                                                                    |
| periodFinish         | uint64\_t  | The end time of the current reward period                                                                                                                                       |
| rewardRate           | uint128\_t | The amount of WAX paid out per second, scaled by 1e8                                                                                                                            |
| rewardsDuration      | uint64\_t  | The amount of seconds that the current reward period lasts for                                                                                                                  |
| lastUpdateTime       | uint64\_t  | The last time that the farm was updated                                                                                                                                         |
| rewardPerTokenStored | uint128\_t | The historical reward paid out per token, at the last time the farm was updated. Works similar to "reward debt" when calculating what a user is owed                            |
| rewardPool           | asset      | The total amount of WAX that has been deposited into the farm, all time                                                                                                         |
| totalSupply          | uint128\_t | The amount of sWAX currently staked in the farm, including the sWAX that backs lsWAX                                                                                            |
| totalRewardsPaidOut  | asset      | Total amount of rewards that have been calculated when users interacted with the contract. Does not differentiate between whether or not the user has actually claimed them yet |

### stakers

> The stakers table keeps a record of each user who interacts with the contract, including information about their sWAX balance, rewards balance etc

| Column         | Type      | Description                                                                                                                                                                        |
| -------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| wallet         | name      | The WAX address of the user who is staking                                                                                                                                         |
| swax\_balance  | asset     | The amount of sWAX that a user is currently staking (does not include liquified sWAX)                                                                                              |
| claimable\_wax | asset     | The amount of WAX rewards that a user is currently eligible to claim (note that this may not reflect real-time data, and is only updated when a user interacts with the contract)  |
| last\_update   | uint64\_t | The timestamp of the last time a user interacted with the contract. This is used in the sync\_user function to process past snapshots and update the user's claimable\_wax balance |

### state2 (pol\_contract namespace)

The pol\_contract::state2 singleton is located on the pol.fusion smart contract, and is referenced on this contract in order to aggregate TVL data for the protocol in one place.

### top21

> The top21 singleton keeps a list of which block producers are currently in the top 21

| Column           | Type          | Description                                           |
| ---------------- | ------------- | ----------------------------------------------------- |
| block\_producers | vector\<name> | The wax addresses of the top 21 block producers       |
| last\_update     | uint64\_t     | The timestamp of the last time this table was 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://docs.waxfusion.io/smart-contracts/dapp.fusion/tables.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.
