QFEX S&P 500 Trend Guard strategy report
Updated by the Circuit team
Summary
Hold the S&P 500 in uptrends. Venue: QFEX · USDC from Arbitrum One. Run this agent on Circuit
The agent holds the S&P 500 as a perp on QFEX while the index is in an uptrend, and USDC at other times. It uses no leverage.
It moves to USDC when the index closes 1% below its 200-day average, and buys back when the index closes 1% above. It pays QFEX's trading fee on about 2 switches a year, and funding while it holds the perp.
In a replay from 1950 to 2026, the trend guard returned 7.25% a year after costs, against 7.94% for holding the index. Its largest fall was −21.4%, against −57.0%.
- Largest fall, guard: −21.4%
- Largest fall, index: −57.0%
- Volatility, guard: 10.4%
- Volatility, index: 15.7%
- Worst 21 days, guard: −14.0%
- Worst 21 days, index: −33.0%
- 2008, guard: 0.0%
- 2008, index: −38.7%
- 2022, guard: −14.5%
- 2022, index: −19.7%
- 2026 to 13 Nov, guard: +5.5%
- 2026 to 13 Nov, index: +10.1%
- Losing years, guard: 23 of 77
- Losing years, index: 21 of 77
- Days long: 71%
- Switches a year: 2.3
- QFEX window, guard on US500: +6.54%
- QFEX window, guard on index: +6.41%
In these rows, guard is the trend guard of the agent, and index is holding the S&P 500 with no switches. Both come from a replay of the price index from 3 Jan 1950 to 13 Nov 2026. The replay charges 10 bps a side and 0.33% funding a year. The QFEX window is 3 Mar 2026 to 13 Nov 2026, after funding and before fees. Both QFEX-window rows apply the trend guard, one to QFEX's US500 prices and one to the index over the same days. At waits of 3 to 10 days the guard's largest fall is −21.4% to −29.0%, and its worst 21 days −14.0% to −23.1%.
Main risks
- The guard decides once a day, after the close, so a fast fall can come before it acts. On 19 Oct 1987 the index fell 20.5% in one day. The replay's guard had sold at the close of 16 Oct.
- In rising markets the guard earns less than the index: 7.25% against 7.94% a year since 1950, and 12.78% against 18.95% a year since 2023.
- Switches can reverse. Since 1950, 60 switches reversed within 20 trading days, at about 0.2% for each round trip.
- QFEX holds the USDC and the position, on cross margin with the user's other QFEX positions. Funding of 3% a year would cut the return to 5.22% a year.
Headline result
Return a year before costs*: 7.75%. Return of the trend guard on the S&P 500 from 1950 to 2026, before costs and funding. It uses a 200-day average, a 1% band and a 5-day wait.
- Trend guard: 7.25%
- Hold the index: 7.94%
- Volatility target: 6.97%
The bars are after 10 bps a side and 0.33% funding a year. At waits of 3 to 10 days the trend guard returns 6.91% to 7.25%. Its largest fall is −21.4%, and −21.4% to −29.0% at waits of 3 to 10 days. The largest fall of holding the index is −57.0%.
Illustrative net return*: 7.00% to 7.37%
- Before costs: +7.75%
- Costs a year: −0.46% to −0.11%
- Funding, 71% of days: 0.33% a year
Low end: 20 bps a side for fee, spread and price difference. High end: 5 bps a side, QFEX's published taker fee. QFEX charged 2.5 bps on each of the 6 real-money fills. Each end is one replay with all costs, so the rows do not add up to the net return.
* Illustrative backtest of the S&P 500 price index, 3 Jan 1950 to 13 Nov 2026, in place of the QFEX perp. Not a forecast. Past results do not show future results.
Strategy
In the replay since 1950, the value of holding the index fell up to 57.0% from a high, and lost 38.7% in 2008. The trend guard holds the index only while its closing price stays above the 200-day average.
The guard gives up part of the rises to cut the large falls. In the replay it returned 7.25% a year against 7.94%, and its largest fall was −21.4% against −57.0%. In 2008 it returned 0.0% against −38.7%. The average and the band are Jeremy Siegel's published 200-day rule. The agent adds a wait of 5 trading days between switches.
Illustration. From 3 Jan 2005 to 16 Oct 2026, the bar shows what the agent holds at each point: the S&P 500 or USDC. From a start of 100, the trend guard ends at 394 and holding the index at 592. The lowest values are 92 for the trend guard and 56 for the index.
The trend guard
The return comes from the S&P 500 price while the agent holds the US500 perp. The agent decides once each trading day, after the close.
- After 16:10 New York, the agent reads 2 years of closing prices from Yahoo, or from Cboe if Yahoo fails.
- It computes the 200-day average: the mean of the last 200 closing prices.
- When long, the agent moves the equity to USDC after a closing price 1% below the average.
- When flat, the agent moves the equity back into the US500 perp after a closing price 1% above the average.
- The earliest next switch is on the 5th closing price after the last switch.
- Between the two band edges, the agent keeps what it holds.
Price-source check
A wrong closing price could cause a wrong switch. So the agent checks each decision against the underlier, QFEX's own price of the index.
- The agent reads the underlier: the opening price of QFEX's 1-hour bar that starts at 16:00 New York.
- It applies the trend guard twice: with the closing price, and with the underlier in its place.
- If both give the same rule state, the decision stands.
- If they differ, the agent decides nothing that day and leaves that day out of later decisions.
- If the underlier read fails, the agent uses Circuit's QFEX perp price of the same hour.
Orders
The agent trades only US500 on QFEX, at 1x of the equity.
- Orders go out only on NYSE trading days from 09:30 to 17:00 New York.
- The target size is the equity divided by the price, rounded down to the size step of 0.001 contracts.
- The agent sends an order when the held size differs from the target by 5% and at least 1 size step.
- Each order is a market order that fills at most 0.25% from the mid.
- The agent runs every 15 minutes and sends at most one order in each run.
- Before each order it writes a pending entry, so a later run completes that order and sends no second one.
- After 3 refused orders in a row, it sends one order a trading day.
Outage and stop
With no index data the agent cannot apply the trend guard, so it moves to USDC.
- With no decided closing price for 5 calendar days, the agent closes the US500 position.
- A new decided closing price ends the outage, and the trend guard acts again.
- When the user stops the agent, the US500 position stays open. The user asks Circuit to close it.
- After the position is closed, the USDC stays in the user's QFEX account until the user withdraws it.
Key facts
- Holds: US500 perp or USDC
- Venue: QFEX
- Deposits: USDC on Arbitrum One
- Leverage: 1x, at most about 1.05x
- Trend guard: 200-day average, 1% band
- Wait between switches: 5 trading days
- Costs: 2.5 bps fee, funding
- Switches: About 2 a year
- Price sources: Yahoo, Cboe, QFEX
- Minimum deposit: 100 USDC
- Run interval: 15 minutes
- On stop: Position stays open
Source: the agent's description and its code.
Parameter choices
Average length
The agent uses Siegel's 200-day average. Another value set replaces Siegel's values only if it is better in all 4 windows. Better means a higher return for each unit of volatility and a smaller largest fall. None of the other 99 value sets is better. Of the 5 lengths, 200 days also gives the highest return in the main window, and its largest fall is the smallest.
- Average length: 200 trading days
| Length, days | Return a year | Switches a year |
|---|---|---|
| 50 | 4.40% | 6.4 |
| 100 | 4.94% | 4.6 |
| 150 | 6.01% | 3.4 |
| 200 | 7.05% | 2.5 |
| 250 | 6.75% | 2.2 |
Largest fall for each average length, 1950 to 2026: 50 days −44.4%; 100 days −49.9%; 150 days −40.5%; 200 days −23.1%; 250 days −24.6%.
Replay 1950 to 2026, 1% band, 1 closing price in a row, no wait, 10 bps a side, funding 0.33% a year. With the 5-day wait, the chosen values give 7.25% and −21.4%.
Band
The agent uses Siegel's 1% band. A 1% band stops a small cross of the average from causing a switch. With no band the guard switched 5.9 times a year, and 327 switches reversed within 20 trading days. At 1% it switched 2.5 times a year, with 75 reversed. Wider bands reverse less, but each does worse than 1% in at least one window. 2% gave a lower return for each unit of volatility from 1950 to 2026, 0.65 against 0.67. It also gave a larger fall from 1950 to 1979, −20.8% against −17.8%. 3% gave more return from 1950 to 2026, 7.38%, but a larger fall, −25.9%. From 1950 to 1979 it gave 0.65 of return for each unit of volatility, against 0.75.
- Band: 1% above and below
| Band | Return a year | Largest fall | Switches a year |
|---|---|---|---|
| 0% | 6.70% | −31.2% | 5.9 |
| 0.5% | 6.94% | −25.5% | 3.4 |
| 1% | 7.05% | −23.1% | 2.5 |
| 2% | 6.82% | −23.0% | 1.7 |
| 3% | 7.38% | −25.9% | 1.1 |
Switches reversed within 20 trading days, 1950 to 2026, for each band: 0% 327; 0.5% 136; 1% 75; 2% 30; 3% 6.
Replay 1950 to 2026, 200-day average, 1 closing price in a row, no wait, 10 bps a side, funding 0.33% a year. Reversed: switches that the next switch undid within 20 trading days.
Closing prices in a row
The agent switches on the first closing price beyond the band. 2 closing prices in a row gave a largest fall of −36.7%, in October 1987, against −23.1% for 1. With more closing prices in a row, the guard switches less often but acts later in a fast fall.
- Closing prices in a row: 1
| In a row | Return a year | Largest fall | Switches a year |
|---|---|---|---|
| 1 | 7.05% | −23.1% | 2.5 |
| 2 | 7.00% | −36.7% | 1.8 |
| 3 | 6.67% | −33.6% | 1.6 |
| 5 | 6.72% | −33.3% | 1.3 |
Replay 1950 to 2026, 200-day average, 1% band, no wait, 10 bps a side, funding 0.33% a year.
Wait between switches
The agent waits one trading week between switches, the same wait as the Stocks, bonds and gold agent. The earliest next switch is on the 5th closing price after the last switch. A wait cuts switches that reverse within 20 trading days: from 75 with no wait to 60 at 5 days and 55 at 10 days. Waits of 3 to 10 days give 6.91% to 7.25% a year and largest falls of −21.4% to −29.0%. A 20-day wait cuts reversed switches to 43, but gives 6.34% a year.
- Wait between switches: 5 trading days
| Wait, days | Return a year | Largest fall | Switches a year |
|---|---|---|---|
| None | 7.05% | −23.1% | 2.5 |
| 2 | 7.08% | −23.6% | 2.4 |
| 3 | 6.91% | −29.0% | 2.4 |
| 4 | 7.09% | −28.7% | 2.3 |
| 5 | 7.25% | −21.4% | 2.3 |
| 6 | 7.25% | −25.5% | 2.3 |
| 7 | 7.16% | −28.2% | 2.3 |
| 8 | 7.09% | −27.7% | 2.2 |
| 9 | 7.05% | −28.2% | 2.2 |
| 10 | 6.96% | −28.7% | 2.2 |
| 20 | 6.34% | −22.4% | 2.1 |
Switches reversed within 20 trading days for each wait between switches, 1950 to 2026: no wait 75; 2 days 71; 3 days 69; 4 days 64; 5 days 60; 6 days 59; 7 days 59; 8 days 56; 9 days 54; 10 days 55; 20 days 43.
Replay 1950 to 2026, 200-day average, 1% band, 1 closing price in a row, 10 bps a side, funding 0.33% a year. Reversed: switches that the next switch undid within 20 trading days.
Trade time
The agent trades in its first run after 16:10 New York, on the evening of the closing price. From 1983 a fill at the closing price gave 7.77% a year, and a fill at the next opening price 7.80%. A fill at the next closing price gave 7.23% and a largest fall of −36.7%. The first two differ by 0.03 points a year and have the same largest fall, −21.4%. The agent fills on the perp on the evening of the closing price, a median 6.3 bps from it. So the closing-price case is the nearer model of its fill.
- Trade time: First run after 16:10
| Fill | Return a year | Largest fall |
|---|---|---|
| At the closing price | 7.77% | −21.4% |
| At the next opening price | 7.80% | −21.4% |
| At the next closing price | 7.23% | −36.7% |
Replay 3 Jan 1983 to 13 Nov 2026, the years with real opening prices. Chosen values, 10 bps a side, funding 0.33% a year. Times are New York time.
Start of the decision
The agent needs the closing price of the day, so it starts after the close at 16:00. At 16:10, QFEX's perp price was a median 6.3 bps from the closing price. From 16:05 to 16:30 the median stayed within 6.3 to 8.0 bps. 16:10 had the lowest median, and it gives the price sources 10 minutes to show the closing price.
- First read, New York: 16:10
| Time, New York | Median | 95th percentile |
|---|---|---|
| 16:00 | 4.7 bps | 24.6 bps |
| 16:05 | 7.0 bps | 35.2 bps |
| 16:10 | 6.3 bps | 30.1 bps |
| 16:15 | 7.5 bps | 44.1 bps |
| 16:25 | 8.0 bps | 48.3 bps |
| 16:30 | 7.9 bps | 45.8 bps |
| 16:40 | 8.2 bps | 48.3 bps |
| 16:55 | 8.6 bps | 48.0 bps |
QFEX US500 1-minute prices against the S&P 500 closing price, 3 Mar 2026 to 13 Nov 2026, 179 trading days. Absolute price difference.
Run interval
The agent runs every 15 minutes. Its first run after 16:10 acts from 16:10 to 16:25, at a median price difference of 6.3 to 8.0 bps. It gets 3 or 4 runs before 17:00, so a failed run can try again the same evening. A run every 5 minutes acts at about the same prices, 6.3 to 7.5 bps. So 15 minutes keeps the evening fill with a third of the runs. A run every 60 minutes can miss 17:00, and the order then waits for 09:30.
- Run interval: 15 minutes
| Interval | First run acts | Median difference |
|---|---|---|
| 5 minutes | 16:10 to 16:15 | 6.3 to 7.5 bps |
| 15 minutes | 16:10 to 16:25 | 6.3 to 8.0 bps |
| 60 minutes | Can miss 17:00 | Fill at 09:30 |
Same 1-minute QFEX prices, 3 Mar 2026 to 13 Nov 2026. New York time.
Order window
Orders go out only on NYSE trading days from 09:30 to 17:00 New York. On weekends only QFEX's own order book sets the US500 price, and only 291 of 874 Saturday hours had trades. An order that waits for 09:30 matches the next-opening-price case: 7.80% against 7.77% a year.
- Days: NYSE trading days
- Hours, New York: 09:30 to 17:00
Saturday trades: QFEX US500 hourly history. Fill cases: the trade-time replay from 1983.
Slippage cap
Each market order fills at most 0.25% from the mid. On a QFEX book read on 14 Nov 2026, the spread was 0.13 bps, inside the cap. 71,554 USD of sell orders and 108,549 USD of buy orders were within 0.5% of the mid. The sell side alone is more than 700 times the minimum deposit of 100 USDC. The cap stops a fill far from the index on a thin book.
- Slippage cap: 0.25% from the mid
| Book read | Value |
|---|---|
| Spread | 0.13 bps |
| Sell orders within 0.5% | 71,554 USD |
| Buy orders within 0.5% | 108,549 USD |
One read of the QFEX US500 order book, Saturday 14 Nov 2026, 10:06 UTC.
Size threshold
The agent resizes only when the held size differs from the target by 5% and at least 1 size step. At 1x the position value follows the equity as the price moves. So only funding, fees, deposits and withdrawals change the ratio of position value to equity. Funding of 0.33% a year needs about 15 years to move that ratio 5%. The threshold keeps the position at about 1.05x the equity or less. A 2% threshold sends an order for each deposit or withdrawal of 2% or more, with more fees on small moves. A 10% threshold lets a withdrawal of 9% leave the position at 1.10x the equity.
- Size threshold: 5% and 1 size step
- Size step: 0.001 contracts
Size step from QFEX's market rules, read 14 Nov 2026. A resize costs 10 bps of the traded part.
Minimum deposit
The agent buys in size steps of 0.001 contracts, 7.55 USD at an index of 7,546, and rounds down. 100 USDC holds 0.98x of the deposit at 7,546, and at least 0.91x at any index level up to 25% higher. For 50 USDC this lower bound is 0.81x. 100 USDC is the smallest tested deposit that holds at least 0.9x up to a 25% rise: 75 USDC holds 0.87x. A larger minimum adds little: 150 USDC holds 0.94x.
- Minimum deposit: 100 USDC
Part of the deposit held in the US500 perp after rounding down, at 7,546, and its lower bound up to a 25% rise: 20 USDC 0.75x and 0.53x; 50 USDC 0.91x and 0.81x; 75 USDC 0.91x and 0.87x; 100 USDC 0.98x and 0.91x; 150 USDC 0.96x and 0.94x.
Position value after rounding down to the size step, divided by the deposit. Lower bound: for any index level up to 25% above 7,546, 1 minus one size step at that level, divided by the deposit.
Outage limit
With no decided closing price for 5 calendar days, the agent moves to USDC. 5 calendar days are about 3 trading days. So the agent can hold the index for about 3 trading days with no price. In 3 trading days the index fell up to 26.3%, from 14 to 19 Oct 1987. Since 1950 the index closed for 5 days or more only 7 times, for example 10 to 17 Sep 2001. So the rule costs about 0.02% a year. A 4-day limit acts on each holiday weekend: 457 times since 1950. A 6-day limit acts once since 1950, at 0.003% a year, but holds the index with no price for about 4 trading days.
- Outage limit: 5 calendar days
| Limit | Closures since 1950 | Cost a year |
|---|---|---|
| 4 days | 457 | 1.19% |
| 5 days | 7 | 0.02% |
| 6 days | 1 | 0.003% |
| 7 days | 1 | 0.003% |
Closures of the index of N calendar days or more, 1950 to 2026. Cost: one exit and one re-entry at 10 bps a side for each closure.
Price-source check rule
Each decision needs the same rule state from the closing price and from QFEX's underlier. Over 179 trading days the underlier at 16:00 New York was a median 3.8 bps from the closing price. The 95th percentile was 13.0 bps. The check blocks a day only when the difference moves the price across the band. A fixed tolerance of 50 bps would have blocked 3 of the 179 days. The rule-state check blocked 0 of the 179 days.
- Check: Same rule state from both
| Second price | Median | 95th percentile | Largest |
|---|---|---|---|
| Underlier at 16:00 | 3.8 bps | 13.0 bps | 96.7 bps |
| Perp at 16:00, if the underlier fails | 4.7 bps | 24.6 bps | 138.8 bps |
QFEX prices at 16:00 New York against the S&P 500 closing price, 3 Mar 2026 to 13 Nov 2026, 179 trading days. Absolute price difference.
History and freshness
At each decision the agent applies the trend guard to the last 500 closing prices. From 2000 to 2026 this gave the full replay's rule state on all 6,758 days. A newest closing price older than 5 calendar days, or fewer than 200 closing prices, counts as a failed read. Yahoo and Cboe agreed within 0.0005 bps on all 501 days since 14 Nov 2024.
- History: 500 closing prices
- Fewest closing prices: 200
- Freshness: 5 calendar days at most
Rebuild against the full replay, 3 Jan 2000 to 13 Nov 2026. Yahoo against Cboe: daily closing prices from both sources.
Exposure
The agent holds a long worth 1x of the equity. It earns the index return with no leverage, as the agent's description states. With USDC margin at 1x, the equity falls with the position, so the position stays near 1x as the price falls.
- Exposure: 1x of the equity
Holdings lag limit
After an order, the agent waits up to 30 minutes for QFEX to show the new position before it sends another order. This stops a second order while QFEX updates the position. After 30 minutes it acts on the position that QFEX shows.
- Holdings lag limit: 30 minutes
Pending-order limit
While an order has no known result, each run sends it again with the same operation name, and Circuit returns the earlier operation. After 2 hours, 8 runs at 15 minutes, the agent asks the user to check the QFEX account.
- Pending-order limit: After 2 hours
Read timeout
Each outside read of Yahoo, Cboe or QFEX waits at most 10 seconds, the default of Circuit's shared agent code. A failed read changes nothing, and the next run reads again.
- Read timeout: 10 seconds
Refused orders
After 3 refused orders in a row, the agent sends one order a trading day. A refused order costs nothing. The limit stops the same refused order in every run of the order window.
- Refusals in a row: 3, then 1 order a day
Risks
- The guard decides once a day, after the close, so a fast fall can come before it acts. On 19 Oct 1987 the index fell 20.5% in one day, and 26.3% from 14 to 19 Oct. The replay's guard had sold at the close of 16 Oct. A guard still long on 19 Oct takes the full fall.
- In rising markets the guard earns less than the index: 7.25% against 7.94% a year since 1950, and 12.78% against 18.95% a year since 2023. From 1 Jan to 13 Nov 2026 it returned +5.5% against +10.1%.
- While the agent held USDC, the index rose a median 2.9% in the 87 flat periods since 1950. The index fell by more than the cost of one round trip, 0.2%, in 15% of them. So in 85% of flat periods the exit did not save the cost of its round trip.
- Switches can reverse. Since 1950, 60 switches reversed within 20 trading days. Each round trip costs about 0.2% at 10 bps a side.
- Slow falls still cost money: in 2022 the guard lost 14.5% against 19.7% for the index. It had 23 losing years of 77, against 21 for the index.
- Funding on QFEX averaged 0.33% a year from 7 Mar 2026 to 14 Nov 2026. At 3% a year, the level of some stock perps on Hyperliquid, the return falls to 5.22% a year.
- QFEX holds the USDC and the position on cross margin. The user's other positions in the same QFEX account share that margin. They can bring the account to the maintenance margin.
- The perp price can differ from the index. At 16:00 New York the underlier differed from the closing price by up to 96.7 bps, and the perp by up to 138.8 bps. On weekends only QFEX's own book sets the price.
- QFEX's market rules, read on Saturday 14 Nov 2026, refuse an order more than 3.0% from the reference price. The agent's market orders fill at most 0.25% from the mid. A refused exit waits for the next run. After 3 refusals in a row, the agent sends one order a trading day.
- A wrong closing price in the history can change the guard's decision. Yahoo and Cboe differed by more than 10 bps on 15 days since 1975, by up to 243.9 bps. The price-source check covers the newest closing price only.
- With no decided closing price for 5 calendar days, the agent sells, and buys back when prices return. Each such round trip costs about 0.2%.
- Small deposits hold less than 1x after rounding down to the size step. 100 USDC holds at least 0.91x at any index level up to 25% above 7,546.
- When the user stops the agent, the US500 position stays open, with its price risk, until the user asks Circuit to close it. After the position is closed, the USDC stays in the QFEX account until the user withdraws it. If the agent holds only USDC when the user stops it, Circuit's list of what the stop leaves behind is empty. The list does not show the USDC in the QFEX account.
Glossary
Terms
- S&P 500: An index of 500 large US stocks. The report uses its price index, with no dividends.
- QFEX: An exchange for perps on stocks, indices and commodities. It holds margin in USDC.
- USDC: A token that is worth 1 US dollar.
- Perp: A futures market with no end date.
- US500: QFEX's perp on the S&P 500 index.
- Contract: The unit of US500 size. One contract is worth the index price in USD.
- Size step: The smallest change of a QFEX position: 0.001 contracts for US500.
- Equity: The agent's USDC on QFEX plus the gain or loss of the open position.
- 1x: A position value equal to the equity, with no leverage.
- Long: Holding the US500 perp. It gains when the price rises.
- Flat: Holding no position: the equity stays in USDC.
- Closing price: The last price of the S&P 500 index on a trading day, at 16:00 New York.
- 200-day average: The mean of the last 200 closing prices.
- Band: The distance from the 200-day average that a closing price must pass before a switch: 1% above to buy, 1% below to sell.
- Trend guard: The rule of this agent: long above the band, flat below it.
- Rule state: Long or flat, from the trend guard.
- Switch: A change of the rule state, from long to flat or back.
- Wait between switches: The smallest number of trading days from one switch to the next.
- Reversed switch: A switch that the next switch undoes within 20 trading days.
- Round trip: One exit and one re-entry.
- Flat period: The trading days from an exit to the next entry.
- Underlier: QFEX's own price of the index.
- Price-source check: The agent applies the trend guard with the closing price and with the underlier, and acts only when both agree.
- Decided closing price: A closing price that passed the price-source check.
- Outage: 5 calendar days with no new decided closing price. The agent then moves to USDC.
- Funding: A payment each hour between longs and shorts on a perp.
- bps: Basis points. 1 bp is 0.01%.
- Mid: The price halfway between the best buy order and the best sell order.
- Market order: An order that fills at once at the best prices in the order book.
- Taker fee: QFEX's fee on an order that fills at once against the order book, such as a market order.
- Slippage cap: The largest distance from the mid at which a market order may fill.
- Size threshold: The smallest difference between the target size and the held size that gets an order.
- Order window: The hours in which the agent sends orders.
- Pending entry: A memory entry that marks an order that the next run must complete first.
- Operation name: A fixed name of one money operation. Circuit runs one operation for each name.
- Cross margin: One margin pool for all positions of a QFEX account.
- Maintenance margin: The margin below which QFEX closes positions.
- Ask Circuit: Circuit's chat. The user asks it to move USDC into or out of QFEX, or to close a position.
- Stop: The user stops the agent in Circuit. The agent then sends no more orders.
- Replay: A simulation of the trend guard on past prices.
- Value set: One choice of average length, band and closing prices in a row.
- Main window: 3 Jan 1950 to 13 Nov 2026.
- Sub windows: 1950 to 1979, 1980 to 1999 and 2000 to 2026.
- Return a year: The yearly growth rate, compounded.
- Volatility: How much the daily return swings, as a yearly percentage.
- Return for each unit of volatility: The return a year divided by the volatility.
- Largest fall: The largest drop from a high to a later low.
- Worst 21 days: The worst return over 21 trading days in a row.
- Losing year: A calendar year with a return below 0.
- Hold the index: The S&P 500 held all the time as a 1x perp, with no switches. The replay charges it the same funding, 0.33% a year, and 10 bps for its one entry.
- Volatility target: The S&P 500 sized to 15% volatility a year from the last 20 days, at most 1x.
- Illustrative net return: The return a year of the replay after costs and funding.
Replays
| Replay | Window | Length | Data |
|---|---|---|---|
| Main | 3 Jan 1950 to 13 Nov 2026 | 77 calendar years | Yahoo S&P 500 closing prices |
| Sub window 1 | 1950 to 1979 | 30 calendar years | Same |
| Sub window 2 | 1980 to 1999 | 20 calendar years | Same |
| Sub window 3 | 2000 to 2026 | 27 calendar years | Same |
| Since 2005 | 3 Jan 2005 to 13 Nov 2026 | 22 calendar years | Same |
| Since 2023 | 3 Jan 2023 to 13 Nov 2026 | 4 calendar years | Same |
| Trade time | 3 Jan 1983 to 13 Nov 2026 | 44 calendar years | Yahoo, with real opening prices |
| QFEX window | 3 Mar 2026 to 13 Nov 2026 | 179 trading days | QFEX US500 prices and underlier |
| Funding | 7 Mar 2026 to 14 Nov 2026 | 6,046 hours | QFEX hourly funding rates |
| Price sources | 2 Jan 1975 to 13 Nov 2026 | 13,076 days | Yahoo against Cboe |
Model
- (E) At each closing price the replay applies the trend guard: 200-day average, 1% band, 1 closing price in a row, 5-day wait. A trade fills at that closing price.
- (E) A 1x long earns the index price return, less funding and fees.
- (E) A flat day earns 0: USDC on QFEX earns nothing.
- (E) Costs: 10 bps of the traded value for each side. QFEX's published taker fee is 5 bps, and QFEX charged 2.5 bps on each of the 6 real-money fills. The rest covers the spread and the price difference to the index.
- (E) Funding: 0.33% a year on each day long, the mean of 6,046 hourly QFEX rates.
- (E) Selection: Siegel's values stay unless a value set is better in the main window and in each sub window. Better means a higher return for each unit of volatility and a smaller largest fall.
- (E) Wait rule: against no wait, a wait may lose at most 0.02 of return for each unit of volatility. It may also lose at most 1 point of largest fall. Both limits apply in all 4 windows. The waits 1 day shorter and 1 day longer must also pass.
- (E) Cost test: the guard's return for each unit of volatility is 0.69, against 0.50 for the index. At 90 bps a side, the guard's value falls to the index's value.
Model assumptions and validation scope
E: Estimate from a replay or from arithmetic.
V: Verified from a source or a recorded test.
A: Assumption: set by design or by reasoning; to be calibrated with live data.
(E) Lead figures: a replay of the S&P 500 price index from 1950 in place of the QFEX perp. QFEX prices in this report start on 3 Mar 2026.
(E) Start of the decision, run interval and price-source check: from 179 trading days of QFEX prices, 3 Mar 2026 to 13 Nov 2026.
(E) Values of the trend guard: Siegel's published rule, from a test on the Dow from 1886 to 2012. This replay checks them on the same S&P 500 data that gives the lead figures.
(E) Wait between switches: Circuit's safety checklist for agents needs a wait. One trading week is a design value, the same as in the Stocks, bonds and gold agent. In the replay's wait rule, only no wait passed together with its neighbouring waits, because the largest fall changes between neighbouring waits.
(E) At waits of 3 and 4 days the largest fall comes from the fall of 2018 to 2020 (−29.0%, −28.7%). At waits of 5 days or more it comes from the fall of 1999 to 2003. So the report gives waits of 3 to 10 days as a range: 6.91% to 7.25% a year, −21.4% to −29.0%.
(E) Funding: 6,046 hourly QFEX rates from about 8 months, applied to 77 years.
(E) Costs: 5 of the 10 bps a side is an estimate for spread and price difference.
(A) Dividends: the replay uses the price index and assumes that US500 pays no dividends. QFEX's documents state a dividend adjustment for its stock perps. An index fund also pays dividends.
(E) Fill: the replay fills at the closing price. The agent fills on the perp from 16:10, a median 6.3 bps from the closing price.
(E) QFEX window: 2 switches, long on 167 of 179 days. The perp return is after funding of 0.25% and before fees.
(V) First read after 16:10: in the real-money run, the 18 Nov closing price read at 16:12 New York equaled Yahoo's final closing price (0.00 bps). The sample is one decision.
(A) Slippage cap: set from one Saturday book read. Weekday reads from 16:10 to 17:00 New York will calibrate it.
(A) Run interval, size threshold, holdings lag limit, pending-order limit, read timeout and refused-orders limit: set by design; to be calibrated with live data.
(V) Holdings lag on QFEX: none seen. The run after each test entry showed the holding.
(V) Reads of Yahoo and QFEX from Circuit's servers: 191 hosted paper runs, no failed run.
(A) Reads of Cboe from Circuit's servers: not verified. For each decision that the real-money runs logged, the agent read Yahoo. In a run from a local machine with Yahoo made to fail, Cboe gave the same decision as Yahoo.
(A) NYSE early-close days: the underlier drifts toward QFEX's own book after 13:00 New York, so the price-source check can block the decision of that day.
(A) QFEX price limit: 3.0% from one read on Saturday 14 Nov 2026. The limit on trading days can differ.
(E) Minimum deposit: exposure at an index of 7,546 on 14 Nov 2026, and a lower bound for index levels up to 25% higher.
(E) Outage cost: one exit and one re-entry for each closure of 5 days or more.
(V) Rebuild from 500 closing prices: the same rule state as the full replay on all 6,758 days from 2000, in a recorded unit test.
(V) Unit tests ran on the agent's code with a draft of Circuit's shared agent code.
(V) Real-money fills: 6 fills with 12 USDC, each within the 0.25% cap. 4 were inside QFEX's 1-minute price range and 2 were 0.1 USD above the minute's high. The largest gap from the minute's opening price was 10.1 bps. QFEX's fee was 2.5 bps on each fill.
(V) Stop, then close: Ask Circuit closed the open US500 position of 0.001 contracts with 2 confirmations and no passkey. The fill came 31 seconds after the stop.
(V) Exit on a closing price that a test version of the agent set below the band, with real money: one sale of the whole position, then no order in the next 2 runs.
(V) Withdrawal: 11.81 USDC back to Arbitrum One in 8 seconds, no fee. The real-money tests cost 0.27 USD in total.
Tests of each rule
| Rule | Unit test | Paper | Real money |
|---|---|---|---|
| Trend guard switches | Passed | None | Passed |
| Wait between switches | Passed | None | None |
| Price-source check | Passed | None | None |
| Price reads, Yahoo | Passed | Passed | Passed |
| Price reads, Cboe | Passed | None | None |
| Outage rule | Passed | None | None |
| Order window | Passed | Passed | Passed |
| Size | Passed | Passed | Passed |
| Resize | Passed | None | None |
| Refused orders | Passed | None | None |
| Pending order and holdings lag | Passed | None | None |
| Close after a stop, by Ask Circuit | None | None | Passed |
Unit test: the agent's code with a simulated venue and a fixed clock, 23 tests passed on 18 Nov 2026. Paper: Circuit's hosted test mode with live prices and no money, 191 runs from 15 to 17 Nov 2026. Real money: tests with 12 USDC from 17 to 19 Nov 2026.
