# Quote object

> Every field of a quote returned by /route and /route/subscribe.

This page is part of the DEX Aggregator docs. The aggregator is at `https://router.intear.tech`, with live quotes at `wss://router.intear.tech/route/subscribe`, on NEAR mainnet only. https://docs.intear.tech/dex-aggregator/llms-full.txt has all of its pages in one file, and https://docs.intear.tech/llms.txt lists every page of the Intear docs.

A quote is one DEX's route for your swap, with everything needed to execute it.

| Field | Type | Description |
| --- | --- | --- |
| `dex_id` | string | The [DEX](https://docs.intear.tech/dex-aggregator/reference/dexs.md) that found this route |
| `estimated_amount` | amount | Expected result. `{"amount_out": "..."}` if you sent `amount_in`, `{"amount_in": "..."}` if you sent `amount_out` |
| `worst_case_amount` | amount | Result at the slippage limit: the minimum output, or the maximum input. Same shape as `estimated_amount`. Equal to `estimated_amount` for Wrap quotes, which have no slippage |
| `discount` | amount, optional | What a [fee discount](https://docs.intear.tech/dex-aggregator/guides/amounts.md#fee-discounts) saves on this route: `{"amount_out": "..."}` of extra output if you sent `amount_in`, `{"amount_in": "..."}` off the input if you sent `amount_out`. Already included in `estimated_amount` and `worst_case_amount`. Missing if the route has no fee discount |
| `execution_instructions` | array | Transactions to sign, in order. See [Executing a route](https://docs.intear.tech/dex-aggregator/guides/executing-routes.md) |
| `token_output` | token ID | Where the output tokens end up. If it differs from your `token_out`, a [second step](https://docs.intear.tech/dex-aggregator/guides/tokens.md#when-token_output-differs) is needed |
| `estimated_gas_usage` | string | Expected gas fee in yoctoNEAR, to show to the user |
| `estimated_max_gas_cost` | string | Gas fee that is attached. A part of it will be refunded |
| `storage_deposits` | string | yoctoNEAR attached to storage deposits. Usually only non-zero the first time the trader uses a token or DEX |
| `fee_amount` | string | What the route's [fee transactions](https://docs.intear.tech/dex-aggregator/guides/executing-routes.md#fee-transactions) pay out of the wallet balance of the input token (wNEAR for NEAR), in its smallest unit. `"0"` without fee transactions. Pass it to [`/route/outcome`](https://docs.intear.tech/dex-aggregator/reference/outcome.md) |
| `signing` | object, optional | The nonce and block hash to [sign the transactions with](#signing). Only with `trader_account_id` and `signing_public_key` in the request, once the key is on chain |
| `needs_unwrap` | boolean | Deprecated, always `false`. Use `token_output` instead |

All token amounts and NEAR amounts are strings, to avoid losing precision in JSON. Parse them as big integers.

## Amount

```json
{ "amount_in": "1000000000000000000000000" }
```
```json
{ "amount_out": "4880007" }
```

Exactly one key, with the raw amount in the token's smallest unit.

## Execution instruction

```json
{
  "NearTransaction": {
    "receiver_id": "wrap.near",
    "actions": [
      {
        "FunctionCall": {
          "method_name": "near_deposit",
          "args": "e30=",
          "gas": 5000000000000,
          "deposit": "1000000000000000000000000"
        }
      }
    ],
    "is_fee_transaction": false
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `receiver_id` | account ID | Contract to send the transaction to |
| `actions[].FunctionCall.method_name` | string | Method to call |
| `actions[].FunctionCall.args` | string | Base64-encoded JSON arguments |
| `actions[].FunctionCall.gas` | number | Gas to attach |
| `actions[].FunctionCall.deposit` | string | yoctoNEAR to attach |
| `is_fee_transaction` | boolean | Pays [referral fees](https://docs.intear.tech/dex-aggregator/guides/referral-fees.md) after the swap. Fee transactions are always the last ones. Send them only if [`/route/outcome`](https://docs.intear.tech/dex-aggregator/reference/outcome.md) of the transactions before them says `charge_fee`. See [fee transactions](https://docs.intear.tech/dex-aggregator/guides/executing-routes.md#fee-transactions) |

`NearTransaction` is the only instruction kind, and `FunctionCall` the only action kind, for now. Treat anything else as an error.

## Signing

```json
{ "nonce": 220599934000001, "block_hash": "5LBYTk45a9txMX73nHumpddPaP4og374UJr14fBRCaqC" }
```

| Field | Type | Description |
| --- | --- | --- |
| `nonce` | number | The nonce of `signing_public_key` as of the latest block when the routes were found. The first transaction takes `nonce + 1` |
| `block_hash` | string | A recent final block's hash |

A [live quote](https://docs.intear.tech/dex-aggregator/guides/live-quotes.md) is only sent again when routes change, so a transaction the key sent since can make `nonce` stale, which is an edge case you might have to handle. A web dApp doesn't need to care, since wallet is the one signing, and if you're integrating DEX Aggregator into a wallet, you probably track nonces anyway, so that shouldn't be an issue, you can just ignore this and sign with whatever nonce / block hash you have.
