Quicknode Pricing 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

QuestionAnswer
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.

FeatureEssentialStartupProPlus
BatchingNoneNoneNoneNone
Receives 1 price per requestYesYesYesYes
Receives up to 3 prices per requestNoYesYesYes
Receives up to 10 prices per requestNoNoYesYes
Receives up to 60 prices per requestNoNoNoYes
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 quicknode.support@odos.xyz with details of your request.