Claiming Rewards
Overview
Liquidity providers earn in two ways:
- Swap fees. The liquidity providers' part of every swap fee stays in the pool. It raises the value of each LP token and is paid out when you withdraw liquidity. There is nothing to claim.
- Incentive rewards. If your LP tokens are staked in the Incentives contract and the pool has active incentive schedules, rewards accrue every second. You claim them with
claim_rewards.
There are no ASTRO emissions: incentive rewards come only from external schedules (see below).
| Chain | Incentives |
|---|---|
| Terra | terra1eywh4av8sln6r45pxq45ltj798htfy0cfcf7fy3pxc2gcv6uc07se4ch9x |
| Neutron | neutron173fd8wpfzyqnfnpwq2zhtgdstujrjz2wkprkjfr6gqg4gknctjyq6m3tch |
Claiming Incentive Rewards
claim_rewards pays out your pending rewards for one or more staked LP tokens. Each entry is an LP token denom or CW20 LP contract address.
_7{_7 "claim_rewards": {_7 "lp_tokens": [_7 "terra1s275y73lfupag0g03nglxaedfnsw5z4m5zc9wk66guy503zuw5ss889tlx"_7 ]_7 }_7}
_12const incentives = "terra1eywh4av8sln6r45pxq45ltj798htfy0cfcf7fy3pxc2gcv6uc07se4ch9x";_12_12await signingClient.execute(_12 sender,_12 incentives,_12 {_12 claim_rewards: {_12 lp_tokens: ["terra1s275y73lfupag0g03nglxaedfnsw5z4m5zc9wk66guy503zuw5ss889tlx"],_12 },_12 },_12 "auto"_12);
Staking more (deposit) and unstaking (withdraw) also pay out pending rewards, so you don't need to claim before either.
Checking Pending Rewards
_6{_6 "pending_rewards": {_6 "lp_token": "terra1s275y73lfupag0g03nglxaedfnsw5z4m5zc9wk66guy503zuw5ss889tlx",_6 "user": "terra1...you"_6 }_6}
The response lists each reward asset and amount:
_10[_10 {_10 "info": {_10 "native_token": {_10 "denom": "ibc/E8481AD838C31D4FC12A504B10F9B4E2F830F8818D2735C2FFC707579B5FA60B"_10 }_10 },_10 "amount": "1234567"_10 }_10]
Where Rewards Come From
Anyone can fund rewards for a pool's stakers by adding an incentive schedule with incentivize. Schedules run in weekly periods that start on Monday 00:00 UTC: a new schedule starts immediately and runs until the next Monday plus duration_periods weeks (1 to 25).
_16{_16 "incentivize": {_16 "lp_token": "terra1s275y73lfupag0g03nglxaedfnsw5z4m5zc9wk66guy503zuw5ss889tlx",_16 "schedule": {_16 "reward": {_16 "info": {_16 "native_token": {_16 "denom": "uluna"_16 }_16 },_16 "amount": "10000000000"_16 },_16 "duration_periods": 2_16 }_16 }_16}
- For a native reward, attach the reward amount as funds. For a CW20 reward, first
increase_allowancefor the Incentives contract; Incentives pulls the tokens withtransfer_from. - The reward must pay at least 1 base unit per second over the schedule.
- A pool can have up to 5 external reward tokens at a time.
- Incentivization fee. Adding a reward token that the pool doesn't have yet costs a fee, also attached as funds. On both chains it is currently 1,500 ASTRO (
1500000000in base units of the chain's ASTRO denom) and goes to the Maker. Checkincentivization_fee_infoin the Incentivesconfigquery. Adding to a reward token the pool already has (while its schedule is still running), or rewarding in ASTRO, needs no fee. Once a token's schedules have all ended it is removed from the pool, and the next schedule in that token counts as new again. On Terra, addresses on the fee exemption list (fee_exemptionsquery), such as the yASTRO contract, don't pay it either.
To check whether a schedule will need the fee:
_6{_6 "is_fee_expected": {_6 "lp_token": "terra1s275y73lfupag0g03nglxaedfnsw5z4m5zc9wk66guy503zuw5ss889tlx",_6 "reward": "uluna"_6 }_6}
On Terra (Incentives 1.5.0) you can add "sender": "terra1..." to take fee exemptions into account. Neutron's Incentives (1.4.0) doesn't accept sender.
To see a pool's current rewards, query pool_info with the LP token. Each entry in rewards has the reward asset and its rps (reward units per second for the whole pool); total_lp is the amount staked.
_5{_5 "pool_info": {_5 "lp_token": "terra1s275y73lfupag0g03nglxaedfnsw5z4m5zc9wk66guy503zuw5ss889tlx"_5 }_5}
yASTRO Rewards for Pools
On Terra, a pool that holds yASTRO earns USDC.inj rewards like any yASTRO holder. Anyone can move them to the pool's stakers by calling forward_pool_rewards on the yASTRO contract (terra1fe8uj96z7f4jfsnkrdxhchxdhdtx8alr9zjqze76hm2ga6tpxjjq5rdjw7):
_5{_5 "forward_pool_rewards": {_5 "pool": "terra1...pool"_5 }_5}
It turns the pool's accrued rewards into an Incentives schedule on that pool's LP token, so only LP tokens staked in Incentives earn them. It needs at least 1% of the pool's LP supply to be staked in Incentives; until then the rewards stay pending.
Protocol Fees
The Maker's share of swap fees is not paid to liquidity providers. On Neutron it buys ASTRO that is burned; on Terra it is split between buying ASTRO to burn, the Development Fund and yASTRO stakers. Anyone can trigger the Maker's collect, but it never pays the caller. See Maker.