Request Quote

Get calculated quote for protocol logic

post
/v1/protocols/{chainId}/{protocolId}/{logicId}/quote
Path parameters
chainIdintegerRequired

Example: 42161

Example: 42161
protocolIdstringRequired

Example: uniswap-v3

Example: uniswap-v3
logicIdstringRequired

Example: swap-token

Example: swap-token
Body
slippageintegerOptionalExample: 100
Responses
200

OK

application/json
post
/v1/protocols/{chainId}/{protocolId}/{logicId}/quote
200

OK

Provides quote of a Logic, depending on the chain and protocol. See Networks & Protocols.

const getQuote = async (chainId, protocol, logicId, logicParams) => {
    const result = await client.post(`/v1/protocols/${chainId}/${protocol}/${logicId}/quote`, {
        body: logicParams,
    });
    return result.data;
}

const chainId = 1;
const protocol = "uniswap-v3";
const logicId = "swap-token";
const logicParams = {
    input: {
        token: USDC,
        amount: '1000'
    },
    tokenOut: WBTC,
    slippage: 100, // 1%
};

const swapQuote = await getQuote(chainId, protocol, logicId, logicParams);

Quote is used in fields of Logic data. It can be used after building Logic according to the following format:

Logic Params (default)

The result contains a list of chains that looks the following:

Compound Logics Params

The result contains a list of chains that looks the following:

Last updated