MakerDAO QA (Ethereum) Schema Version 1.2.1 Subgraph Version 1.0.1 Methodology Version 1.0.0
I am documenting here the issues I found with the makerdao subgraph in the master branch (subgraphVersion 1.0.1, schema 1.3.0), as I work on developing the makedao extended subgraph:
data issues
- [x] 1. ~~"from" and "liquidatee" in Liquidate entity are always the same, pointing to the account triggering vat.grab~~(
tx.transaction.fromlogged for the function); according to the schema "from" - Address that carried out the liquidation; "liquidatee" - Address that got liquidated. - [x] 2. ~~Cat_v2 contract in subgraph.yaml (line 193) is not using the correct contract address~~0xa5679C04fc3d9d8b0AaB1F0ab83555b301cA70Ea and still use v1 address of 0x78f2c2af65126834c51822f56be0d7469d7a523e, likely leading to incorrect mapping of liquidations
- [x] 3. ~~
Createdevent from theDSProxyFactorycontract (creating a proxy) should not triggerupdateUsageMetrics(src/mappings/users/users.ts line 13), leading to incorrect usage metrics~~ - [x] 4. CdpManager
- [x] ~~should
give(transfer a cdp position) contract triggerupdateUsageMetrics?~~ - [x] ~~frob event should not trigger
updateUsageMetrics, as it calls vat.frob, which again triggersupdateUsageMetrics~~
- [x] ~~should
- [x] 5 ~~pot contract has not been mapped, thus daisavingrate & supplysiderevenue has not been considered, leading to zero supplysiderevenue and missing deposit rates~~
- [x] 6 ~~Market.OutputToken: DAI (borrow) is not the outputToken~~
- [x] 7 ~~IDs for transaction entities (Borrow, Repay, Deposit, Withdraw, Liquidate) do not confirm to the schema specification of "{ Transaction hash }-{ Log index }"~~
- [x] 8 ~~incorrect inputTokenBalance for USDC-A market (#610)~~
code issues
- [x] ~~deployment failure due to non-nullable fields error in graph-ts version 0.30;~~
- [x] ~~There is no need to include Deploy, Jug, Spot, Cat, and DSProxy in the templates section of subgraph.yaml as they are already included as ethereum/contract and the
createmethod is never called on them.~~- Deploy is not needed at all
- [-] although inefficient, there is no alternative
Vat.rely(address usr)handles authorization of privileges user and is not ideal as trigger to create mapping for markets
| Description | Value |
|---|---|
| Subgraph Reviewed | https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/messari/makerdao-ethereum&tab=protocol |
| Date Reviewed | July 6 2022 |
| Schema Version | 1.2.1 |
| Subgraph Version | 1.0.1 |
| Methodology Version | 1.0.0 |
| Evidence Spreadsheet | https://docs.google.com/spreadsheets/d/16qE8N4rPNwnc-hR0wleYDBZ4YheadeRcmGh7wxR_iQA/edit?usp=sharing |
Metrics To Review
Protocol Metrics
| Section | Metric | Issue |
|---|---|---|
| financialsDailySnapshots | dailySupplySideRevenueUSDÂ | This should not be 0 and we should be utilizing DSR for supply side revenue |
| financialsDailySnapshots | cumulativeSupplySideRevenueUSD | Daily is off, so this is too |
| financialsDailySnapshots | totalBorrowBalanceUSD | This looks close to the actual value, but dune and etherscan are showing values slightly off from ours. Should be the total supply of DAI on etherscan which it is not. Most likely needs another look. Link - - https://etherscan.io/token/0x6b175474e89094c44da98b954eedeac495271d0f |
Pool Metrics
| Pool | Section | Metric | Issue |
|---|---|---|---|
| ALL POOLS | marketDailySnapshots | cumulativeDepositUSD | Outputting 0 when there is an output on the daily metric. Should be the addition of all the daily values. |
| ALL POOLS | marketDailySnapshots | cumulativeBorrowUSD | Outputting 0 when there is an output on the daily metric. Should be the addition of all the daily values. |
| ALL POOLS | marketDailySnapshots | outputTokenSupply - DAI: Dai Stablecoin | This is for output tokens that are tracking ownership, such as ctokens and atokens. We can remove this metric. |
| ALL POOLS | marketDailySnapshots | outputTokenPriceUSD - DAI: Dai Stablecoin | This is for output tokens that are tracking ownership, such as ctokens and atokens. We can remove this metric. |
| ALL POOLS | marketHourlySnapshots | cumulativeDepositUSD | Same as daily |
| ALL POOLS | marketHourlySnapshots | cumulativeBorrowUSD | Same as daily |
| ALL POOLS | marketHourlySnapshots | outputTokenSupply - DAI: Dai Stablecoin | Same as daily |
| ALL POOLS | marketHourlySnapshots | outputTokenPriceUSD - DAI: Dai Stablecoin | Same as daily |
| SOME POOLS | marketHourlySnapshots | inputTokenBalance and totalValueLockedUSD | Some of the pools have TVLs that do not match up to the inputTokenBalance*inputTokenPrice. In some cases, the inputTokenBalance is very far off (PSM-USDCA, WBTC-A/B/C, USDC - A). Others the TVL just seems off in general (USDC - B). |
| WBTC-A | marketDailySnapshots | dailyLiquidateUSD | On 5/03/2020 there is a daily liquidate value when the TVL of MakerDAO is recorded as 0. Should not be a liquidation if there is no value in this market |
@tnkrxyz Do you mind renaming this to - MakerDAO QA (Ethereum) Schema Version 1.2.1 Subgraph Version 1.0.1 Methodology Version 1.0.0
It seems like MakerDAO has been upgraded to lending protocol schema 1.3.0, but the schemaVersion response from the subgraph is still returning 1.2.1
It seems like MakerDAO has been upgraded to lending protocol schema 1.3.0, but the schemaVersion response from the subgraph is still returning 1.2.1 Will fix this in PR #555
Status of issues reported by @bye43 in PR #555 (temporary deployment with current implementation available at https://api.studio.thegraph.com/query/29379/makerdao-ethereum-v2/v0.0.2)
Protocol Metrics
| Section | Metric | Issue | Status/Note |
|---|---|---|---|
| financialsDailySnapshots | dailySupplySideRevenueUSD | This should not be 0 and we should be utilizing DSR for supply side revenue | Fixed. Since the lending schema expected supply revenue from a market, a "market" is created for the dai saving POT contract, even though it is not an actual market |
| financialsDailySnapshots | cumulativeSupplySideRevenueUSD | Daily is off, so this is too | same as above |
| financialsDailySnapshots | totalBorrowBalanceUSD | This looks close to the actual value, but dune and etherscan are showing values slightly off from ours. Should be the total supply of DAI on etherscan which it is not. Most likely needs another look. Link - - https://etherscan.io/token/0x6b175474e89094c44da98b954eedeac495271d0f | totalBorrowBalanceUSD doesn't necessarily match totalSupply of DAI token. Users' borrowing balance of DAI is tracked by the Vat contract internally; DAI is minted when they exit via the DAIJoin contract. mintedTokenSupply tracks totalySupply of DAI token |
Pool Metrics
| Pool | Section | Metric | Issue | Status/Note |
|---|---|---|---|---|
| ALL POOLS | marketDailySnapshots | cumulativeDepositUSD | Outputting 0 when there is an output on the daily metric. Should be the addition of all the daily values. | Fixed |
| ALL POOLS | marketDailySnapshots | cumulativeBorrowUSD | Outputting 0 when there is an output on the daily metric. Should be the addition of all the daily values. | Fixed |
| ALL POOLS | marketDailySnapshots | outputTokenSupply - DAI: Dai Stablecoin | This is for output tokens that are tracking ownership, such as ctokens and atokens. We can remove this metric. | Fixed. Since it is a required field in the schema, it is set to 0 |
| ALL POOLS | marketDailySnapshots | outputTokenPriceUSD - DAI: Dai Stablecoin | This is for output tokens that are tracking ownership, such as ctokens and atokens. We can remove this metric. | Fixed. Since it is a required field in the schema, it is set to 0 |
| ALL POOLS | marketHourlySnapshots | cumulativeDepositUSD | Same as daily | Fixed |
| ALL POOLS | marketHourlySnapshots | cumulativeBorrowUSD | Same as daily | Fixed |
| ALL POOLS | marketHourlySnapshots | outputTokenSupply - DAI: Dai Stablecoin | Same as daily | Fixed. Same as daily |
| ALL POOLS | marketHourlySnapshots | outputTokenPriceUSD - DAI: Dai Stablecoin Same as daily | Fixed. Same as daily | |
| SOME POOLS | marketHourlySnapshots | inputTokenBalance and totalValueLockedUSD | Some of the pools have TVLs that do not match up to the inputTokenBalance*inputTokenPrice. In some cases, the inputTokenBalance is very far off (PSM-USDCA, WBTC-A/B/C, USDC - A). Others the TVL just seems off in general (USDC - B). | Fixed. This is the same problem as reported in Issue #610, caused by incorrect decimals for tokens not using decimals of 18 |
| WBTC-A | marketDailySnapshots | dailyLiquidateUSD | On 5/03/2020 there is a daily liquidate value when the TVL of MakerDAO is recorded as 0. Should not be a liquidation if there is no value in this market | Fixed |
With #555 merged, this issue is now closed. Please comment/re-open if there is any remaining issue.
Reopening
| Description | Value |
|---|---|
| Subgraph Reviewed | https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/id/QmXH6LgaK8RfwZrqCL2JT5137hpbWRU2oLBsm7seyjJgVi&tab=protocol&version=pending&name=messari/makerdao-ethereum |
| Date Reviewed | August 12 2022 |
| Schema Version | 1.3.0 |
| Subgraph Version | 1.1.0 |
| Methodology Version | 1.0.1 |
| Evidence Spreadsheet | https://docs.google.com/spreadsheets/d/1QtzXoC6B0X3oDMqEW1kgX54mEK0gOlkZ6aWfGerCSv4/edit?usp=sharing |
Metrics To Review
Protocol Metrics
| Section | Metric | Issue |
|---|---|---|
| financialsDailySnapshots | dailyProtocolSideRevenueUSD | There is a huge spike on 3/14/2020 to about 1.4m. The cumulative protocol side revenue on Token Terminal for the 03/2022 is 197K, so it seems like the subgraph value is too high. I am not exactly sure how token terminal calculates protocol revenue and if they include liquidation penalties, but IIRC this was correct in the last subgraph version 1.2.1 that I reviewed. I would also imagine that the spike would probably come from liquidations on 03/14/2020, but does not look like anything major |
| financialsDailySnapshots | cumulativeProtocolSideRevenueUSD | Same notes as dailyProtocolSideRevenue |
| financialsDailySnapshots | dailyTotalRevenueUSD | This is the same as the protocol revenue, so same notes as dailyProtocolSideRevenue |
| financialsDailySnapshots | cumulativeTotalRevenueUSD | Same notes as dailyProtocolSideRevenue |
| financialsDailySnapshots | totalBorrowBalanceUSD | This kinda looks good, but dates like 04/01/2020 and 05/01/2020 are about 20% difference from Dune query. I will make a note and let dev decide if these differences are ok or if they need to actually be addressed. Link to dune query - https://dune.com/queries/1165145 |
| financialsDailySnapshots | dailyLiquidateUSD | This looks off, there is a large spike on 08/26/2020 to 30,610,813,888,689.035 and other values scaling into the 1E16. Furthermore, it looks like the current version subgraph matches up with a dune query I found, and they are both drastically different then the pending version. Here is the dune query - https://dune.com/queries/1165244/1992113 |
| financialsDailySnapshots | cumulativeLiquidateUSD | Daily off, so this is too. Pictures in evidence sheet show comparison between all three sources. |
| financialsDailySnapshots | mintedTokenSupplies | This should be similar to the CoinGecko MCAP for DAI since DAI is usually = $1, but is way off. This also looked correct on the last version (current subgraph version) |
| usageMetricsDailySnapshots | cumulativeUniqueUsers | This is half of the old subgraph and also have of this dune query (https://dune.com/queries/2951). I think it could use a second look |
| usageMetricsDailySnapshots | dailyActiveUsers | The numbers seem plausible, but they are diff than the current version. Not sure which is right since there is no baseline and they both seem believable, so going to make a note. Protocol_MetricComparison tab on evidence spreadsheet shows differences |
| usageMetricsDailySnapshots | dailyTransactionCount | The numbers seem plausible, but they are diff than the current version. Not sure which is right since there is no baseline and they both seem believable, so going to make a note. But also the deposit, borrow, repay, and liquidate counts look almost the exact same for the pending and current version, so not sure why total transaction count is so different between both. Protocol_MetricComparison tab on evidence spreadsheet shows |
Pool Metrics
| Pool | Section | Metric | Issue |
|---|---|---|---|
| PSM-USDC-A | marketDailySnapshots | dailyDepositUSD | Using the makerburn PSM view and the subgraph values are pretty far off (>80%) than the "value in" metrics. I am not sure if this represents dailyDepositUSD though, but am going to make a note |
| PSM-USDC-A | marketDailySnapshots | dailyBorrowUSD | This is the same value as dailyDepositUSD (makes sense though because PSM is a swap), so as long as dailyDepositUSD is ok then this is fine |
| ETH-A | marketDailySnapshots | marketDailySnapshots-rates | This is stuck at 5.497% and it the rate looks dynamic on makerburn. Link to makerburn (click fee on the top right) - https://makerburn.com/#/collateral/eth |
Thanks for the QA report - looking into these.
Thanks! Let me know if you have any questions.
Reopening
Description Value Subgraph Reviewed https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/id/QmXH6LgaK8RfwZrqCL2JT5137hpbWRU2oLBsm7seyjJgVi&tab=protocol&version=pending&name=messari/makerdao-ethereum Date Reviewed August 12 2022 Schema Version 1.3.0 Subgraph Version 1.1.0 Methodology Version 1.0.1 Evidence Spreadsheet https://docs.google.com/spreadsheets/d/1QtzXoC6B0X3oDMqEW1kgX54mEK0gOlkZ6aWfGerCSv4/edit?usp=sharing
Metrics To Review
Protocol Metrics
| Section | Metric | Issue | Response/Comment |
|---|---|---|---|
| financialsDailySnapshots | dailyProtocolSideRevenueUSD | There is a huge spike on 3/14/2020 to about 1.4m. The cumulative protocol side revenue on Token Terminal for the 03/2022 is 197K, so it seems like the subgraph value is too high. I am not exactly sure how token terminal calculates protocol revenue and if they include liquidation penalties, but IIRC this was correct in the last subgraph version 1.2.1 that I reviewed. I would also imagine that the spike would probably come from liquidations on 03/14/2020, but does not look like anything major | The $1.4M revenue is reasonable AFAIK given the amount of liquidations going on during those few days during dramatic eth price drop due to COVID. I didn't find a second data source for the liquidations on these days, but this paper (page 6, section 4.3.1) indirectly confirms that "in March, 2020, the MarkerDAO monthly profit reached 13.13M USD". There are even higher daily liquidation revenue later, on 1/21/2022 (Verified via: coindesk and makerdato 1/2022 financial report |
| financialsDailySnapshots | cumulativeProtocolSideRevenueUSD | Same notes as dailyProtocolSideRevenue | |
| financialsDailySnapshots | dailyTotalRevenueUSD | This is the same as the protocol revenue, so same notes as dailyProtocolSideRevenue | |
| financialsDailySnapshots | cumulativeTotalRevenueUSD | Same notes as dailyProtocolSideRevenue | |
| financialsDailySnapshots | totalBorrowBalanceUSD | This kinda looks good, but dates like 04/01/2020 and 05/01/2020 are about 20% difference from Dune query. I will make a note and let dev decide if these differences are ok or if they need to actually be addressed. Link to dune query - https://dune.com/queries/1165145 | This relates to your previous comment to financialsDailySnapshots.totalBorrowBalanceUSD for version 1.2.1 - The dune lending abstraction table only counts newly minted DAI and dai joins the POT contract as new borrow, but the Vat contract counts borrow when the frob function is called to update a user's urn and starts to collect stability fee. I believe our implementation (current and previous version is more in line with the contract than dune. I am happy to discuss more. |
| financialsDailySnapshots | dailyLiquidateUSD | This looks off, there is a large spike on 08/26/2020 to 30,610,813,888,689.035 and other values scaling into the 1E16. Furthermore, it looks like the current version subgraph matches up with a dune query I found, and they are both drastically different then the pending version. Here is the dune query - https://dune.com/queries/1165244/1992113 | This is due to a bug in liquidation.amount for tokens not using standard 18 decimals (WBTC). Now fixed in PR #803. This should not affect the protocol side revenue calculation above. |
| financialsDailySnapshots | cumulativeLiquidateUSD | Daily off, so this is too. Pictures in evidence sheet show comparison between all three sources. | same as above |
| financialsDailySnapshots | mintedTokenSupplies | This should be similar to the CoinGecko MCAP for DAI since DAI is usually = $1, but is way off. This also looked correct on the last version (current subgraph version) | I think the market cap on CoinGecko is close to our mintedTokenSupplies number, $6.8b as of 8/14? https://www.coingecko.com/en/coins/dai |
| usageMetricsDailySnapshots | cumulativeUniqueUsers | This is half of the old subgraph and also have of this dune query (https://dune.com/queries/2951). I think it could use a second look | The previous version double-counted users and transaction counts, as it counts cdp and proxy creation activity, as well as vat. See my notes 3 and 4 under the Data Issues above |
| usageMetricsDailySnapshots | dailyActiveUsers | The numbers seem plausible, but they are diff than the current version. Not sure which is right since there is no baseline and they both seem believable, so going to make a note. Protocol_MetricComparison tab on evidence spreadsheet shows differences | same as above |
| usageMetricsDailySnapshots | dailyTransactionCount | The numbers seem plausible, but they are diff than the current version. Not sure which is right since there is no baseline and they both seem believable, so going to make a note. But also the deposit, borrow, repay, and liquidate counts look almost the exact same for the pending and current version, so not sure why total transaction count is so different between both. Protocol_MetricComparison tab on evidence spreadsheet shows | same as above |
Pool Metrics
| Pool | Section | Metric | Issue | Response/Comments |
|---|---|---|---|---|
| PSM-USDC-A | marketDailySnapshots | dailyDepositUSD | Using the makerburn PSM view and the subgraph values are pretty far off (>80%) than the "value in" metrics. I am not sure if this represents dailyDepositUSD though, but am going to make a note | Similarly, I cannot find what the value-in/value-out on makerburn are. I suspected it was deposit - withdraw, but probably not. Our daily deposits/borrows are quite different from them. But our numbers are pretty close to the PSM inflow/outflow in this dune dashboard: https://dune.com/queries/17216/34750 - their number includes inflow/outflow from other PSMs, but those are much smaller. |
| PSM-USDC-A | marketDailySnapshots | dailyBorrowUSD | This is the same value as dailyDepositUSD (makes sense though because PSM is a swap), so as long as dailyDepositUSD is ok then this is fine | Same as above |
| ETH-A | marketDailySnapshots | marketDailySnapshots-rates | This is stuck at 5.497% and it the rate looks dynamic on makerburn. Link to makerburn (click fee on the top right) - https://makerburn.com/#/collateral/eth | this is due a bug in that market.rates isn't captured in the snapshot. Fixed in #803. Thanks for catching this. |
Read a bit more on the liquidations on 3/12-13, 2020, it seems the situation was more complex: the high protocol side revenue from liquidations was on paper - the vat contract first transfers collateral & debt + interest + chop (liquidation penalty) to the vow contract before auction, which is how I implemented the protocol side revenue. But there is no guarentee that makerdao can get the amount (debt + interest + chop) from collateral auction. On 3/12-13, 2020, makerdao actually lost a lot of money (~$5m) because the collaterals were sold for very low price (close to 0). Here is makerdao's own blog about the chaotic situation: https://blog.makerdao.com/the-market-collapse-of-march-12-2020-how-it-impacted-makerdao/
Since Vincent already merged #803, I will look into how to implement this & create a new PR when I figure out.
@tnkrxyz Thanks for the detailed responses!
Going to format my responses in a list:
Protocol Metrics
dailyProtocolSideRevenueUSD - Ahh that's my bad, I must have had a brain fart and totally forgot about eth dropping in March 2020. Those revenue numbers make sense then, but I guess my only comment is about how token terminal is tracking it lower overall for that month. Sounds like this might be addressed though in your second comment.
totalBorrowBalanceUSD - Trust you on this. So will mark it as good to go
dailyLiquidateUSD, cumulativeLiquidateUSD - Sounds good. Will check this in the new version
mintedTokenSupplies - This does look very accurate for recent data. Did you happen to check the section for this on the sheet? In 2020, a few dates were up to 40% off. DAI looks like its pegged at $1 on those dates in CMC, so I feel like there should not be such a big deviation here
cumulativeUniqueUsers, dailyActiveUsers, dailyTransactionCount - Marked these as good
PSM-USDC-A
dailyDepositUSD, dailyBorrowUSD - Marked these as good
ETH - A
marketDailySnapshots - rates - Will check this on the next version
@bye43 regarding the mintedTokenSupplies field, I still haven't figured out what the coingecko numbers are/were. From my own verification using Dune (https://dune.com/tnkrxyz/dai-supply), our number matches exactly with Dune.
@bye43 regarding the mintedTokenSupplies field, I still haven't figured out what the coingecko numbers are/were. From my own verification using Dune (https://dune.com/tnkrxyz/dai-supply), our number matches exactly with Dune.
That is probably more correct. Will mark this as good. Thanks.
| Description | Value |
|---|---|
| Subgraph Reviewed | https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/messari/makerdao-ethereum&tab=pool&poolId=0x2f0b23f53734252bda2277357e97e1517d6b042a |
| Date Reviewed | August 19 2022 |
| Schema Version | 1.3.0 |
| Subgraph Version | 1.1.1 |
| Methodology Version | 1.1.0 |
| Evidence Spreadsheet | https://docs.google.com/spreadsheets/d/164GhLDB8Kv_prSnj8Cqkm4k5W3igog2ZYemI4xcv6YE/edit?usp=sharing |
Metrics To Review
Protocol Metrics
| Section | Metric | Issue |
|---|---|---|
| financialsDailySnapshots | totalValueLockedUSD | This is very close. Last time, I only checked dates in 2020, so rechecked for present values. 08/01/2022 and 07/01/2022 are >15%, which is not that much cause for concern, but the previous dates are <5% difference. If @tnkrxyz is ok with this, then it is good to go for me |
| financialsDailySnapshots | dailyProtocolSideRevenueUSD | Subgraph is outputting 0 for all dates before 08/18/2022 when there should be protocol revenue values before. Maybe this is because we are accounting for negative revenue now. |
| financialsDailySnapshots | cumulativeProtocolSideRevenueUSD | I think this might be correct its outputting 180m vs token terminal 140m for the most recent dates. It is not adding the daily protocol value though, as it should be a much lower number if it was |
| financialsDailySnapshots | dailyTotalRevenueUSD | The numbers are generally closer here. A few dates are >20% difference. I think I am only somewhat concerned since the token terminal numbers are larger than the subgraph's and because we include liquidation penalities I would expect ours to be higher on average (except for when there is negative liquidations), but if @tnkrxyz gives ok on this, then I am good. Also interesting that there are values here different than protocol side revenue (looks like supply + protocol =/= total) - https://api.thegraph.com/subgraphs/name/messari/makerdao-ethereum/graphql?query=%7B%0A++financialsDailySnapshot+%28id%3A+%2218224%22%29+%7B%0A++++dailyTotalRevenueUSD%0A++++dailySupplySideRevenueUSD%0A++++dailyProtocolSideRevenueUSD%0A++%7D%0A%7D |
| financialsDailySnapshots | cumulativeTotalRevenueUSD | Same comment at cumulativeProtocolSideRevenue |
| financialsDailySnapshots | totalBorrowBalanceUSD | I believe that totalBorrowBalanceUSD should be closer to the mintedTokenSupplies value then what the subgraph is outputting (7,106,894,482.24 vs 6,646,663,032.765). It does not look like DAI is over peg, so might need a second look. |
| financialsDailySnapshots | totalDepositBalanceUSD | Should be same as TVL, so if TVL is ok then this is fine also |
| financialsDailySnapshots | dailyLiquidateUSD | This generally looks pretty good. Subgraph data matches up well to Maker Risk dashboard, but the only date I have concern for is 01/22/2022. Subgraph is recording 32m in liquidations and Maker Risk is outputting 11m. Could use another look. Link to Maker Risk - https://maker.blockanalitica.com/liquidations/?tab=per-date |
Vault Metrics
| Vault | Section | Metric | Issue |
|---|---|---|---|
| ETH-A | marketDailySnapshots | marketDailySnapshots-rates | This is outputting a static market rate at 2.25% now. |
| ETH-A | marketDailySnapshots | totalBorrowBalanceUSD | For 8/19/2022 its looks like the totalBorrowBalanceUSD for the subgraph is 346,015,130.562 and makerburn is outputting 166,256,017. Link to makerburn - https://makerburn.com/#/collateral/eth |
| PAXUSD-A | marketDailySnapshots | totalValueLockedUSD | This looks like its 0 on the subgraph, but its not outputting 0? Last recorded date is 07/16/2022 and looks like its trending to 0, but the pool overview page is recording with a TVL in the 6m. |
@tnkrxyz Not going to raise a formal issue since a lot of comments might not result in changes to the subgraph. Couple things I have questions about, so just going to link the sheet here - https://docs.google.com/spreadsheets/d/1IOWSAo8-37aBXqdOxoFsOAWs6mKveuSQNG-UO8ghbn0/edit?usp=sharing. Feel free to add responses via comment!
Here are few issues that needs to be fixed from the latest round of QA @bye43 did:
Protocol
| Section | Value | Status | Comments |
|---|---|---|---|
| financialsDailySnapshots | dailyLiquidateUSD | UNSURE | This generally looks pretty good. Subgraph data matches up well to Maker Risk dashboard, but the only date I have concern for is 01/22/2022. Subgraph is recording 32m in liquidations and Maker Risk is outputting 11m. Could use another look. Link to Maker Risk - https://maker.blockanalitica.com/liquidations/?tab=per-date |
This is because the implementation doesn't deduct partial collateral returned to borrower after the liquidation auction.
Pool
ETH-A
| Section | Value | Status | Comments |
|---|---|---|---|
| marketDailySnapshots | marketDailySnapshots-rates | NOT OK | Fixed waiting to be synced |
| marketDailySnapshots | totalBorrowBalanceUSD | UNSURE | For 8/19/2022 its looks like the totalBorrowBalanceUSD for the subgraph is 346,015,130.562 and makerburn is outputting 166,256,017. Is this also because of how we track totalBorrowBalanceUSD differently at the protocol level? Link to makerburn - https://makerburn.com/#/collateral/eth |
ETH-B
| Section | Value | Status | Comments |
|---|---|---|---|
| marketDailySnapshots | totalBorrowBalanceUSD | UNSURE | Same comments as ETH - A. Subgraph is reporting 95,116,237.1 and looks like the totaly DAI supply on makerburn here is 38,094,739. Link to makerburn - https://makerburn.com/#/rundown |
WBTC - A
| Section | Value | Status | Comments |
|---|---|---|---|
| marketDailySnapshots | totalBorrowBalanceUSD | UNSURE | Same comments as ETH - A. Subgraph is reporting 313,466,454.77 and looks like the totaly DAI supply on makerburn here is255,661,280. Link to makerburn - https://makerburn.com/#/rundown |
All those are due to current implementation does not close liquidated borrow positions.
Working on a fix now & will do a PR with the fix.
@tnkrxyz and I discussed dailyLquidateUSD and have decided that the current implementation is correct. I am going to leave some of the notes @tnkrxyz made in discord, as I think it will be helpful to reference later on:
I believe our liquidation data is actually consistent with makerrisk. The difference on the surface is due to the fact that makerrisk counts a liquidation to the date when the liquidation auction kicks off (Kick event), but we account them when the auction ends. For ETH-A pool on 1/22, there were 12 liquidations (id 321-332) kicked off on 1/21, but ended on 1/22. we included them for 1/22, but makerrisk included them on 1/21. You can read the different timestamp for the Kick and Take section, for example, on this page: https://maker.blockanalitica.com/liquidations/ETH-A/321 After including these 12 liquidations on 1/22, our subgraph is close to makerrisk's number, $9,585,883 vs $9,656,320 (the small difference mostly likely due to rounding). I create a new "eth-a-liquidations" in your Google sheets: https://docs.google.com/spreadsheets/d/1IOWSAo8-37aBXqdOxoFsOAWs6mKveuSQNG-UO8ghbn0/edit#gid=1690675429.
For the makerdao liquidation: look like the difference in pools tracked made little difference, the cutoff date causes most of the differences, at least for 1/22. These two WBTC-A liquidations account for > $14 M: https://maker.blockanalitica.com/liquidations/WBTC-A/139/ and https://maker.blockanalitica.com/liquidations/WBTC-A/140/
Also, note that when a liquidation auction was divided up by multiple liquidators, we consider each slice of a liquidation auction as a separate liquidation (so that we can keep track of all liquidators in the liquidate entity). Because of this, our liquidation count (77) is higher than what makerrisk reported (63).
Re: the discrepancy in totalBorrowBalanceUSD between the subgraph and makerrisk after fix in #928:
Note that the totalBorrowBalanced in the ETH-A market after the fix ($153M) is still different than the number on makerrisk ($166M) on 8/19. I can verify on miniscan.xyz $153M is the correct number: query the ilks with input "0x4554482d41000000000000000000000000000000000000000000000000000000" (bytes32 for ETH-A) for block number 15374318 (last block for 8/19), you'll get "Art": "153483929481010987735691081" ($153M) as one of the outputs - it is the total normalized debt for the market. In the subgraph, we are not reading the value off-chain, but sum all borrows and repays (including liquidation). These two numbers match give me confidence that we're doing it right.
@this-username-is-taken this can be frozen! @tnkrxyz thanks for all the hard work.
Ok, I believe the cause of the discrepancy between makerrisk borrow number and our subgraph number is that makerrisk's number is borrow + interest, while our number is borrow only. The rate for the same query above is 1076641430855509053020903915, which means the borrow + interest is 153483929481010987735691081 * 1076641430855509053020903915/1e45 = $165M, which is much closer to makerrisk's number. Not sure which block they use to represent the day (we use the last block). For the first block of the day, borrow + interest = $166M, even closer, although still not match their number exactly to the decimals.