> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getFlowQuote

# getFlowQuote

Fetches a conversion quote for a flow. The quote includes the amounts, fees, estimated time, and an expiry. Call this after attaching a source.

## When to call

Call `getFlowQuote` when `executionState` is `source_attached`, `quoted`, or `signing`. Calling it from `quoted` refreshes the quote. Calling it from `signing` returns the flow to `quoted`, so do not reuse the previous signing payload.

Before restoring or retrying a flow, call [`getFlow`](/docs/javascript/reference/client/get-flow) and check its current state.

<Warning>
  If the flow is `initiated`, attach a source first. Do not call `getFlowQuote`
  after `broadcasted` or `source_confirmed`; poll the existing flow instead. If
  the flow is `cancelled`, `expired`, or `failed`, create a new flow for another
  attempt. Calling from any unsupported state returns `409`.
</Warning>

## Usage

```javascript theme={"system"}
import { getFlowQuote } from '@dynamic-labs-sdk/client';

const flow = await getFlowQuote({
  flowId: 'your-flow-id',
  fromTokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
});

console.log('Send:', flow.quote.fromAmount);
console.log('Receive:', flow.quote.toAmount);
console.log('Fees:', flow.quote.fees?.totalFeeUsd);
```

## Parameters

| Parameter          | Type                | Description                                                                                                                                                                                                                                                              |
| ------------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `flowId`           | `string`            | The flow ID.                                                                                                                                                                                                                                                             |
| `fromTokenAddress` | `string` (optional) | Token contract address (EVM) or mint (Solana) the sender is paying with. Defaults to the native token for the chain set during source attachment. Use `0x0000000000000000000000000000000000000000` for native ETH, or `11111111111111111111111111111111` for native SOL. |
| `fromChainId`      | `string` (optional) | Override the chain ID recorded at source attachment. The chain family (`fromChainName`) is locked at attachment — to switch families, call `attachFlowSource` again.                                                                                                     |
| `slippage`         | `number` (optional) | Slippage tolerance as a decimal (e.g., `0.005` for 0.5%).                                                                                                                                                                                                                |

## Returns

`Promise<Flow>` — the updated flow with `quote` populated:

```typescript theme={"system"}
type FlowQuote = {
  version: number;
  fromAmount: string;
  toAmount: string;
  estimatedTimeSec?: number;
  fees?: {
    totalFeeUsd?: string;
    gasEstimate?: {
      usdValue: string;
      nativeValue: string;
      nativeSymbol: string;
    };
  };
  createdAt: string;
  expiresAt: string;
};
```

<Note>
  Quotes expire in 60 seconds. If the quote expires before you submit, call `getFlowQuote` again.
</Note>

## Examples

### Quote with a specific ERC-20 token

```javascript theme={"system"}
import { getFlowQuote } from '@dynamic-labs-sdk/client';

const flow = await getFlowQuote({
  flowId: 'your-flow-id',
  fromTokenAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC on Base
});
```

### Quote with native ETH

```javascript theme={"system"}
import { getFlowQuote } from '@dynamic-labs-sdk/client';

const flow = await getFlowQuote({
  flowId: 'your-flow-id',
  fromTokenAddress: '0x0000000000000000000000000000000000000000',
});
```

### Quote with slippage tolerance

```javascript theme={"system"}
import { getFlowQuote } from '@dynamic-labs-sdk/client';

const flow = await getFlowQuote({
  flowId: 'your-flow-id',
  fromTokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  slippage: 0.005,
});
```

## React

`useGetFlowQuote` is a mutation hook — call `mutate` to request a quote on demand:

```tsx theme={"system"}
import { useGetFlowQuote } from '@dynamic-labs-sdk/react-hooks';

function QuoteButton({ flowId }) {
  const { mutate: getQuote, data: flow, isPending } = useGetFlowQuote();

  return (
    <div>
      <button
        onClick={() => getQuote({ flowId, fromTokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' })}
        disabled={isPending}
      >
        {isPending ? 'Quoting...' : 'Get Quote'}
      </button>
      {flow?.quote && (
        <p>Send {flow.quote.fromAmount} → Receive {flow.quote.toAmount}</p>
      )}
    </div>
  );
}
```

## Related

* [Fireblocks Flow JavaScript SDK guide](/docs/overview/fireblocks-flow-js-sdk) - End-to-end flow guide
* [`attachFlowSource`](/docs/javascript/reference/client/attach-flow-source) - Attach a wallet or exchange source
* [`submitFlowTransaction`](/docs/javascript/reference/client/submit-flow-transaction) - Submit for signing and broadcast
* [`prepareFlowSigning`](/docs/javascript/reference/client/prepare-flow-signing) - Prepare signing (advanced)
