# Oracle

# Votes

Terra.oracle.votes(validator=None, denom=None)

Query the currently casted votes for the exchange rate of LUNA, filterable by validator or denom.

# all prevotes for UKRW
terra.oracle.votes

# Parameters

At least one of the following must be provided.

ValAddress
validator
optional

Validator operator address to query votes for.


Denom
denom
optional

Denomination to query votes for.


# Returns

ExchangeRateVote[]

Current list of outstanding votes cast by the validator for the denomination.

# Prevotes

Terra.oracle.prevotes(validator=None, denom=None)

Query the currently casted prevotes, filterable by validator or denom.

# all prevotes for UKRW
terra.oracle.prevotes

# Parameters

At least one of the following must be provided.

ValAddress
validator
optional

Validator operator address to query prevotes for.


Denom
denom
optional

Denomination to query prevotes for.


# Returns

ExchangeRatePrevote[]

Current list of outstanding prevotes cast by the validator for the denomination.

# Exchange Rate

Terra.oracle.exchange_rate(denom=None)

Get the Oracle module's current registered exchange rate for LUNA for the specified denomination. If no denomination is specified, returns exchange rates for all denominations.

terra.oracle.exchange_rate("ukrw") # -> Coin
terra.oracle.exchange_rate()["ukrw"] # -> same thing

# Parameters

Denom
denom
optional

Denomination in which to get the exchange rate of LUNA.


# Returns

Coins

Current exchange rate of LUNA for all denominations.

Coin

If denom was provided, for just that denomination.

# Active Denoms

Terra.oracle.active_denoms()

Get the list of currently active denominations (those who have had votes beyond vote threshold parameter).

denoms = terra.oracle.active_denoms()
"umnt" in denoms # -> True if MNT is being voted on

# Returns

Set[Denom]

Current active denominations.

# Feeder Address

Terra.oracle.feeder_address_for(validator)

Get the registered feeder address for a validator.

terra.oracle.feeder_address_for()

# Parameters

ValAddress
validator
optional

Validator's operator address.


# Returns

AccAddress

Address of the validator's current registered feeder.

# Misses

Terra.oracle.misses(validator)

Get the number of missed vote periods for a validator over the current slash window.

terra.oracle.misses_for("terra...")

# Parameters

ValAddress
validator
optional

Validator's operator address.


# Returns

int

Number of missed votes incurred over current slash window.

# Module Params

Terra.oracle.params(key=None)
Get the current values of the Oracle module's parameters.
terra.oracle.params() # -> dict
terra.oracle.params("vote_period") # -> int

# Parameters

str
key
optional

One of "vote_period", "vote_threshold", "reward_band", "reward_distribution_window", "whitelist", "slash_fraction", "slash_window", or "min_valid_per_window".


# Returns

JiguBox with the following keys:

int
vote_period

Number of blocks that define the period over which new votes must be submitted for the exchange rate of LUNA.

Dec
vote_threshold

Ratio of voting power that must be reached for a denomination to be considered "active."

Dec
reward_band

The ratio of the band around the weighted median of the voted exchange rates whose voters are eligible for rewards. Votes that reported exchange rates that lie beyond this band are considered misses.

int
reward_distribution_window

Number of blocks that define the period over which oracle rewards from non-missed Oracle votes accrue. They are disbursed at the end of these periods.

Denom[]
whitelist

List of active denominations that must be voted on.

Dec
slash_fraction

Percetange of stake slashed once per slash window.

int
slash_window

Number of blocks that define the period over which slashing penalties for missing votes are incurred.

Dec
min_valid_per_window

Minimum percentage of valid (non-miss) exchange rate votes per slash window.

Updated on: 3/4/2020, 7:47:53 AM