# swap

## Swapping one coin for another

```
.swap({
  token0: {
    token: TOKENS.KDA,
    amount: 0.02
  },
  token1: {
    token: TOKENS.ABC,
    amount: 0.1
  },
  slippage: '0.05',
  isSwapIn: true
})
```

| Parameter   | Type        | Default Value        |
| ----------- | ----------- | -------------------- |
| `account`   | Account     | config.account (†)   |
| `secretKey` | string      | config.secretKey (†) |
| `token0`    | TokenAmount |                      |
| `token1`    | TokenAmount |                      |
| `slippage`  | string      |                      |
| `isSwapIn`  | boolean     |                      |

† Can be initialized in the SDK client constructor, i.e

```
new KaddexSdk({ account, secretKey })
```
