dhedge / dhedge-docs

MIT License
5 stars 3 forks source link

[Bounty] Create Dune Analytics Dashboard with dHEDGE V1 data on Ethereum #6

Open leckylao opened 3 years ago

leckylao commented 3 years ago

Prize Title

[Bounty] Create Dune Analytics Dashboard with dHEDGE V1 data on Ethereum

Prize Bounty

$3000 USDC

Challenge Description

Create a dashboard with dHEDGE V1 data on Dune Analytics on Ethereum similar to the dashboard for mStable here https://dune.xyz/derc/mta-community. Including the following but not limited data:

dHEDGE Factory on Ethereum mainnet: 0x03D20ef9bdc19736F5e8Baf92D02C8661a5941F7

Contract public repo: https://github.com/dhedge/dhedge-contracts

dHEDGE Factory ABI: https://drive.google.com/file/d/1NCRm-OsU7EX87yaUoC-uyvL6zlq2kTrl/view?usp=sharing

Submission Requirements

Please include a link to the dashboard

Judging Criteria

Valid submission requires showing Dune Analytics dashboard including but not limited the above data.

Winner Announcement Date

Winners will be announced at the conclusion of Open Defi Hackathon

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 3000.0 USDC (3000.0 USD @ $1.0/USDC) attached to it.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 2 weeks, 4 days from now. Please review their action plans below:

1) cruisefinance has started work.

Working on Dune Analytics for exporting insight datas of dHEDGE V1 on Ethereum

Learn more on the Gitcoin Issue Details page.

tonytran1307 commented 3 years ago

Hi @leckylao , can I ask for smartcontract of dHEDGE V1 ? I have no idea of this. Thanks for your support.

leckylao commented 3 years ago

Hi @leckylao , can I ask for smartcontract of dHEDGE V1 ? I have no idea of this. Thanks for your support.

Updated contract details

tonytran1307 commented 3 years ago

Hi @leckylao , can I ask for smartcontract of dHEDGE V1 ? I have no idea of this. Thanks for your support.

Updated contract details

Very fast, appreciated it 💯

tonytran1307 commented 3 years ago

Hi @leckylao , I want to confirm that "TVL for all pools" is the sum of all separated pools, the number is "$28,037,178" ? This number of TVL I took from here : https://stats.dhedge.org/#Protocol

leckylao commented 3 years ago

Hi @leckylao , I want to confirm that "TVL for all pools" is the sum of all separated pools, the number is "$28,037,178" ? This number of TVL I took from here : https://stats.dhedge.org/#Protocol

Yea, there would be some duplicate data with the stats page. The idea is to replace it and have all data together in one Dune Analytics dashboard.

tonytran1307 commented 3 years ago

Hi @leckylao , I want to confirm that "TVL for all pools" is the sum of all separated pools, the number is "$28,037,178" ? This number of TVL I took from here : https://stats.dhedge.org/#Protocol

Yea, there would be some duplicate data with the stats page. The idea is to replace it and have all data together in one Dune Analytics dashboard.

I think this number of TVL with stats page is correct which compared to defillama. But on Defipulse TVL is displayed as " $ 21,9M " I am confused. I want to confirm in general which number of TVL is correct. Thanks

leckylao commented 3 years ago

Hi @leckylao , I want to confirm that "TVL for all pools" is the sum of all separated pools, the number is "$28,037,178" ? This number of TVL I took from here : https://stats.dhedge.org/#Protocol

Yea, there would be some duplicate data with the stats page. The idea is to replace it and have all data together in one Dune Analytics dashboard.

I think this number of TVL with stats page is correct which compared to defillama. But on Defipulse TVL is displayed as " $ 21,9M " I am confused. I want to confirm in general which number of TVL is correct. Thanks

You were right, looks like Defi Pulse didn't include the V2 data. Thanks for reporting.

rob-lw commented 3 years ago

Hi All. @tonytran1307 i am looking to get involved in this bounty and learn more about dhegde and dune analytics. Would you like to team up on this one ? I see you are working on TVL, I have already pulled unique addresses and shall start the unique manager addresses. Let me know.

rob-lw commented 3 years ago

