# Quotes

Once you've established the tokens you want to trade, and the amount you want to trade, you may want to get a price quote from Dexible to determine current market pricing and fees. The SDK instance has a "quote" property that allows you to get quotes quickly.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
let quote = sdk.quote.getQuote({
    tokenIn, //WETH
    tokenOut, //MATIC,
    amountIn: ethers.utils.parseUnits("20", tokenIn.decimals),
    slippagePercent: .5,
    //optionally set max rounds for the quote
    //maxRounds: 10, 
    //optionall set a max fixed gas price to apply to the quote fees
    //maxFixedGas: ethers.utils.parseUnits("10", 9)
});
```

{% endtab %}

{% tab title="Python" %}

```python
quote = sdk.quote.get_quote(
    token_in=token_in,  # WETH
    token_out=token_out,  # MATIC,
    amount_in=dexible.common.as_units(20, token_in.decimals),
    slippage_percent=.5,
    ## optionally set max rounds for the quote
    # max_rounds=10, 
    ## optionall set a max fixed gas price to apply to the quote fees
    # max_fixed_gas=dexible.common.as_units(10, 9)
)
```

{% endtab %}
{% endtabs %}

Dexible will return an array with two quotes: immediate and recommended, in that order. The immediate quote is for a single round so that you can compare the price impact of your full order on the market. Sometimes, the immediate and recommended quotes will match if Dexible determines it's the best outcome. Both quotes have the following structure:

```
{
    id: 13,
    tokenIn: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
    tokenOut: '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0',
    amountInPerRound: '20000000000000000000',
    amountOutPerRound: '41162692560851345024700',
    maxNetOutput: '41162576735049726266880',
    minNetOutput: '40956418895145987335127',
    networkId: 1,
    rounds: 1,
    costPercentage: 0.0016816710779981633,
    minTotalFees: 68914601737519830000,
    maxTotalFees: 69120759577423570000,
    expires: '2021-07-12T22:06:54.687Z'
 }
```

Most of the fields are self-explanatory. The amounts in/out per round shows what Dexible will send to DEX's as input and what it expects you to receive per round (before fees). Then it deducts fees, including gas costs, and gives you the min/max NET outputs. This is what you can expect to receive after fees are taken from the output side. There is also a cost percentage showing what portion of the proceeds are going towards gas and fees. Finally, the min/max fees are provided to give you an idea of the best/worst case scenarios on cost. Note that in most cases, actual fees will be slightly less than the estimate. This is because we have to use a high gas usage amount when estimating actual transaction costs. This results in estimates with higher gas costs than what will actually be used.

{% hint style="info" %}
Quotes provide min/max amounts due to the slippage applied to the round. In some cases, full slippage may be realized in the market while other times, no slippage will occur. This gives a best/worst case scenario or min/max.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dexible.gitbook.io/dexible-sdk-v1.0/major-sdk-components/order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
