airswap-aips icon indicating copy to clipboard operation
airswap-aips copied to clipboard

AIP 48: Configuring L2 reward pools to prioritize smaller stakes

Open Koploseus opened this issue 3 years ago • 17 comments

Summary

  • Allow stakers to claim their rewards through L2 to avoid high ethereum gas fees
  • Prioritize smaller stakes on L2 pools as their claims would be more impacted by gas
  • Claiming parameters of SCALE and MAX on L2 rewards pools will be adjusted so that small stakes (< 20,000 points) will roughly receive similar claim amounts as from the ETH rewards pool.

Rationale

The current staking contract on Ethereum L1 chain rewards AST stakers with points for participation in governance voting. Unfortunately, gas prices for a single claim can go up to ~ $150 during periods of congestion - making it difficult for small stakers to enjoy their rewards.

When claiming rewards under $100, the bulk of the rewards go towards offsetting gas fees. In some cases, the staker even loses money as he pays more in gas than in rewards obtained. image

We would ideally like to maximize the rewards going to stakers and minimize the rewards wasted on gas. To ensure that every AST staker may be able to claim without worrying too much about gas fees, we propose to prioritize smaller claims on L2 rewards pools. This benefits smaller stakes since less of their rewards are used up in gas. Larger stakes would also benefit since smaller stakers would now be incentivized to claim from the L2 pools instead, which would leave more in the L1 (ETH) rewards pool.

Specification

AirSwap has already been deployed on BSC, which has a largest pool of ~ $2,500 to date (https://bscscan.com/address/0xF636776aCfca2132E019E714a1fC881124B3bAfC). We propose to configure the L2 rewards claiming parameters to roughly match the amounts on L1 for claims using < 20,000 points.

To start, the SCALE and MAX parameters would be set to 9 and 25 respectively on L2 pools. This gives small stakes a larger % claim from the L2 pool. A comparison between claimed amounts on ETH and BSC (with the updated parameters) is shown below. Gas fees are currently around $0.3 on BSC and $15 on ETH, so the slightly reduced rewards on BSC would be made up for by negligible gas fees for claims on BSC.

image These parameters will be reviewed when new L2s are added, or when volumes through L1 or L2 pools change significantly. image

Copyright

Copyright and related rights waived via CC0. Thanks to @agrimony

Koploseus avatar Sep 09 '21 08:09 Koploseus

But fees are physically stored on the Ethereum Mainnet because makers trade there, who will pay the fee to execute a "Transfer" of your claim/of each fee portion generate to the L2? It is going to become much more expensive than simple claim on mainnet.

VWorkerFirst avatar Sep 09 '21 08:09 VWorkerFirst

This is the question where i don't have the answer. I guess that a part of the pool for the team will have to be a bit higher to be able to pay the fees.

You will pay 50$ of fees for the swap. If nothing moove, stackers will have to pay 150$ of fees for every claim, this is not an solution for "little" stackers.

For 20k of AST you get around 110$ of rewards .. so they won't enjoy it

Koploseus avatar Sep 09 '21 08:09 Koploseus

I think a few numbers we would have to first think about

  1. how much does it cost to move from L1 to L2
  2. how about cross-L2 swaps (e.g. if we have BSC pools to move to MATIC?)

If gas eats up most of the returns then it no longer becomes practical to do it.

Alternatively, we can start to pursue integrations on these side chains - with each side chain building up its own share of pool rewards. We could deploy our staking contracts on all these side chains as well, so that Stakers have the option of staking on these L2 chains, which would allow them to claim the rewards from the respective L2. (Or perhaps more ideally, if staking on L1 could offer the option of claiming from L2 that might also work)

agriimony avatar Sep 09 '21 11:09 agriimony

1- From L1 --> L2 it cost around 50$ (i tested 2 days ago ) 2- But won't are we going to have like a "pool" war ? Like i control 10% of the eth pool (with 10$k of reward) .. but on the BSC pool i will get 80% on 10k$ of reward ? So the little stackers can still being ... stucked or pay less fees .. but less reward also ?

Koploseus avatar Sep 09 '21 12:09 Koploseus

how much does it cost to move from L1 to L2

Moving from L1 to L2 is okay because that is a single big transaction that can be compensated similarly to the proposal for fee consolidation (i.e. caller gets 1%). Moving from L2 to L1 is a big query - how does this work? If I claim on L2, do I have to execute an L1 transaction in order to get the funds on L1?

At the start of the year I was doing some arbitrage between dexes on L1 and xDai - bridging the funds was very expensive as it always required a fairly complex (high gas) ETH transaction. If a L1 ETH transaction is required per user to return funds to L1 from L2 then there is no benefit in claiming on L2.

Haven't had time to research, but I have a feeling rollups are the way forward for this? My understanding is they aggregate a large number of cheap transactions on L2 into a single L1 tx.

Very willing to be educated on this :)

gpxl-dev avatar Sep 09 '21 14:09 gpxl-dev

Mmmh if you claim on the L2 you will get the your rewards on the L2 (the reward pool will push the reward to the l2 pool)

You don't have to transfert your fund L2 ---> L1 , it actually depend of the L2 that you use, some are compatible with cex etc. And if we choose polygon for exemple, i used : https://hyphen.biconomy.io/ to swap L2 to L1 and the fees were small.

Even thought the fees L2--->L1 will still be smaller.

L1-->L2 cost ~50$ because you are doing a eth trx But L2 --> L1 < 30$ because you are going the trx on a L2

And for the claim on the l1 its ~150$.

So you win in the change

Koploseus avatar Sep 09 '21 14:09 Koploseus

