Skip to content

Commit

Permalink
Better data reading on low quality nodes (#175)
Browse files Browse the repository at this point in the history
- Rework internal caching mechanisms for tokens and chain ids
- `TokenDetails` is now cacheable
- A lot of fixes for reading Uniswap v3 data on low-quality nodes
- Converted a lot of tests to `create_multi_provider_web3` because JSON-RPC providers were giving headache to get the test suite complete with random failures
- Disable `test_revert_reason` because it fails on QuickNode
  • Loading branch information
miohtama authored Oct 29, 2023
1 parent f73e3ef commit 455c68f
Show file tree
Hide file tree
Showing 25 changed files with 1,623 additions and 1,587 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# Current

- Various improvements when working with low quality JSON-RPC nodes
- Uniswap v3 price tutorial is now runnable with low quality nodes
- API chance: `fetch_erc20_details(cache)` has now an internal cache, implemented
with Python's cachetools package.
- Add: `static_call_cache_middleware` to reduce the amount of `eth_chainId` API calls
- Add: `TrackedLazyTimestampReader` to help working with slow nodes
- Add: `MultiProviderWeb3.get_api_call_counts` to see JSON-RPC API call stats across all providers
- Fix: `swap_with_slippage_protection(max_slippage)` is BPS
- API change: `swap_with_slippage_protection(max_slippage=15)` - change the default Uniswap v3
trade slippage tolerance from (unrealistic) 0.1 BPS to 15 BPS.
- Fix: The madness of JSON-RPC providers abuse the error code `-32000`.
We check for *error message* now instead of error code.
- Internal change: When reading events, only notify progress bar when we have an event hit,
to avoid unnecessary `eth_getBlockByNumber` calls for timestamps.

# 0.22.30

Expand Down
Loading

0 comments on commit 455c68f

Please sign in to comment.