> For the complete documentation index, see [llms.txt](https://docs.cork.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cork.tech/core-concepts/fees.md).

# Fees

Cork Pools charge fees on two operations: **Exercise** and **Repurchase**. By default, fees flow to the Cork fee treasury. Governance can configure specific markets to redirect fees (partially or fully) to Cork Principal Token holders to adjust underwriting economics.

***

## Fee Types

| Fee            | Applied To                               | When                                                                   |
| -------------- | ---------------------------------------- | ---------------------------------------------------------------------- |
| Exercise Fee   | Exercise (swap / exercise)               | When exchanging Reference Asset + Cork Swap Token for Collateral Asset |
| Repurchase Fee | Repurchase (unwindSwap / unwindExercise) | When exchanging Collateral Asset for Reference Asset + Cork Swap Token |

Fees are **not** charged on Deposit, Unwind Deposit, Withdraw, or Redeem operations.

***

## How Fees Are Calculated

Fees use a **custom encoding** where `1e18 = 1%` (one percentage point). This differs from standard 18-decimal fixed-point where `1e18` would represent 100%. The fee is applied to the Collateral Asset amount involved in the operation:

```
feeAmount = amount × feePercentage / 100e18
```

**Example:** If the Exercise fee is `1e18` (1%) and you exercise for 100 Collateral Asset:

```
feeAmount = 100 × 1e18 / 100e18 = 1 Collateral Asset
```

You receive 99 Collateral Asset after the fee.

{% hint style="info" %}
Fees are rounded up (ceiling) to protect the pool. The actual fee may be fractionally higher than the formula suggests for non-round amounts.
{% endhint %}

***

## Fee Limits

The maximum allowed fee for either type is `5e18` (**5%**). Fees are configured individually for each Cork Pool at creation and can be updated by governance (DefaultCorkController) within this maximum.

***

## Querying Fees

Read the current fee for any pool on CorkPoolManager. The `MarketId` type is a `bytes32` hash that uniquely identifies a pool — see [MarketId Computation](/developers/contract-reference/cork-pool-manager.md#marketid-computation) for details.

```solidity
function swapFee(MarketId poolId) external view returns (uint256 fees)
function unwindSwapFee(MarketId poolId) external view returns (uint256 fees)
```

The returned value uses Cork's fee encoding (`1e18 = 1%`).

{% hint style="info" %}
The API returns fees as decimal fractions (e.g., `0.01` = 1%). On-chain, the same 1% fee is represented as `1e18` (1000000000000000000). See [API Reference](/developers/api-reference.md) for details.
{% endhint %}

***

## Fee Configuration

Fees are set per pool at creation via the `PoolCreationParams` struct and can be updated by governance:

```solidity
function updateSwapFeePercentage(MarketId id, uint256 newSwapFeePercentage) external
function updateUnwindSwapFeePercentage(MarketId id, uint256 newUnwindSwapFeePercentage) external
```

See [Admin & Governance](/developers/contract-reference/admin-and-governance.md) for the full governance interface.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cork.tech/core-concepts/fees.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
