messari / subgraphs

Standardized subgraphs for blockchain data
MIT License
510 stars 241 forks source link

Build Satellite (Axelar) Subgraph #1628

Open bye43 opened 1 year ago

bye43 commented 1 year ago
###  Deployment Status
- [ ] https://github.com/messari/subgraphs/issues/2007
- [ ] Arbitrum: https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/tnkrxyz/axelar-arbitrum&tab=protocol
- [ ] Avalanche: https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/tnkrxyz/axelar-avalanche&tab=protocol
- [ ] BSC: https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/id/QmeWuhBTWqiHTNHkz56dtNdD3diLFiCNcihx7eXNfYpDXD&tab=protocol
- [ ] Celo: https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/tnkrxyz/axelar-celo&tab=protocol
- [ ] Fantom: https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/tnkrxyz/axelar-fantom&tab=protocol
- [ ] Moonbeam:  https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/tnkrxyz/axelar-moonbeam&tab=protocol
- [ ] Polygon: https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/tnkrxyz/axelar-polygon&tab=protocol
bye43 commented 1 year ago

@dmelotik IIRC this needs to be QA'd still?

tnkrxyz commented 1 year ago

@dmelotik IIRC this needs to be QA'd still?

correct. @dmelotik created https://github.com/messari/subgraphs/issues/1971 for it; We should re-open 1971 I think?

bye43 commented 1 year ago

@tnkrxyz I sent to the ETH depoyment to Serenity Fund to do the indepth QA, so they should submit their own QA issue when they complete it.

subtledrift commented 1 year ago

Arbitrum: No data except last 5 days. Did it just get turned on? Avalanche: Deployment error BSC: Deployment error Celo: Non-TVL looks ok but why zero TVL? Fantom: Why does TVL only have data for last couple months but other metrics have it much farther back? Moonbeam: Non TVL looks OK but why is there zero TVL? Matic: Same question as Fantom

Thanks @tnkrxyz

bye43 commented 1 year ago

@tnkrxyz Just re-pinging you on this. If you could take a look at this before arrakis that would be great. Thanks!

tnkrxyz commented 1 year ago

@tnkrxyz Just re-pinging you on this. If you could take a look at this before arrakis that would be great. Thanks!

thx for the reminder! busy with arp dagster and aave-forks last week. started to look into this and arrakis.

tnkrxyz commented 1 year ago

thx @pietydespises !

Arbitrum: No data except last 5 days. Did it just get turned on?

The issue with data on arbitrum is that the price oracle is not finding prices for most tokens and defaulting to 0 and thus anything accounted in USD ends up in 0s. For example, the aUSDC pool clearly has activities since 2022-12 image, but all USD metrics are 0s because there is no price for aUSDC.

Recently, they added arbitrum as one of the pools, for which the price oracle does find prices, the dashboard shows as if it is only actively since very recently.

Avalanche: Deployment error

fixed in #2093

BSC: Deployment error

fixed in #2093

Celo: Non-TVL looks ok but why zero TVL? Fantom: Why does TVL only have data for last couple months but other metrics have it much farther back? Moonbeam: Non TVL looks OK but why is there zero TVL? Matic: Same question as Fantom

axelar supports burn-mint (internal token) and lock-release (tokens external to axelar) mode of transfers. Only lock-release will add/remove TVL. burn-mint mode won't. The issue that price oracle not finding prices is another factors with 0 TVL.

bye43 commented 1 year ago

@pietydespises Updated those broken deployments in the links on the tasklist

subtledrift commented 1 year ago

Thanks @bye43 and @tnkrxyz :)

Avalanche looks wrong (thus is wrong). Why does TVL = TVE? Total Value Imported also looks strange, huge values but way before TVL and TVE spiked. Volume metrics also shifted in the same way.

BSC: Same thing, why does TVL = TVE? TVI looks like it could be right here.

Does what you said above "axelar supports burn-mint (internal token) and lock-release (tokens external to axelar) mode of transfers. Only lock-release will add/remove TVL. burn-mint mode won't." explain it?

bye43 commented 1 year ago

@tnkrxyz Just bumping the above; in case, you have not seen

tnkrxyz commented 1 year ago

Thanks @bye43 and @tnkrxyz :)

Avalanche looks wrong (thus is wrong). Why does TVL = TVE? Total Value Imported also looks strange, huge values but way before TVL and TVE spiked. Volume metrics also shifted in the same way.

@pietydespises This again is a combination of two factors: 1.) we only include in the TVL for transfers using lock-release mode (for tokens not minted by axelar protocol). With the lock-release mode, for outgoing transfers, the gateway contract will lock the token users want to transfer on the source chain (in this case avalance, thus they are included in total value "LOCKED") and release the equal amount of external tokens on the destination chain. vice versa for inbounding transfers. With the burn-mint mode, an outgoing transfer burns internal token (such as axlUSDC, thus not accounted in TVL because no value is LOCKED) on the source chain and an equal amount of internal token is minted on the destination chain. vice versa for inbounding transfers.

2.) we only have prices for some of the tokens. Depending which tokens the oralce find prices, if you only look at the USD amount(tvl, tve, tvi), they will only reflect some of transfers (more likely using the lock-release mode; some of the external tokens may not have prices). The high tvi USD amount earlier is because the oracle found prices for axlUST and axlLUNA, but they are not included in tvl since they are internal token transfered in with burn-mint mode.

If you look at the transfers, you will see we have both transfers in the subgraph data.

!image

BSC: Same thing, why does TVL = TVE? TVI looks like it could be right here.

same as avalance.

Does what you said above "axelar supports burn-mint (internal token) and lock-release (tokens external to axelar) mode of transfers. Only lock-release will add/remove TVL. burn-mint mode won't." explain it?

Does the above explanation help?

tnkrxyz commented 1 year ago

@tnkrxyz Just bumping the above; in case, you have not seen

@bye43 , thx for the reminder! responded above.

subtledrift commented 1 year ago

Thanks for the in-depth explanation @tnkrxyz ! Will the oracle be able to find more prices eventually to cure this imbalance we have in the graphs?

tnkrxyz commented 1 year ago

Thanks for the in-depth explanation @tnkrxyz ! Will the oracle be able to find more prices eventually to cure this imbalance we have in the graphs?

good question. @bye43 probably has more insights, but my understanding is that fixing prices within subgraphs is not priority atm.

bye43 commented 1 year ago

@tnkrxyz Ya atm we are just doing what we can with steeges new pricing library. If the pricing issues still persist, we will just use the deployments with good pricing for now and revisit the pricing another time. @pietydespises with this is mind, could you lmk which deployments you think are good for PM and which are not?

subtledrift commented 1 year ago

@bye43 none of these look displayable atm.

melotik commented 1 year ago

After talking to @bye43 I think the plan is to show Ethereum as it passed QA.

For the other ones the best way to tackle the price issues is likely to use the flag in the sdk to do custom price logic. And create a pricing function that grabs price from a dex or oracle based on the token.

This addition will take a while so we are moving it to backlog as it is lower priority than other DQ issues.