FAQ

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?

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

How I can generate API key?
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

Last updated