ENGINEERING HOMEWORK ·Golang/Blockchain Engineer, Injective Labs
ⓘ Independent job-application page. Not affiliated with, endorsed by, or operated by Injective Labs. Public information as of November 2026.

Homework for my application to Injective Labs Golang/Blockchain Engineer.

How the exchange module clears a block, where it sits against other onchain books, and a working Go order book client and batch-auction matcher that runs in the browser against mainnet.

489
active markets read from the chain: 135 spot, 354 perps
2 of 2
documented FBA worked examples reproduced as Go tests
~$2.4M
BTC perp depth within 50 bps of mid, 7 Nov snapshot
106
scale gap between v1beta1 and v2 prices for the same book

00 · Summary

The role owns the Go that turns orders into trades and trades into data.

Core components
Order book, matcher and the batch auction that clears every block in the exchange EndBlocker.
Go clients
The open-source path a trader or integrator uses first: market params, books, order checks, retries.
REST and WebSocket APIs
One upstream read per tick, fanned out to every frontend and bot that subscribes.

The work sample builds a small, tested version of each of the three: a fixed-point matcher that follows the documented clearing rules, a hedged LCD client with a sequence guard, and a REST and WebSocket server with one poller per market.

01 · The exchange in November 2026

A Cosmos SDK chain whose order book is a native Go module.

LayerWhat is there nowWhy it matters for this role
Exchange moduleSpot, perpetual, expiry and binary options markets with a fully onchain order book. Matching runs in the EndBlocker as a frequent batch auction.The "decentralized orderbook, order matcher" in the JD.
Markets489 active: 135 spot, 354 perps. Every perp is quoted in USDC (an erc20: denom). Perps include equities and metals: AAPL, NVDA, TSLA, MSFT, PLTR, GME, XAU, XAG.Market params (ticks, min notional, fees) drive every client-side check.
OraclesPerp oracle types on chain: PythPro 315, Chainlink Data Streams 33, Provider 6.Mark price is an input to the limit-order clearing price.
FeesAll 354 perps carry a 0.0001% maker and taker rate on chain. Spot rates vary: 109 markets at 0.05% taker.Fee refunds and charges depend on the clearing price (docs, "Single Trade Calculations").
MultiVMNative EVM live since 11 Nov 2025 (chain ID 1776). Solidity reaches the exchange module through a precompile at 0x…0065.A second client population that calls the same Go keeper.
Read pathsChain LCD (/injective/exchange/v2/…), the Indexer (gRPC, gRPC-web, REST) and Chain Stream.The REST and WebSocket APIs the JD names sit on this layer.

Market counts, fees and oracle types: live LCD queries, 7 Nov 2026. EVM facts: Injective docs.

02 · How a block clears

Two stages, one uniform price per stage.

Stage 1 · market orders
Matched against the resting book as it stood at the start of the block.
Orders with the best worst-price go first. Resting orders fill at their own prices.
Every market order on a side fills at one uniform price: total notional over total quantity. Any unfillable remainder is cancelled.
Stage 2 · limit orders
New limit orders merge with the resting book and match while the spread is negative.
The clearing price lies in [last matched sell, last matched buy].
Inside that range: resting mid for spot, mark price for derivatives. Outside it: the nearer bound.
Why it is built this way
One clearing price per block removes the edge from ordering transactions inside a block, which is the front-running case the docs name. Matching runs per market in parallel and persists after all markets finish (split, apply, combine).

Sources: Injective docs, exchange module EndBlocker and Other Concepts; worked examples in the API reference.

03 · Competitive map

Injective has the broadest product set and the thinnest major-pair books.

VenueWhere the book and matching liveBTC perp depth ±50 bpsGap vs Injective
InjectiveNative Go module; frequent batch auction at block end; one clearing price.~$2.4MReference row. Spot, perps, expiry, binary options, RWA perps, EVM precompile access.
HyperliquidHyperCore onchain book; continuous price-time matching inside HyperBFT; HyperEVM reads it through precompiles.~$100MFar deeper majors. Narrower product scope; continuous matching leaves ordering inside a block as a factor.
dYdX v4Book held in each validator's memory; only fills are committed on chain.~$7.5MBook state is offchain. Perps only.
LighterSequencer matches; zk proofs of matching and liquidation posted to Ethereum.not measuredVerifiable matching via proofs; no native multi-module chain around it.
Binance futuresCentralised engine (reference only).floor only*The liquidity benchmark every onchain book is quoted against.

Depth: one live snapshot on 7 Nov 2026 from each venue's public API, sum of bid and ask notional within 50 bps of the venue's own mid. Hyperliquid's API returns 20 levels a side, so deeper levels come from its rounded book. *Binance's public depth reaches about 17 bps on BTC. Snapshots move; treat these as orders of magnitude.

What this means for the Go work. Depth follows makers, and makers follow tooling: fast book reads, predictable fills, clear rejections. That is the client and API half of this job.

★ · Findings while building

Three things a new integrator trips on.