Hi All. @leckylao I have produced the TVL for Eteherum data across all pools. Today's value comes at £27.4M. It seems in the order you report as well as other sites although none quite match - could be due to exchange rates ? I do have an issue with pulling synth stock prices into dune (specifically commodities and blue chip) although this has little impact on the overall TVL due to relatively low sums. What do you use to get prices for those ? through smart contracts ?

leckylao commented 3 years ago

Hi All. @leckylao I have produced the TVL for Eteherum data across all pools. Today's value comes at £27.4M. It seems in the order you report as well as other sites although none quite match - could be due to exchange rates ?

Not sure, if U$27.4M instead would be more correct.

I do have an issue with pulling synth stock prices into dune (specifically commodities and blue chip) although this has little impact on the overall TVL due to relatively low sums.

Yea, they seems disabling those assets as well.

What do you use to get prices for those ? through smart contracts ?

We have getFundComposition on pool that you could use to get value of the pool.

tonytran1307 commented 3 years ago

Hi All. @leckylao I have produced the TVL for Eteherum data across all pools. Today's value comes at £27.4M. It seems in the order you report as well as other sites although none quite match - could be due to exchange rates ? I do have an issue with pulling synth stock prices into dune (specifically commodities and blue chip) although this has little impact on the overall TVL due to relatively low sums. What do you use to get prices for those ? through smart contracts ?

Hi, do you have any update for TVL ?

rob-lw commented 3 years ago

Hi @tonytran1307 . The getFundComposition does not return data in Dune. I had turned to dune for support and they have advised this is an issue in the decoding process. They are looking whether this can be addressed and if so how quickly. In the meantime I am attempting to workout what causes the discrepancy between what i get, the 27.4M vs 28.2M that is reported.

tonytran1307 commented 3 years ago

Hi @tonytran1307 . The getFundComposition does not return data in Dune. I had turned to dune for support and they have advised this is an issue in the decoding process. They are looking whether this can be addressed and if so how quickly. In the meantime I am attempting to workout what causes the discrepancy between what i get, the 27.4M vs 28.2M that is reported.

How can you get the number is 27.4M ? Same way to you, the getFundComposition returned nothing !

tonytran1307 commented 3 years ago

The pools of Ethereum is 470 ! So simply, we just calculate all of them.

leckylao commented 3 years ago

Hi everyone, as the Hackathon is ending soon, but there's still no submission and people report there's decode issue for Dune that returned no data. Therefore I am extending the bounty for another 3 weeks. Hopefully that could give enough time for everyone to resolve data issue with Dune and do a submission.

Please note bounty could still close early if there's a submission that has fulfilled all the requirements and we think that it could be a winner.

rob-lw commented 3 years ago

@tonytran1307 yes i go through all the pools, get the value held in each and then sum all to get tvl.

rob-lw commented 3 years ago

Hi All. @leckylao I have produced the TVL for Eteherum data across all pools. Today's value comes at £27.4M. It seems in the order you report as well as other sites although none quite match - could be due to exchange rates ?

Not sure, if U$27.4M instead would be more correct.

I do have an issue with pulling synth stock prices into dune (specifically commodities and blue chip) although this has little impact on the overall TVL due to relatively low sums.

Yea, they seems disabling those assets as well.

What do you use to get prices for those ? through smart contracts ?

We have getFundComposition on pool that you could use to get value of the pool.

@leckylao an update on this. now I report TVL of $29.810M (to be exact), you report £29.895M. seems this is due to exchange rates. do you pull 24hr exchange rates ?

leckylao commented 3 years ago

Hi All. @leckylao I have produced the TVL for Eteherum data across all pools. Today's value comes at £27.4M. It seems in the order you report as well as other sites although none quite match - could be due to exchange rates ?

Not sure, if U$27.4M instead would be more correct.

I do have an issue with pulling synth stock prices into dune (specifically commodities and blue chip) although this has little impact on the overall TVL due to relatively low sums.

Yea, they seems disabling those assets as well.

What do you use to get prices for those ? through smart contracts ?

We have getFundComposition on pool that you could use to get value of the pool.

@leckylao an update on this. now I report TVL of $29.810M (to be exact), you report £29.895M. seems this is due to exchange rates. do you pull 24hr exchange rates ?

£29.895M in Euro? I don't think have ever reported price in euro. In getFundComposition we use Chainlink price feed in USD. But $29.810M LGTM.

rob-lw commented 3 years ago

