Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
All actions (Trades, Asset Movements e.t.c.) are now saved in the DB #508
That's because we need to be able to test the DB upgrades from back then and there is no residual DBs from then to be found. From here and on for each upgrade an old DB must be used.
Just like with trades and marging positions, now deposits and withdrawals are first queried from the DB and only iff newer data may exist online for the time period is the exchange queried.
Iterating a list of records is better than just using a bunch of functions that are called sequentially since it's: 1. easier to read 2. can be mocked/modified easier in tests to test only upgrades until a specific target version
- Adding a Location Enum table in the DB and using it for the trades location - Changing the exchange enum in python to a more generic Location enum Important: Still left to add this enum to other DB tables
As opposed to the previous logic where a simple executemany() was done and if it failed we bailed out now we first try that but if it fails we resort to writting entries to the DB one by one
Ethereum transactions are now also saved in the database. Initially for each address in a time range we first check if the last DB trade is at the limit of the range. If yes then that means the range has been queried before succesfully and then we do not query again. Else we query etherscan and save the transactions in the DB. The logic needs more finetuning, and needs to be made similar to the rest of the DB + API querying logic, but unfortunately etherscan querying uses block numbers and not timestamps. Converting between timestamps and block numbers is non trivial.
LefterisJP merged commit
Sep 27, 2019
1 of 3 checks passed
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments.