Skip to main content
logo

base

Chain-agnostic logics for the Oracle contract.

InstantiateMsg

json
oracle.rs
Copy

_4
{
_4
"owner": "...",
_4
"base_denom": "..."
_4
}

ParamsTypeDescription
ownerStringThe contract's owner, who can update config and price sources
base_denomStringThe asset in which prices are denominated in

ExecuteMsg

set_price_source

Specifies the price source to be used for a coin.

NOTE

The input parameters for method are chain-specific.

json
oracle.rs
Copy

_8
{
_8
"set_price_source": {
_8
"denom": "...",
_8
"price_source": {
_8
// PriceSource (chain-specific)
_8
}
_8
}
_8
}

ParamsTypeDescription
denomStringDenom of the asset
price_sourceTCoin's price source. See OsmosisPriceSource for an example of a chain specific integration.

remove_price_source

Removes price source for a coin.

json
oracle.rs
Copy

_5
{
_5
"remove_price_source": {
_5
"denom": "..."
_5
}
_5
}

ParamsTypeDescription
denomStringDenom of the asset

update_owner

Manages admin role state.

json
address_provider.rs
Copy

_7
{
_7
"update_owner": {
_7
"propose_new_owner": {
_7
"proposed": "..."
_7
}
_7
}
_7
}

QueryMsg

config

Queries contract config.

json
oracle.rs
Copy

_3
{
_3
"config": {}
_3
}

Returns a Config<String> response.

price_source

Queries a coin's price source.

NOTE

The response type of this query is chain-specific.

json
oracle.rs
Copy

_5
{
_5
"price_source": {
_5
"denom": "..."
_5
}
_5
}

ParamsTypeDescription
denomStringDenom of the asset

PriceSourceResponse<String>

json
oracle.rs
Copy

_6
{
_6
"denom": "...",
_6
"price_source": {
_6
// PriceSource (chain-specific)
_6
}
_6
}

ParamsTypeDescription
denomStringDenom of the asset
price_sourceTCoin's price source. See OsmosisPriceSource for an example of a chain specific integration.

price_sources

Enumerates all coins' price sources.

NOTE

The response type of this query is chain-specific.

json
oracle.rs
Copy

_6
{
_6
"price_sources": {
_6
"start_after": "...",
_6
"limit": 5
_6
}
_6
}

ParamsTypeDescription
start_afterOption<String>Denom to start after.
limitOption<u32>Amount of price sources to list.

Returns a vector that contains objects of type PriceSourceResponse<String>.

price

Queries a coin's price.

NOTE

This query may be dependent on block time (e.g. if the price source is TWAP), so may not work properly with time travel queries on archive nodes.

json
oracle.rs
Copy

_5
{
_5
"price": {
_5
"denom": "..."
_5
}
_5
}

ParamsTypeDescription
denomStringDenom of the asset

PriceResponse

json
oracle.rs
Copy

_4
{
_4
"denom": "...",
_4
"price": "1.27"
_4
}

ParamsTypeDescription
denomStringDenom of the asset
priceDecimalPrice of the asset

prices

Enumerates all coins' prices.

NOTE

This query may be dependent on block time (e.g. if the price source is TWAP), so may not work properly with time travel queries on archive nodes.

json
oracle.rs
Copy

_6
{
_6
"prices": {
_6
"start_after": "...",
_6
"limit": 5
_6
}
_6
}

ParamsTypeDescription
start_afterOption<String>Price to start after.
limitOption<u32>Amount of prices to list.

Returns a vector that contains objects of type PriceResponse.