01 / 06

Goblin

Fully on-chain limit orders. The Uniswap killer.

Powered by Arbitrum Stylus Robinhood Chain Rust

Goblin solves an open problem in DeFi: a central limit order book that lives entirely on-chain — on-chain matching, on-chain settlement — with no operator and no off-chain matcher.

100+ orders per call1 tx match + settle
Why Goblin

Everything an AMM can do.
Everything a CLOB should.

Three designs for trading on-chain. Only one keeps liquidity composable while matching and settling every order on-chain.

AMM

Uniswap v2 · v3 · v4

Decentralization Decentralized
Order types Market only
Liquidity Composable
Matching On-chain
Settlement On-chain

Upsides

  • Composable liquidity
  • Fully on-chain

Downsides

  • Only market orders — no limit orders
  • Impermanent loss
  • Toxic arbitrage
  • Retail LPs lose money

Hybrid CLOB

dYdX · 0x Exchange

Decentralization Centralized operator
Order types Limit + market
Liquidity Siloed
Matching Off-chain
Settlement On-chain

Upsides

  • Limit orders
  • Better price discovery
  • Impermanent-loss protection

Downsides

  • Siloed liquidity
  • Not composable
Winner

Goblin

Decentralization Decentralized
Order types Limit + market
Liquidity Composable
Matching On-chain
Settlement On-chain

Upsides

  • Limit + market orders
  • Composable liquidity
  • On-chain matching & settlement
  • No operator, no off-chain matcher

Downsides

None. That's the point.

Benchmarks

Batch 99 orders. In a single call.

Place 99 limit orders on Goblin, or open a single position on Uniswap v4. Same market, very different economics.

Goblin

goblin-core-v1
Bids mid 80,000 Asks
79,800 spread 50 80,200
empty order book
0/99
orders
1
tx
100+
per call

Uniswap v4

AMM
Uniswap LP liquidity price 80,000
60,000 no position 100,000
no positions
0/1
positions
1
tx
1
per call

Demo only — each run pops a sample transaction. Both link to real testnet txs.

Benchmarks

Run both tests to reveal the results.

○ Place 99 orders ○ Open 1 position
Under the hood

A 256-bit key. Two layers. Zero rebalancing.

Goblin replaces the tree with two bitmap layers. Matching starts from the market's last position and walks the bits outward: the outer bitmap finds live price regions, the inner bitmap finds the order slot. No pointers, no rebalancing.

Goblin · 2-layer matrix

O(1) write
MARKET STATElast bid positionlast quote positionOUTER BITMAP1 bit / bitmapINNER BITMAP01234567bidsspreadasks
market state
holds the last bid / last quote position. A position carries both the price and its slot coordinates, so it also points into the bitmaps.
outer bitmap
256 bits, one per inner bitmap. A set bit means that inner bitmap is active.
inner bitmap
one bit per slot — up to 8 active orders per price, densest at the touch, and nothing between best bid and best ask.
the magic
slots are never cleared. Filling a resting order just turns its bit off in the inner bitmap; when an inner bitmap goes quiet, its bit in the outer bitmap turns off too.
  • Market and price information encoded in a 256-bit key
  • No rebalancing required
  • Builds iteration capability on top of EVM's key-value trie
  • Size: a few KBs
  • Gas cost: cheaper than Uniswap

Balanced tree

O(log n) + rebalance
balanced tree · index keys pointers, not data

dashed nodes = allocated index slots holding no price data

memory crosses gas ceiling
0 gas ceiling 1 MB+
Keys raw indices
Data stored in nodes
Rebalance overwrites slots
Cost prohibitive
  • Keys are simply indices. Price data must be stored in nodes, and keys are left with empty space while more slots are needed to store leaf data.
  • Rebalancing wastes gas by overwriting slots
  • Size: 1 MB+
  • Gas cost: prohibitive — beyond the gas ceiling
Algorithm · continued

Deposits stay home. Deltas net out.

Two more pieces make Goblin cheap to run: balances held inside the contract, and a netting step that cancels opposing deltas across markets before anything is transferred.

Internal deposits

Balances live inside the contract, not in an ERC-20 wallet.

A fill updates a balance in place, so no token transfer leaves the contract — market making stops paying for token movement.

Delta netting

Trade across many markets in a single settlement.

Every fill produces a per-token delta. Goblin sums the deltas per token and applies only the net, so fills cancel out before any transfer happens.

ETH / USDC+2 ETH-6,000 USDCWBTC / USDC+15,000 USDC-0.5 WBTCETH / WBTC+1 ETH-0.03 WBTCNET DELTA · PER TOKENETH+2 +1+3USDC-6,000 +15,000+9,000WBTC-0.5 -0.03-0.53TOKEN TRANSFERS6 ERC-20 transfers→0 transfersbalances updated in place · nothing leaves the contract

Three fills, three markets: ETH +2 +1 = +3, USDC -6,000 +15,000 = +9,000, WBTC -0.5 -0.03 = -0.53. Only the net is applied, so the trade settles against internal balances with no ERC-20 transfers at all.

The goblins

4 people. One open problem.

A small team building the on-chain order book that DeFi has been missing.

Johan

Technology

Systems and Stylus. Wrote an order book that fits inside the trie.

Anna

Business Development

Markets and integrations. Turns limit orders into liquidity.

Hans

Finance

Runs the books and the treasury. Keeps the goblins solvent.

Franz

Design & Marketing

Draws the interface and the goblin — then tells everyone about it.

Ship limit orders on-chain.

Goblin is a fully on-chain limit order book built on Arbitrum Stylus. Composable liquidity, on-chain matching, on-chain settlement.