Contents Menu Expand Light mode Dark mode Auto light/dark mode
Web3 Ethereum Defi documentation
Web3 Ethereum Defi documentation
  • API documentation
    • Core API
      • chain
        • has_graphql_support
        • install_chain_middleware
        • install_retry_middleware
      • token
        • create_token
        • fetch_erc20_details
        • TokenDetails
        • TokenDetailError
      • balances
        • convert_balances_to_decimal
        • fetch_erc20_balances_by_token_list
        • fetch_erc20_balances_by_transfer_event
        • DecimalisedHolding
        • BalanceFetchFailed
      • abi
        • decode_function_args
        • encode_function_args
        • encode_function_call
        • encode_with_signature
        • get_abi_by_filename
        • get_contract
        • get_deployed_contract
        • get_transaction_data_field
        • humanise_decoded_arg_data
      • deploy
        • deploy_contract
        • get_or_create_contract_registry
        • register_contract
      • event
        • fetch_all_events
      • gas
        • apply_gas
        • estimate_gas_fees
        • node_default_gas_price_strategy
        • GasPriceMethod
        • GasPriceSuggestion
      • confirmation
        • broadcast_and_wait_transactions_to_complete
        • broadcast_transactions
        • wait_transactions_to_complete
        • ConfirmationTimedOut
      • revert_reason
        • fetch_transaction_revert_reason
        • TransactionReverted
      • hotwallet
        • HotWallet
        • SignedTransactionWithNonce
      • anvil
        • CLI_FLAGS
        • fork_network_anvil
        • launch_anvil
        • make_anvil_custom_rpc_request
        • mine
        • revert
        • sleep
        • snapshot
        • unlock_account
        • AnvilLaunch
        • InvalidArgumentWarning
        • RPCRequestError
      • ganache
        • EVM_DEFAULT
        • fork_network
        • GanacheLaunch
        • InvalidArgumentWarning
        • NoGanacheInstalled
      • middleware
        • DEFAULT_RETRYABLE_EXCEPTIONS
        • DEFAULT_RETRYABLE_HTTP_STATUS_CODES
        • DEFAULT_RETRYABLE_RPC_ERROR_CODES
        • exception_retry_middleware
        • http_retry_request_with_sleep_middleware
        • is_retryable_http_exception
        • raise_on_revert_middleware
      • tx
        • decode_signed_transaction
        • DecodeFailure
      • trace
        • assert_transaction_success_with_explanation
        • print_symbolic_trace
        • trace_evm_transaction
        • SymbolicTreeRepresentation
        • TraceMethod
        • TraceNotEnabled
        • TransactionAssertionError
      • utils
        • is_localhost_port_listening
        • sanitise_string
        • shutdown_hard
    • Uniswap v2 DEX API
      • uniswap_v2.deployment
        • INIT_CODE_HASH_MISSING
        • deploy_factory_sushi
        • deploy_trading_pair
        • deploy_uniswap_v2_like
        • fetch_deployment
        • mock_partial_deployment_for_analysis
        • UniswapV2Deployment
      • uniswap_v2.pair
        • fetch_pair_details
        • PairDetails
      • uniswap_v2.fees
        • estimate_buy_price
        • estimate_buy_price_decimals
        • estimate_buy_quantity
        • estimate_buy_received_amount_raw
        • estimate_sell_price
        • estimate_sell_price_decimals
        • estimate_sell_received_amount_raw
        • UniswapV2FeeCalculator
        • BadReserves
      • uniswap_v2.analysis
        • analyse_trade_by_hash
        • analyse_trade_by_receipt
      • uniswap_v2.utils
        • ZERO_ADDRESS
        • pair_for
        • sort_tokens
      • uniswap_v2.swap
        • swap_with_slippage_protection
      • uniswap_v2.liquidity
        • get_liquidity
        • LiquidityResult
        • UnmatchedToken
      • uniswap_v2.oracle
        • convert_sync_log_result_to_price_entry
        • update_live_price_feed
        • update_price_oracle_with_sync_events_single_thread
        • UniswapV2PriceOracleContext
      • uniswap_v2.token_tax
        • estimate_token_taxes
        • TokenTaxInfo
        • ApprovalFailure
        • OutOfGasDuringSell
        • OutOfGasDuringTransfer
        • SellFailed
        • SwapError
        • TransferFailure
        • TransferFromError
    • Uniswap v3 DEX API
      • uniswap_v3.deployment
        • add_liquidity
        • decrease_liquidity
        • deploy_pool
        • deploy_uniswap_v3
        • deploy_uniswap_v3_factory
        • fetch_deployment
        • increase_liquidity
        • mock_partial_deployment_for_analysis
        • UniswapV3Deployment
      • uniswap_v3.constants
      • uniswap_v3.utils
        • decode_path
        • encode_path
        • encode_sqrt_ratio_x96
        • get_default_tick_range
        • get_max_tick
        • get_min_tick
        • get_nearest_usable_tick
        • get_token0_amount_in_range
        • get_token1_amount_in_range
        • run_graphql_query
        • tick_to_price
        • tick_to_sqrt_price
      • uniswap_v3.liquidity
        • create_tick_csv
        • create_tick_delta_csv
        • estimate_liquidity_depth_at_block
        • get_pool_state_at_block
        • handle_burn_event
        • handle_mint_event
        • TickDelta
      • uniswap_v3.analysis
        • analyse_trade_by_receipt
        • get_input_args
      • uniswap_v3.events
        • decode_burn
        • decode_mint
        • decode_pool_created
        • decode_swap
        • fetch_events_to_csv
        • get_event_mapping
        • TokenCache
      • uniswap_v3.price
        • UniswapV3PriceHelper
      • uniswap_v3.pool
        • fetch_pool_details
        • get_raw_fee_from_pool_address
        • PoolDetails
      • uniswap_v3.swap
        • swap_with_slippage_protection
      • uniswap_v2.oracle
        • convert_sync_log_result_to_price_entry
        • update_live_price_feed
        • update_price_oracle_with_sync_events_single_thread
        • UniswapV2PriceOracleContext
    • Aave v3 API
      • aave_v3.balances
        • aave_v3_get_deposit_balance
        • aave_v3_get_stable_borrow_balance
        • aave_v3_get_variable_borrow_balance
      • aave_v3.constants
        • aave_v3_get_account_address
        • aave_v3_get_json_rpc_url
        • aave_v3_get_network_by_chain_id
        • aave_v3_get_token_name_by_deposit_address
        • AaveNetwork
        • AaveToken
      • aave_v3.events
        • aave_v3_fetch_events_to_csv
        • decode_reserve_data_updated
        • get_event_mapping
        • TokenCache
      • aave_v3.rates
        • aave_v3_calculate_accrued_deposit_interest
        • aave_v3_calculate_accrued_interests
        • aave_v3_calculate_accrued_stable_borrow_interest
        • aave_v3_calculate_accrued_variable_borrow_interest
        • aave_v3_calculate_apr_apy_rates
        • aave_v3_calculate_mean
        • aave_v3_calculate_ohlc
        • aave_v3_filter_by_date_range
        • aave_v3_filter_by_token
        • AaveAccruedInterest
        • AaveAccruedInterests
    • Enzyme protocol
      • enzyme.deployment
        • EnzymeContracts
        • EnzymeDeployment
        • RateAsset
        • EnzymeDeploymentError
      • enzyme.vault
        • Vault
      • enzyme.integration_manager
        • IntegrationManagerActionId
      • enzyme.events
        • fetch_vault_balance_events
        • Deposit
        • EnzymeBalanceEvent
        • Withdrawal
      • enzyme.uniswap_v2
        • prepare_swap
    • Solidity event reader
      • event_reader.reader
        • extract_events
        • extract_events_concurrent
        • extract_timestamps_json_rpc
        • prepare_filter
        • read_events
        • read_events_concurrent
        • ProgressUpdate
        • Web3EventReader
        • BadTimestampValueReturned
        • TimestampNotFound
      • event_reader.logresult
        • LogContext
        • LogResult
      • event_reader.conversion
        • convert_int256_bytes_to_int
        • convert_jsonrpc_value_to_int
        • convert_uint256_bytes_to_address
        • convert_uint256_string_to_address
        • convert_uint256_string_to_int
        • decode_data
      • event_reader.fast_json_rpc
        • patch_provider
        • patch_web3
        • IPCFlaky
      • event_reader.block_header
        • BlockHeader
      • event_reader.block_time
        • measure_block_time
      • event_reader.block_data_store
        • BlockDataStore
      • event_reader.reorganisation_monitor
        • ChainReorganisationResolution
        • GraphQLReorganisationMonitor
        • JSONRPCReorganisationMonitor
        • MockChainAndReorganisationMonitor
        • ReorganisationMonitor
        • BlockNotAvailable
        • ChainReorganisationDetected
        • ReorganisationResolutionFailure
      • event_reader.parquet_block_data_store
        • ParquetDatasetBlockDataStore
        • NoGapsWritten
      • event_reader.csv_block_data_store
        • CSVDatasetBlockDataStore
        • NoGapsWritten
      • event_reader.json_state
        • JSONFileScanState
      • event_reader.web3factory
        • SimpleWeb3Factory
        • TunedWeb3Factory
        • Web3Factory
      • event_reader.web3worker
        • create_thread_pool_executor
        • get_worker_web3
      • event_reader.state
        • ScanState
    • Price oracle
      • price_oracle.oracle
        • time_weighted_average_price
        • BasePriceOracle
        • FixedPriceOracle
        • PriceEntry
        • PriceFunction
        • PriceOracle
        • PriceSource
        • TrustedStablecoinOracle
        • DataPeriodTooShort
        • DataTooOld
        • NotEnoughData
        • PriceCalculationError
    • Data research
      • research.candle
        • convert_to_ohlcv_candles
  • Tutorials
    • ERC-20 token transfer with web3.py
    • EVM JSON-RPC node integrity verifier
    • Uniswap v2 live price with web3.py
    • Uniswap V3 liquidity analysis
    • Uniswap V3 price analysis
    • Uniswap v2 historial swaps and pairs
    • Uniswap v2 reading real-time swaps and new pairs
    • Aave V3 Interest Analysis
  • Developer guide
  • Troubleshooting
  • Related projects
  v: latest
Versions
latest
Downloads
On Read the Docs
Project Home
Builds
Back to top
Edit this page

API documentation

web3-ethereum-defi Python package comes with 100% API documentation coverage.

  • Most APIs have inline code examples for functions and classes

  • For more code examples check out tests folder

  • Core API
  • Uniswap v2 DEX API
  • Uniswap v3 DEX API
  • Aave v3 API
  • Enzyme protocol
  • Solidity event reader
  • Price oracle
  • Data research

Indices and tables

  • Index

  • Module Index

  • Search Page

Next
Core API
Previous
Home
A part of Trading Strategy algorithmic trading suite. Follow us on Twitter.
Contents
  • API documentation
    • Indices and tables