---
title: GetQuote
description: Price a trade and persist it, returning the quote hash a deposit binds to.
openapi: "openapi.json POST /v1/quote"
---
```
rpc GetQuote(QuoteRequest) returns (QuoteResponse)
```
Runs the pricing pipeline, stores the canonical order parameters, and returns their keccak hash. Call it when the user is ready to deposit; use [`PreviewQuote`](/api-reference/preview-quote) for prices that update as they type.
## Request
Source chain name, lowercase. Equal to `dst_chain` for a same-chain swap.
Destination chain name, lowercase.
Source token address. The zero address is the native asset on EVM chains.
Destination token address.
Which side of the trade `amount` fixes and whether the output is guaranteed: `TRADE_TYPE_EXACT_INPUT`, `TRADE_TYPE_EXPECTED_OUTPUT`, `TRADE_TYPE_EXACT_INPUT_GUARANTEED_OUTPUT`, or `TRADE_TYPE_EXACT_OUTPUT`. `TRADE_TYPE_UNSPECIFIED` is rejected. See [Trade types](/concepts/trade-types).
For exact input, the amount to deposit in the source token's base units. For expected output, the desired output in the destination token's base units.
Address receiving on the destination chain, in that chain's address format.
Source-chain address a refund is paid to if the order cannot be fulfilled.
Native asset to deliver on the destination chain, in base units. Empty string for none. Capped by the chain's `max_gas_drop`.
Floor for the destination swap leg, in basis points. Omitted means a tier is chosen for the pair.
Floor for the source swap leg, in basis points.
Referrer addresses and their basis points. Priced into the quote as `referrer_fee`.
Request a gasless quote: the deposit is signed off chain and relayed by the operator, whose gas cost is priced in as `sponsor_gas`. Only for cross-chain quotes from a non-native source token on a chain where `GetChains` reports `gasless: true`. See [SubmitGaslessOrder](/api-reference/gasless).
With `gasless`, charge the relay gas to your partner funding balance instead of the user's output. Requires an `x-api-key` belonging to a funded partner. See [PartnerApi funding](/api-reference/partner#funding).
## Response
`QuoteResponse` is a `oneof` with two cases, `cross_chain` and `same_chain_swap`. Both carry the fields below; `cross_chain` additionally carries the gasless fields.
Keccak hash of the stored order parameters. The deposit carries it, and it identifies the order everywhere afterwards.
Deposit amount in the source token's base units. Echoes the request for exact input; the solved input for expected output.
Expected output in the destination token's base units, net of every fee. On an expected-output quote this can differ from the requested `amount` by a few basis points.
Guaranteed floor. A fulfillment delivering less does not land.
Slippage actually applied, which may differ from the request.
Itemized costs. See [types](/api-reference/types#feebreakdown).
Contract the deposit must be sent to. Program id on Solana.
The full bound parameter set. Needed to build the deposit call. See [types](/api-reference/types#orderparams).
Notional input value in USD micros. Absent when a price is unavailable.
Notional output value in USD micros. Absent when a price is unavailable.
Estimated seconds from deposit to fulfillment, the median over recent orders on the same chain pair and route type. Absent when there is no history and no configured default for the destination chain.
RFC 3339 timestamp, 30 minutes after the quote was issued. Informational: the price is not adjusted afterwards, so clients should re-quote instead of depositing past it. A deposit that still lands is processed at the quoted terms while the quote is retained.
On `cross_chain` only:
The quote was priced for gasless submission. Deposit it through [`SubmitGaslessOrder`](/api-reference/gasless), not a wallet transaction.
The relay gas is charged to the partner's funding balance rather than the user's output.
EVM contract the relayed deposit executes against, and the spender the permit2 signature must authorize. Present on gasless quotes.
Solana account that pays the transaction fee. Set it as the fee payer of the transaction sent to `SubmitGaslessOrder`. Present on gasless quotes from a Solana source.
## Example
```bash
grpcurl \
-H "x-api-key: $HULAR_API_KEY" \
-d '{
"src_chain": "arbitrum",
"dst_chain": "solana",
"src_token": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"dst_token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"trade_type": "TRADE_TYPE_EXACT_INPUT",
"amount": "25000000",
"recipient": "EPjF...",
"refund_address": "0x...",
"gas_drop": ""
}' \
$HULAR_HOST hular.v1.HularApi/GetQuote
```
## Errors
| Code | When |
| --- | --- |
| `INVALID_ARGUMENT` | Unsupported pair, missing or unknown trade type, malformed amount or address, size outside the accepted band, gas drop over the cap, slippage of 100% or more on an expected-output quote, unusable referrer list, gasless requested where it is not supported. |
| `UNAVAILABLE` | Chain disabled for quoting, insufficient inventory, bridge pair suspended, price feed stale, aggregator failure. |
| `UNAUTHENTICATED` | `sponsor_fees` without an API key. |
Full messages in [Error handling](/integration/errors).