# defaultFeeEstimator | @aa-sdk/core

> Overview of the defaultFeeEstimator function from @aa-sdk/core

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function defaultFeeEstimator<C>(client): ClientMiddlewareFn;
```

Defined in: [aa-sdk/core/src/middleware/defaults/feeEstimator.ts:26](https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/middleware/defaults/feeEstimator.ts#L26)

Default fee estimator middleware function that estimates the maximum fee per gas and maximum priority fee per gas for a given client and applies the necessary overrides and fee options.

## Example

```ts
import { createSmartAccountClient, defaultFeeEstimator, createBundlerClient } from "@aa-sdk/core";

const bundlerClient = createBundlerClient(...);

// NOTE: this is already provided by the smart account client
const client = createSmartAccountClient({
 feeEstimator: defaultFeeEstimator(bundlerClient),
 ...otherParams
});
```

## Type Parameters

<table>
  <thead>
    <tr>
      <th align="left">Type Parameter</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `C` *extends* `MiddlewareClient`
      </td>

      <td>
        The type of the client
      </td>
    </tr>

  </tbody>
</table>

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `client`
      </td>

      <td>
        `C`
      </td>

      <td>
        The client to perform the fee estimation
      </td>
    </tr>

  </tbody>
</table>

## Returns

`ClientMiddlewareFn`

A middleware function that takes in the struct and options, estimates the fees, and updates the struct with the estimated fees