# Fee\<ChainIdentifier, TSrc, TDst>

```
type Fee<ChainIdentifier, TSrc, TDst> = object;
```

Defined in: [atomiq-sdk/src/types/fees/Fee.ts:11](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/types/fees/Fee.ts#L11)

Fee represented in both, source and destination tokens, as well as providing USD valuation helpers and fee composition

## Type Parameters

| Type Parameter                                                                                                                     | Default type                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `ChainIdentifier` *extends* `string`                                                                                               | `string`                                                                                                          |
| `TSrc` *extends* [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`ChainIdentifier`> | [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`ChainIdentifier`> |
| `TDst` *extends* [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`ChainIdentifier`> | [`Token`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md)<`ChainIdentifier`> |

## Properties

### amountInDstToken

```
amountInDstToken: TokenAmount<TDst, true>;
```

Defined in: [atomiq-sdk/src/types/fees/Fee.ts:23](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/types/fees/Fee.ts#L23)

Fee value equivalent in destination token

***

### amountInSrcToken

```
amountInSrcToken: TokenAmount<TSrc, true>;
```

Defined in: [atomiq-sdk/src/types/fees/Fee.ts:19](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/types/fees/Fee.ts#L19)

Fee value equivalent in source token

***

### composition?

```
optional composition: object;
```

Defined in: [atomiq-sdk/src/types/fees/Fee.ts:51](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/types/fees/Fee.ts#L51)

Returns the composition of the fee (base fee + percentage fee) if known, the total fee is calculated as: base\_fee + amount \* percentage\_fee

#### base

```
base: TokenAmount;
```

#### percentage

```
percentage: PercentagePPM;
```

***

### currentUsdValue()

```
currentUsdValue: (abortSignal?, preFetchedUsdPrice?) => Promise<number>;
```

Defined in: [atomiq-sdk/src/types/fees/Fee.ts:31](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/types/fees/Fee.ts#L31)

Fetches the current USD value of the fee

#### Parameters

| Parameter             | Type          | Description                                                    |
| --------------------- | ------------- | -------------------------------------------------------------- |
| `abortSignal?`        | `AbortSignal` |                                                                |
| `preFetchedUsdPrice?` | `number`      | You can supply a pre-fetched usd price to the pricing function |

#### Returns

`Promise`<`number`>

A promise resolving to the current USD value of the token amount

***

### pastUsdValue?

```
optional pastUsdValue: number;
```

Defined in: [atomiq-sdk/src/types/fees/Fee.ts:46](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/types/fees/Fee.ts#L46)

USD value of the fee when swap was created - only present for newer swaps where the USD value at create time is known. Left for convenience only, use usdValue() instead, which automatically recognizes which pricing to use (either past value if available or fetches it on-demand)

***

### usdValue()

```
usdValue: (abortSignal?, preFetchedUsdPrice?) => Promise<number>;
```

Defined in: [atomiq-sdk/src/types/fees/Fee.ts:40](https://github.com/atomiqlabs/atomiq-sdk/blob/786509324f7f09c427e9ccfe527d82e496f06af5/src/types/fees/Fee.ts#L40)

Gets USD value of the fee, if the USD value when the swap was created is known (newer swaps) it returns this value, otherwise fetches the usd value on-demand

#### Parameters

| Parameter             | Type          | Description                                                    |
| --------------------- | ------------- | -------------------------------------------------------------- |
| `abortSignal?`        | `AbortSignal` |                                                                |
| `preFetchedUsdPrice?` | `number`      | You can supply a pre-fetched usd price to the pricing function |

#### Returns

`Promise`<`number`>

A promise resolving to the current USD value of the fee
