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

Scrape swaps #8

Open
Tomen opened this issue Mar 21, 2022 · 0 comments
Open

Scrape swaps #8

Tomen opened this issue Mar 21, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Tomen
Copy link
Contributor

Tomen commented Mar 21, 2022

Given an SS58 address and a parachain, swaps shall be scraped.

This varies between parachains. Maybe an adapter solution can be found that generalizes this.

@Tomen Tomen added this to the v2.0 milestone Mar 21, 2022
@Tomen Tomen added the enhancement New feature or request label Mar 22, 2022
spazcoin added a commit to spazcoin/subscrape that referenced this issue Apr 12, 2022
* Get token name, symbol, and calculate real transaction values. But
this required adding support for the Blockscout API.
* adaptive rate limit for subscan.io depending on whether an API key is
provided.
* migrate URLs to be encapsulated within the block explorer wrappers.

contributes to ChaosDAO-org#8 decoding DEX swap transactions
spazcoin added a commit to spazcoin/subscrape that referenced this issue Apr 12, 2022
* Support most dex swap transactions except "swapETHForTokens"
transactions because they don't specify input quantity.

contributes to ChaosDAO-org#8 decoding DEX swap transactions
spazcoin added a commit to spazcoin/subscrape that referenced this issue Apr 12, 2022
* Support most dex swap transactions except "swapETHForTokens"
transactions because they don't specify input quantity.

contributes to ChaosDAO-org#8 decoding DEX swap transactions
spazcoin added a commit to spazcoin/subscrape that referenced this issue Apr 14, 2022
Previously, we were able to decode the input data to a contract
interaction. But in a DEX exchange, there could be slippage so the
actual amount swapped might be slightly different. Therefore, we need
to get the actual event logs to see the exact quantities exchanged.

This commit uses @yifei_huang's script to decode a transaction log file.
Some testing remains, to figure out to handle multiple input values to
a swap.

contributes to ChaosDAO-org#8
spazcoin added a commit to spazcoin/subscrape that referenced this issue Apr 21, 2022
moonbeam_scraper.py is now able to retrieve transaction receipts for
contract interactions so that it can decode the internal dex 'trace'
transactions to determine the exact input and output quantities for
swap transactions.
Previously, we were using the internal 'Swap' transactions, but those
were too difficult to match up for a multi-hop swap (i.e. ROME -> MOVR
-> SOLAR). So instead the code now only sums up the Transfer input
quantities from the source acct. This is done in a generic way without
requiring classes for each DEX contract implementation which works as
long as DEX contracts all follow general patterns and naming
conventions.

contributes to ChaosDAO-org#8
spazcoin added a commit to spazcoin/subscrape that referenced this issue Apr 21, 2022
moonbeam_scraper.py is now able to retrieve transaction receipts for
contract interactions so that it can decode the internal dex 'trace'
transactions to determine the exact input and output quantities for
swap transactions.
Previously, we were using the internal 'Swap' transactions, but those
were too difficult to match up for a multi-hop swap (i.e. ROME -> MOVR
-> SOLAR). So instead the code now only sums up the Transfer input
quantities from the source acct. This is done in a generic way without
requiring classes for each DEX contract implementation which works as
long as DEX contracts all follow general patterns and naming
conventions.

contributes to ChaosDAO-org#8
@Tomen Tomen modified the milestones: v2.0, 1.6 DeFi Scrapers & Transformers May 8, 2022
@Tomen Tomen removed this from Subscrape Grant 1 May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant