# ReservoirAdapter

`ReservoirAdapter.sol` is an adapter contract that enables the Unlockd Protocol to interact with the Reservoir marketplace. It implements the IMarketAdapter interface and provides functions for selling, buying, and canceling orders on the Reservoir marketplace.

### Key functions:

```solidity
function preSell(
    PreSellParams memory params
) public payable onlyProtocol
```

Prepares an asset for selling on the Reservoir marketplace.

### Parameters:

`params`: The parameters for preparing the sell operation.

***

```solidity
function sell(
    SellParams memory params
) public payable onlyProtocol
```

Sells an asset on the Reservoir marketplace.

### Parameters:

`params`: The parameters for the sell operation.

***

```solidity
function preBuy(
    PreBuyParams memory params
) public payable onlyProtocol
```

Prepares for buying an asset on the Reservoir marketplace.

### Parameters:

`params`: The parameters for preparing the buy operation.

***

```solidity
function buy(
    BuyParams memory params
) public payable onlyProtocol returns (uint256)
```

Buys an asset on the Reservoir marketplace.

### Parameters:

`params`: The parameters for the buy operation.

Returns: The actual cost of the buy operation.


---

# 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://devs.unlockd.finance/adapters-and-strategies/reservoiradapter.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.
