Initia (Closed Testnet)
  • Reminder
    • ⛔Confidentiality Disclaimer
  • WELCOME TO CLOSED TESTNET
    • Welcome to Closed Testnet
  • About Initia
    • What is the Initia Platform?
      • Architecture
        • Layer 1
        • Layer 2
      • Aligning Initia (coming soon!)
    • InitiaDEX
    • Enshrined Liquidity and Staking
  • Developers
    • Initiad
      • Download Initiad
      • Using Initiad
    • Get INIT token
    • Build your own Minitia
      • Simple Minitia Setup
      • Connect Minitia to L1
        • OPinit Stack
          • OPinit Module
          • OPinit Bots
        • Relayer
          • Fetching Oracle Prices
    • Virtual Machines
      • MoveVM
        • Interact with CLI
      • WasmVM
    • Contracts
      • Move Contracts
      • CosmWasm Contracts
      • EVM Contracts (Coming Soon)
    • Oracles
  • Initia Developer Tutorials
    • 1. Create account
    • 2. Send Move coin
    • 3. Interchain Message
    • 4. Create your own Move coin
    • 5. Create your own Move NFT
    • 6. Build and Publish Contracts
      • Move Module
      • CosmWasm Contract
  • Core Applications
    • Core Applications
      • Wallet
      • Initia App
      • Usernames
      • Initia Scan
  • Node Operators
    • Running Initia Node
      • Prerequisites
      • Oracle
      • Boot an Initia Node
      • Connect to Initia Network
      • Cosmovisor Guide
    • Configuring Initia Validator
  • References and Tools
    • Move Language
    • Rust Language (CosmWasm)
    • Closed Testnet Chain Information
    • Chain Parameters
    • Initia.js
    • API Docs
    • API Docs (minimove)
    • API Docs (miniwasm)
    • Whitelisted Tokens and Pairs
Powered by GitBook
On this page
  • Overview
  • Binaries
  • Building From Source
  • Running The Sidecar
  1. Node Operators
  2. Running Initia Node

Oracle

Details on installing and running the oracle sidecar process.

PreviousPrerequisitesNextBoot an Initia Node

Last updated 1 year ago

Overview

The Slinky oracle was developed by Skip and is integrated directly into the Initia layer 1. It has two components:

  1. An on-chain integration which fetches prices from the sidecar each block, submits them to the chain via vote extensions, and aggregates prices across all participating validators.

  2. A sidecar process which is responsible for querying price providers and supplying prices to the on-chain module.

Binaries

We will provide pre-compiled binaries in the future. Please build from source for now.

Building From Source

Clone the slinky repository.

git clone git@github.com:skip-mev/slinky.git
cd slinky
make build

The output binary will be located in the build directory, ./build/oracle.

Running The Sidecar

Config Setup

To run the oracle sidecar you need valid configuration files for both the oracle and the metrics components. The oracle binary accepts flags for each configuration file. The following are sane defaults for the current Initia Devnet.

metrics.toml
###############################################################################
###                              Metrics                                    ###
###############################################################################
# MetricsConfig TOML Configuration

# PrometheusServerAddress is the address of the Prometheus server that the oracle will expose metrics to.
prometheus_server_address = "localhost:8000"

# OracleMetrics is the config for the oracle metrics
[oracle_metrics]

# Enabled indicates whether metrics should be enabled
enabled = true

# AppMetrics is the config for the app metrics
[app_metrics]
# Enabled indicates whether metrics should be enabled
enabled = false

# ValidatorConsAddress is the validator's consensus address
validator_cons_address = ""

oracle.toml
###############################################################################
###                               Oracle                                    ###
###############################################################################
# OracleConfig TOML Configuration

# Enabled specifies whether the side-car oracle needs to be run.
enabled = true

# InProcess specifies whether the oracle is currently running in-process (true) or out-of-process (false).
in_process = true

# ClientTimeout is the time that the client is willing to wait for responses from the oracle.
client_timeout = "2s"  # Replace "2s" with your desired timeout duration.

# RemoteAddress is the address of the remote oracle server (if it is running out-of-process).
remote_address = ""

# UpdateInterval is the interval at which the oracle will fetch prices from providers.
update_interval = "2s"  # Replace "2s" with your desired update interval duration.

# Production is the flag that determines whether the oracle is running in production mode.
production = true

# Providers is the list of providers that the oracle will fetch prices from.

[[providers]]
name = "coinbase"
path = "config/local/providers/coinbase.json"
api.enabled = true
api.timeout = "500ms"  # Replace "500ms" with your desired timeout duration.
api.interval = "1s"  # Replace "1s" with your desired update interval duration.
api.max_queries = 5  # Replace "5" with your desired maximum number of queries per update interval.

[[providers]]
name = "coingecko"
path = "config/local/providers/coingecko.json"
api.enabled = true
api.timeout = "500ms"
api.interval = "1s"
api.max_queries = 1 # CoinGecko is atomic so it can fetch all prices in a single request.


# Currency Pairs

[[currency_pairs]]
base = "BITCOIN"
quote = "USD"

[[currency_pairs]]
base = "ETHEREUM"
quote = "USD"

[[currency_pairs]]
base = "ATOM"
quote = "USD"

[[currency_pairs]]
base = "SOLANA"
quote = "USD"

[[currency_pairs]]
base = "POLKADOT"
quote = "USD"

[[currency_pairs]]
base = "DYDX"
quote = "USD"

[[currency_pairs]]
base = "ETHEREUM"
quote = "BITCOIN"

Starting The Sidecar

Starting the oracle side car is done through the binary.

oracle -oracle-config-path oracle.toml -metrics-config-path metrics.toml -host <optional-host> -port <optional-port>

The default host and port are localhost:8080 for the GRPC server and localhost:8000 for the prometheus metrics endpoint, if enabled.

Validating Prices

To learn more about the oracle, visit the Slinky repository at .

The path component of a provider needs to provide the mapping between the canonical base and quote names and their equivalent in the given provider API. The proper mapping files are all located in Slinky's provider directory . If you execute the binary at the root of the Slinky directory, the above config is valid. Otherwise you will need to provide the proper path to the JSON mapping files.

After starting the oracle you should see prices being requested successfully from the provider sources. You can also optionally run the in the slinky repository via make run-oracle-client.

https://github.com/skip-mev/slinky/
https://github.com/skip-mev/slinky/tree/main/config/local/providers
test client script