Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Total tokens received do not match amount reported on grant page #4362

Closed
lrettig opened this issue May 3, 2019 · 34 comments
Closed

Total tokens received do not match amount reported on grant page #4362

lrettig opened this issue May 3, 2019 · 34 comments

Comments

@lrettig
Copy link

lrettig commented May 3, 2019

Hello,

Our grant page (https://gitcoin.co/grants/82/official-progpow-technical-audit-funding) says we received 15,799.70 DAI but we didn't actually receive that many (https://etherscan.io/address/0x68085e7f88e90fa9247489c83fab30b177ebccb3#tokentxns). We are short by a few hundred DAI. How was this 15,799.70 DAI figure calculated? Does it include the CLR match amount? Maybe this hasn't actually been paid out yet? We also received ~3 contributions in other tokens but they were small and even adding them, it's still short.

Thanks!

@spm32
Copy link
Collaborator

spm32 commented May 5, 2019

Hey @lrettig I believe this is related to an ongoing issue with the current API we're using as discussed in #4186, sorry about the issue with conversion. The thing is, because all projects were affected the same way by the conversion issues we'll likely leave it this way for Round 2 (feel free to chime in if we want to change this policy @owocki) and make sure we have the proper price conversions in place for future rounds.

@lrettig
Copy link
Author

lrettig commented May 5, 2019

@ceresstation thanks for weighing in, and just to be clear, you're suggesting that we didn't actually raise as much as we thought we did? But as I indicated in the original message here, nearly all of the funds were raised in DAI itself, so it doesn't seem to be a conversion issue and I'm pretty sure the math still does not work out!

@spm32
Copy link
Collaborator

spm32 commented May 6, 2019

@lrettig so after talking with @danlipert in this case I think it was actually due to the fluctuation of DAI's value over the contribution period, not due to the API conversion issue. We use the values of assets at the time they're committed to calculate the CLR matching amount which is why the amount on etherscan now is different. The reason for doing it this way is that the value the donor intended to give (i.e. the signal) is best represented by the value at the time of donation.

@lrettig
Copy link
Author

lrettig commented May 7, 2019

Okay. Is there a way to know how much DAI we actually raised? Thanks!

@lrettig
Copy link
Author

lrettig commented May 7, 2019

Actually is there a way to get a dump of the raw data for the transactions?

@lrettig
Copy link
Author

lrettig commented Jun 25, 2019

Ping here - would it be possible to get access to this data? Thanks!

@owocki
Copy link
Contributor

owocki commented Jun 25, 2019

thx for the bump!

heres the output of the following query

select 
 grants_contribution.created_on,
 grants_contribution.tx_id,
 grants_contribution.success,
 grants_subscription.amount_per_period,
 grants_subscription.token_symbol
from 
grants_grant 
inner join grants_subscription on grants_subscription.grant_id = grants_grant.id
inner join grants_contribution on grants_contribution.subscription_id = grants_subscription.id

where grants_grant.id = 82;

@lrettig
Copy link
Author

lrettig commented Jun 25, 2019 via email

@wschwab
Copy link

wschwab commented Jun 25, 2019

I don't think this is the right data. For instance, there's no True/False column for success, nothing that resembles a tx hash, either, and no token symbol. Can you check this again please?

@owocki
Copy link
Contributor

owocki commented Jun 25, 2019

sorry guys, uploaded the wrong file. this is the correct data: http://bits.owocki.com/19800a5b618e/Untitled.csv

columns are:

 grants_contribution.created_on,
 grants_contribution.tx_id,
 grants_contribution.success,
 grants_subscription.amount_per_period,
 grants_subscription.token_symbol

@BrentAllsop
Copy link

BrentAllsop commented Jul 31, 2019

I’ve been looking into this hoping to figure things out.
I’ve spent some time today looking into the info contained above.

Before I spend too much time on this, I wanted to give an update of what I am seeing so far.
I might not understand things and may be going down an unnecessary rat hole.
So, I wanted to check with all of you to see if you had any more info that might help, maybe keeping me from going down a rat hole. If not, I’ll keep trying to figure things out.

I’m assuming this is the ECH multi-sig account with the discrepancies:
0x68085e7f88e90fa9247489c83fab30b177ebccb3

And I’m looking at the csv data dump of contributions from Kevin Owocki
In an effort to understand what is going on, I started with the largest and most recent 6/11 entry for 13548 DAI contribution in the csv file.
Also, there is a deposit into the ECH 0x6808 account for 13,548 on Jun 9 so thinking these are the same, and trying to see if I can make a connection to be sure I understand things.

The txid entry for that 13,548 DAI csv deposit is:
0x37059e9ef5463d73b74641ae2bb1664b42e90b908aceff2871715390794d60e8
Is dated Jun 6.
It appears to be for 40 ETH, which was converted to 9,377.59 DAI through a uniswap: DAI contract: 0x09cabec1ead1c0ba254b09efb3ee13841712be14.

That 9K DAI went to a mysterious address I don’t understand:
0x620a3981f796346df02be83fd929758a88078e3c
This seems to have something to do with the uniswap DAI contract.

There is an entry in that mysterious 0x620a account for 13,548 DAI going into the ECH 0x6808 account on Jun 9.

So, other than the dates, it seems there is almost a connection from the 0x3705 csv txid to the 13,548 deposited into the ECH 0x6808 account, through this mysterious 0x620a account.

But the 40 ETH -> 9,377.59 DAI going into the mysterious 0x620a account from the txid in the csv file doesn’t match the 13,548 DAI listed in the same csv file line, and coming from that mysterious 0x620a into the ECH 0x6808 account.

So, it doesn’t seem like I’ve yet figured out everything necessary to start reconciling things.
But I’ll keep at it.

@BrentAllsop
Copy link

BrentAllsop commented Jul 31, 2019

@owocki, could you explain the stuff I'm seeing in bold?

@owocki
Copy link
Contributor

owocki commented Jul 31, 2019

thanks brent. confirming this is on my TODO list, but i have a few things ahead of it (and meetings, ugh). let me see if i can knock this out by end of w1 August.

@BrentAllsop
Copy link

I’m assuming the grants.contribution and grants.subscription tables are tables in the gitcoin db. Perhaps you could tell me more about these tables, in particular the “amount_per_period” values. Could this represent more than the amount in the corresponding transaction id in the same column? (i.e. more than one txid “per period”?) If so, what other txids might be involved?

@owocki
Copy link
Contributor

owocki commented Aug 1, 2019

Does it include the CLR match amount?

yes

Maybe this hasn't actually been paid out yet?

that number should only include successful tx's

Actually is there a way to get a dump of the raw data for the transactions?

Yes ! here it is - i added tab with etherscan data and one with gitcoin data too.
https://docs.google.com/spreadsheets/d/17G8c9Z6PLN-7aMGdS4_JD78oHAvLdfCp1vM8_tlSJL8/edit#gid=1480236244

There seems to be more rows from etherscan than with gitcoin though -- is this account used for something else too?

@owocki
Copy link
Contributor

owocki commented Aug 1, 2019

Could this represent more than the amount in the corresponding transaction id in the same column? (i.e. more than one txid “per period”?)

it should only be one tx per period

@BrentAllsop
Copy link

BrentAllsop commented Aug 3, 2019

Oh, thanks for sending this google sheet, that really helps.
In that you indicated the 13,548 DAI I was trying to track down, above, was from the CLR (Who is CLR?) matching. So that explains why I was falling down that rat hole trying to figure out what it was.

@owocki aked:

There seems to be more rows from etherscan than with gitcoin though -- is this account used for something else too?

If you are talking about the 0x68085e7f88e90fa9247489c83fab30b177ebccb3 account, yes my understanding is that this account is used for all Cat Herder funds. There has been talk of splitting the ProgPOW audit funding to its own account.

The grants page Total seems incorrect.

When I total up the amounts on the grants page it doesn’t match the “Total Funded” field, today (Aug 3, 2019)

29,198.41 DAI Manually calculated (matches spreadsheet + 5 additional contributed by @owocki)
28,289.00 DAI Claimed on grants page
909.41 DAI Difference from manually counted amount.

Is this the problem?

@lrettig said:

Our grant page (https://gitcoin.co/grants/82/official-progpow-technical-audit-funding) says we received 15,799.70 DAI

But this balance never existed, that I can see, no matter how you run the balance from all contributions in order.

@BrentAllsop
Copy link

BrentAllsop commented Aug 4, 2019

I just noticed that is about a 3% discrepancy. Maybe this is a gitcoin fee?

@owocki
Copy link
Contributor

owocki commented Aug 4, 2019

I just noticed that is about a 3% discrepancy. Maybe this is a gitcoin fee?

no, no gitcoin fee

@BrentAllsop
Copy link

If it isn't a get coin fee. Where is the money going?

@owocki
Copy link
Contributor

owocki commented Sep 10, 2019

talking to @BrentAllsop on twitter today; we need to figure out why the 3% difference in the numbers.

@owocki
Copy link
Contributor

owocki commented Sep 11, 2019

hmm ; looking at the calcs... i wonder if the ZRX/LPT contributions (both of which have had some price fluctuations) have something to do with the 3% discrepancy..

When I total up the amounts on the grants page it doesn’t match the “Total Funded” field, today (Aug 3, 2019)

maybe if i add a USD equivilent column to the 'activity' tab on the grants activity page; that will help us reconcile this.. having both the gitcoin DB values and your values on one spreadsheet will make it easier to zero in on the root issue.

also.. hindsight is 20/20 but next time we should use one account per grant

@BrentAllsop
Copy link

BrentAllsop commented Sep 11, 2019

I don't know what you mean by "USD" equivalent. My understanding is that Dai are Dai. If X + Y + Z dai are donated, you should have a total balance of dai contributed which equals X+Y+Z DAI, not 3% less than that total amount of DAI? The exchange rate between USD and DAI or the "USD" equivalent has nothing to do with these DAI totals, right?

@owocki
Copy link
Contributor

owocki commented Sep 11, 2019 via email

@owocki
Copy link
Contributor

owocki commented Sep 11, 2019

here i wrote a script that will show everyone exactly how the contributions we've got tracked add up to the total reported on the grant page (the original intent of the ticket).. hopefully this clears things up; i wish i had just done this in the beginning:

In [1]: from grants.models import Grant
   ...: grant = Grant.objects.get(pk=82); grant.save()
   ...:
adding contribution of 5.00 DAI, pk: 559, worth $5.00 to make total $0. (txid: 0xfd8951b920f6c1ae7112fbc50467f51a032bc6de031c8f996a2135b81730748b tx_cleared:True )
adding contribution of 10.00 ZRX, pk: 445, worth $1.71 to make total $5.00. (txid: 0xa18e50f813b8637ad610121d4cd064b4cee5710c220b0629a822fd9c571954d6 tx_cleared:True )
adding contribution of 1000.00 DAI, pk: 449, worth $1000.00 to make total $6.71. (txid: 0x83172094c9016f1e1eea4918f0170aeede5afc5a357e248828e83e40bef99287 tx_cleared:True )
adding contribution of 50.00 DAI, pk: 455, worth $50.00 to make total $1006.71. (txid: 0x4f0f7c947a8caeffb0dd5ed31570ec8dc2afafc89d93f59d7b7fe5b1d9930e68 tx_cleared:True )
adding contribution of 1200.00 DAI, pk: 466, worth $1200.00 to make total $1056.71. (txid: 0xeff9b6ca6fa0f2a740ba2eb5cbe90a02d6c62bd13b1fe9b709654df35cf4f1fc tx_cleared:True )
adding contribution of 19.00 DAI, pk: 531, worth $19.00 to make total $2256.71. (txid: 0x6edd7ea215d9ca18f13156a6c0f7060820831022c100d0b99ebed1cecb98dc34 tx_cleared:True )
adding contribution of 135.00 DAI, pk: 460, worth $135.00 to make total $2275.71. (txid: 0x77bf4e526d162ef5f676b5a0f17694b00cdde18d1c1a1b0ccf35208120284fa3 tx_cleared:True )
adding contribution of 0.94 WETH, pk: 532, worth $176.28 to make total $2410.71. (txid: 0x23a84a7b72720fb772fa48beeae25b22663dd0c5cf0406c78eb9861fe17375d8 tx_cleared:True )
adding contribution of 10750.00 DAI, pk: 468, worth $10750.00 to make total $2586.98. (txid: 0x93bdfe69552a02b86bba805a26511e5a55ecf4b8b4a7ad7e3c8dc1f585925dc0 tx_cleared:True )
adding contribution of 209.41 DAI, pk: 577, worth $209.41 to make total $13336.98. (txid: 0x193f246abbbe02454621b9460a7ae0e9235da92172d70f528b2920721be03e15 tx_cleared:True )
adding contribution of 2.10 LPT, pk: 469, worth $15.56 to make total $13546.40. (txid: 0x552566b23c58ab3d5ec3040b0740a11ae1fc382829f1aef7dbafc5ae639ac241 tx_cleared:True )
adding contribution of 20.00 DAI, pk: 498, worth $20.00 to make total $13561.96. (txid: 0xe4e0e905ef976ac9ea4119557339727089614c5885623d1c2537623f98c55785 tx_cleared:True )
adding contribution of 42.00 DAI, pk: 471, worth $42.00 to make total $13581.96. (txid: 0x728939331bb8808a5e4a61192f77642e5561218c86077581b2150219db11bf47 tx_cleared:True )
adding contribution of 1000.00 DAI, pk: 499, worth $1000.00 to make total $13623.96. (txid: 0x827c8cef831112093649716498a81025ecf10b0399adcab870d3d9f9b7f2445a tx_cleared:True )
adding contribution of 13548.00 DAI, pk: 941, worth $13548.00 to make total $14623.96. (txid: 0x37059e9ef5463d73b74641ae2bb1664b42e90b908aceff2871715390794d60e8 tx_cleared:True )
adding contribution of 5.00 DAI, pk: 1076, worth $5.00 to make total $28171.96. (txid: 0xe1b26766486668d23332502d9f6bd0614e57e556e6f6c91dcac2cc04e3932d7a tx_cleared:True )
adding contribution of 5.00 DAI, pk: 1135, worth $5.00 to make total $28176.96. (txid: 0xf4f9e3db920915e062022f164422eb23a9d8ba8523e794b4b34150d07605364c tx_cleared:True )
adding contribution of 5.00 DAI, pk: 839, worth $5.00 to make total $28181.96. (txid: 0x5bc022184370243bc58868fe1b6406417fcac302a491201509374426ff0c4391 tx_cleared:True )
adding contribution of 5.00 DAI, pk: 940, worth $5.00 to make total $28186.96. (txid: 0x4c3c53ec439a7a7ca214b9fdfdcae3304980a0c79724b73e1b12b638c8d5e5a9 tx_cleared:True )
adding contribution of 5.00 DAI, pk: 572, worth $5.00 to make total $28191.96. (txid: 0x3edef5b276ae273f78977211a80611c787eda4c20f244a3efb0f5896ae379ec1 tx_cleared:True )

owocki added a commit that referenced this issue Sep 11, 2019
@BrentAllsop
Copy link

Hi Kevin @owocki,
Thanks for the continued help so we can understand what is going on.

You did provide some data in the Untitled.csv file, above, as of Jun 25. As I indicated, that data matched the individual amounts donated, as listed on the activity tab on the grants page.

When I remove the non DAI entries from this list you just provided, and then total only the DAI, I get 28,003.41 total DAI. The total DAI donated, on the grant page, as of today says: 28,196 DAI. This is 192 less DAI. This is only about 0.6% difference, as of today. As I indicated, above, the difference on Jun 25 was 909.41 DAI, when doing this same summation. That was a much larger 3% difference

I guess our question is, what is accounting for these differences?

@owocki
Copy link
Contributor

owocki commented Sep 11, 2019

hmmm... let me restore a backup on my local from june 25 (when i posted that csv) so ican look at the diff

@BrentAllsop
Copy link

BrentAllsop commented Sep 11, 2019

@owocki,
Oh wait, sorry. I had those last numbers backwards. The total listed on the grant page is 192 more DAI than the total in this list. So, this increase could be accounted for by the non DAI contributions. So it appears that there may not be a problem now. But that I can see, I didn't make any mistakes when doing these only DAI summations back on Jun 25, when there was a 3% deficit.

@BrentAllsop
Copy link

BrentAllsop commented Sep 11, 2019

I provided the totals, with the 3% deficit, in my August 3rd post, above.

@poojaranjan
Copy link

poojaranjan commented Oct 29, 2019

I agree with @lrettig initial statement. There is some mismatch in numbers.

I took a dump of ECH multisig account (Date Oct 29, 2019) and matched with transactions available on Gitcoin page. Converted value of ERC tokens in DAI and USD (Rate: CoinmarketCap) and it shows a difference of 50DAI.

Screen Shot 2019-10-29 at 3 48 57 PM

@owocki
Copy link
Contributor

owocki commented Oct 29, 2019

can i have access to the spreadsheet?

what does the difference look like if you use the conversion rates that the gitcoin system uses ? which i noted in this doc... #4362 (comment)

note: we sync our price data from etherdelta/poloniex

@poojaranjan
Copy link

can i have access to the spreadsheet?

Attached.
ProgPOW funds.xlsx

what does the difference look like if you use the conversion rates that the gitcoin system uses ? which i noted in this doc... #4362 (comment)

note: we sync our price data from etherdelta/poloniex

That may be a probable reason for the difference.

@BrentAllsop
Copy link

Kevin, just FYI, I sent Pooja a copy of this spreadsheet, I think originated from you.
Which has the conversion values gitcoin used?
I'm guessing if Pooja uses these numbers it will match?
https://docs.google.com/spreadsheets/d/1LG_5h3aR7mfnueoTH-7VUVQtm1bvO1r7ZH9anavpG1A/edit?usp=sharing

@poojaranjan
Copy link

poojaranjan commented Oct 30, 2019

Revisited the sheet and figured an error. Now the total fund is only a DAI off. Unsure, but that could be because I used coinmarketcap rates and Gitcoin uses etherdelta/poloniex.

Screen Shot 2019-10-30 at 10 01 18 AM

Updated sheet attached
ProgPOW funds2.xlsx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants