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

Add swapr to dex.trades on ethereum #966

Merged
merged 1 commit into from
Apr 18, 2022
Merged

Add swapr to dex.trades on ethereum #966

merged 1 commit into from
Apr 18, 2022

Conversation

0xtekgrinder
Copy link
Contributor

Added Swapr to dex.trades table on Ethereum as requested in #601.
Results of the Swapr query can be checked at the dune_user_generated.swapr table.

You can check that the results are right by comparing to the official swapr stats https://dxstats.eth.link/#/home

I've checked that:

  • the query produces the intended results
  • the folder name matches the schema name
  • the schema name exists in Dune
  • views are prefixed with view_, functions with fn_.
  • the filename matches the defined view, table or function and ends with .sql
  • each file has only one view, table or function defined
  • column names are lowercase_snake_cased

@jeff-dude
Copy link
Member

@lolboysg thank you for the new request. i'm looking at this with the team. there was a prior PR #622 for Swapr which was closed. ensuring the changes are what is needed

@jeff-dude
Copy link
Member

@lolboysg token_a should be token bought, looks like you may need to flip logic for token a/b assignment.

comparing to uniswap entries in dex trades:
select *
from dex.trades
where lower(project) like '%uniswap%'
and tx_hash = '\xfd6abe304f5332582f76d8f0bdfe9f8e4fe1d8a4ccf5079a7826ba6602ee97c4'

https://etherscan.io/tx/0xfd6abe304f5332582f76d8f0bdfe9f8e4fe1d8a4ccf5079a7826ba6602ee97c4

1 similar comment
@jeff-dude
Copy link
Member

@lolboysg token_a should be token bought, looks like you may need to flip logic for token a/b assignment.

comparing to uniswap entries in dex trades:
select *
from dex.trades
where lower(project) like '%uniswap%'
and tx_hash = '\xfd6abe304f5332582f76d8f0bdfe9f8e4fe1d8a4ccf5079a7826ba6602ee97c4'

https://etherscan.io/tx/0xfd6abe304f5332582f76d8f0bdfe9f8e4fe1d8a4ccf5079a7826ba6602ee97c4

@0xtekgrinder
Copy link
Contributor Author

I think the logic is correct as the token_a is the token being bought and token_b is the token being sold.
You can see a example in this request which is this transaction in etherscan

@jeff-dude
Copy link
Member

I think the logic is correct as the token_a is the token being bought and token_b is the token being sold. You can see a example in this request which is this transaction in etherscan

makes sense. i've loaded the history and enabled the cron job. thank you for the new dex addition.

@jeff-dude jeff-dude merged commit 3b27ecc into duneanalytics:master Apr 18, 2022
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

Successfully merging this pull request may close these issues.

2 participants