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 filtering for not mine (STATS) swaps #799

Closed
tonymorony opened this issue Jan 29, 2021 · 6 comments
Closed

Add filtering for not mine (STATS) swaps #799

tonymorony opened this issue Jan 29, 2021 · 6 comments
Assignees

Comments

@tonymorony
Copy link

tonymorony commented Jan 29, 2021

It would be wonderful to use DB and filtration/pagination functionality not only for my_orders swap statuses but also for collected swap statuses on seed nodes

ref: #33

@artemii235
Copy link
Member

@tonymorony Thanks for creating the issue! Could you please provide more details about the expected SQLite table data/schema? I guess we need the following columns: UUID, maker_coin, taker_coin, maker_amount, taker_amount, started_at (maybe separate for maker and taker too), but maybe something else is required?

@tonymorony
Copy link
Author

yeah, that looks like enough data. also separation between successful and failed would be helpful

just rechecked data from the swap status structure we using:

first_event = swap["events"][0]["event"]["data"]

first_event["taker_amount"]
first_event["maker_amount"]
["events"][0]["timestamp"]
first_event['uuid']
first_event['started_at']

The most tricky matter we got in our stats tool so far is to determine the list of pairs with >0 swaps - we should scan all possible permutations. Is it possible to create such an "alive pairs" list during import into DB? it'll help a lot

@artemii235
Copy link
Member

Is it possible to create such an "alive pairs" list during import into DB? it'll help a lot

Sure, just one question: should we add both RICK/MORTY and MORTY/RICK there? Or will it be sufficient to order tickers alphabetically and insert just MORTY/RICK?

@tonymorony
Copy link
Author

counting logic using both ways now (according to dexstats.info not only we counting both ways) - so would be great to include it as RICK/MORTY + MORTY/RICK if there are both directions trades (if it's not a huge complication to list creation logic)

@artemii235
Copy link
Member

@tonymorony I have implemented the indexing of swaps statistics to the SQLite DB. You can use the build from http://195.201.0.6/mm2.1-stats-swaps-index-filter/ until the corresponding PR is merged. The SQLite file path is %MM2_DB_DIR%/MM2.db. The table name with statistics is stats_swaps.

The most tricky matter we got in our stats tool so far is to determine the list of pairs with >0 swaps

You can now get them using the SELECT DISTINCT maker_coin, taker_coin FROM stats_swaps; query.

artemii235 added a commit that referenced this issue Feb 8, 2021
* WIP. Compilation fails.

* Index swap statistics to SQLite database #799

* Add is_success to swaps events.
@tonymorony
Copy link
Author

Works like a charm, thank you!

Parser (WIP) with this DB usage https://github.com/tonymorony/dexstats_sqlite_py

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

2 participants