How to Automate Market Making on HIP-3 Pairs with Origami Tech

How to Automate Market Making on HIP-3 Pairs with Origami Tech

Introduction

This guide explains what HIP-3 markets on HyperLiquid are and how to build a basic futures market making algorithm for them using Origami Tech. You will see how to structure a top-of-book quoting grid, manage inventory risk, and adapt quotes dynamically to order book conditions.

What Are HIP-3 Markets on HyperLiquid

HIP-3 markets are permissionless perpetual futures deployed by external developers on HyperLiquid. Instead of relying only on centrally curated listings, HyperLiquid allows third parties to launch their own perpetual pairs, creating a constantly expanding ecosystem of experimental assets, niche narratives, and alternative volatility profiles.

For traders, this means earlier access to emerging markets, faster price discovery, and more diverse trading conditions. HIP-3 pairs often exhibit higher volatility, sharper liquidity shifts, and frequent micro swings, making them particularly suitable for automated strategies such as grid trading, market making, scalping, and structured execution.

Origami Tech integrates directly with HyperLiquid and treats HIP-3 markets as first-class instruments. You can deploy bots, grids, and formula-based strategies on HIP-3 pairs using the same workflow and infrastructure as standard perpetual markets.

How to Build a Basic Futures Market Making Algo for HIP-3 Pairs

This setup demonstrates how to create a simple top-of-book futures market maker using a single grid in Origami Tech. The goal is to continuously quote one bid and one ask near the best prices in the order book while actively managing inventory risk.

The configuration refreshes frequently, reacts to order book pressure, enforces hard position limits, and avoids quoting when the spread is too tight.

Below is the full grid configuration.

{
  "execute_price": "bid_px if side=='buy' else ask_px",
  "execute_volume": "order_notional_counter / execute_price",
  "buy_orders_count": "1 if edge_ok==1 and allow_buy==1 else 0",
  "sell_orders_count": "1 if edge_ok==1 and allow_sell==1 else 0",
  "r": "micro - k_inv * pos_norm * spr",
  "mm": "grid().margin_mode",
  "ps": "grid().position_side",
  "imb": "(bidAmt0 - askAmt0) / max((bidAmt0 + askAmt0), 0.00000001)",
  "mid": "(bid0 + ask0) / 2",
  "spr": "ask0 - bid0",
  "ask0": "orderbook_futures().ask[0].price",
  "bid0": "orderbook_futures().bid[0].price",
  "half": "max(min_half, 0.25 * spr)",
  "tick": "symbol().price_precision",
  "k_inv": "1.5",
  "micro": "mid + 0.5 * imb * spr",
  "ask_px": "max(ask0 - tick, raw_ask, bid0 + tick)",
  "bid_px": "min(bid0 + tick, raw_bid, ask0 - tick)",
  "askAmt0": "orderbook_futures().ask[0].amount",
  "bidAmt0": "orderbook_futures().bid[0].amount",
  "edge_ok": "1 if spr > 2*tick else 0",
  "max_pos": "0.05",
  "pos_raw": "position(ps, mm).quantity",
  "raw_ask": "r + half",
  "raw_bid": "r - half",
  "min_half": "max(2 * tick, 0.0002 * mid)",
  "pos_norm": "pos_signed / max(max_pos, 0.00000001)",
  "allow_buy": "1 if pos_signed <  max_pos else 0",
  "allow_sell": "1 if pos_signed > -max_pos else 0",
  "pos_signed": "pos_raw if ps=='one_way' else ((-pos_raw) if ps=='short' else pos_raw)",
  "is_buy_first": "1",
  "sleep_after_seconds": "1.0",
  "time_between_orders": "0.2",
  "order_notional_counter": "25"
}

What This Grid Does

This grid is a fast top-of-book futures market maker. It continuously places one limit bid and one limit ask near the top of the order book, updates them frequently (≈ once per second), and actively manages risk using your current futures position. Specifically, it:

• quotes 1 bid + 1 ask at all times;
• uses L1 imbalance to tilt its reference price (microprice);

• uses your signed futures position to skew quotes and reduce inventory, and to enforce hard max position limits;

• refuses to quote when the spread is too tight.

Logic > Reading the Futures Order Book (Top of Book)

Each cycle, the bot pulls the best prices from the futures order book:

• bid0 = best bid price

• ask0 = best ask price

From that, it computes:

• spr = ask0 - bid0 (the spread)

• mid = (bid0 + ask0) / 2 (the midpoint)

These values anchor where the bot quotes.

Logic > Measuring L1 Pressure with an Imbalance Signal

The bot looks at the amount available at the best bid and best ask:

• bidAmt0 = size at best bid

• askAmt0 = size at best ask

Then it computes a normalized imbalance:

imb = (bidAmt0 - askAmt0) / (bidAmt0 + askAmt0)

Interpretation:

• If imb > 0, bids are “heavier” → buy pressure is stronger

• If imb < 0, asks are “heavier” → sell pressure is stronger

Logic > Building a “Microprice” (a Smarter Fair Value than Midpoint)

Instead of quoting around the midpoint, it uses a microprice:

micro = mid + 0.5 imb spr

So:

• strong bid-side imbalance nudges the reference price up

• strong ask-side imbalance nudges it down

This helps the bot lean slightly into short-term pressure without fully becoming directional.

