Staking
The staking contract allows ASTRO holders to stake their tokens in exchange for xASTRO. The amount of ASTRO they can claim later increases as accrued fees in the Maker contract get swapped to ASTRO which is then sent to stakers.
Links
- Contract Address: terra1nyu6sk9rvtvsltm7tjjrp6rlavnm3e4sq03kltde6kesam260f8szar8ze
- Testnet Address: terra19t8ffmz6q2rdm3rllyksd6sex6n650a4anttzzvz9mf8mqr4nkrq44cyu6
- Contract Repo: https://github.com/astroport-fi/astroport-core/tree/main/contracts/tokenomics/staking
- contract.rs: https://github.com/astroport-fi/astroport-core/blob/main/contracts/tokenomics/staking/src/contract.rs
- staking.rs: https://github.com/astroport-fi/astroport-core/blob/main/packages/astroport/src/staking.rs
- Tests: https://github.com/astroport-fi/astroport-core/tree/main/contracts/tokenomics/staking/tests
InstantiateMsg
Initializes the contract with the token code ID used by ASTRO and the ASTRO token address.
Params | Type | Description |
---|---|---|
owner | String | The contract owner address |
token_code_id | u64 | CW20 token code identifier |
deposit_token_addr | String | The ASTRO token contract address |
merketing | Option<InstantiateMarketingInfo> | The marketing info |
InstantiateMarketingInfo
This structure describes the marketing info settings such as project, description, and token logo.
Params | Type | Description |
---|---|---|
project | Option<String | The project name |
description | Option<String> | The project description |
marketing | Option<String> | The address of an admin who is able to update marketing info |
logo | Option<Logo> | The token logo |
ExecuteMsg
receive
CW20 receive msg.
Params | Type | Description |
---|---|---|
receive | Cw20ReceiveMsg | CW20 receive message |
enter
Deposits ASTRO in the xASTRO staking contract.
You should execute this message inside the ASTRO token contract and use a message like one shown below.
Params | Type | Description |
---|---|---|
send | Cw20ReceiveMsg | CW20 receive message |
In send.msg
, you may encode this JSON string into base64 encoding:
leave
Burns xASTRO and unstakes underlying ASTRO (initial staked amount + accrued ASTRO since staking).
You should execute this message inside the xASTRO token contract and use a message like one shown below.
Params | Type | Description |
---|---|---|
send | Cw20ReceiveMsg | CW20 receive message |
In send.msg
, you may encode this JSON string into base64 encoding:
QueryMsg
config
Returns the ASTRO and xASTRO addresses.
ConfigResponse
Params | Type | Description |
---|---|---|
deposit_token_addr | Addr | The ASTRO token address |
share_token_addr | Addr | The xASTRO token address |
total_shares
Returns the total amount of xASTRO tokens.
Returns Uint128
total_deposit
Returns the total amount of ASTRO deposits in the staking contract.
Returns Uint128