TrustedStablecoinOracle

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

class TrustedStablecoinOracle[source]

Return a price for a token we trust we can always redeem for 1 USD.

Attributes summary

STABLE_USD

Methods summary

__init__()

calculate_price([block_number])

Get a price for the current block.

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