Broadcasting Intents
Submit your intents and receive all possible solutions for the best execution route.
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 utilizing the getRoute
function.
Available parameters
The following parameters enable you to customize your route request:
srcChain
Chain ID of the chain the user is providing from funds from.
number (required)
destChain
Chain ID 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)
destAddress
Contract address of the receiving wallet for the trade.
string (required)
addContractCall
Contract call information for transaction to execute after the specified trade.
ContractCall (optional)
Now that you're able to find the optimal execution route, you can fully execute the transactions:
Last updated