> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avnu.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrator Fees

> Earn revenue on every swap through your integration

Earn revenue on every swap by adding integrator fees. Fees are specified in basis points and sent directly to your recipient address on-chain.

## Parameters

<ParamField path="integratorFees" type="bigint" required>
  Fee in basis points as bigint (10n = 0.1%, 100n = 1%)
</ParamField>

<ParamField path="integratorFeeRecipient" type="string" required>
  Address to receive fee payments
</ParamField>

<ParamField path="integratorName" type="string" required>
  Your protocol/platform identifier (for analytics)
</ParamField>

## SDK Example

```typescript theme={null}
import { getQuotes, executeSwap } from '@avnu/avnu-sdk';
import { parseUnits } from 'ethers';

const quotes = await getQuotes({
  sellTokenAddress: ethAddress,
  buyTokenAddress: usdcAddress,
  sellAmount: parseUnits('1', 18),
  takerAddress: account.address,
  integratorFees: 10n, // 0.1% (10 bps)
  integratorFeeRecipient: '0xYourFeeRecipientAddress',
  integratorName: 'YourProtocolName',
});

// Execute swap with fees
const result = await executeSwap({
  provider: account,
  quote: quotes[0],
  slippage: 0.001,
});

console.log('Swap executed:', result.transactionHash);
```

## How It Works

**Fee Calculation:**

* Fees are specified in basis points (bps)
* Transferred directly to your recipient address on-chain

**Fee Token Selection:**

The contract automatically selects the best token to collect fees using an on-chain priority mechanism. Stablecoins are preferred, followed by major assets (ETH, wstETH, WBTC, STRK, etc.).

<Info>
  The fee token is selected automatically based on the swap route - you don't need to specify it.
</Info>

## Best Practices

<AccordionGroup>
  <Accordion title="Always Set integratorName" icon="tag">
    Setting your integrator name helps with:

    * Analytics and volume tracking
    * Support and troubleshooting
    * Potential partnership opportunities
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Swap Guide" icon="arrow-right-arrow-left" href="/docs/swap/index">
    Back to main swap documentation
  </Card>

  <Card title="API Reference" icon="code" href="/api/swap">
    View complete API parameters
  </Card>
</CardGroup>
