Skip to content

Agent Skill · version 0.1.0

Download Fensory Mean-Reversion Agent Skill

Evaluate a transparent mean-reversion rule from completed candles, inspect funding, liquidity and Fensory account controls, then prepare a bounded order for review.

Download and review

Download the public file, review every instruction, then place it in the skills directory documented by the compatible client you use. Client-specific paths are omitted until each workflow is verified.

Download
curl -fsSL https://fensory.com/skills/mean-reversion/SKILL.md -o SKILL.md

What the skill instructs

  • Read the account and instrument before preparing an action.
  • Keep the proposal inside the user's ceiling and the account's per-order cap.
  • Show the exact symbol, side, order type and size before a write call. Include the limit price for a limit order, or the current quote and expected execution conditions for a market order, then ask for confirmation.
  • Report a prepared order, submitted order and fill as three different states.

SKILL.md

---
name: fensory-mean-reversion
description: Evaluate a transparent mean-reversion rule from completed candles, inspect funding, liquidity and Fensory account controls, then prepare a bounded order for review.
license: Proprietary
compatibility: Requires access to the Fensory MCP server and an eligible Fensory account. Fensory is not available to US persons.
metadata:
  author: Fensory AG
  version: "0.1.0"
  source: "https://fensory.com/skills/mean-reversion"
---

# Build a mean-reversion strategy with an AI agent

## When to use

This guide is for an eligible user who wants an agent to calculate a simple deviation rule consistently and explain why a candidate exists. The example uses a 20-candle mean and standard deviation so every input can be shown.

It is not a claim that an asset has a stable fair value or that every extreme will reverse. It does not support a two-asset pairs trade, and it should not be described as arbitrage. A one-market perpetual-futures position can keep losing while price moves farther from the mean.

## Operating rules

- Start with read tools and identify the signed-in account, market, venue and instrument before preparing an action.
- Treat the Fensory account state, open orders, positions and fills as authoritative when they differ from the conversation.
- Fensory enforces four controls on the account: a kill-switch, an access expiry, a market allow-list and a per-order cap. Client confirmation instructions are separate from those account controls.
- Never describe a perpetual future as a share or tokenized equity. State the instrument and its risks before discussing an order.
- Never substitute a different market, quote currency or instrument because the requested one is unavailable.
- Keep every proposed order within both the user's stated ceiling and the account's per-order cap.
- Do not place, cancel or replace an order until the exact symbol, side, order type and size have been shown. For a limit order, show the limit price. For a market order, show the current quote and expected execution conditions. The user must confirm that exact action.
- Stop when a required tool is unavailable, the account limit cannot be verified, the quote is stale or the instrument is ambiguous.

## Risk and scope

This file is operational guidance, not financial advice. Trading can lose the full amount committed. Perpetual futures use margin and can be liquidated. Spot assets can lose value. Stop if the instrument, current quote or account controls cannot be verified.

## Procedure

1. **Resolve the market and collect completed data.** The agent verifies the instrument, removes the current candle and checks the one-hour timestamps. It does not mix spot prices with the perpetual-futures position it may later prepare. Tools: `get_perps_status`, `get_market`, `get_candles`.
2. **Calculate the reference window.** The mean and sample standard deviation come from the 20 candles before the latest completed close. The client prints the window so the z-score can be recalculated independently.
3. **Separate an extreme from an instruction.** A threshold crossing creates a candidate, not an order. The agent reports the direction, distance from the mean and invalidation level without calling the signal safe or likely to win.
4. **Check funding, liquidity and existing exposure.** A position held while waiting for a reversion can pay funding and face changing spread or depth. The account may already contain exposure or a resting order, so those records are checked before a new proposal. Tools: `get_predicted_fundings`, `get_orderbook`, `get_account_state`, `get_open_orders`.
5. **Prepare one bounded action and read the result.** The agent shows the limit order, target and stop proposal first. After confirmation it reads the actual venue state and distinguishes a resting order, partial fill and completed fill. Tools: `place_perps_order`, `get_order_status`, `get_fills`, `get_open_orders`.

## Request template

Use the Fensory tools to assess a BTC perpetual-futures mean-reversion rule. Stay read-only first. Call get_perps_status, get_market and get_candles. Request at least 100 completed one-hour candles and ignore the candle that is still forming.

Using the 20 completed candles immediately before the latest completed candle, calculate the mean close and sample standard deviation. Calculate the latest completed close's z-score against that window. Mark a long candidate only when z is at or below -2. Mark a short candidate only when z is at or above 2. Otherwise report no signal. Use the reference mean as the illustrative exit target and a move beyond an absolute z-score of 3 as the invalidation threshold. Print every timestamp, value and formula input used.

Then call get_account_state, get_open_orders, get_predicted_fundings and get_orderbook. State the current position, funding, spread, nearby depth, balance, allowed markets, access expiry and per-order cap. If a candidate exists, prepare but do not submit a limit order worth no more than $25, without changing leverage or margin mode. Show the exact entry, target and proposed stop arguments, estimated fees and liquidation risk. Ask for confirmation for that exact action. Stop if the history is incomplete, the standard deviation is zero, the latest data is stale or price continues to extend beyond the invalidation threshold.

## Failure handling

- **The market is trending rather than reverting:** Price can continue away from the reference for many candles. A larger z-score is not proof that a reversal is closer, and increasing size as the move extends compounds the risk.
- **The reference mean moves:** Each new completed candle changes the rolling mean and standard deviation. A target calculated in one review may differ at the next review, so the agent must report its timestamp.
- **The sample is too quiet:** A very small or zero standard deviation makes the z-score unstable or undefined. The prompt stops rather than dividing by zero or treating a tiny move as a reliable extreme.
- **Funding and time work against the position:** A reversion can take longer than expected or never arrive. Funding, fees and spread continue to affect the account while the position remains open.
- **The client stops before the next review:** This is a client-run process. The position and protective orders remain at the venue, but the agent does not recalculate the rolling window after its client or external schedule stops.

## Response contract

Report the account used, the exact instrument, the tools called, the controls that applied and the current order or position state. Separate a prepared order from a submitted order, and a submitted order from a fill. If no action was taken, say so directly.

## Sources

- [NBER: reappraisal of mean-reversion evidence](https://www.nber.org/papers/w2795)
- [Research: cryptocurrency momentum and reversal](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3913263)
- [Hyperliquid liquidations](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/liquidations)
- [Hyperliquid fees](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees)
- [Fensory MCP server](https://fensory.com/mcp)

Product behavior and client permissions verified 2026-10-17.

Questions people ask

What does the Fensory Mean-Reversion Agent Skill install?
It downloads one SKILL.md file containing operating instructions, risk boundaries, the tool sequence and a response contract. It does not install the Fensory MCP server or create an account.
Does the skill receive trading authority by itself?
No. Authority comes from the signed-in Fensory connection and the controls configured on that account. The skill cannot increase the market access, expiry or per-order cap.
Can the skill submit an order without showing it first?
The public file instructs the client to show the exact action and wait for confirmation before a write call. That confirmation is a client instruction, while the Fensory account controls are enforced separately.