Skip to main content
The following examples leverage Viem, a Typescript library similar to ethers.js that simplifies the process of interacting with the Oracle contract.
Attention: Follow the examples carefully. It is recommended that you first test and deploy your code on Testnet before using Pricing Sylo on Mainnet.

Initial configuration

The account used will need sufficient balance to deposit in SYLOs and pay the associated gas fees.
All values used in these examples are for Porcini, The Root Network testnet.

Typical User Flow

Step 1: Deposit SYLO tokens to the Oracle.
Step 2: Create a price data request for a token.
Below is a table of asset IDs for the Oracle contract on Porcini. These asset IDs are used to identify what token to retrieve price data for. Step 3: Get the response data once it’s available.
Complete Workflow
It is useful to note that retrieving the requestId can be done in a few different ways. In this particular example, the Responded event indicates that the Daemon has processed the request and that the token data is ready to be read.

Oracle ABI