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": "paloma...",
"astro_token": "paloma...",
"tokens_per_block": "123",
"start_block": "123",
"vesting_contract": "paloma..."
}
Update the vesting contract address, generator controller contract address or generator guardian address. Only the contract owner can execute this.
{
"update_config": {
"vesting_contract": "paloma...",
"generator_controller": "paloma...",
"guardian": "paloma...",
"voting_escrow": "paloma...",
"generator_limit": 20
}
}
Set up a new list of pools with allocation points.
{
"setup_pools": {
"pools" : [
[
"paloma...",
"60"
],
[
"paloma...",
"40"
]
]
}
}
Update has_asset_rewards parameter for the given pool.
{
"update_pool": {
"lp_token": "paloma...",
"has_asset_rewards": true
}
}
Update rewards and return it to user.
{
"claim_rewards": {
"lp_token": "paloma..."
}
}
CW20 receive msg.
{
"receive": {
"sender": "paloma...",
"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": "paloma..."
}
Unstakes LP tokens from the Generator contract and claims outstanding token emissions.
{
"withdraw": {
"lp_token": "paloma...",
"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": "paloma..."
}
}
Sends orphaned rewards (left behind by emergency withdraws) to another address. Only the contract owner can transfer orphan rewards.
{
"send_orphan_reward": {
"recipient": "paloma...",
"lp_token": "paloma..."
}
}
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": "paloma...",
"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": "paloma...",
"proxy": "paloma..."
}
}
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": ["paloma...", "paloma..."],
"remove": ["paloma...", "paloma...", "paloma..."]
}
}
Sets the allocation point to zero for specified pool. Only the factory contract can execute this.
{
"deactivate_pool": {
"lp_token": "paloma..."
}
}
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": ["paloma...", "paloma..."],
"user": "paloma..."
}
}
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": "paloma...",
"user": "paloma..."
}
}
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": "paloma...",
"user": "paloma..."
}
}
Returns the main Generator contract configuration.
{
"config": {}
}
Returns the amount of orphaned proxy rewards left behind by emergency withdrawals.
{
"orphan_proxy_rewards": {
"lp_token": "paloma..."
}
}
Returns information about token emissions for the specified LP token.
{
"reward_info": {
"lp_token": "paloma..."
}
}
Returns pool information for the specified LP token.
{
"pool_info": {
"lp_token": "paloma..."
}
}
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": "paloma...",
"future_block": 999
}
}
Returns a list of stakers that currently have funds in a specific generator.
{
"list_of_stakers": {
"lp_token": "paloma...",
"start_after": "paloma...",
"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": "paloma...",
"user": "paloma..."
}
}
Returns the total virtual supply of generator
{
"total_virtual_amount": {
"lp_token": "paloma..."
}
}
Returns a list of reward proxy contracts which have been ever used
{
"reward_proxies_list": {}
}