The Generator contract allocates token rewards (ASTRO) for various LP tokens and distributes them pro-rata to LP stakers. The Generator supports proxy staking via 3rd party contracts that offer a second reward besides ASTRO token emissions.
Initializes the contract with required addresses and contracts used for reward distributions.
{
"owner": "terra...",
"astro_token": "terra...",
"tokens_per_block": "123",
"start_block": "123",
"vesting_contract": "terra..."
}
Update the vesting contract address, generator controller contract address or generator guardian address. Only the contract owner can execute this.
{
"update_config": {
"vesting_contract": "terra...",
"generator_controller": "terra...",
"guardian": "terra...",
"voting_escrow": "terra...",
"generator_limit": 20
}
}
Set up a new list of pools with allocation points.
{
"setup_pools": {
"pools" : [
[
"terra...",
"60"
],
[
"terra...",
"40"
]
]
}
}
Update has_asset_rewards parameter for the given pool.
{
"update_pool": {
"lp_token": "terra...",
"has_asset_rewards": true
}
}
Update rewards and return it to user.
{
"claim_rewards": {
"lp_tokens": ["terra...", "terra...", "terra..."]
}
}
CW20 receive msg.
{
"receive": {
"sender": "terra...",
"amount": "123",
"msg": "<base64_encoded_json_string>"
}
}
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": {}
}
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:
{
"deposit_for": "terra..."
}
Unstakes LP tokens from the Generator contract and claims outstanding token emissions.
{
"withdraw": {
"lp_token": "terra...",
"amount": "123"
}
}
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..."
}
}
Sends orphaned rewards (left behind by emergency withdraws) to another address. Only the contract owner can transfer orphan rewards.
{
"send_orphan_reward": {
"recipient": "terra...",
"lp_token": "terra..."
}
}
Sets the total amount of ASTRO distributed per block among all active generators. Only the owner can execute this.
{
"set_tokens_per_block": {
"amount": "123"
}
}
Creates a request to change contract ownership. The validity period of the offer is set by the expires_in
variable. Only the current owner can execute this.
{
"propose_new_owner": {
"owner": "terra...",
"expires_in": 1234567
}
}
Removes the existing offer to change contract ownership. Only the contract owner can execute this.
{
"drop_ownership_proposal": {}
}
Used by the newly proposed contract owner to claim contract ownership.
{
"claim_ownership": {}
}
Change the current dual rewards proxy for a specific LP token. Only the contract owner can execute this.
{
"move_to_proxy": {
"lp_token": "terra...",
"proxy": "terra..."
}
}
Add or remove tokens to and from the tokens blocked list. Only the owner contract or generator guardian can execute this.
{
"update_tokens_blockedlist": {
"add": ["terra...", "terra..."],
"remove": ["terra...", "terra...", "terra..."]
}
}
Sets the allocation point to zero for specified pool. Only the factory contract can execute this.
{
"deactivate_pool": {
"lp_token": "terra..."
}
}
Sets the allocation point to zero for each pool by the pair type.
{
"deactivate_pool": {
"pair_types": [{"xyk": {}}, {"stable": {}}]
}
}
Updates emissions boost for specified generators
{
"checkpoint_user_boost": {
"generators": ["terra...", "terra..."],
"user": "terra..."
}
}
All query messages are described below. A custom struct is defined for each query response.
Returns the total amount of generators that have been created until now.
{
"pool_length": {}
}
Returns the amount of a specific LP token that a user currently has staked in the Generator.
{
"deposit": {
"lp_token": "terra...",
"user": "terra..."
}
}
Returns the amount of pending ASTRO and 3rd party token rewards that can be claimed by a user that staked a specific LP token.
{
"pending_token": {
"lp_token": "terra...",
"user": "terra..."
}
}
Returns the main Generator contract configuration.
{
"config": {}
}
Returns the amount of orphaned proxy rewards left behind by emergency withdrawals.
{
"orphan_proxy_rewards": {
"lp_token": "terra..."
}
}
Returns information about token emissions for the specified LP token.
{
"reward_info": {
"lp_token": "terra..."
}
}
Returns pool information for the specified LP token.
{
"pool_info": {
"lp_token": "terra..."
}
}
Returns the amount of ASTRO that will be distributed up to a future block and for a specific LP token.
{
"simulate_future_reward": {
"lp_token": "terra...",
"future_block": 999
}
}
Returns a list of stakers that currently have funds in a specific generator.
{
"list_of_stakers": {
"lp_token": "terra...",
"start_after": "terra...",
"limit": 5
}
}
Returns the list of blocked tokens
{
"blocked_tokens_list": {}
}
Returns the total amount of active generators.
{
"active_pool_length": {}
}
Returns the current virtual amount in a specific generator
{
"user_virtual_amount": {
"lp_token": "terra...",
"user": "terra..."
}
}
Returns the total virtual supply of generator
{
"total_virtual_amount": {
"lp_token": "terra..."
}
}
Returns a list of reward proxy contracts which have been ever used
{
"reward_proxies_list": {}
}