Fair enough. The link you shared doesn't seem to have any accompanying docs, so I can't see how it works. The bridge I used to and from xDai had two transactions required for each transfer - one to send funds from the source network, and the other to claim them on the destination network. I.e. all transfers required a transaction on both xDai and ETH Mainnet.

I do understand that many people may not wish to extract their funds from Layer 2, but I think it's a good working assumption that people will want to be able to do that cost effectively, so the L2 solution we choose should facilitate if possible.

Remember comparing costs of mainnet transactions in dollars is tricky because it depends hugely on both the current gas price and current ETH price. Ideally when we discuss this we should be looking at amount of gas used, but at least ETH costs w/ a rough idea of gas price. I think it's fair to assume that a layer 2 transaction is essentially "Free".

An example of gas used fetched from my transaction history:

Claiming (MATIC) from AirSwap rewards pool: 102,782 Claiming (INDEX) from xDai Omnibridge: 237,659 Claiming xDai from xDai bridge: 153,001

So 2x gas to get an ERC20 back from xDai, or 1.5x to get xDai -> mainnet DAI.

I thought this was common for all Sidechain-type L2s. I expect rollups are different.

gpxl-dev avatar Sep 09 '21 14:09 gpxl-dev

For the link documentation : https://docs.biconomy.io/products/hyphen-instant-cross-chain-transfers

Mmmh i never tried the xDAI bridge, i only did polygon & bsc, & immutable x and i had only 1 transaction to do.

It's hard to predict the gas fees for ethereum i guess it depends on the NFT minning aha

Koploseus avatar Sep 09 '21 14:09 Koploseus

Activity impacts the price of the gas, but not the amount of gas used, which is why comparing gas used is the ideal. It's not constant, but the cost of past transactions give a pretty good estimation of future ones

gpxl-dev avatar Sep 09 '21 15:09 gpxl-dev

1- From L1 --> L2 it cost around 50$ (i tested 2 days ago ) 2- But won't are we going to have like a "pool" war ? Like i control 10% of the eth pool (with 10$k of reward) .. but on the BSC pool i will get 80% on 10k$ of reward ? So the little stackers can still being ... stucked or pay less fees .. but less reward also ?

The BSC pools are smaller so would be able to claim less of course. Big stakers would prefer to get rewards from L1 since gas affects their payout less. Smaller stakers might be interested to claim on L2 instead since fees are less.

Personally, I'd prefer to implement a separate staking contract on each L2 chain which entitles stakers to claim from that particular pool. Another issue might be snapshot and activate - I'm not sure if they can support other L2s

agriimony avatar Sep 09 '21 15:09 agriimony

Yeah but it could be unfair for small stackers.

Let's try something :

Let's say that I got 500k ast , that on the l1 pool I control 33% of the pool. With a pool of 40k every month I will get 1500$ (based on dune )

Now let's say that the l2 pool get 10k/month but there is only little stacker according to my 500k AST.

I will control almost all the pool and get all the rewards znd at the end it will be maybe more interesting for small stackers to stay in eth and accumulate point, so back to square 1

Koploseus avatar Sep 09 '21 15:09 Koploseus

Yeah but it could be unfair for small stackers.

Let's try something :

Let's say that I got 500k ast , that on the l1 pool I control 33% of the pool. With a pool of 40k every month I will get 1500$ (based on dune )

Now let's say that the l2 pool get 10k/month but there is only little stacker according to my 500k AST.

I will control almost all the pool and get all the rewards znd at the end it will be maybe more interesting for small stackers to stay in eth and accumulate point, so back to square 1

Assuming the ratio stays the same, you would only be entitled to 1500/40000 * 10000 = $375 claim on the l2 pool. but the small stakers would also get less - so maybe it evens out the gas.

agriimony avatar Sep 09 '21 15:09 agriimony

The ratio can't be the same unless you have the same amount of sAST on eth and L2.

Do we actually know the volume on the l2 ? For bsc I think that the pool only get 1.5k$/month.. so maybe not that interesting

Koploseus avatar Sep 09 '21 15:09 Koploseus

ah yeah thats true. We dont have analytics up for BSC unfortunately since Dune doesn't support BSC at the moment, but around 1k per month sounds about right for the BSC pool at the moment.

what might be possible is to tweak the claim parameters on side chain pools so that it benefits smaller stakers more, that way smaller stakers might want to move over to L2.. would need some careful balancing though

agriimony avatar Sep 10 '21 05:09 agriimony

API 48 updated with the last draft.

Koploseus avatar Oct 06 '21 08:10 Koploseus

we can reformat the table in markdown instead. but otherwise looks good.

need Don to chime in on technical feasibility in Activate regarding the claiming system though

agriimony avatar Oct 10 '21 14:10 agriimony

I think it might be nice to also use rounder numbers in the table, and order them in ascending order?

In terms of technical feasibility (I'm not the expert on this, so this is based off of a quick glance at the contract), one of the issues to resolve would be that currently the state of a claim (i.e. if a particular claim has already been made) is stored within the pool contract. If someone uses points from a vote to claim from the BSC pool, there is nothing currently to stop them using the same points to claim from the mainnet pool.

I assume technology exists somewhere for cross chain oracles (if it doesn't, someone should make it!), which would potentially mean it's possible to read the state from mainnet, but without putting too much thought into that, it sounds like:

  1. There would probably need to be a mainnet TX as well to update the "master" claims list (defeating the point of this AIP)
  2. There could be issues with people claiming on both chains simultaneously (claims would be non atomic? Is that the right terminology)?

gpxl-dev avatar Oct 11 '21 11:10 gpxl-dev