Fetch Quote
The Shogun SDK enables anyone to broadcast intents and receive optimal execution routes from a host of different liquidity venues. The SDK allows you to compose the intent lifecycle how you see fit. You can choose to handle the entire lifecycle through the SDK via direct execution or you just request quotes and handle execution yourself.
Requesting the Optimal Execution Route
You can request the best route for a particular intent by calling the fetchQuote
method using the client you intialized.
Available parameters
The following parameters enable you to customize your quote request:
srcChain
Chain of the chain the user is providing from funds from.
Number (required)
destChain
Chain of the chain the user is wants to have their funds received on.
Number (required)
srcToken
Contract address of the token the user is providing for the trade.
String (required)
destToken
Contract address of the token the user is requesting to receive for the trade.
String (required)
amount
Amount of srcToken
the user is providing for the trade.
String (required)
senderAddress
Wallet address initiating the transaction.
String (required)
affiliateWallet
The wallet address that will receive the affiliate fee. Use your own wallet address to earn a portion of the transaction.
String (optional)
affiliateFee
The percentage (as a string) of the transaction to be routed to the affiliate wallet. For example, "1" represents a 1% fee.
String (optional)
slippage
The maximum price slippage youβre willing to tolerate for the swap. A 0.5 value allows for a 0.5% change in price before the transaction reverts.
Number (required)
destinationAddress
The wallet address where the assets will be sent. Often the same as senderAddress, but can differ.
String (required)
dynamicSlippage
When set to true, slippage tolerance is automatically adjusted based on current market conditions. Especially useful for networks like Solana, where price volatility can vary.
Bool (optional)
Now that you're able to find the optimal execution route, you can fully execute the transactions:
Last updated