subgraphs icon indicating copy to clipboard operation
subgraphs copied to clipboard

Rari Vaults v1 QA (Ethereum) Schema Version 1.2.1 Subgraph Version 1.3.13 Methodology Version 1.0.0

Open bye43 opened this issue 3 years ago • 7 comments

Description Value
Subgraph Reviewed https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/messari/rari-vaults-ethereum&tab=protocol
Date Reviewed June 28 2022
Schema Version 1.2.1
Subgraph Version 1.3.13
Methodology Version 1.0.0
Evidence Spreadsheet https://docs.google.com/spreadsheets/d/1kl06BqJs2a_Ay_qNmMr0xhAq8mf9w9UooPi19RUjGgY/edit?usp=sharing

Metrics To Review

Protocol Metrics

Section Metric Issue
financialsDailySnapshots dailySupplySideRevenueUSD On 02/02/2021 and 11/23/2020 Supply Side Revenue is 0 when Total Revenue has positive values, which is incorrect
financialsDailySnapshots cumulativeSupplySideRevenueUSD Daily is off, so this is too. But looks like daily values are being added correctly
financialsDailySnapshots dailyProtocolSideRevenueUSD On 02/02/2021 and 11/23/2020 Protocol Revenue accounts for all Revenue, which is incorrect
financialsDailySnapshots cumulativeProtocolSideRevenueUSD Daily is off, so this is too. But looks like daily values are being added correctly
financialsDailySnapshots dailyTotalRevenueUSD Big revenue spike on 02/04/2021 that needs a second look
financialsDailySnapshots cumulativeTotalRevenueUSD Daily is off, so this is too. But looks like daily values are being added correctly

Pool Overview Metrics

Pool Metric Issue
ALL POOLS ALL METRICS Nothing Being Displayed
ALL POOLS Total Pool Count Lots of pools being displayed on search bar, but according to Rari there is only a USDC and DAI vault at present

Pool Metrics

Pool Section Metric Issue
Rari USDC Pool-mStable USD vaultDailySnapshots outputTokenSupply - RSPT Negative Value
Rari USDC Pool-mStable USD vaultDailySnapshots outputTokenPriceUSD - RSPT Negative Value
Rari USDC Pool-mStable USD vaultDailySnapshots pricePerShare Small, Negative Value
Rari USDC Pool-mStable USD vaultHourlySnapshots outputTokenSupply - RSPT Same problem as daily and all meaningful hourly metrics are not outputting hourly metrics
Rari USDC Pool-mStable USD vaultHourlySnapshots outputTokenPriceUSD - RSPT Same problem as daily and all meaningful hourly metrics are not outputting hourly metrics
Rari USDC Pool-mStable USD vaultHourlySnapshots pricePerShare Same problem as daily and all meaningful hourly metrics are not outputting hourly metrics
Rari DAI Pool-Dai Stablecoin vaultDailySnapshots pricePerShare This is 0. I understand this as price in the input token, which is DAI, so shouldn't be 0.
Rari DAI Pool-Dai Stablecoin vaultHourlySnapshots totalValueLockedUSD All meaningful hourly metrics are not outputting hourly metrics
Rari DAI Pool-Dai Stablecoin vaultHourlySnapshots inputTokenBalance - DAI All meaningful hourly metrics are not outputting hourly metrics
Rari DAI Pool-Dai Stablecoin vaultHourlySnapshots outputTokenSupply - RDPT All meaningful hourly metrics are not outputting hourly metrics
Rari DAI Pool-Dai Stablecoin vaultHourlySnapshots outputTokenPriceUSD - RDPT All meaningful hourly metrics are not outputting hourly metrics
Rari DAI Pool-Dai Stablecoin vaultHourlySnapshots pricePerShare Same problem as daily and all meaningful hourly metrics are not outputting hourly metrics

bye43 avatar Jun 28 '22 21:06 bye43

Upgraded to 1.3.0. Ready for another round of review

this-username-is-taken avatar Jul 09 '22 01:07 this-username-is-taken

Rari Vaults V1 Review 2

Description Value
Subgraph Reviewed https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/messari/rari-vaults-ethereum&tab=protocol
Date Reviewed July 11 2020
Schema Version 1.3.0
Subgraph Version 1.4.0
Methodology Version 1.0.0
Evidence Spreadsheet https://docs.google.com/spreadsheets/d/1kl06BqJs2a_Ay_qNmMr0xhAq8mf9w9UooPi19RUjGgY/edit?usp=sharing

Metrics To Review

Protocol Metrics

