- Add EIP-3009
transferWithAuthorization
support. Related refactoring of EIP-3009 module.
- Fix: Token equality:
TokenDetails
does a logical comparison with chain id and address, instaed of object comparison. This makes TokenDetails good for ifs and hash maps. This addsTokenDetails.__eq__
andTokenDetails.__hash__
. - Fix
TradeSuccess.price
is in PythonDecimal
- Add:
TradeSucces.get_human_price(reverse_token_order: bool)
- Add USDC (Centre FiatToken)
- Add EIP-712
- Add EIP-3009
- Add
transferWithAuthorization
andreceivedWithAuthorization
- Add Enzyme vault USDC payment forwarder allowing single click purchases (no
approve
step) - Fix: Don't try to
trace_transaction
unless we know we are on Anvil - Add Aave v3 loan support in
eth_defi.aave_v3.loan
module
- Add: Enzyme's FundValueCalculator contract as part of the deployment
- Fix: Excessive log output if
__repr__
on GraphQLReorganisationMonitor - Fix: Aave deployer tests fail on Github
- Add Aave v3 deployer support in
eth_defi.aave_v3.deployer
module - Add Solidity library linking support for Hardhat-based deployments in
eth_defi.abi.get_linked_contract
- Add: More logging and better error messages to some parts
- Add:
figure_reorganisation_and_new_blocks(max_range)
to catch situations you somehow feed a too long block range to scan - Add:
analyse_trade_by_receipt(input_args)
to analyse the success of Uni v3 trades when trading on Enzyme
- Fix: Use
web3.eth.wait_for_transaction_receipt
in appropriate places - Add: Helper functions to interact with
UniswapV3PriceHelper
- Add: TQDM progress bar support for event reading in the form of
eth_defi.event_reader.progress_update.TQDMProgressUpdate
- Add: Enzyme price feed removal support
- Add:
eth_defi.chain.fetch_block_timestamp
shortcut method - Fix: Web3 6.0 compatibility
- Fix: Better error message when reorganisation monitor is missing blocks
- Fix:
EnzymePriceFeed.primitive_token
resolution fails on some Enzyme tokens on Polygon
- Add argument
Vault.fetch(generic_adapter_address)
- Fix: Handle
HexBytes
event signatures for Web3 6.0 - API change: No longer allow
HexBytes
results to fall through inLogResult
to make sure all event readers get the data in the same format
- Dependency version updates
- Fix: Various fixes to transaction receipt handling
- Fix: Report the revert reason why Uniswap v2 pair deployment fails
- Fix:
eth_defi.uniswap_v2.analysis.analyse_trade_by_receipt
supports complex compounded transactions - Add:
eth_defi.deploy.get_registered_contract
for unit test contract diagnosis - API change:
VaultControllerWallet.sign_transaction_with_new_nonce
has new API - API change: Use bound
ContractFunction
inEnzymeVaultTransaction
- Reorganise ABI compilation process, source dependencies and
eth_defi.abi
folder layout - In-house contracts are now compiled using Foundry
- Add
VaultSpecificGenericAdapter.sol
for Enzyme - Add
eth_defi.enzyme.vault_controlled_vallet
- Add
eth_defi.tx.AssetDelta
- Add
Vault.fetch_denomination_token_usd_exchange_rate
- Add initial Chainlink support
- Add eth_defi.reader.multithread.MultithreadEventReader for easy to use high-speed Solidity event reading
- Add Enzyme's price feeds
- Add Enzyme's
Vault.fetch
- Add
eth_defi.utils.to_unix_timestamp
- Add
eth_defi.reorganisation_monitor.create_reorganisation_monitor
- Rename:
eth_defi.enzyme.events.Withdrawal
->Redemption
- Optimize
get_contract
with improved caching - Add preliminary
assert_call_success_with_explanation
- but looks like Anvil support is still missing, so currently hacked together
- Add
EnzymeDeployment.fetch_vault
- Add
Vault.fetch_deployment_event
- Add
BroadcastFailure
exception - Fix token sorting condition in Uniswap v2 pair deployment
- Fix Anvil launch to do three attempts by default if the process fails to launch
- Web3.py 6.0 release API fixes
- Add API call count middleware
- Fix: Clean accidentally released breakpoint code in revert middleware
- Added a script for verifying the integrity of your EVM JSON-RPC node data
- Added
TunedWeb3Factory(thread_local_cache)
option for more performant web3 connection when using thread pooling
- Migrate to Web3.py 6.0. Notable Web3.py API changes:
toChecksumAddress
->to_checksum_address
processReceipt
->process_receipt
web3.contract.Contract
->web3.contract.contract.Contract
solidityKeccak
->solidity_keccak
decode_function_input
returns dict instead of tuple
- Support Anvil as the unit test backend ove
EthereumTester
- Anvil is much faster deploy_contract()
tracks deployed contracts and their ABIs so we can print symbolic Solidity stack traces- Print Solidity stack traces of failed transactions using
print_symbolic_trace()
andtrace_evm_transaction()
- Adding initial Enzyme Protocol APIs
- Adding dHEDGE Protocol ABI files and compile commands
- Add
revert_reason_middleware
- Documentation restructure
- Add Ethereum to
AAVE_V3_NETWORKS
configuration - Fix price calculation in Uniswap v3
analysis.py
- Replace
ganache
withanvil
as the mainnet fork solution. Anvil is much more stable than Ganache what comes to JSON-RPC. Anvil is much faster. You can now call fork_network_anvil that is a drop-in replacement for old Ganache basedfork_network
. - Move internal test suite to use Anvil instead of Ganache. This allows us to remove
flaky
decorators on tests. - Add
analysis.py
for Uniswap V3 and relevant tests - Add
mock_partial_deployment
function for V3 - Abstract
TradeResult
,TradeSuccess
, andTradeFailure
out of Uniswap V2 and into eth_defi.trade, since also used in Uniswap V3 - Add Uniswap V3
increase_liquidity()
anddecrease_liquidity()
by @pbharrin
- Add Uniswap V3 decode_path method
- Uniswap v3 fixes
- Add middleware support for Avalanche C-chain
- Fix retry sleep not reset between function calls in
exception_retry_middleware
- Fix
extract_timestamps_json_rpc
to be compatible with both middlewared and non-middlewared JSON-RPC request format (string hex numbers vs. converted ints).
- Attempt to overcome
ValueError: {'message': 'Internal JSON-RPC error.', 'code': -32603}
if served by a Pokt relay
has_graphql_support
made more robust
- Retry middleware fine tuning
- Off by one fix in read_events_concurrent max block range
- More event reader test coverage
- Better test and exception coverage if bad
extract_timestamps
is passed while reading events. This prevents the library user to write a bad timestamp provider function.
- Fix
filter
andevent
assert inread_events_concurrent()
- Fix: Duplicate events appearing when using the concurrent event reader
- Added
ReorganisationMonitor
andChainReorganisationDetected
to deal with unstable chain tips when doing event ignestion - Added
uniswap-v2-pairs-swap-live.py
example that shows real-time swaps happening on QuickSwap (Polygon) in a terminal - Add
has_graphql_support()
to detect GraphQL interface on GoEthereum - Add
GraphQLReorganisationMonitor
for very fast downloading of block headers and timestamps using GoEthereum /graphql API
- Added
generate_fake_uniswap_v2_data()
to generate synthetic Uniswap v2 trade feeds - Improved
PairDetails
API, addedget_current_mid_price()
- Add
PairDetails.checksum_free_address
to shortcut getting lowercased Ethereum address - Added
convert_jsonrpc_value_to_int()
to deal differences between real JSON-RPC and EthereumTester - Add
install_chain_middleware()
andinstall_retry_middleware()
- Add
measure_block_time()
- Add multiple contract address filtering to the event reader
- Add
fetch_deployment
for Uniswap v3 - Add
swap_with_slippage_protection
for Uniswap v3
- Add new PriceOracle types for unit testing
- Adding Trader Joe compatibility. Unlike other clones, Trader Joe uses
Router.WAVAX
insteadRoueter.WETH
for the native token variable. - Document BNB Chain "Limits exceeded" error - BNB Chain eth_getLogs have been disabled on public endpoints
- Moving
nbsphinx
to optional dependency, was as core dependency by accident
- Feature: generic price oracle implementation with configurable price function
- Feature: time weighted average price (TWAP) price function for price oracle
- Feature: price oracle implementation for Uniswap v2 and v3 pools
- Feature:
update_live_price_feed
for real-time Uniswap v2 and v3 price oracles - Feature:
fetch_pair_details
to get info on Uniswap v2 pairs - API change: Refactored event filter implementation to
eth_defi.reader.filter
- Fix: Python 3.9 or later required
- Feature: Added Uniswap V3 price helper (both single hop and multi hops)
- API change: Moved Uniswap V3
add_liquidity
to its own function - Fix: Correct slippage calculation to match official Uniswap v2 SDK
- Fix: Microsoft Windows compatibility: Always use utf-8 when reading and writing text files
- Feature: High speed Solidity events / eth_getLogs fetching and decoding
- Feature: JSON-RPC retry middleware with sleep and backoff
- Feature: Added decode_signed_transaction with EIP-2718 and EIP-2930 tx support
- Feature: Added
estimate_buy_received_amount_raw
andestimate_sell_received_amount_raw
- Fix: pairFor could give a wrong address for trading pair
- Fix: Cosmetic API improvements and fixes, with more asserts
- API change: Split
analyse_trade
->analyse_trade_by_hash
andanalyse_trade_by_receipt
- API change: Rename module
txmonitor
->confirmation
- Update web3.py dependency to 5.28.0
- Feature: Added Uniswap v2 swap function with slippage protection
- Feature: Added support for
fee
andslippage
to Uniswap v2 price calculations - Feature: Added Uniswap v2 pair liquidity fetch
- Feature: Added support for three-way swap (swap through an intermediate token) and price calculations
- Feature: Added support for transfer fee, token tax and honeypot checks
- API change: Moved
get_amount_in
andget_amount_out
toUniswapV2FeeCalculator
class - Fix: Improve exception message when transactions timeout
- Feature: Added ERC-20 transfer tutorial
- Completed migration to new web3-ethereum-defi package name
- Feature: Added revert reason extraction for failed transactions
- Feature: Added
eth_defi.gas.node_default_gas_price_strategy
to support BNB Chain - Fix: BNB Chain compatibility fixes because of brokeness in Ethereum JSON-RPC
- Fix: Ganache compatibility fixes because of brokeness in Ethereum JSON-RPC
- Fix: Wait 10 seconds instead of 5 seconds to ganache-cli to launch, as the latter is too slow for some computers
- Fix: Optimize
wait_transactions_to_complete
- API change: Created a separate
broadcast_transactions
function
- Feature: Added initial Uniswap v3 testing support
- Feature: Allow override init code hash for
eth_defi.uniswap_v2.fetch_deployment
- Feature: Faster failing if ganache-cli RPS port is already taken
- Feature: Added
fetch_erc20_balances_by_token_list
- Feature: Added
get_transaction_data_field
- API change:
uniswap_v2
oruniswap_v3
are now their respective submodules - API change: Rename
fetch_erc20_balances
->fetch_erc20_balances_by_transfer_event
- API change: Removed
fetch_erc20_balances_decimal_by_transfer_event
- API change: Rename
convert_to_decimal
->convert_balances_to_decimal
- Fix:
fetch_erc20_balances
: User friendly error message when trying to grab a too big chunk of transfers once - Fix: Use
london
hard fork by default forfork_network
- Feature: eth_defi.ganache module to support ganache-cli mainnet forks
- Feature:
HotWallet.get_native_currency_balance
to easier management of hot wallet accounts - Feature:
HotWallet.from_private_key
to easier management of hot wallet accounts
- Rename module:
eth_defi.portfolio
->eth_defi.balances
- Fix: Documentation now builds correctly with body text for functions
- Fix: ERC-20 balances when there exist debit transactions
- Feature: ERC-20 token deployments with custom decimals
- Feature: Wallet ERC-20 token holdings analysis
- Feature: Scaleable Solidity event fetcher
- Feature: Uniswap v2 price impact and fee estimator
- Feature: Fetch Uniswap deployment from on-chain data
- Feature: ERC-20 detail fetcher
- Feature: London hard fork compatible gas estimator
- Feature: Hot wallet with nonce management and batch sending
- Feature: Sending and confirming transactions in batches
- Renamed package to
eth-hentai
- Initial release