> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://sdk.railnet.org/api/mcp` to find what you need.

# useEstimateConduit

Estimates the output of a conduit operation, as a TanStack Query result. A deposit estimate is in
conduit shares, a redeem estimate in the underlying asset.

## Import

```ts twoslash
import { useEstimateConduit } from '@railnetorg/railnet-sdk/react'
```

## Usage

```tsx twoslash
import { useEstimateConduit } from '@railnetorg/railnet-sdk/react'
import { QueryMode, EstimationType } from '@railnetorg/railnet-sdk'

function Estimate() {
  const { data, isLoading } = useEstimateConduit({
    conduit: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
    asset: { asset: '0x6B175474E89094C44Da98b954EedeAC495271d0F', value: 1000000000000000000n },
    mode: QueryMode.DEPOSIT,
    estimationType: EstimationType.OUTPUT,
  })

  if (isLoading) return <div>Loading...</div>

  if (!data) return null

  return (
    <p>
      {data.asset}: {data.value.toString()}
    </p>
  )
}
```

## Returns

```ts
UseQueryResult<Asset, ReadContractErrorType>
```

The estimated asset and its amount, as a single [`Asset`](/types/Asset).

## Parameters

### conduit

* **Type:** `Address`

### asset

* **Type:** [`Asset`](/types/Asset)

### mode

* **Type:** [`QueryMode`](/types/Enums#querymode)

### estimationType

* **Type:** [`EstimationType`](/types/Enums#estimationtype)

### chainId (optional)

* **Type:** `number`
* **Default:** the connected chain

Chain to read from. See [Query keys](/react/queryOptions#query-keys).

```tsx
import { base } from 'viem/chains'

const result = useEstimateConduit({
  conduit: '0x...',
  asset: { asset: '0x...', value: 1_000_000n },
  mode: QueryMode.DEPOSIT,
  estimationType: EstimationType.OUTPUT,
  chainId: base.id, // [!code focus]
})
```

### enabled (optional)

* **Type:** `boolean`
* **Default:** `true`

## Query options

[`estimateConduitQueryOptions`](/react/queryOptions) is this read as TanStack Query options, with
`estimateConduitQueryKey` and `estimateConduitQueryPrefix` for invalidation.

```ts
import { estimateConduitQueryOptions } from '@railnetorg/railnet-sdk/react'

await queryClient.prefetchQuery(estimateConduitQueryOptions(client, parameters))
```
