Decentralized Exchanges
Some common tasks relating to Decentralized Exchanges and DeFi.
Jupiter Exchange Aggregator
Users can fetch data from the Jupiter Exchange Aggregator. This can be an effective tool for quoting assets traded on Solana.
Raydium
Raydium is an active hub for DeFi activity on Solana, and Switchboard allows you to quote assets from its Concentrated and Standard pools. All you need is a pool address.
The following is an example using Raydium to quote SLERF/SOL, and converting to its USD value using a Pyth task with SOL/USD.
Orca
You can pull exchange rates from Orca (Solana AMM). Plugging in any of these pools will yield the resulting price.
Meteora
You can read in prices from Meteora using a meteoraSwapTask
. You can use it to pull in exchange rates from DLMM pools and standard pools.
Sanctum
The LST protocol on Solana, Sanctum, is also supported. This task is useful for users who want to bring fair Solana LST prices into their protocols through Switchboard.
Uniswap
Uniswap is probably the most recognized AMM that exists. Switchboard enables users to pull prices from the protocol, along with clones on other chains.
Using the uniswapExchangeRateTask
, users can bring in exchange rates from Uniswap V2 and Uniswap V3, along with any Uniswap-ABI-compatible protocols (/Uniswap clones on other chains).
Here's an example of a Uniswap Task pulling data from the glyph.exchange protocol, on Core, which is a Uniswap V2 fork.
In the same task for Uniswap V3, a Quoter address should also be passed. Here's an example from corex.network, a Uniswap V3 clone also on Core.
OpenBook
The OpenBook codebase was the first major CLOB on Solana, and we support it through the serumSwapTask
. The following is an example of pulling a SOL/USDC price:
Last updated