# Maximum-Executable-Volume Auction

`D12-F02-A01` · Matching Engines and Venue Logic → Auctions · archetype `record-transform` · difficulty 4/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/matching-engines-and-venue-logic/auctions/maximum-executable-volume-auction/
Agent skill: `npx skills add IslamBaraka90/Fintech-Algorithms-Library` — https://docs.thefintechbuilder.com/guides/agent-skill/

## Install and import

```bash
npm install fintech-algorithms
```

```ts
import { maximumExecutableVolumeAuction } from "fintech-algorithms/matching-engines-and-venue-logic/auctions/maximum-executable-volume-auction";
```

## Signature

```ts
maximumExecutableVolumeAuction(ordersRaw, referenceRaw, tickRaw)
```

Finds the price that crosses the most volume — the first and most important auction criterion. Ties are common, which is why the tie-break rules exist as their own topics. Prices and quantities are integer **atoms** — the venue's minimum increment — not floating-point currency. Matching arithmetic that rounds is matching arithmetic that disagrees with the exchange.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `ordersRaw` | `Order[]` | yes | Auction orders with prices, quantities and sides. |
| `referenceRaw` | `number` | yes | Reference price used when criteria tie. |
| `tickRaw` | `number` | yes | Tick size in atoms. · min: 1, integer: true |

## Returns

`{ price, executable_volume, candidates, tie, … }`

The clearing price and volume, with every tied candidate — a hidden tie is a hidden decision.

## Errors

- When no order crosses — reported as a status rather than thrown

## Complexity

Time `O(orders log orders)`, space `O(prices)`.

## Worked example

Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.

### Input

`ordersRaw`:

```json
[
  {
    "order_id": "B-101",
    "side": "buy",
    "order_type": "limit",
    "price": 101,
    "quantity": 300,
    "arrival_sequence": 10
  },
  {
    "order_id": "B-100",
    "side": "buy",
    "order_type": "limit",
    "price": 100,
    "quantity": 500,
    "arrival_sequence": 20
  },
  {
    "order_id": "S-099",
    "side": "sell",
    "order_type": "limit",
    "price": 99,
    "quantity": 200,
    "arrival_sequence": 30
  }
]
```

Showing 3 of 5 elements.

`referenceRaw`:

```json
100
```

`tickRaw`:

```json
1
```

### Call

```ts
maximumExecutableVolumeAuction(ordersRaw, referenceRaw, tickRaw)
```

### Returns

object with 9 fields: model, reference_price, tick_size, order_count, maximum_executable_quantity, maximum_volume_prices, unique_price, candidate_evaluations, …

```json
{
  "model": "maximum-executable-volume-candidate-set",
  "reference_price": 100,
  "tick_size": 1,
  "order_count": 5,
  "maximum_executable_quantity": 600,
  "maximum_volume_prices": [100],
  "unique_price": 100,
  "candidate_evaluations": [
    {
      "price": 99,
      "buy_quantity": 800,
      "sell_quantity": 200,
      "executable_quantity": 200,
      "imbalance_quantity": 600,
      "absolute_imbalance": 600,
      "imbalance_side": "buy"
    },
    {
      "price": 100,
      "buy_quantity": 800,
      "sell_quantity": 600,
      "executable_quantity": 600,
      "imbalance_quantity": 200,
      "absolute_imbalance": 200,
      "imbalance_side": "buy"
    },
    {
      "price": 101,
      "buy_quantity": 300,
      "sell_quantity": 1100,
      "executable_quantity": 300,
      "imbalance_quantity": -800,
      "absolute_imbalance": 800,
      "imbalance_side": "sell"
    }
  ],
  "state": "unique-maximum"
}
```

## Other exports

`minimumImbalanceTieBreak`, `openingCrossPrice`, `closingCrossPrice`, `volatilityAuctionReopening`, `calculate`. Every module additionally exports `run` as an alias of its primary
function, and a `meta` object carrying its catalog id, domain, family, shape and article URL.

## Verification and provenance

Tier: **verified** (via D).

The worked example below is the figure published in this algorithm's article, replayed and asserted by the test suite on every build. The arithmetic cannot drift without the build failing.

Both tiers guarantee the signature. Full explanation: https://docs.thefintechbuilder.com/guides/verification/

Generated from the docs.json payload shipped inside fintech-algorithms@0.13.1.
The signature and parameter list are checked against the compiled implementation at build time,
so a description that contradicts the code fails the build rather than reaching this file.

## Links

- Article (how it works, step by step): https://thefintechbuilder.com/matching-engines-and-venue-logic/auctions/maximum-executable-volume-auction/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/matching-engines-and-venue-logic/auctions/maximum-executable-volume-auction/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/matching-engines-and-venue-logic/llms.txt