Hi All. @leckylao I have produced the TVL for Eteherum data across all pools. Today's value comes at £27.4M. It seems in the order you report as well as other sites although none quite match - could be due to exchange rates ?

Not sure, if U$27.4M instead would be more correct.

I do have an issue with pulling synth stock prices into dune (specifically commodities and blue chip) although this has little impact on the overall TVL due to relatively low sums.

Yea, they seems disabling those assets as well.

What do you use to get prices for those ? through smart contracts ?

We have getFundComposition on pool that you could use to get value of the pool.

@leckylao an update on this. now I report TVL of $29.810M (to be exact), you report £29.895M. seems this is due to exchange rates. do you pull 24hr exchange rates ?

£29.895M in Euro? I don't think have ever reported price in euro. In getFundComposition we use Chainlink price feed in USD. But $29.810M LGTM.

Sorry. all in $ dollars. I get $29.810M vs your $29.895M.

aaaapsouuu commented 3 years ago

Hi,

How confident are you about the data in here: https://stats.dhedge.org/#Protocol When I look into the pool composition, I see that, in theory, I should find some SLP USDC-USDT tokens. But when I check all the pool transactions, there are no transactions with that token.

leckylao commented 3 years ago

Hi,

How confident are you about the data in here: https://stats.dhedge.org/#Protocol When I look into the pool composition, I see that, in theory, I should find some SLP USDC-USDT tokens. But when I check all the pool transactions, there are no transactions with that token.

This one? Looks like SLP USDC-USDT is there. image

aaaapsouuu commented 3 years ago

Yes, I can find it in the chart, but when I look into all the pool transactions in Dune, I can't find anyone who has deposited this token

leckylao commented 3 years ago

Yes, I can find it in the chart, but when I look into all the pool transactions in Dune, I can't find anyone who has deposited this token

Here you go: https://app.dhedge.org/pool/0xbae28251b2a4e621aa7e20538c06dee010bc06de

aaaapsouuu commented 3 years ago

Ok, sorry, my bad that's in Polygon, and I was looking at the txs in Ethereum I clicked on the Ethereum tab and thought that the composition was only from Ethereum.

leckylao commented 3 years ago

Ok, sorry, my bad that's in Polygon, and I was looking at the txs in Ethereum I clicked on the Ethereum tab and thought that the composition was only from Ethereum.

Ah, right, haha, it is very easy to mix up.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 3000.0 USDC (3000.00 USD @ $1.0/USDC) has been submitted by:


aaaapsouuu commented 3 years ago

Hi again,

I submitted my work. It is far from perfect, but considering the situation, with Dune, I believe I can't do much better. The Chainlink aggregators on Dune haven't been updated since April (I believe), so there is no way to get an accurate price in USD for all the tokens.

I took the price of the erc20 token for the synths that this is available and the price from the last exchange for the remaining synths. This has 2 issues: 1) The price update of erc20 tokens on Dune is trailing by approx 15 minutes (which I think isn't that bad) 2) Some synths were traded weeks ago for the last time, and the price isn't very accurate. (I believe iXRP is one of them).

I could make the current version of the dashboard a bit more accurate by manually putting the price of the frozen/paused synths, but this will make future prices inaccurate.

Let me know if you have any other ideas or if you want me to change something.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 3000.0 USDC (3000.00 USD @ $1.0/USDC) has been submitted by:

  1. @aaaapsouuu

@leckylao please take a look at the submitted work:


Echolon166 commented 3 years ago

Hello, I've submitted my work, I believe it should cover all of the requirements.

Synthetix price tables start from 2020-12-25 so before that TVL only consists of sUSD on the chart, apart from that, I believe there shouldn't be a problem.

Would love to get feedback on it, please let me know if you would like to change/add something.

rob-lw commented 3 years ago

@leckylao @tonytran1307 All RE: getFundComposition on Dune. Screenshot from 2021-09-03 20-05-50

rob-lw commented 3 years ago

@leckylao. i will put a request to Dune to link synth prices directly under the usd.prices. will need a bit of time to pull the required info together for them. until then as the other submissions, the synth price feeds are a temporary solution.

leckylao commented 3 years ago

Well done guys! Thanks everyone for the submissions! Will let the team to review all and leave comments.

leckylao commented 2 years ago

https://forum.dhedge.org/t/pay-open-defi-winners-proposal-to-grants-dao/236