The Exclusive Resolver API is a new feature available for resolvers within the 1inch Fusion mode. This API allows a 1inch Fusion resolver to be chosen as an exclusive filler at the beginning of the auction.

By providing a quote, a resolver commits to executing the order as soon as the user submits it to the 1inch Relayer API. The order must be executed before the end of the exclusivity period.

The executed order’s maker amount must match the amount provided by the resolver’s API for a specific `initialRateBump`

**Performance metrics:**

- **Maximum response time (including network):** 500ms
- **SLA:** 90%. Calculated from: _Number of executed exclusive orders ÷ Total resolver’s exclusive orders × 100%_. Only orders submitted by the user before the exclusivity period ends are counted.

<aside>

This feature is currently in its testing phase. As we refine its functionality, terminology, rules, and terms of use may change.

</aside>

### **API Endpoint:** `POST /quote`

Returns a list of resolver’s quotes, sorted by the maker’s amount (descending), along with the corresponding taker amount rate bump from the minimal return amount.

### Body

- `makerAsset`: the address of the token that the user is selling.
- `takerAsset`: the address of the token that the user is buying.
- `makerAmount`: the amount of the `makerAsset` that the user is selling.
- `minTakerAmount`: the minimum amount of the `takerAsset` that the user expects to receive.
- `makerAddress`: the wallet address of the user requesting a quote.
- `quoteId`: a unique ID of the quote.
- `gasBumpEstimate` _(New!)_: estimated gas cost adjustment based on order fill through the 1inch router.
- `gasPriceEstimate` _(New!)_: estimated gas price for executing the order.

These new fields allow resolvers to fine-tune their quotes more precisely based on gas costs.

### Response

- `grid`: an array containing details of proposed price improvements (max items: 50):
  - `makerAmount`: partial or full fill amount.
  - `initialRateBump`: rate bump at the beginning of the Dutch auction.
    - **Min**: 0
    - **Max**: 16777215
    - **10000000** → **100%**

### Example

**Request:**

```text
POST /quote
```

**Body:**

```json
{
  "chainId": 1,
  "makerAsset": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "takerAsset": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "makerAmount": "1000000000000000000",
  "minTakerAmount": "2400000000",
  "makerAddress": "0xbe0eb53f46cd790cd13851d5eff43d12404d33e8",
  "quoteId": "cf872857-c456-4f4f-aff0-84f7bebb7df2",
  "gasBumpEstimate": "50000",
  "gasPriceEstimate": "30000000000"
}
```

**Response (HTTP code: 200):**

```json
{
  "grid": [
    {
      "makerAmount": "1000000000000000000", // 1 ETH (100%)
      "initialRateBump": 10000 // improve minTakerAmount by 0.1%
    },
    {
      "makerAmount": "500000000000000000", // 0.5 ETH (50%)
      "initialRateBump": 100000 // improve minTakerAmount by 1%
    },
    {
      "makerAmount": "100000000000000000", // 0.1 ETH (10%)
      "initialRateBump": 1000000 // improve minTakerAmount by 10%
    }
  ]
}
```

## Errors

Use these error codes in API response in case:

- **_400 Bad Request_**:
  - Token pair is not supported.
  - Cannot provide a quote for specified `makerAmount` / `minTakerAmount` / `makerAddress`.
- **_500 Internal Server Error_**:
  - Unexpected error on the server.

# Useful tips and formulas

## Calculate: “**How much does the user receive at the start of the auction?**”

```text
takerAmount = minTakerAmount * (initialRateBump + 10000000) / 10000000
```

## Calculate: “**What initial rate bump is needed for a specific `takerAmount`?**”

```text
initialRateBump = (takerAmount * 10000000 / minTakerAmount) - 10000000
```

## **Understanding `gasBumpEstimate` and `gasPriceEstimate`**

- `gasBumpEstimate`: this value is calculated based on the estimated gas cost required to fill an order via the 1inch router. If you anticipate that your execution will be more gas-efficient, you can adjust your `initialRateBump` accordingly to reflect this advantage.
  - Detailed calculation: [Fusion SDK Gas Bump Calculation](https://github.com/1inch/fusion-sdk/blob/8452c43be3edfccf181e5c1003ffb55c6b32b2dc/src/auction-calculator/auction-calculator.ts#L90)
- `gasPriceEstimate`: this estimate provides an expected gas price for executing the transaction, helping to determine the most optimal bid pricing strategy.
  - Detailed calculation: [Fusion SDK Gas Estimate Calculation](https://github.com/1inch/fusion-sdk/blob/8452c43be3edfccf181e5c1003ffb55c6b32b2dc/src/auction-calculator/auction-calculator.ts#L76)

Additionally, for reference, you can check the related contract logic used in gas calculations:

[Limit Order Settlement Contract Code](https://github.com/1inch/limit-order-settlement/blob/2eef6f86bf0142024f9a8bf054a0256b41d8362a/contracts/extensions/BaseExtension.sol#L140)

## **How to determine if my resolver is selected for exclusive execution?**

To check whether your resolver is selected for exclusive execution, follow steps below.

1. Import the necessary modules from the 1inch Fusion SDK:

```typescript
import { Extension, FusionOrder, now } from "@1inch/fusion-sdk";

import { Address } from "@1inch/fusion-sdk";
```

1. Create an object containing the details of the Fusion order:

```typescript
const orderData = { ... }
```

1. Provide the encoded order extension data

```typescript
const ext = "0x..."; // Example encoded order extension
```

4. Decode and process the Fusion order

```typescript
const fusionOrder = FusionOrder.fromDataAndExtension(orderData, Extension.decode(ext));
```

5. Check if the resolver is exclusive. Define the resolver’s promotee address and check whether it has exclusive execution rights using the updated Fusion SDK logic:

```typescript
const resolverPromoteeAddress = Address.ZERO_ADDRESS;

const isExclusive = fusionOrder.isExclusiveResolver(resolverPromoteeAddress);

const isExclusivePeriod = fusionOrder.isExclusivityPeriod(now());
```

6. Interpret the results

- `isExclusive` → Returns `true` if the resolver is selected for exclusive execution.
- `isExclusivePeriod` → Returns `true` if the exclusivity period is still active.

For further details, refer to the relevant Fusion SDK implementation:

- [Fusion Order Exclusive Resolver Check](https://github.com/1inch/fusion-sdk/blob/5b112ec34fc12e61c496cbe54cc93987accfce4b/src/fusion-order/fusion-order.ts#L302)
- [Fusion Order Exclusivity Period Check](https://github.com/1inch/fusion-sdk/blob/5b112ec34fc12e61c496cbe54cc93987accfce4b/src/fusion-order/fusion-order.ts#L588)