Section Metric Issue
financialsDailySnapshots dailyProtocolSideRevenueUSD Uncharacteristic spike on 11/23/2020 and 02/04/2021. These values do not look correct. I think this has to do with the deprecated Yield - USDC pool, which I made a note about below.
financialsDailySnapshots cumulativeProtocolSideRevenueUSD Daily is off, so this is too. But looks like daily values are being added correctly
financialsDailySnapshots dailyTotalRevenueUSD The weird revenue spikes here are from the protocol side revenue, so probably will be addressed when protocolRevenueSide is checked
financialsDailySnapshots cumulativeTotalRevenueUSD Daily is off, so this is too. But looks like daily values are being added correctly

Pool Overview

Pool Metric Issue
ALL POOLS Overall Pool Count Not a real problem, but we have more pools listed than on the Rari UI. I am assuming we are currently outputting deprecated pools and wanted to make sure that was correct.

Pool Metrics

Pool Section Metric Issue
Rari USDC Pool-mStable USD vaultDailySnapshots dailySupplySideRevenueUSD Rari vaults started in October 2020, so the extremely high yield and TVL makes sense for these dates. But 10/21/2020 is recording 180k for supply side revenue on 44m TVL (~0.4% in a day). While this does not seem crazy if we include the farming of RGT here, I believe that only performance yield is being counted, so this date seems like it might need a second look.
Rari USDC Pool-mStable USD vaultDailySnapshots dailyProtocolSideRevenueUSD Same as daily supply side.
Rari USDC Pool-mStable USD vaultDailySnapshots pricePerShare This is 0. I understand this as price in the input token, which is mStable USD, so shouldn't be 0.
Rari USDC Pool-mStable USD vaultDailySnapshots outputTokenPriceUSD - RSPT I believe this should be equal to USDC + mUSD vault TVL / RSPT supply. I am calculating around 1.25 which is not that far off, but expect the current pricing to be exact. Maybe I am missing tokens or do not have the correct calculation
Rari DAI Pool-Dai Stablecoin vaultDailySnapshots pricePerShare This is 0. I understand this as price in the input token, which is DAI, so shouldn't be 0.
Rari DAI Pool-Dai Stablecoin vaultHourlySnapshots outputTokenPriceUSD - RDPT I believe this should be equal to DAI Vault TVL / RDPT supply. I am calculating around 1.35 (this seems high though), so maybe I am missing tokens or do not have the correct calculation
Rari Yield Pool-USD Coin vaultDailySnapshots dailyProtocolSideRevenueUSD On 11/23/2020 and 02/02/2021 the ProtocolSideRevenue exceeds the TVL of the vault, which should not be the case.

bye43 avatar Jul 11 '22 21:07 bye43

Hey @bye43 thanks for the QA check! I wanted to check in on a few things as I am starting to make changes.

The reason there are more pools than rari says is because rari allows multiple input tokens while our schema allows only one. Our solution was to make a separate pool for each. Do you think this makes sense for this subgraph?

And as far as pricePerShare goes, it actually looks like the FE is moving the decimal to the left. If you look at the api it looks normal.

melotik avatar Aug 03 '22 10:08 melotik

The discrepency we are seeing in outputTokenPriceUSD comes from where I get the values.

TVL uses getRawFundBalance() which returns the balance + unclaimed fees outputTokenPrice uses getFundBalance() which returns the rawFundBalance() - unclaimed fees

I can't remember why I did it this way and it seems like the docs are taken down... lol

I think it is best to keep it consistent, and I am leaning towards getRawFundBalance(), any suggestions?

melotik avatar Aug 03 '22 10:08 melotik

Hey @dmelotik! Gonna respond in a list to hopefully be more clear:

totalPoolCount - I think it is fine to leave to the pools the way they are currently and just make sure that we add something about that in the README.

pricePerShare - O gotcha, can close that issue then. That is my bad I should have queried it too.

outPutTokenPriceUSD - Is unclaimed fees the yield that the vault accrues? If so they I would agree with you and go with getRawFundBalance(). I would expect the outputTokenPriceUSD to increase in value as yield is generated to the vault.

bye43 avatar Aug 03 '22 13:08 bye43

@bye43 it is somewhat unclear to me in their smart contract, but I believe it is fees that the pool generates that has not been paid out to the Rari Foundation yet. So maybe we should use getFundBalance() for TVL and fees instead? It is unclear to me since it isn't really revenue that is staying in the protocol.

