# Price Oracle

Every 30 seconds, all 75 validators in the Kujira active set are required to post a transaction containing the current price for a range of assets, aggregated from a number of sources. This creates an on-chain source of truth which can be queried from a UI front-end, the CLI and also in smart contracts.

### REST

You can fetch all exchange rates here: <https://lcd.kaiyo.kujira.setten.io/oracle/denoms/exchange_rates>

Or just a specific one at eg <https://lcd.kaiyo.kujira.setten.io/oracle/denoms/ATOM/exchange_rate>

### CLI

```
kujirad query oracle exchange-rates
```

### CosmWASM

The kujira-rs package provides queryable bindings to fetch current exchange rates inside your smart contracts:

{% embed url="<https://docs.rs/kujira/0.7.5/kujira/msg/enum.KujiraMsg.html>" %}

```rust
use kujira::querier::KujiraQuerier;
use kujira::query::KujiraQuery;

pub fn query(deps: Deps<KujiraQuery>, env: Env, msg: QueryMsg) -> StdResult<Binary> {
    let q = KujiraQuerier::new(&deps.querier);
    let res = q.query_exchange_rate("ATOM".to_string())?;
    let price = res;
    Ok(to_binary(&price))
}
```

Note that the type signature for a `query` interface that uses this must be&#x20;

```rust
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kujira.app/developers/smart-contracts/oracle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
