Changed type on Pairs entities property volumeToken[x]#62
Changed type on Pairs entities property volumeToken[x]#62GabrielCamba wants to merge 4 commits intodevelopfrom
Conversation
…ameter to prevent build error
…Decimal with being calculated with each token decimals.
alfetopito
left a comment
There was a problem hiding this comment.
Very nice Gabi, great work in the PR description 👍
Is this deployed anywhere yet that can be tested?
If it is, please add it in the description under a testing section or similar
For reference, here's one of my recent PRs cowprotocol/cowswap#905
Think as if you are someone looking at this PR without much context and need to verify it.
List steps - if necessary - to validate the changes done here
Sorry I missed this answer. Regarding this, we are only replacing the price for 0xee... token. If you are ok with this, I can add a ticket for addressing this change. |

Close #61
On entities Pair, PairHourly and PairDaily the properties volumeToken0 and volumeToken1 was expressed in BigInt with each volume calculated in atoms. That type made difficult to compare volumes and have a better idea of the volume traded.
volumeToken0 and volumeToken1 is now expressed in BigDecimal making the calculation of the decimals using each token decimals property.
Example query:
{ pairHourly(id:"0x4ecaba5870353805a9f068101a40e0f32ed605c6-0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1-1628812800"){ token0{ symbol } volumeToken0 } }Previous version result:
{ "data": { "pairHourly": { "token0": { "symbol": "USDT" }, "volumeToken0": "109547611" } } }New version result:
{ "data": { "pairHourly": { "token0": { "symbol": "USDT" }, "volumeToken0": "109.547611" } } }To test:
For testing this is deployed both on Ethereum mainnet and Gnosis chain
Here is an example query that should work for Pairs, PairsDailies and PairsHourlies entities:
{ pairDailies(first: 5){ token0{ address symbol } token1 { address symbol } volumeToken0 volumeToken1 } }The expected result is to have volumes of the tokens expressed with decimals, based on each token definition