I am remembering now, and I used getRawFundBalance() because I didn't have another way to get the totals for an individual asset in a pool. getFundBalance() does not allow you to specify an asset in the pool.

melotik avatar Aug 03 '22 13:08 melotik

Sent pm on discord. Lets discuss off GH comments, so it is easier to follow.

bye43 avatar Aug 03 '22 14:08 bye43

@bye43 this is ready for review on https://okgraph.xyz/?q=messari%2Frari-vaults-ethereum

We (vincent and I) decided to keep the token balances as is, I don't believe there is a way to get the balances without "unclaimed fees" and it is not worth the time to keep looking at the same thing. I made notes in the README to describe the behavior here

melotik avatar Sep 04 '22 23:09 melotik

Description Value
Subgraph Reviewed https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/messari/rari-vaults-ethereum&tab=protocol
Date Reviewed September 5 2022
Schema Version 1.3.0
Subgraph Version 1.4.1
Methodology Version 1.0.0
Evidence Spreadsheet https://docs.google.com/spreadsheets/d/11RI6_jqEjNOKGUONsU0DF0i5yfoCe10zr2s6LuhhPiA/edit?usp=sharing

Metrics To Review

Protocol Metrics

Section Metric Issue
financialsDailySnapshots dailyProtocolSideRevenueUSD Uncharacteristic spike on 11/23/2020 and 02/04/2021. If @dmelotik says these are fine, then I am good with them. Looks like they are both from the Rari Yield Pool-USD Coin (0x9245efB59f6491Ed1652c2DD8a4880cBFADc3ffA-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48). Notes on these further below.
financialsDailySnapshots cumulativeProtocolSideRevenueUSD Daily is off, so this is too. But looks like daily values are being added correctly
financialsDailySnapshots dailyTotalRevenueUSD The weird revenue spikes here are from the protocol side revenue
financialsDailySnapshots cumulativeTotalRevenueUSD Daily is off, so this is too. But looks like daily values are being added correctly

Vault Metrics

Vault Section Metric Issue
Rari USDC Pool-mStable USD vaultDailySnapshots dailySupplySideRevenueUSD Spike to 18k on 10/21/2020 and the vault generates no revenue for almost a year. Just want to confirm that this is ok, but guessing it is fine
Rari USDC Pool-mStable USD vaultDailySnapshots dailyProtocolSideRevenueUSD Same as daily supply side.
Rari Yield Pool-USD Coin vaultDailySnapshots dailyProtocolSideRevenueUSD There is a spike on 02/04/20221 where protocol revenue is 4m. Looks like TVL is less than protocol revenue, so I think this needs another look. This is also probably why there is that spike in protocol daily snapshots to 4m. Query - https://api.thegraph.com/subgraphs/name/messari/rari-vaults-ethereum/graphql?query=%7B%0A++vaultDailySnapshots+%28orderBy%3A+dailyProtocolSideRevenueUSD%2C+orderDirection%3A+desc%2C+where%3A%7Btimestamp_gte%3A+1612396800%2C+timestamp_lte%3A+1612483199%7D%29+%7B%0A++++vault+%7B%0A++++++name%0A++++++id%0A++++%7D%0A++++dailyProtocolSideRevenueUSD%0A++++totalValueLockedUSD%0A++%7D%0A%7DAnother spike on 11/23/2020 where the protocol revenue spikes over TVL. I guess this is possible, but Rari would have to farm something heinous like OHM for a single day and convert it all to USDC. I think this is likely not the case, but you never know. Link to query - https://api.thegraph.com/subgraphs/name/messari/rari-vaults-ethereum/graphql?query=%7B%0A++vaultDailySnapshots+%28orderBy%3A+dailyProtocolSideRevenueUSD%2C+orderDirection%3A+desc%2C+where%3A%7Btimestamp_gte%3A+1606089600%2C+timestamp_lte%3A+1606175999%7D%29+%7B%0A++++vault+%7B%0A++++++name%0A++++++id%0A++++%7D%0A++++dailyProtocolSideRevenueUSD%0A++++totalValueLockedUSD%0A++%7D%0A%7D

bye43 avatar Sep 05 '22 21:09 bye43

@this-username-is-taken This is good to freeze. I am going to close out the issue.

bye43 avatar Sep 07 '22 19:09 bye43

@dmelotik is fixing withdraw.amounts to include fees and then this will be good to freeze. Sorry for the fake out @this-username-is-taken

bye43 avatar Sep 07 '22 19:09 bye43

@this-username-is-taken This is now good to freeze.

bye43 avatar Sep 09 '22 14:09 bye43