Actual Source of Protocol Fees

Dose anyone know which yEarn product the protocol fees actually come from? The only product with enough use to generate the $60k+ per week mentioned in the tweets seems to be the ytokens. However, I don’t see any mechanism in the yToken smart contracts for collecting fees.

I tried tracing the source of the rewards currently being distributed in the YFI staking smart contract. They come from:

from 0x431e81e5dfb5a24541b5ff8762bdef3f32f96354 to 0x2d407ddb06311396fe14d4b49da5f0471447d45c (yearn deployer address) in transaction 0x95df3a6d7f08ff8b08eb0ba5d7dcee93536cad0e0e9cb3ced70032a0dd8eb896

then go from 0x2d407ddb06311396fe14d4b49da5f0471447d45c to the rewards contract in transaction 0x4ea765b817e1b26270b739d8fb3c452ef33a4bbfd2eb37bc443b5d8097aef924

However, I can’t figure out where the first address 0x431e81e5dfb5a24541b5ff8762bdef3f32f96354 got the tokens from or how they ultimately come from any yEarn smart contracts.

@andre.cronje

8 Likes

To be honest, I was confused about this as well. If you stake BPT 1,2 and yToken from pool 1,2,3 in gov.yearn.fi, do fees/interest go to your account, or do they go to the rewards pool where people stake YFI? I thought its the former, so in that case what is the source of these system protocol fees? In addition, it was mentioned that today’s fees will be paid out tomorrow, but on the website, it looks like you can continuously claim yTokens tokens

+1 this is DeFi, how can we verify these rewards on-chain? in order to create an informed proposal, the community needs to know how the current system is dictating weekly rewards…

1 Like

I believe @andre.cronje mentioned in a tweet that it’s a manual process right now. He’s working on automating it.

You mind linking the tweet source?

1 Like

I tried tracing the fees as well, unsuccessfully. The distribution of fees is manual. But the earning surely is automated in some smart contract. So many people have already asked about this. It should be very simple to just post all relevant smart contracts to anyone to verify the code which generates the fees.

@andre.cronje Can you post the links to smart contracts that are generating the fees?

I was able to trace the source of the rewards referenced in this tweet. It looks like it was mostly originally obtained as 36,337 aLEND by yswap in a single transaction 0xb6fe364882b76a31c72095f15b68a4184e35a60bb8a9b319fc70ed9f89a7f82f.

To explain this transaction, we first need to explain some stuff about yswap. The way yswap works is that when you deposit, yswap uses your deposit to take a share of a uniswap pool of your token vs. aUSD, minting aUSD as necessary. When you withdraw, yswap withdraws that share. It then looks at value of your token withdrawn according to the chainlink oracle vs. the uniswap pool itself, assuming 1 aUSD = 1 USD. If these are the same, you get back whatever of your token was withdrawn, and the aUSD that were withdrawn are burned. If the chainlink oracle value is lower, you get back whatever of your token was withdrawn plus the difference in value in aUSD, assuming 1 aUSD = 1 USD.

However, if the chainlink oracle value is more, then you only get back an amount of your token equal to the aUSD value that was withdrawn, assuming 1 aUSD = 1 USD and using the chainlink oracle to determine the value of your token. The smart contract defines the rest of the withdrawn token as “dust” and sends it to the yswap vault address at 0xb99a40fce04cb740eb79fc04976ca15af69aaaae. The aUSD is burned.

In the above transaction, someone withdrew aLEND from yswap. At the time of withdrawal, their pool share had about 165,853 aLEND. However, it appears that 36,337 of that amount was considered dust by the smart contract according to the rules above and sent to the yswap vault. From there, it appears that it was converted to CRV and distributed to YFI stakers.

Classifying it as dust and taking it seems wrong to me.

5 Likes

So to recap:

  • aUSD is minted when you deposit a token (e.g LINK) to yswap
  • aUSD is used as a second token in the Uniswap pair which allows you to deposit just one token instead of two
  • aUSD is shared across all supported deposit tokens
  • When you withdraw, you get back the USD value of your initial deposit, regardless of the price movement of the token you deposited. This USD value is returned to you in the fraction of your initial token deposit + appropriate amount of aUSD.

Very interesting mechanism! But I see some major problems with this.

  1. Let’s assume there are 2 pools. One with LINK, one with WBTC. Two LPs deposit 1000 USD worth of tokens (LINK and WBTC) into both pools. Now both tokens drop in value by half and the USD value of pools is just $500. When both LPs withdraw all their tokens from both pool, ySwap will give them back their tokens plus 500 aUSD to “compensate” for the loss of value of their tokens.

But since aUSD is not backed by anything anymore, aUSD has zero value.

  1. When your token appreciates and you make the withdrawal, you only will get back your original USD value of your token and the rest is sent by ySwap to the vault as “revenue” (dust). Why not at least keep this addition token amount in the system for better collateralization of aUSD?

If I understand this correctly, over time, this mechanism will undercollateralize the aUSD. IMO, calling it “aUSD” is deceiving since ySwap just slowly redistributes the gains of token appreciations to the vault and gives back LPs aUSD which loses value over time.

Please correct me if I missed some important detail and this is not the case. I really hope I got it wrong since the main idea of depositing just one token as an LP is very appealing.

1 Like

Is this currently the only revenue source? This is highly concerning as most YFI valuations depend on either the revenue generated by the system or on AUM. Why aren’t more people concerned about how the fees are generated?

3 Likes

Busy codifying the collection, check my latest contracts, just give me a few days… There is a lot to build that replaces what I’ve been doing manually for ~6 months.

11 Likes