BasePriceOracle

Documentation for eth_defi.price_oracle.oracle.BasePriceOracle Python class.

class BasePriceOracle[source]

Base class for price oracles.

Methods summary

__init__()

calculate_price([block_number])

Get a price for the current block.

abstract calculate_price(block_number=None)[source]

Get a price for the current block.

Parameters

block_number (Optional[int]) – Hint of what is the current block. We do not support prices for historical blocks, but we may cache the result of the previous block calculation for speedups.

Return type

decimal.Decimal