Orally
  • 👋Introduction
  • ❔Why Orally?
  • Orally Price Feed Integration Guide
  • quick-start
    • 🌱Sybil: data feeds
    • 🐬Apollo: request feeds from EVM
    • 🎬Pythia: automation
    • 📖Useful addresses & Links
  • Overview
    • 💡Video Overview
    • ✨How Orally Works
    • 🔐Security and Reliability
    • 📖Glossary
  • Page
  • Problems
    • The Oracle Problem
    • Frozen Oracle Problem
  • 🛰️Use Cases
  • Orally Products
    • 🧙‍♂️Sybil
    • 🦉Pythia
    • 🐬Apollo
    • 🕵️‍♂️Cassandra (DAuth)
    • ▶️Deplhos
    • 📧Hermes
  • Utilised ICP features
    • 🛠️ECDSA threshold Signatures
    • ✴️HTTP Outcalls
    • ⏳ICP timers (heartbeat system)
    • 🌀Random tape
    • 💱Exchange rate canister
  • FAQ
Powered by GitBook
On this page

FAQ

PreviousExchange rate canister

Last updated 4 months ago

Canister ID

wth3l-tiaaa-aaaap-aa5uq-cai

prod 1

xywyw-qiaaa-aaaad-aaema-cai

prod 2

tysiw-qaaaa-aaaak-qcikq-cai

staging

How I can top up balance?
  • Go to

  • Choose your canister

  • Select allowed token in "Top Up" modal

  • Make deposit

On the same page you can your current balance on current canister:

How I can generate API key?
  • Go to

  • Press the button "Generate API key"

  • Copy & Use it OR construct your request in example module

How to get TWAP price from DEX pool?

To request data, use method get_dxr_data_batch.

To request data with proof, use method get_dxr_data_batch_with_proof.

Query Fields:

  • chain_id - on which chain your DEX pool is located

  • pool_addresses[] - array of targeted pool addresses

  • dex_type - the type of DEX (e.g. UniswapV2)

  • bytes (boolean) - to receive bytes response for easy to pass and use on-chain

  • api_key - your API key

  • cache_ttl - cache time interval in seconds (responsible for universal cache, if you want to optimize time and cost between different user or services)

Example:

const SYBIL_CANISTER = 'wth3l-tiaaa-aaaap-aa5uq-cai';
// or xywyw-qiaaa-aaaad-aaema-cai
// or tysiw-qaaaa-aaaak-qcikq-cai (staging)

const parameters = {
  chain_id: 1,
  pool_addresses: ['0x811cfb75567a252bea23474e2ccd1286927bfe0a'],
  dex_type: 'UniswapV2',
  bytes: true,
  cache_ttl: 30,
  api_key: '11e7b24ec171a41d73309f8c0c665667',
}

const query = queryString.stringify(parameters, {arrayFormat: 'bracket'});

const fetchBatchData = () => {
    fetch(`https://${SYBIL_CANISTER}.raw.icp0.io/get_dxr_data_batch?${query}`)
      .then(response => response.json())
      .then(data => console.log(data));
};

const fetchDataWithProof = () => {
    fetch(`https://${SYBIL_CANISTER}.raw.icp0.io/get_dxr_data_batch_with_proof?${query}`)
      .then(response => response.json())
      .then(data => console.log(data));
};
How much it costs?

For requesting dex data with proof (if 1 ICP = 8T cycles && 1 ICP = $12):

  • Price = ±27B cycles = ±0,003375 ICP = ±$0,04

  • Time = 6 sec (fetching data) + 5 sec (generating proof) = 11 sec

For requesting data without proof (if 1 ICP = 8T cycles && 1 ICP = $12):

  • Price = ±687M cycles = ±0,000085875 ICP = ±$0,001

  • Time = 6 sec

https://app.orally.network/sybil
https://app.orally.network/sybil