# Generator

## 1. Overview <a href="#overview" id="overview"></a>

The Generator contract distributes token rewards (ASTRO) based on locked LP token amounts for each eligible Astroport pool. The Generator also supports proxy staking via 3rd party contracts so that stakers can receive [dual rewards](https://miro.medium.com/max/1400/0*8hn2NSnZJZTa9YGV).&#x20;

The Generator contract code can be found [here](https://github.com/astroport-fi/astroport-core/blob/main/contracts/tokenomics/generator/src/contract.rs).

## 2. Variables & Functions <a href="#state" id="state"></a>

### Constants <a href="#state" id="state"></a>

<table><thead><tr><th>Name</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td><code>CONFIG</code></td><td>Stores the contract configuration</td><td></td></tr><tr><td><code>POOL_INFO</code></td><td>Contains information about all generators</td><td></td></tr><tr><td><code>TMP_USER_ACTION</code></td><td>Used to temporarily store data about a user action</td><td></td></tr><tr><td><code>USER_INFO</code></td><td>Stores information about all stakers in every generator</td><td></td></tr><tr><td><code>MAX_LIMIT</code></td><td>The maximum amount of users that can be read at once from <code>USER_INFO</code></td><td></td></tr><tr><td><code>DEFAULT_LIMIT</code></td><td>The default amount of users to read from <code>USER_INFO</code></td><td></td></tr><tr><td><code>OWNERSHIP_PROPOSAL</code></td><td>Contains the proposal to change contract ownership</td><td></td></tr><tr><td><code>CONTRACT_NAME</code></td><td>Contract name</td><td></td></tr><tr><td><code>CONTRACT_VERSION</code></td><td>Contract version</td><td></td></tr></tbody></table>

### Structs

| Name                   | Description                                                                                                                                    | Contains                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `InstantiateMsg`       | This struct holds parameters used to instantiate the Generator contract                                                                        | <ul><li><code>owner: String</code> - Address that can change contract settings</li><li><code>astro\_token: String</code> - ASTRO token contract address</li><li><code>tokens\_per\_block: Uint128</code> - Amount of ASTRO distributed per block among all pairs</li><li><code>start\_block: Uint64</code> - Start block for distributing ASTRO</li><li><code>allowed\_reward\_proxies: Vec\<String></code> - Dual rewards proxy contracts allowed to interact with the Generator</li><li><code>vesting\_contract: String</code> - The ASTRO vesting contract that drips ASTRO rewards</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `PoolLengthResponse`   | This structure holds the response returned when querying the total length of the array that keeps track of instantiated generators             | <ul><li><code>length: usize</code> - The total length of the generator array </li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `PendingTokenResponse` | This structure holds the response returned when querying the amount of pending rewards that can be withdrawn from a 3rd party rewards contract | <ul><li><code>pending: Uint128</code> - The amount of pending ASTRO</li><li><code>pending\_on\_proxy: Option\<Uint128></code> - The amount of pending 3rd party reward tokens</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `RewardInfoResponse`   | This structure holds the response returned when querying for the token addresses used to reward a specific generator                           | <ul><li><code>base\_reward\_token: Addr</code> - The address of the base reward token</li><li><code>proxy\_reward\_token: Option\<Addr></code> - The address of the 3rd party reward token</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `PoolInfoResponse`     | This structure holds the response returned when querying for a pool's information                                                              | <ul><li><code>alloc\_point: Uint64</code> - The slice of ASTRO that this pool's generator gets per block</li><li><code>astro\_tokens\_per\_block: Uint128</code> - Amount of ASTRO tokens being distributed per block to this LP pool</li><li><code>last\_reward\_block: u64</code> - The last block when token emissions were snapshotted (distributed)</li><li><code>current\_block: u64</code> - Current block number. Useful for computing APRs off-chain</li><li><code>accumulated\_rewards\_per\_share: Decimal</code> - Total amount of ASTRO rewards already accumulated per LP token staked</li><li><code>pending\_astro\_rewards: Uint128</code> - Pending amount of total ASTRO rewards which are claimable by stakers right now</li><li><code>reward\_proxy: Option\<Addr></code> - The address of the 3rd party reward proxy contract</li><li><code>pending\_proxy\_rewards: Option\<Uint128></code> - Pending amount of total proxy rewards which are claimable by stakers right now</li><li><code>accumulated\_proxy\_rewards\_per\_share: Decimal</code> - Total amount of 3rd party token rewards already accumulated per LP token staked</li><li><code>proxy\_reward\_balance\_before\_update: Uint128</code> - Reward balance for the dual rewards proxy before updating accrued rewards</li><li><code>orphan\_proxy\_rewards: Uint128</code> - The amount of orphan proxy rewards which are left behind by emergency withdrawals and not yet transferred out</li><li><code>lp\_supply: Uint128</code> - Total amount of lp tokens staked in the pool's generator</li></ul> |
| `ConfigResponse`       | This structure holds the response returned when querying the contract for general parameters                                                   | <ul><li><code>owner: Addr</code> - Address that's allowed to change contract parameters</li><li><code>astro\_token: Addr</code> - ASTRO token contract address</li><li><code>tokens\_per\_block: Uint128</code> - Total amount of ASTRO distributed per block</li><li><code>total\_alloc\_point: Uint64</code> - Sum of total allocation points across all active generators</li><li><code>start\_block: Uint64</code> - Start block for ASTRO incentives</li><li><code>allowed\_reward\_proxies: Vec\<Addr></code> - List of 3rd party reward proxies allowed to interact with the Generator contract</li><li><code>vesting\_contract: Addr</code> - The ASTRO vesting contract address</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `StakerResponse`       | This structure holdes the parameters used to return information about a staked in a specific generator                                         | <ul><li><code>account: String</code> - The staker's address</li><li><code>amount: Uint128</code> - The amount that the staker currently has in the generator</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `UserInfo`             | This structure provides information for an address staked in a specific generator                                                              | <ul><li><code>amount: Uint128</code> - An amount of staked LP tokens</li><li><code>reward\_debt: Uint128</code> - A reward amount an address already received or that the address is not eligible for; used for proper reward calculation</li><li><code>reward\_debt\_proxy: Uint128</code> - Proxy reward amount an address already received or is not eligible for; used for proper reward calculation</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `PoolInfo`             | This structure provides information for a pool                                                                                                 | <ul><li><code>alloc\_point: Uint64</code> - Allocation points are used to control reward distribution among eligible pools; a pool is eligible is its generator has a non-zero <code>alloc\_point</code></li><li><code>last\_reward\_block: Uint64</code> - Accumulated amount of rewards per share unit. Used for correct reward calculations</li><li><code>accumulated\_rewards\_per\_share: Decimal</code> - This is the accrued amount of rewards up to the latest checkpoint</li><li><code>reward\_proxy: Option</code> - The 3rd party proxy reward contract</li><li><code>accumulated\_proxy\_rewards\_per\_share: Decimal</code> - This is the accrued amount of 3rd party rewards up to the latest checkpoint</li><li><code>proxy\_reward\_balance\_before\_update: Uint128</code> - This is the balance of 3rd party proxy rewards that the proxy had before a reward snapshot</li><li><code>orphan\_proxy\_rewards: Uint128</code> - The orphaned proxy rewards which are left behind by emergency withdrawals</li><li><code>has\_asset\_rewards: bool</code> - Whether a generator receives 3rd party rewards or not</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `Config`               | This structure returns the main configuration for the Generator contract                                                                       | <ul><li><code>owner: Addr</code> - Address used to change contract settings</li><li><code>astro\_token: Addr</code> - The ASTRO token address</li><li><code>tokens\_per\_block: Uint128</code> - Total amount of ASTRO rewards per block split between all active generators</li><li><code>total\_alloc\_point: Uint64</code> - The total (summed up) allocation points for all active generators</li><li><code>start\_block: Uint64</code> - The block number when ASTRO mining started</li><li><code>allowed\_reward\_proxies</code> - The list of allowed reward proxy contracts</li><li><code>vesting\_contract: Addr</code> - The vesting contract from which ASTRO rewards are distributed</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

### Functions

| Function                       | Params                                                                                                                                                                            | Description                                                                                                                                 |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `instantiate`                  | `(deps: DepsMut`, `_env: Env`, `_info: MessageInfo`, `msg: InstantiateMsg)` `-> <Response, ContractError>`                                                                        | Initializes the generator contract using provided parameters                                                                                |
| `execute`                      | `(deps: DepsMut`, `env: Env`, `info: MessageInfo`, `msg: ExecuteMsg)` `->` `Result<Response`, `ContractError>`                                                                    | Exposes execute functions available in the contract                                                                                         |
| `execute_update_config`        | `execute_update_config(deps: DepsMut`, `info: MessageInfo`, `vesting_contract: Option<String>)` `->` `Result<Response`, `ContractError>`                                          | Sets a new Generator vesting contract address                                                                                               |
| `add`                          | `add(mut deps: DepsMut`, `env: Env`, `lp_token: Addr`, `alloc_point: Uint64`, `has_asset_rewards: bool`, `reward_proxy: Option<String>)` `->` `Result<Response`, `ContractError>` | Creates a new generator and adds it to `POOL_INFO` (if it does not exist yet) and updates total allocation points (in `Config`)             |
| `set`                          | `set(mut deps: DepsMut`, `env: Env`, `lp_token: Addr`, `alloc_point: Uint64`, `has_asset_rewards: bool)` `->` `Result<Response`, `ContractError>`                                 | Updates the given generator's ASTRO allocation points                                                                                       |
| `reply`                        | `reply(deps: DepsMut`, `env: Env`, `_msg: Reply)` `->` `Result<Response`, `ContractError>`                                                                                        | The entry point to the contract for processing replies from submessages                                                                     |
| `mass_update_pools`            | `mass_update_pools(mut deps: DepsMut`, `env: Env)` `->` `Result<Response`, `ContractError>`                                                                                       | Updates the amount of accrued rewards for all generators                                                                                    |
| `update_pool`                  | `update_pool(mut deps: DepsMut`, `env: Env`, `lp_token: Addr)` `->` `Result<Response`, `ContractError>`                                                                           | Updates the amount of accrued rewards for a specific generator                                                                              |
| `accumulate_rewards_per_share` | `accumulate_rewards_per_share(deps: DepsMut`, `env: &Env`, `lp_token: &Addr`, `pool: &mut PoolInfo`, `cfg: &Config`, `deposited: Option<Uint128>)` `->` `StdResult<()>`           | Accrues the amount of rewards distributed for each staked LP token in a specific generator. Update reward variables for the given generator |
| `receive_cw20`                 | `(deps: DepsMut`, `env: Env`, `info: MessageInfo`, `cw20_msg: Cw20ReceiveMsg)` `->` `Result<Response`, `ContractError>`                                                           | Receives a message of type \[`Cw20ReceiveMsg`] and processes it depending on the received template                                          |
| `send_pending_rewards`         | `send_pending_rewards(cfg: &Config`, `pool: &PoolInfo`, `user: &UserInfo`, `to: &Addr)` `->` `Result<Vec`, `ContractError>`                                                       | Distributes pending proxy rewards for a specific staker                                                                                     |
| `deposit`                      | `deposit(mut deps: DepsMut`, `env: Env`, `lp_token: Addr`, `beneficiary: Addr`, `amount: Uint128)` `->` Result\<Response, ContractError>                                          | Deposit LP tokens in a generator to receive token emissions                                                                                 |
| `withdraw`                     | `withdraw(mut deps: DepsMut`, `env: Env`, `lp_token: Addr`, `account: Addr`, `amount: Uint128)` `->` `Result<Response`, `ContractError>`                                          | Withdraw LP tokens from a generator                                                                                                         |
| `emergency_withdraw`           | `emergency_withdraw(deps: DepsMut`, `_env: Env`, `info: MessageInfo`, `lp_token: String)` `->` `Result<Response`, `ContractError>`                                                | Withdraw LP tokens without caring about rewards. **To be used in emergency cases only**                                                     |
| `set_allowed_reward_proxies`   | `set_allowed_reward_proxies(deps: DepsMut`, `info: MessageInfo`, `proxies: Vec<String>)` `->` `Result<Response`, `ContractError>`                                                 | Sets the allowed reward proxies that can interact with the Generator contract                                                               |
| `send_orphan_proxy_rewards`    | `send_orphan_proxy_rewards(deps: DepsMut`, `info: MessageInfo`, `recipient: String`, `lp_token: String)` `->` `Result<Response`, `ContractError>`                                 | Sends orphaned proxy rewards (which are left behind by emergency withdrawals) to another address. Can only be called by the `owner`         |
| `migrate`                      | `migrate(deps: DepsMut`, `_env: Env`, `_msg: MigrateMsg)` `->` `Result<Response`, `ContractError>`                                                                                | Used for contract migration                                                                                                                 |
| `query`                        | `query(deps: Deps`, `env: Env`, `msg: QueryMsg)` `->` `Result<Binary`, `ContractError>`                                                                                           | Exposes all the queries available in the contract                                                                                           |
| `pool_length`                  | `pool_length(deps: Deps)` `->` `Result<PoolLengthResponse`, `ContractError>`                                                                                                      | Returns the amount of instantiated generators                                                                                               |
| `query_deposit`                | `query_deposit(deps: Deps`, `lp_token: String`, `user: String)` `->` `Result<Uint128`, `ContractError>`                                                                           | Returns the amount of LP tokens a user staked in a specific generator                                                                       |
| `pending_token`                | `pending_token(deps: Deps`, `env: Env`, `lp_token: String`, `user: String)` `->` `Result<PendingTokenResponse`, `ContractError>`                                                  | Calculates and returns pending token rewards for a specific user                                                                            |
| `query_config`                 | `query_config(deps: Deps)` `->` `Result<ConfigResponse`, `ContractError>`                                                                                                         | Returns information about a generator's configuration                                                                                       |
| `query_reward_info`            | `query_reward_info(deps: Deps`, `lp_token: String)` `->` `Result<RewardInfoResponse`, `ContractError>`                                                                            | Returns reward information for a specific generator                                                                                         |
| `query_orphan_proxy_rewards`   | `query_orphan_proxy_rewards(deps: Deps`, `lp_token: String)` `->` `Result<Uint128`, `ContractError>`                                                                              | Returns the amount of orphaned proxy rewards for a specific generator                                                                       |
| `query_pool_info`              | `query_pool_info(deps: Deps`, `env: Env`, `lp_token: String)` `->` `Result<PoolInfoResponse`, `ContractError>`                                                                    | Returns a generator's configuration                                                                                                         |
| `query_simulate_future_reward` | `query_simulate_future_reward(deps: Deps`, `env: Env`, `lp_token: String`, `future_block: u64)` `->` `Result<Uint128`, `ContractError>`                                           | Returns the total amount of ASTRO tokens distributed for a specific generator up to a certain block in the future                           |
| `query_list_of_stakers`        | `query_list_of_stakers(deps: Deps`, `lp_token: String`, `start_after: Option<String>`, `limit: Option<u32>)` `->` `Result<Vec<StakerResponse>`, `ContractError>`                  | Returns a list of stakers that currently have funds in a specific generator                                                                 |
| `calculate_rewards`            | `calculate_rewards(env: &Env`, `pool: &PoolInfo`, `cfg: &Config)` `->` `StdResult<Uint128>`                                                                                       | Calculates and returns the amount of accrued rewards since the last reward checkpoint for a specific generator                              |

## 3. Reward Distribution <a href="#reward-distribution" id="reward-distribution"></a>

The Generator reward distribution is controlled by several variables:

| Variable            | Description                                                                                        |
| ------------------- | -------------------------------------------------------------------------------------------------- |
| `tokens_per_block`  | The total amount of ASTRO rewards that will be distributed every block among all active generators |
| `alloc_point`       | A distribution ratio set per individual generator                                                  |
| `total_alloc_point` | The sum of **`alloc_point`** for each active generator                                             |

The formula for reward distribution (for every generator) is the following:

`astro_to_distribute = blocks_since_last_reward * tokens_per_block * alloc_point / total_alloc_point`

For example, if there are three active generators, and the **`alloc_point`** for each generator is **1000,** the **`total_alloc_point`** would equal **3000** (1000 \* 3). All three pools will get an equal amount of rewards. But what happens if we want to add another pool? Let's add one more pool and set its **`alloc_point`** to **3000**.&#x20;

*Note, that doing this will change the distribution for all existing pools, as it will affect the **`total_alloc_point`** variable.* After adding the new pool, the **`total_alloc_point`** would be **6000**. This new pool will now receive 50% of rewards (**3000** is 50% of **6000**) and the other 50% will be evenly distributed between the initial three pools (because each of their **alloc\_points** is **1000**). In order to maintain the same reward allocations for existing pools, it is required to update each of their **`alloc_point`**&#x73;.

## 4. Walkthrough <a href="#risks" id="risks"></a>

{% hint style="info" %}
The following are examples and descriptions of core functions that can be called by anyone to interact with the Generator contract.&#x20;
{% endhint %}

### **Execute Functions**

**`deposit`**

Stakes LP tokens in a specific generator (inside the Generator contract). In order to stake in the Generator contract, you should execute this message inside the contract of the LP token you want to stake.

```
{
  "send": {
    "contract": <GeneratorContractAddress>,
    "amount": 999,
    "msg": "base64-encodedStringOfWithdrawMsg"
  }
}
```

Inside `send.msg`, you may encode this JSON string into base64 encoding:

```
{
  "Deposit": {}
}
```

#### **`depositFor`**

Stakes LP tokens in the Generator on behalf of another address. In order to stake in the Generator contract, you should execute this message inside the LP token you want to stake.

```
{
  "send": {
    "contract": <GeneratorContractAddress>,
    "amount": 999,
    "msg": "base64-encodedStringOfWithdrawMsg"
  }
}
```

In `send.msg`, you may encode this JSON string into base64 encoding:

```
{
  "DepositFor": "terra..."
}
```

**`withdraw`**

Unstakes LP tokens from the Generator contract and claims outstanding token emissions. An address can also claim rewards without unstaking from a generator: call the withdraw function and specify **`amount`** as 0 (you don’t withdraw any LP tokens, only claim rewards).

```
  "withdraw": {
    "lp_token": "terra...",
    "amount": "123"
  }
}
```

#### **`emergency_withdraw`**

Unstakes LP tokens without caring about rewards. To be used only in emergencies such as a critical bug found in the Generator contract.

```
{
  "emergency_withdraw": {
    "lp_token": "terra..."
  }
}
```

**`auto_stake`**

An address can provide liquidity and stake in the Generator in one transaction using the Swap Pairs contracts. Calling the `provide_liquidity` operation with `auto_stake` as`true` allows LP tokens to automatically be staked in the Generator contract (if the LP tokens currently get ASTRO or 3rd party emissions). If `auto_stake` is not specified, LP tokens will just be minted for the recipient.&#x20;

{% tabs %}
{% tab title="ANC-UST" %}

```
{
  "provide_liquidity": {
    "assets": [
      {
        "info": {
          "token": {
            "contract_addr": "terra14z56l0fp2lsf86zy3hty2z47ezkhnthtr9yq76"
          }
        },
        "amount": "1000000"
      },
      {
        "info": {
          "native_token": {
            "denom": "uusd"
          }
        },
        "amount": "1000000"
      }
    ],
    "slippage_tolerance": "0.01",
    "auto_stake": true,
    "receiver": "terra..."
  }
}
```

{% endtab %}

{% tab title="bLUNA-LUNA" %}

```
{
  "provide_liquidity": {
    "assets": [
      {
        "info": {
          "token": {
            "contract_addr": "terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp"
          }
        },
        "amount": "1000000"
      },
      {
        "info": {
          "native_token": {
            "denom": "uluna"
          }
        },
        "amount": "1000000"
      }
    ],
    "slippage_tolerance": "0.01",
    "auto_stake": true,
    "receiver": "terra..."
  }
}
```

{% endtab %}
{% endtabs %}

### Query Functions

#### `deposit`

Returns the amount of a specific LP token that a user currently has staked in the Generator.&#x20;

{% tabs %}
{% tab title="Query" %}

```
{
  "deposit": {
    "lp_token": "terra...",
    "user": "terra..."
  }
}
```

{% endtab %}

{% tab title="Ex. Response" %}

```
"123"
```

{% endtab %}
{% endtabs %}

#### `pending_token`

Returns the amount of pending ASTRO and 3rd party token rewards that can be claimed by a user that staked a specific LP token.

{% tabs %}
{% tab title="Query" %}

```
{
  "pending_token": {
    "lp_token": "terra...",
    "user": "terra..."
  }
}
```

{% endtab %}

{% tab title="Ex. Response" %}

```
{
  "pending": "123",
  "pending_on_proxy": null
}
```

{% endtab %}
{% endtabs %}

#### `reward_info`

{% tabs %}
{% tab title="Query" %}

```
{
  "reward_info": {
    "lp_token": "terra..."
  }
}
```

{% endtab %}

{% tab title="ANC-UST Ex. Response" %}

```
{
  "base_reward_token": "terra1xj49zyqrwpv5k928jwfpfy2ha668nwdgkwlrg3",
  "proxy_reward_token": "terra14z56l0fp2lsf86zy3hty2z47ezkhnthtr9yq76"
}
```

{% endtab %}
{% endtabs %}

#### `orphan_proxy_rewards`

{% tabs %}
{% tab title="Query" %}

```
{
  "orphan_proxy_rewards": {
    "lp_token": "terra..."
  }
}
```

{% endtab %}

{% tab title="ANC-UST Ex. Response" %}

```
"0"
```

{% endtab %}
{% endtabs %}

#### `simulate_future_reward`

Returns the amount of ASTRO that will be distributed up to a future block and for a specific LP token.

{% tabs %}
{% tab title="Query" %}

```
{
  "simulate_future_reward": {
    "lp_token": "terra...",
    "future_block": "999"
  }
}
```

{% endtab %}

{% tab title="Ex. Response" %}

```
"123"
```

{% endtab %}
{% endtabs %}

#### `list_of_stakers`

Returns a list of stakers that currently have funds in a specific generator.

{% tabs %}
{% tab title="Query" %}

```
{
  "list_of_stakers": {
    "lp_token": "terra...",
    "start_after": "terra...",
    "limit": 5
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Risks <a href="#risks" id="risks"></a>

1. **`alloc_point`** miscalculation can lead to specific pools not getting the initially intended ASTRO emissions.
2. If **`owner`** is compromised, it can drain the Generator of all staked LP tokens.
3. Dual rewards proxy misconfiguration can block addresses from staking in specific generators.


---

# 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://astroport.gitbook.io/astroport/smart-contracts/tokenomics/generator.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.
