Skip to content

Strategy guide

Build a supervised market-making strategy with an AI agent

An AI market-making workflow places a bid below the best ask and an offer above the best bid, then monitors fills, inventory and the live order book. The aim is to quote both sides without letting one fill turn into an uncontrolled directional position. It is an execution method, not a promise that the spread will cover fees, adverse price movement or funding.

Fensory exposes the required perpetual-futures tools through MCP: live order-book data, account state, open orders, limit-order placement, single and batch cancellation, order modification, order status and fills. The current tools make a supervised cancel and replace cycle possible. Each placement, cancellation or modification remains a separate real-money action that requires review and confirmation in the connected client.

Copy this prompt

Use the Fensory tools to prepare one supervised market-making cycle on BTC perpetual futures. Stay read-only first. Call get_perps_status, get_market, get_orderbook with depth 10, get_account_state, get_open_orders, get_user_fees and get_predicted_fundings. Report the best bid, best ask, spread, visible size at the first five levels, current position, available collateral, existing BTC orders, fees, current funding, market allow-list, access expiry and per-order cap. Stop if perpetual-futures trading is not ready, the market or account state is stale, the spread is too narrow to compare with fees, or an existing order would overlap this test. Prepare, but do not submit, one post-only bid and one post-only offer. Keep each order at or below $25 notional, keep total resting notional at or below $50 and keep the proposed net inventory boundary at $25. Use limit orders with tif Alo. Show the exact asset, side, size and price for each order. Ask for confirmation separately before each placement. After any confirmed placement, call get_order_status, get_open_orders and get_fills. If one side fills, stop quoting the side that would increase the resulting position. Do not place a replacement until you show the current inventory, the remaining order and a fresh order book. For a confirmed refresh, modify only one identified resting order with modify_perps_order. Explain that the modification creates a new oid and is post-only. Re-read get_open_orders after the response and track the new oid. If the modification is rejected or times out, do not retry. Check order status and open orders instead. For a confirmed stop, cancel only the named oids returned by get_open_orders. Do not use an unrestricted batch cancel. State whether any named order is a stop-loss or take-profit before asking for confirmation. Verify the final state with get_open_orders and get_fills.

Who this is for

This guide is for an eligible non-US user who understands perpetual futures and wants to test one small, supervised two-sided quoting cycle on a liquid market with explicit inventory and order limits.

What it is not

It is not an unattended market-making bot, a high-frequency system or a profit claim. It does not keep running after the client closes, guarantee maker fills or cancel orders automatically when connectivity is lost.

What you need

  • One verified perpetual-futures market

    Use one market with a current order book, valid minimum size and enough visible depth for the proposed quote. Do not switch symbols because the requested market is thin or unavailable.

  • A hard inventory boundary

    Set maximum resting notional, maximum net position and a stop condition before placing anything. The account per-order cap checks each order separately and does not cap the combined exposure of several resting orders.

  • A supervised refresh rule

    Define when a quote becomes stale and require a new order-book and account read before any change. Repricing too often can lose queue position, increase fees and turn a small test into repeated real actions.

What the agent does

  1. 01

    Check the market and account

    The assistant verifies that perpetual-futures trading is ready, resolves the market, reads minimum size and current collateral, and compares the account cap with the proposed order size before it constructs a quote.

    Tools: get_perps_status · get_market · get_account_state · get_user_fees

  2. 02

    Read the order book and existing orders

    The spread and visible depth show the immediate market. Existing orders and positions show the exposure already working. Funding is included because a market-making position can remain open after one side fills.

    Tools: get_orderbook · get_open_orders · get_predicted_fundings

  3. 03

    Prepare two post-only quotes

    The bid and offer use limit orders with Alo time in force. A post-only order is rejected instead of crossing the book. Each side is shown and confirmed separately, and a successful submission is not reported as a fill.

    Tools: place_perps_order

  4. 04

    Reconcile fills and inventory

    The assistant separates resting size, partial fills and completed fills. When one side fills, the resulting position becomes the new starting point. The opposite quote is not treated as a guaranteed offset.

    Tools: get_order_status · get_open_orders · get_fills

  5. 05

    Cancel or replace one known order

    A refresh starts from the live oid in open orders. A modification replaces that order and returns a new oid. A cancellation removes only the named order. Both actions require a fresh preview, separate confirmation and a final state check.

    Tools: modify_perps_order · cancel_perps_order

Fensory perpetual-futures terminal with an order book, open orders and position information
Use the live book, open-order state and position together. A quoted spread does not show whether either side filled.

Failure modes and limits

  • One side fills and price moves away

    A bid fill creates a long position and an offer fill creates a short position. The remaining quote may never fill, so the workflow stops and reports the inventory instead of assuming the book will return.

  • Both quotes become stale

    A new mid price can leave both orders far from the market or make one side too aggressive. The assistant re-reads the book and asks before changing either order. It does not reprice on a timer by itself.

  • Post-only placement is rejected

    Hyperliquid rejects an Alo order when it would immediately match. That protects the maker-only instruction, but it means the quote is not live. The assistant reports the rejection and does not silently convert it to Gtc, Ioc or market.

  • A modification changes the order id

    The previous oid is dead after a successful modification. The replacement is post-only and carries a new oid. Reusing the old id can produce an incorrect status or cancellation request.

  • A broad cancellation removes protection

    Stop-loss and take-profit orders also appear among resting orders. An unrestricted batch cancel can remove position protection. This guide names individual oids and requires the assistant to identify trigger orders before cancellation.

  • The spread does not cover the costs

    A visible spread is not profit. Fees, funding, adverse selection, partial fills and inventory losses can exceed it. The audit uses actual fills and fees and does not infer performance from quoted prices.

Read the result in the terminal

Open orders
Confirm each live oid, side, remaining size, price and time in force. After a modification, find the replacement under its new oid before making another request.
Position and margin
Read the net position, entry price, mark price, margin and liquidation price after every fill. A two-sided quoting plan can leave one directional perpetual-futures position.
Fills, fees and funding
Group fills by order id and use the actual filled prices and fees. Include funding when a position remained open. Resting quotes alone do not establish a gain or loss.

Runs on

The client list comes from the same release record as the MCP page. Every verified client has its own setup guide.

Questions people ask

Can Fensory cancel and replace a perpetual-futures order through MCP?
Yes. The live MCP exposes single and batch cancellation plus a modify tool for resting perpetual-futures orders. A modification replaces the order, forces the replacement to post-only and returns a new order id.
Does this strategy run automatically after I close the client?
No. This guide describes one supervised cycle started by the connected client. It does not claim a Fensory-hosted runtime, background loop or connectivity failover.
Why use post-only orders?
A post-only order must rest on the book instead of immediately taking liquidity. Hyperliquid rejects it when the price would cross the book. That keeps the order type explicit but does not guarantee a fill or a maker rebate.
Can I cancel every open order at once?
The MCP has a batch-cancel tool, but an unrestricted cancellation can also remove stop-loss and take-profit orders. This workflow names specific order ids and checks for trigger orders before any cancellation.
Does a tight spread make market making profitable?
No. The spread is only one input. Fees, funding, queue position, adverse selection, partial fills and inventory movement determine the actual result, which must be measured from fills and account records.