feat(741macro): 741 Pure Macro Matrix — x402-gated 5-EMA B2B endpoint#202
Merged
Conversation
5-layer EMA structural alignment engine (EMA 30/60/90/120/741) exposed as a premium REST + MCP tool gated at 0.04 RLUSD via x402/402Proof. - NEW core/api/macro741_bp.py — Flask blueprint at GET/POST /api/741macro • Fully dynamic ticker universe via ?symbols= (no hardcoded list) • Tradier primary, Alpaca fallback for 1150-day daily bar history • Pure-Python EMA computation (no pandas dependency in hot path) • PERFECT_BULLISH_REGIME / PERFECT_BEARISH_REGIME / CONSOLIDATION_CHOP • squeeze_alert flag when CHOP + |matrix_spread_pct| < 5% (macro coil) • Discord webhook (DISCORD_WEBHOOK_ALL) fires on PERFECT alignment hits • 60-second per-ticker in-memory cache; max 50 symbols per call - EDIT proof402_integration.py — register /api/741macro UUID + price - EDIT core/api/mcp_bp.py — add macro_741_scan MCP tool (schema + dispatch) - EDIT core/app.py — import and register macro741_bp at /api prefix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RyKH8i6w34HcLA3HGBzfQn
|
Deployment failed with the following error: Learn More: https://vercel.com/timothy-waltons-projects?upgradeToPro=build-rate-limit |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Adds Macro741ID constant (f3a7c891-2d54-4b8e-9a1f-6c3d8e5f7b2a) and seeds the 741 Pure Macro Matrix endpoint (0.04 RLUSD) into 402Proof on every boot. Without this, 402Proof cannot issue invoices for the new B2B macro alignment endpoint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RyKH8i6w34HcLA3HGBzfQn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
741 Pure Macro Matrix
Adds
/api/741macro— a new x402-gated premium endpoint implementing the 741 Pure Macro Matrix: a 5-layer EMA structural alignment engine for institutional macro regime detection.API:
GET/POST /api/741macro| Cost: 0.04 RLUSD | MCP tool:macro_741_scanWhat It Does
Computes EMA 30 / 60 / 90 / 120 / 741 on daily closes for any set of US equity tickers and classifies each into one of three macro states:
PERFECT_BULLISH_REGIMEPERFECT_BEARISH_REGIMECONSOLIDATION_CHOPsqueeze_alertsqueeze_alert=truefires whenCONSOLIDATION_CHOPand|matrix_spread_pct| < 5%— price coiling directly against the 741 anchor, macro breakout building.matrix_spread_pct = ((EMA_30 - EMA_741) / EMA_741) * 100Key Design Points
?symbols=SPY,QQQ,GME,NVDA(any comma-separated list, max 50). No hardcoded defaults.DISCORD_WEBHOOK_ALLenv var)f3a7c891-2d54-4b8e-9a1f-6c3d8e5f7b2aregistered inproof402_integration.pyFiles Changed
core/api/macro741_bp.pyproof402_integration.py/api/741macroendpoint UUID + price to ENDPOINTS,_PAYMENT_PRICES,_FREE_PREVIEW_BY_PATHcore/api/mcp_bp.pymacro_741_scantool to_TOOLS,_ENDPOINT_IDS,_PRICES, and_dispatch()core/app.pymacro741_bpat/apiprefixExample Usage
{ "status": "success", "product": "741 Pure Macro Matrix", "summary": {"perfect_bullish": 2, "perfect_bearish": 1, "consolidation_chop": 3, "squeeze_alerts": 1}, "results": [ { "ticker": "SPY", "current_close": 547.21, "structural_alignment": "PERFECT_BULLISH_REGIME", "matrix_spread_pct": 12.847, "squeeze_alert": false, "layers": {"EMA_30": 548.1, "EMA_60": 541.3, "EMA_90": 532.7, "EMA_120": 521.4, "EMA_741": 486.2} } ] }Before merging to main, register the new endpoint UUID in the 402Proof dashboard:
f3a7c891-2d54-4b8e-9a1f-6c3d8e5f7b2a0.04 RLUSD/api/741macroGenerated by Claude Code