Arik Levinsky

Fifteen years in software, the last eight leading teams. Chief Technology Officer at a financial technology company that became three brands, 500+ people and tens of millions in ARR on three continents, where engineering grew from one person to dozens. Most recently founder of Slate Labs: the complete stack a brokerage runs on, built alone in four months.

Mexico City · arik@thesoft.dev · LinkedIn

Scale

A liquidation engine

Below is a working matching engine and margin account for SYNTH-PERP, a fictional perpetual quoted in dollars. It runs entirely in this page. Every number is an exact integer — no floating point touches money — and every state change is an event, which is what makes the replay at the end honest rather than decorative. It is small on purpose: the decisions it makes — and the ones it refuses to make — are the same decisions a production risk system faces, here at a size where you can watch them happen.

Here is a book

A price level is one price and everything resting at it. The queue at a level is ordered by arrival: at the same price, the order that got there first fills first. That single rule — price first, then time — is most of what a matching engine does.

SYNTH-PERP — five levels a side
Bid qty Bid Ask Ask qty
0.4099,999.50100,000.500.30
0.1099,998.50100,001.500.60
0.7099,997.50100,002.500.20
0.3099,996.50100,003.500.50
0.8099,995.50100,004.500.40

Now you trade

Place a limit buy below the spread and watch it rest — it joins the queue at its level and waits. Place a market buy larger than the top level and watch it walk: it consumes the best price, then the next, and fills at several prices at once. Each of those partial fills is its own event at its own price.

Order ticket

Open positions — one ticket per fill, hedging style
Side Qty Entry Mark P&L Margin

One symbol would normally mean one net position. This account is a hedging account: every fill opens its own ticket with its own entry price. That is standard broker behaviour, and it is what makes the next beat interesting — with several tickets open, which one to close becomes a real question.

Now it goes wrong

Raise the leverage, then shock the market. Margin level is equity over margin used; when it falls through 50% the engine begins closing positions, and it stops once the account is back above 60%. The trigger is the bare line; the buffer is what keeps a recovering account from being liquidated further than it needs to be.

Equity
—
Margin used
—
Margin level
n/a
Status
Flat

Three things are worth watching, and none of them is the closing itself.

Which position closes first is a policy choice, not an algorithm. Switch the strategy and run the same shock again. Biggest loser first is the industry default; most margin freed first reaches the target in fewer closes. Same starting state, different tickets closed. The interesting decisions in a liquidation engine are policy, and they belong somewhere a human can change them.

The cascade stops early when the world changes. Press Deposit while positions are closing. The engine re-computes margin level from authoritative state before every close, so the deposit is seen between one close and the next and the remaining positions are left alone. The outcome is recovered, which is a different claim from completed.

The engine refuses to act on bad data. Toggle Stale the price feed and shock the market. Nothing is closed. A stale or missing price on a long looks exactly like a total loss, and liquidating an account on a price you cannot trust is worse than doing nothing — so deferral is a first-class outcome with its own event, not an error. A toy would have closed.

All of that was events

Every line below is an event the engine emitted; the state you have been reading is a fold over that log. Press Replay and the entire visible state is re-derived from the log alone. That is why replay here is exact rather than approximate — there is no second path by which state can change.

    Deliberately absent, so their absence reads as a decision: multi-currency conversion and FX staleness, commission schedules, distributed locking and crash recovery, idempotency keys, and the durability machinery that makes any of this safe with real money. Also absent, and for a different reason — a minimum-order-size rule. At this instrument's lattice it could never bind, and shipping a rule that cannot fire would have been worth less than explaining why it is missing.

    Track record

    Slate Labs — Founder 2026

    The complete stack a brokerage or prop firm runs on, delivered white-label as one product for a flat subscription: trading engine, margin and risk, CRM and agent workspace, payments, KYC and onboarding, compliance, workflow automation. Brokers normally assemble this from five or six vendors.

    • Designed and built alone in four months: 23 services in Python and Go, running on Kubernetes in AWS. A new broker gets a fully branded instance with its own database, cache and message bus, provisioned by one script and live in under 30 minutes.
    • Every money path runs through a database transaction boundary with client-generated idempotency keys, and order execution re-checks positions mid-liquidation, so a crash at any point leaves the books consistent.
    • Its margin engine closes only the exposure needed to restore margin, re-checking the account before every close. The engine above is a small, honest version of that one.
    Teix / Sharktec — Chief Technology Officer 2023–2026

    Joined as the first engineer and promoted to CTO within the first year, reporting to the CEO, as the brokerage grew from early stage to three brands and 500+ people on three continents.

    • Wrote the core trading and operations platform before there was anyone to delegate to, then grew engineering to 60 people across backend, full stack, DevOps, BI and analytics: hired 60+ engineers, built the management layer, and kept regretted attrition under 10% a year.
    • Ran the whole technology stack — trading and operational infrastructure, cloud, data platform, CI/CD and monitoring — at 99.9%+ uptime on trading across every brand and time zone, and replaced or renegotiated the external vendors for trading technology, payments, telephony and data, saving $1.1M a year.
    • Built the company BI platform from scratch — the single source of truth for finance, operations, marketing and retention, used daily by about 70 managers — and put AI into daily use: a sales copilot trained on calls labeled by deposit outcome rather than human quality scores lifted conversion 14% among experienced reps and 27% among new hires, and a schema-aware BI assistant declines any answer it cannot check against the data model.
    Exto.io — Principal Engineer and Technical Lead 2021–2023
    Led a 12-person team building a greenfield upsell and cross-sell product for Shopify merchants on machine-learning recommendations — architecture and delivery from first commit to live operation across paying stores, over 3,000 of them by 2023.
    DM International — Owner / CTO 2018–2021
    Founded and ran a 14-person performance-marketing network, P&L included, and personally built its revenue engine: two-sided lead distribution doing real-time capture, validation, dedup and rules-based routing across competing buyers — about 60,000 leads a day across Europe and Asia, hundreds of buyers, about $2M a year in ad spend. Exited in 2021.
    Independent consulting 2015–2018
    End-to-end delivery for international clients — requirements, architecture, implementation, deployment.
    Bank Hapoalim — Senior Full Stack 2010–2015
    Senior engineer on the internal API layer at one of Israel's largest banks — the tier every downstream consumer sits on — and part of the team that re-platformed it onto Node.js without taking those consumers down.

    How I run engineering