QuickNode Token Pricing Marketplace Add-On
Now you can utilize Odos' DeFi native prices through the convenience of your existing Quicknode RPC integrations! No more fiddling with custom asset IDs or low-fidelity prices heavily influenced by centralized exchanges. The Odos token price plugin will give you the real-time, executable price of an asset based on current market conditions and the highest decentralized exchange coverage in the industry. Chain-specific prices work seamlessly with other native EVM RPC calls through your existing Quicknode RPC endpoint.
FAQ
Question | Answer |
---|---|
How do I know which assets are supported? | You can use our curated token whitelists to get addresses at https://api.odos.xyz/info/tokens/{chain_id} , or try passing the address of any ERC-20 and Odos will have a price if liquidity is available! |
How to add to your RPC endpoint
Simply enable the Token Pricing API by Odos Add-On to start using the odos_tokenPrices JSON RPC method over your existing node endpoint.
Quickstart
The Token Pricing API is accessible via the odos_tokenPrices
RPC method on your existing node endpoint once the add-on has been enabled. The call takes 1 argument in position 0 of the params
field of a standard RPC request body, which is a JSON object of the shape
{
"tokenAddrs": ["0x0000000000000000000000000000000000000000"]
}
where tokenAddrs
is a list of strings containing the addresses of the assets you are retrieving prices for. The number of prices you can fetch at once is determined by the batch size in your plan.
Feature | Essential | Startup | Pro | Plus |
---|---|---|---|---|
Batching | None | None | None | None |
Receives 1 price per request | Yes | Yes | Yes | Yes |
Receives up to 3 prices per request | No | Yes | Yes | Yes |
Receives up to 10 prices per request | No | No | Yes | Yes |
Receives up to 60 prices per request | No | No | No | Yes |
- Python
- JavaScript
- Rust
- bash
from web3 import Web3
w3 = Web3(Web3.HTTPProvider("https://YOUR_QUICKNODE_ENDPOINT_HERE.com"))
resp = w3.provider.make_request(
'odos_tokenPrices',
[{"tokenAddrs":["0x0000000000000000000000000000000000000000"]}]
)
print(resp)
const ethers = require("ethers");
(async () : {
const provider = new ethers.providers.JsonRpcProvider("https://YOUR_QUICKNODE_ENDPOINT_HERE.com");
const network = await provider.send(
"odos_tokenPrices",
[{"tokenAddrs":["0x0000000000000000000000000000000000000000"]}]
);
console.log(network);
})();
require 'eth'
client = Eth::Client.create "https://YOUR_QUICKNODE_ENDPOINT_HERE.com"
payload = {
"id":1,
"jsonrpc":"2.0",
"method":"odos_tokenPrices",
"params": [{"tokenAddrs":["0x0000000000000000000000000000000000000000"]}]
}
response = client.send(payload.to_json)
puts response
curl https://YOUR_QUICKNODE_ENDPOINT_HERE.com \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"odos_tokenPrices","params": [{"tokenAddrs":["0x0000000000000000000000000000000000000000"]}],"id":1,"jsonrpc":"2.0"}'
Advanced Features
All prices are returned in USD by default, but we can configure token prices in any currency of your choosing (excludes Essential Plan customers).
Please send an email to [email protected] with details of your request.
Need Help?
- For a deeper dive, the API Endpoints page is your go-to resource, providing an extensive look at all available endpoints, parameters, and more.
- For technical assistance, visit our Support Page.
- Join the Odos Discord Community to connect with other developers and our team.