FindingEvidenceWhat I would do
v1beta1 and v2 return one book on two scalesBTC/USDC PERP best bid: exchange/v1beta1/…/orderbook returns 75903000000, exchange/v2/…/orderbook returns 75903. v1beta1 is in chain units (quote decimals applied); v2 is human readable. Both paths are live.One line on each orderbook query page naming the unit, and a typed price in the Go client so a mixed-up value fails to compile.
Worked limit-order example: intermediate tables do not reconcileThe new 0.2 buy at 64,360 appears as 0.1 in the merged book; the first match draws from the 64,250 ask while cheaper new asks remain; the text writes the range as "64,220 ≥ clearing ≥ 64,360" and the stop condition as "64,220 > 62,210". The stated range [64,220, 64,360] and the clearing price 64,230 are correct.Regenerate the tables from a test fixture. My fba tests assert the stated results and could serve as that fixture.
Thin books stay stale between tradesPolled across this session, the INJ/USDT spot book kept the same seq (73443633) for over an hour at a 2% spread, and far-from-mid resting orders persist on the BTC perp (asks up to ~$89k with mid ~$76k).Expose seq and last-update time on every REST book response so clients can tell quiet from stuck.

Checked 7 Nov 2026 against sentry.lcd.injective.network and three other public LCD hosts.

04 · JD duties, my plan

Each duty, the first thing I would ship, and where the sample already shows it.

JD dutyFirst thing I would shipIn the work sample
Build, maintain and test the order book, trade execution and matcherTable tests generated from the documented clearing rules, plus fuzzing of order sequences against invariants (no crossed book after a block, conserved quantity, clearing price inside the matched range).fba package: both documented worked examples as tests; book.Validate invariant checks.
Open-source Go clients for the protocol and contractsClient-side order checks that mirror chain rules (ticks, min notional) so a rejected order fails before broadcast, with the nearest valid value in the error.Market.CheckOrder returns every violation with a fix; client package with hedged reads.
High-performance REST and WebSocket APIsOne upstream subscription per market fanned out to N sockets, level diffs instead of full books, bounded per-client buffers.bookd: one poller per market, diff messages, drop-on-slow-consumer; tested with three clients on one market.
Go idioms and CS fundamentalsContext everywhere, no shared mutable state without a lock, O(n) merges over sorted levels, fixed-point money.go test -race clean; O(n) book.Diff; 18-digit dec with a fuzz test.
Geth or Erigon familiarityMap how EVM calls into the exchange keeper through the precompile, and where gas and state access differ from a plain Geth call.Earlier Injective EVM console work: live eth_call to the exchange precompile.
Communicate with technical and non-technical teammatesShort design notes per change: the invariant, the test, the rollback.This page and the docs findings above.

05 · The work sample

Injective Book Lab: Go compiled to WebAssembly, reading mainnet.

01
Live book
Any of 489 markets, polled every 2 s, changed levels highlighted from a Go diff.
02
Taker simulator
Walks the book for a size and worst price. VWAP, slippage, on-chain fee, chain order checks.
03
Batch auction lab
Seeds a block of orders from the live book and clears both stages with the documented rules.
04
Endpoint health
Four public LCD hosts, hedged at 400 ms, lagging snapshots rejected by seq.
PackageWhat it doesTests
decFixed-point decimal at 18 digits (the Cosmos SDK LegacyDec precision), half-up rounding, tick floor and ceil.Table tests, fuzz round trip
bookL2 book, validation, mid, spread, depth bands, taker walk, O(n) diff, exchange tick and notional checks.Table tests, 2 benchmarks
fbaStage 1 market clearing and stage 2 limit clearing with the reference-price rule.Both documented examples
clientLCD client over net/http: hedged requests, failover, sequence guard, per-endpoint stats.Failover, hedge, stale node
cmd/bookdREST (/v1/book, /v1/sim, /v1/markets) and WebSocket (/v1/stream) server.3-client fan-out, bad input
cmd/wasm, cmd/injbookBrowser build exposing the packages as Promises; CLI for the same reads from a terminal.Browser run on mainnet

Standard library plus one WebSocket package. About 2,000 lines of Go, a quarter of them tests. Independent code written for this application.

06 · First 90 days

Read, test, then ship behind the tests.

Days 1 to 30
Read the keeper paths
Trace one spot and one derivative order from MsgCreate…Order to EndBlocker persistence.
Run a local node and the exchange tests; land a first small fix with a test.
Write the clearing rules down as property tests the team agrees with.
Days 31 to 60
Own a client surface
Pre-broadcast order validation in the Go SDK that mirrors chain rules.
Typed chain-unit vs human-unit prices across query versions.
Benchmarks for the hot paths a trader hits: book decode, order build.
Days 61 to 90
Own an API path
One WebSocket feed with diffs, sequence numbers and resync, load tested at the target subscriber count.
Dashboards for p99 latency and dropped-client rate.
A short design note for the next change to matching, with its invariants.

07 · Method & sources

Every number on this page comes from a live query or the docs linked below, taken on 7 Nov 2026. The JD is the public job posting (2026).

Exchange module: EndBlocker · Other Concepts

Worked examples: market · limit

EVM: precompiles · exchange precompile

Live data: sentry.lcd.injective.network/injective/exchange/v2/…

Go SDK: InjectiveLabs/sdk-go

Depth comparison: each venue's public order book API, read in one pass

Demo: injective-go.pages.dev · source

Independent homework for the Injective Labs Golang/Blockchain Engineer role · 2026 · edwardtay.com