agentleFS
SiftingIOSiftingIO/siftingio-ai-rules/.cursor/rules/siftingio-methodology.mdc

siftingio-ai-rules / rules

Cursor rule0 starsChanged 6 months agoMITView on GitHub

SiftingIO Fair Price methodology, how the single published price per symbol is formed (volume×reputation weighted median, MAD scoring, reputation/quarantine, quality flags) and what it is and isn't. Context for treating the feed correctly.

The file

We split this siftingio-methodology.mdc into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Bounded to a minority of bad feeds: no median- or mean-based estimator survives a *majority* of venues making the same coordinated error …

    line 47
  2. Distinctive:

    Treat the published price as a robust consensus mark, not a venue print.

    line 53
  3. Distinctive:

    Don't engineer for sub-ms execution off this feed.

    line 55
  4. Distinctive:

    Use the three timestamps to monitor latency rather than inferring it.

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 7,324 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
siftingio-methodology.mdc
---
description: SiftingIO Fair Price methodology, how the single published price per symbol is formed (volume×reputation weighted median, MAD scoring, reputation/quarantine, quality flags) and what it is and isn't. Context for treating the feed correctly.
globs: ["**/*"]
alwaysApply: false
---

# SiftingIO Fair Price methodology

For every symbol SiftingIO publishes **one fair price aggregated from multiple independent venues**, not a single-source pass-through. It's built on robust statistics so a stale, frozen, or manipulated venue can't move your price. This context matters when you build on the feed: treat it as a **robust reference price**, gate on its quality flag, and don't assume it's an executable, sub-millisecond quote.

## Design principles

- **Robust by construction**: the fair price is a **weighted median**, not an average. A median has a **50% breakdown point**: more than half the venues must be wrong, in the same direction, before the output is wrong. One bad feed moves an average; it does not move a median.
- **Never gate publishing**: even if every venue is degraded, the engine falls back to its safest source and still emits a price, with the degraded state exposed on the wire. It fails *soft*.
- **Independent venues**: venues share no infrastructure and no operator, so adding sources strengthens rather than dilutes the result.
- **Transparent & versioned**: the method is published and version-tagged; the algorithm and its guarantees don't change without a version bump.

## The pipeline

1. **VALIDATE**: drop any quote older than a strict staleness window; hard-kill any price more than a fixed fraction from the cross-venue median (catches decimal bugs and depegs).
2. **SCORE**: measure cross-venue dispersion with **MAD** (median absolute deviation, itself outlier-immune); convert each venue's deviation to a scale-free **modified z-score** (Iglewicz & Hoaglin, 1993) so a $10 miss on BTC and on a cheap asset are judged on the same footing.
3. **REMEMBER**: keep a per-venue **EWMA reputation**: one bad tick barely registers, sustained disagreement erodes trust, good behaviour restores it. **Quarantine with hysteresis** (a control-theory dead-band) benches a venue only after sustained misbehaviour and re-admits only after clear recovery, so borderline venues don't flicker. **Frozen-feed detection** flags a venue whose price is unchanged while the market demonstrably moves, a failure no staleness check catches.
4. **AGGREGATE**: surviving venues are weighted by **`volume × reputation`** and combined with a **weighted median**: anchored to where trading actually happens, yet no single heaviest venue can drag the price past its neighbours. The composite bid/ask is built around the fair price (`mid ± half-spread`) so it **can never cross**, and widens automatically when venues diverge.

## On-the-wire metadata

Every tick carries:

- **Three timestamps**: source (when the venue published), ingest (engine received), publish (reached you), so you can measure freshness, engine cost, and end-to-end latency independently.
- **Cross-venue consensus**: a normalised value of how tightly sources agreed, derived from the same MAD. Gate on it when you need tighter consensus than the median already enforces.
- **Quality flag**: `Normal` when the standard quorum of independent sources is contributing; `Degraded` when fewer than quorum are available and the engine fell back to its safest source (reason exposed). The price keeps flowing; **read the flag and decide for yourself**.

## Delivery cadence (per plan)

| Plan | Rate |
| --- | --- |
| Free | 1 Hz (1 update/s per symbol) |
| Builder | 4 Hz (~250 ms) |
| Pro | 6 Hz (~165 ms) |
| Ultra | 10 Hz (~100 ms) |
| Enterprise | Near real-time, no fixed cap, tuned to SLA |

The price is computed identically for everyone; only how often it's pushed depends on the plan.

## Stated limits (be honest about these)

- **Bounded to a minority of bad feeds**: no median- or mean-based estimator survives a *majority* of venues making the same coordinated error within the outlier threshold. The defence is independence and breadth, not a claim of immunity.
- **Reference price, not a sub-millisecond execution feed**: suitable for strategies, risk, valuation, settlement, and analytics; not a co-located feed for HFT order routing.
- **Composite spread is representative, not executable depth**: it describes the prevailing spread; it doesn't assert size is available at the quote on any single venue.

## How to build on it

- Treat the published price as a **robust consensus mark**, not a venue print.
- **Gate on the quality flag / consensus** for anything sensitive (settlement, marking, risk limits).
- Don't engineer for sub-ms execution off this feed; pick the plan tier whose Hz matches your workload.
- Use the three timestamps to monitor latency rather than inferring it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.