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
  • Interacting with Oracles on the L1
  • Get all tickers
  • Fetch Prices
  • Interacting with Oracles from a L2
  1. Developers

Oracles

A guide on fetching and interacting with Initia's Enshrined Oracles via Skip Slinky

PreviousEVM Contracts (Coming Soon)Next1. Create account

Last updated 1 year ago

The Initia L1 has an Enshrined Oracle system powered by Skip Slinky to ensure fresh price data is posted to the chain each block. Slinky is highly performant, tied to the liveness of the chain, and flexible.

Learn more about Slinky

To view current price feeds that are being posted to Initia along with code snippets for initiad, cURL, and JS endpoints visit the Slinky Dashboard built by our friends at Alles Labs.

If there are certain price feeds you'd like to be included, please contact a member of the Initia team.

Interacting with Oracles on the L1

Get all tickers

In order to fetch prices, currency_pair_id is required, which is equal to {Base}/{Quote}.

All currency pairs information including its {Base} and {Quote} are returned by running the command line below.

> curl -X -GET "{lcd-url}/slinky/oracle/v1/get_all_tickers"
# {"currency_pairs":[{"Base":"ATOM","Quote":"USD"},{"Base":"BITCOIN","Quote":"USD"},{"Base":"ETHEREUM","Quote":"USD"}]}

Fetch Prices

Oracle price can be fetched by using the currency_pair_id found from the above section.

Get price by using LCD

> curl -X -GET "{lcd-url}/slinky/oracle/v1/get_price?currency_pair_id={pair_id}" 
# {"price":{"price":"277191500000","block_timestamp":"2024-02-15T06:26:07.884250155Z","block_height":"657085"},"nonce":"637976","decimals":"8","id":"1"}

Get price in MoveVM

use initia_std::oracle

fun get_price(pair_id: String) {
    let (price, update_at, decimals) = oracle::get_price(pair_id);
    ...
}

Interacting with Oracles from a L2

LCD addresses used in this guide can be found in section.

Closed Testnet Chain Information
Skip Slinky Docs
Skip Slinky GitHub Repo
Slinky Oracle Dashboard
Logo