FAQ
Last updated
Last updated
wth3l-tiaaa-aaaap-aa5uq-cai
prod 1
xywyw-qiaaa-aaaad-aaema-cai
prod 2
tysiw-qaaaa-aaaak-qcikq-cai
staging
Choose your canister
Select allowed token in "Top Up" modal
Make deposit
On the same page you can your current balance on current canister:
Press the button "Generate API key"
Copy & Use it OR construct your request in example module
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));
};
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