# Tick-Size Validation

`D12-F03-A01` · Matching Engines and Venue Logic → Order Controls · archetype `record-transform` · difficulty 2/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/matching-engines-and-venue-logic/order-controls/tick-size-validation/
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 { tickSizeValidation } from "fintech-algorithms/matching-engines-and-venue-logic/order-controls/tick-size-validation";
```

## Signature

```ts
tickSizeValidation(price_atoms, tick_size_atoms, price_scale, effective_policy_id)
```

Rejects a price that is not a whole multiple of the instrument's tick. 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. Validating in floating point is how sub-tick prices reach a book that cannot represent them.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `price_atoms` | `number` | yes | Order price in integer atoms. · min: 0, integer: true |
| `tick_size_atoms` | `number` | yes | Tick size in atoms. · min: 1, integer: true |
| `price_scale` | `number` | yes | Decimal scale relating atoms to display currency. · min: 0, integer: true |
| `effective_policy_id` | `string` | yes | Which tick policy applies; tick size varies by price band on many venues. |

## Returns

`{ valid, reason, price_atoms, tick_size_atoms, policy_id }`

The verdict with the policy applied, so a rejection can be explained to the participant.

## Errors

- When tick size is not a positive integer — throws

## Complexity

Time `O(1)`, space `O(1)`.

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

`price_atoms`:

```json
1000500
```

`tick_size_atoms`:

```json
100
```

`price_scale`:

```json
10000
```

`effective_policy_id`:

```json
"SYN-US-EQ-2026-A"
```

### Call

```ts
tickSizeValidation(price_atoms, tick_size_atoms, price_scale, effective_policy_id)
```

### Returns

object with 12 fields: effective_policy_id, price_atoms, tick_size_atoms, price_scale, valid, remainder_atoms, lower_valid_price_atoms, upper_valid_price_atoms, …

```json
{
  "effective_policy_id": "SYN-US-EQ-2026-A",
  "price_atoms": 1000500,
  "tick_size_atoms": 100,
  "price_scale": 10000,
  "valid": true,
  "remainder_atoms": 0,
  "lower_valid_price_atoms": 1000500,
  "upper_valid_price_atoms": 1000500,
  "distance_to_lower_atoms": 0,
  "distance_to_upper_atoms": 0,
  "reason": "on-grid",
  "state": "accepted"
}
```

## Other exports

`priceBandValidation`, `selfTradePrevention`, `cancelOnDisconnect`, `fatFingerLimit`, `circuitBreakerTrigger`, `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/order-controls/tick-size-validation/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/matching-engines-and-venue-logic/order-controls/tick-size-validation/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
