--- title: Quotes and the quote hash description: How a price becomes a binding set of order parameters, and what the deposit is matched against. --- import { QUOTE_RETENTION_HOURS, MIN_QUOTE_USD, MAX_QUOTE_USD } from "/snippets/vars.mdx"; A quote is a priced, persisted set of order parameters. `GetQuote` runs the pricing pipeline, stores the canonical `OrderParams`, and returns their keccak hash as `quote_hash`. The request's `trade_type` decides whether `amount` fixes the deposit or the payout; see [Trade types](/concepts/trade-types). That hash is the only thing the deposit carries. Everything the operator later does with the order is read from the stored parameters, not from the deposit transaction. ## Preview versus quote Prices a trade without persisting anything. No recipient or refund address required. Use it for amount fields that reprice as the user types. Prices and persists. Returns a `quote_hash` that can be deposited against. Use it once the user is ready to commit. `PreviewQuote` returns the same economics (`amount_in`, `amount_out`, `min_amount_out`, `slippage_bps`, `fee_breakdown`), so the number you display while typing is the number you get when you commit, subject to the price moving between the two calls. ## What the hash binds The stored parameters cover both sides of the trade: | Field | Bound value | | --- | --- | | `src_chain`, `dst_chain` | Where the deposit is expected and where the payout goes. | | `src_token`, `dst_token` | Exact token addresses on each side. | | `bridge_token_src`, `bridge_token_dst` | The assets actually moved between chains: what leaves the source and what arrives on the destination. Equal to each other except on a cross-asset lane, and `bridge_token_src` equals `src_token` when there is no source swap. | | `amount_in` | Exact deposit amount, in base units. On an expected-output quote, the input the engine solved for. | | `min_amount_out`, `min_bridge_out` | Floors the fulfillment is checked against. | | `recipient` | Who receives on the destination chain. | | `refund_address`, `refund_token` | Where a refund goes if the order cannot be fulfilled. | | `gas_drop` | Native asset delivered alongside the payout. | | `referrers` | Referrer addresses and their basis points. | | `router_address` | The contract the deposit must be made to. | | `nonce` | Makes otherwise identical quotes distinct hashes. | A deposit that does not match these (wrong token, wrong amount, or a quote hash already consumed by another order) is never fulfilled. It becomes an order in `pending_refund`. See [Refunds](/concepts/refunds). ## Response shape `QuoteResponse` is a `oneof` over the two quote kinds, so branch on the case rather than assuming a field exists: ```ts import { quoteOf, isSameChainSwap } from "@mayanfinance/hular-sdk"; const response = await hular.getQuote(request); const quote = quoteOf(response); if (!quote) throw new Error("no quote"); if (isSameChainSwap(response)) { // settled inside the deposit transaction } ``` Both kinds carry the same fields: `quote_hash`, `amount_in`, `amount_out`, `min_amount_out`, `slippage_bps`, `fee_breakdown`, `router_address`, `deposit_deadline`, and the full `order_params`. ## Lifetime A quote has no on-chain deadline. Its price is fixed at the moment it was requested and does not follow the market, so treat it as short-lived: refresh before the user signs, and re-quote if they hesitate. Each quote carries a `deposit_deadline`, 30 minutes after issuance. It is informational, not enforced on-chain or by the backend: a deposit that lands later is still processed at the quoted terms while the quote is retained, but the SDK refuses to build deposit steps past it and clients should re-quote instead. Unused quotes are pruned after {QUOTE_RETENTION_HOURS} hours. Only one active order can exist per quote. Depositing twice against the same hash produces one order and one refund. ## Size limits Quotes are bounded by notional value in USD, between {MIN_QUOTE_USD} and {MAX_QUOTE_USD}. Requests outside the band fail with `amount below minimum` or `amount above maximum`; both are `invalid_argument`. See [Error handling](/integration/errors). ## What to persist Store the `quote_hash` before you send the user to sign. It is how you find the order afterwards, and without it a deposit that lands is hard to attribute. `order_params` is worth storing too if you want to render the expected outcome without a second API call.