Logic > Correctly Reading Your Futures Position (and Why one_way Matters)

For futures, inventory is your position, not a base-asset wallet balance.

The grid uses:

• ps = grid().position_side (e.g., one_way, or long/short in hedge mode)

• mm = grid().margin_mode (cross/isolated)

Then it reads:

• pos_raw = position(ps, mm).quantity

Important nuance to point out:

In one_way mode, quantity is already signed: long = positive, short = negative.

So the grid defines:

• pos_signed = pos_raw when ps == 'one_way' - this works for most of the DEXes and a default position mode for centralized venues

• otherwise, it forces the hedge “short” leg to be negative

The result is a consistent internal variable:

• pos_signed > 0 means net long exposure

• pos_signed < 0 means net short exposure

Logic > Enforcing a Max Position (Hard Risk Cap)

The grid defines a maximum allowed inventory:

• max_pos (example: 0.05)

Then normalizes your position:

• pos_norm = pos_signed / max_pos

This gives the bot a scaled view of exposure (roughly -1 to +1 inside limits).

Logic > Choosing How Wide to Quote (Half-Spread Logic)

To avoid quoting too tightly (and getting picked off or fee-bled), it computes a quoting distance:

• tick = symbol().price_precision

• min_half = max(2*tick, 0.0002*mid)

• half = max(min_half, 0.25*spr)

What this means in practice:

• it will never quote closer than ~2 ticks (or ~0.02% of price)

• it also widens when the market spread widens

Logic > Inventory-Aware Skew: Shifting the “Center” of Quotes

This is the core market-making risk control.

It sets a reservation (center) price:

r = micro - k_inv pos_norm spr

Intuition:

• If you’re too long, pos_norm > 0 → r shifts down

•→ bids get less aggressive, asks get more aggressive (you sell more)

• If you’re too short, pos_norm < 0 → r shifts up

•→ bids get more aggressive (you buy more to reduce short)

Logic > Building One Bid and One Ask, then Clamping to Avoid Crossing

It proposes raw quote levels:

•raw_bid = r - half

•raw_ask = r + half

Then it clamps prices so they remain passive:

• bid must be ≤ ask0 - tick

• ask must be ≥ bid0 + tick

So the bot avoids becoming a taker by accidentally crossing the spread.

Logic > Only Quoting When Spread is Wide Enough

It applies a simple “edge” filter:

edge_ok = 1 if spr > 2*tick else 0

If the spread is too tight, it posts no orders. That reduces low-edge churn where fees and adverse selection dominate.

Logic > Position Gating: Stops Adding to an Already-Too-Big Position

It prevents the position from growing beyond ±max_pos:

• if pos_signed >= max_pos → stop placing buys

• if pos_signed <= -max_pos → stop placing sells

So in limit conditions, it can become one-sided temporarily to reduce risk, then return to two-sided quoting once back inside limits.

Logic > Sizing Orders by Fixed Notional

Instead of a fixed contract size, it targets a consistent quote-currency value:

• order_notional_counter = 25

• execute_volume = notional / execute_price

This keeps the trade size roughly stable as the price moves.

Logic > Fast Refresh + Staggered Order Placement

Two timing controls give it the high-frequency feel:

• sleep_after_seconds = 1.0 → recompute/requote roughly every second

• time_between_orders = 0.2 → small delay between buy and sell placement in a cycle

Both these variables can be completely removed from the grid, then the bot will start to replace orders after every market trade. But this approach may eat the rate limit quota too fast.

Origami Tech & HyperLiquid: Automating Trade on HIP-3 Markets

The integration between the Origami Tech trading automation platform and the HyperLiquid exchange now allows users to trade on experimental perpetual markets known as HIP-3. This collaboration enables traders to apply automated strategies to a new class of assets created by third-party developers, all while using the familiar Origami Tech toolset.

Key Aspects of the Integration

Unified Access: Traders can automate strategies across standard perpetuals, spot markets, and HIP-3 markets through a single, unified interface without altering their existing infrastructure or strategic logic.

HIP-3 Market Support: HIP-3 markets are permissionless perpetual futures created by external developers on the HyperLiquid platform. This structure provides traders with early-stage access to new, potentially high-volatility assets before they are listed on major centralized exchanges. Projects deploying such markets include Trade.xyz, Ventuals, and Felix Protocol.

Web3 API Connection: The integration is powered by a new Web3-based API flow, facilitating direct interaction with the HyperLiquid ecosystem.

Opportunities for Traders

The HIP-3 market environment is defined by increased volatility, frequent directional moves, and diverse trading conditions. Origami Tech offers several automated strategy types that are particularly well-suited for these markets:

strategy type and it's application in hip-3 markets

Looking Ahead: Support for HIP-4 (Outcome Markets and Options)

The recent HIP-4 proposal introduces "outcome" trading to the platform—fully collateralized contracts with a fixed price range and non-linear payouts, which are essentially prediction markets and options . The payout for a basic Call option at its expiration time T can be expressed as:

Payout = max(S_T - K, 0)

Unlike perpetual futures, HIP-4 contracts do not carry liquidation or margin leverage risks.

Date
February 10, 2026
Smart Trading, Maximum Profit

Trade Smarter with Origami

Take your crypto trading to the next level with our powerful automated trading terminal. Maximize profits, minimize risks, and stay ahead of the market 24/7.

Start Trading Now