> For the complete documentation index, see [llms.txt](https://docs.nucleusearn.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nucleusearn.io/nucleus-architecture/smart-contracts/contracts/atomic-queue/iatomicsolver.md).

# IAtomicSolver

[Git Source](https://github.com/Ion-Protocol/nucleus-boring-vault/blob/cc0b494b83e17b9b169a73b96050d2810b690477/src/atomic-queue/IAtomicSolver.sol)

## Functions

### finishSolve

This function must be implemented in order for an address to be a `solver` for the AtomicQueue

```solidity
function finishSolve(
    bytes calldata runData,
    address initiator,
    ERC20 offer,
    ERC20 want,
    uint256 assetsToOffer,
    uint256 assetsForWant
)
    external;
```

**Parameters**

| Name            | Type      | Description                                                                                                              |
| --------------- | --------- | ------------------------------------------------------------------------------------------------------------------------ |
| `runData`       | `bytes`   | arbitrary bytes data that is dependent on how each solver is setup it could contain swap data, or flash loan data, etc.. |
| `initiator`     | `address` | the address that initiated a solve                                                                                       |
| `offer`         | `ERC20`   | the ERC20 asset sent to the solver                                                                                       |
| `want`          | `ERC20`   | the ERC20 asset the solver must approve the queue for                                                                    |
| `assetsToOffer` | `uint256` | the amount of `offer` sent to the solver                                                                                 |
| `assetsForWant` | `uint256` | the amount of `want` the solver must approve the queue for                                                               |
