---
import Base from "@/layouts/Base.astro";
import { href, NAV } from "@/lib/nav";
const description =
"Superfast primitives and data structures for high frequency trading: Dec, " +
"a fixed-scale decimal for exact arithmetic, and OrderBook, a level 2 book " +
"built on it.";
---
<Base title="Primitives for high frequency trading" description={description}>
<header>
<h1>troy</h1>
<p class="lede">
Superfast primitives and data structures for high frequency trading, where
every nanosecond counts. <code>Dec</code> is a fixed-scale decimal backed
by an <code>i128</code>, exact inside its range and collapsing to a single
NaN state outside it. <code>OrderBook</code> is a level 2 book built on it,
each side kept best first so the best price, the n-th level and the depth
cut are index arithmetic rather than searches.
</p>
</header>
<nav class="pills" aria-label="Sections">
{
NAV.map((item) => (
<a class="pill" href={href(item.path)}>
{item.full ?? item.label}
</a>
))
}
</nav>
</Base>