# Oracle

# Query

# Exchange Rates of LUNA

terracli query oracle exchange-rates

# Votes

terracli query oracle votes <denom> <validator>

# Prevotes

terracli query oracle prevotes <denom> <validator>

# Active Denoms

terracli query oracle actives

# Feeder Account

terracli query oracle feeder <validator-addr>

# Miss Counter

terracli query oracle miss <validator-addr>

# Aggregate Prevotes

terracli query oracle aggregate-prevote <validator-addr>

# Aggregate Votes

terracli query oracle aggregate-vote <validator-addr>

# Vote Targets

terracli query oracle vote-targets

# Tobin Taxes

terracli query oracle tobin-taxes

# Parameters

terracli query oracle params

# Transaction

# Submit an Exchange Rate Vote

Validators must submit two exchange rate vote transactions to participate in the oracle; a prevote containing the hash of the actual vote in the first vote period, and a vote containing the salt of the hash submitted in the prevote phase to prove honestly. The hash is the leading 20 bytes of the SHA256 hexa string run over the string of the format salt:price:denom:validator-address. i To submit a prevote, run:

terracli tx oracle prevote \
    <salt> \
    <price> \
    <validator_address> \
    --from mykey

After VotePeriod has expired from the submission of the prevote, the voter must submit the actual exchange rate vote. To do so, run:

terracli tx oracle vote \
    <salt> \
    <price>  \
    <validator_address> \
    --from mykey \
    --validator <validator-address>

Where price is the form of Coin 8890.32ukrw

Given that oracle votes have to be submitted in a feed over short time intervals (30 seconds), prevotes and votes will need to be submitted via some persistent server daemon, and not manually. For more information on how to do this, read the Exchange Rate Oracle section of the Validator Handbook, and the Oracle Module Specification.

# Delegate Exchange Rate Voting Rights

A voter may also elect to delegate exchange rate voting to another signing key.

terracli tx oracle set-feeder <feeder_address> --from=mykey

where feeder_address is the address you want to delegate your voting rights to. Note that the feeder will still need to submit votes on behalf of your validator in order for you to get credit.