> For the complete documentation index, see [llms.txt](https://docs.butternetwork.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.butternetwork.io/butter-swap-integration/integration-guide/swap-fee.md).

# Fee

The swap fee is divided into two parts: one part is charged by the butterSwap, and the other part is charged by the access party. The access party can pass relevant parameters for collecting the fee to butterSwap, allowing butterSwap to collect the fee on their behalf.

The part of butterSwap consists of two sections, one is the fixed native value,and the other is the input token amount multiply by fee rate;

For access party they can choose to either use a fixed native value or input a percentage of the amount as the collection fee.

For ease of use, you can use the following interface to get the fee detail:

```solidity
    function getFee(
        address _inputToken,
        uint256 _inputAmount,
        bytes calldata _feeData
    ) external view returns (address feeToken, uint256 tokenFee, uint256 nativeFee, uint256 afterFeeAmount);

```


---

# 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:

```
GET https://docs.butternetwork.io/butter-swap-integration/integration-guide/swap-fee.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
