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

# Swapping Through Hadron Pools

Build a swap instruction.

```typescript theme={null}
const ix = pool.swap(user, {
  isX: true,             // true = sell token X for Y, false = sell Y for X
  amountIn: 1_000_000n,
  minOut: 0n,
  feeRecipient: feePk,
});
```

| **Param**             | **Type**    | **Description**                        |
| :-------------------- | :---------- | :------------------------------------- |
| `user`                | `PublicKey` | The user’s wallet                      |
| `params.isX`          | `boolean`   | Direction: `true` = X→Y, `false` = Y→X |
| `params.amountIn`     | `bigint`    | Input amount in token atoms            |
| `params.minOut`       | `bigint`    | Minimum output (slippage protection)   |
| `params.feeRecipient` | `PublicKey` | Address to receive fees                |
| `params.expiration?`  | `number`    | Optional slot expiration               |

<Info>
  Hadron does not currently support custom matching across multiple propAMMs for the same asset natively. For multi-prop matching, please use one of our supported aggregators or reach out to us to discuss more.
</Info>
