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


---

# Agent Instructions: 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.nucleusearn.io/nucleus-architecture/smart-contracts/contracts/atomic-queue/iatomicsolver.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.
