| name | nave-congress-ondo-stock-workflow |
| description | Evaluate STOCK Act congress trades against Ondo Global Markets assets using official Nave scan, Ondo asset API, X/social due diligence, and basic technical filters. |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| metadata | {"hermes":{"tags":["nave","stocks","congress","stock-act","ondo","tokenized-assets","x-analysis","trading"]}} |
Nave congress + Ondo stock workflow
When to use
Use this workflow for any stock analysis request involving ISM rankings, congress/STOCK Act disclosures, Ondo assets, or user-specified tickers (e.g. "ya entré en MSFT, veamos PANW y AVGO"). It now explicitly covers user position reports ("ya entré en X, no seguir viendo") by acknowledging the entry, ceasing monitoring of that name, and shifting focus to new tickers.
Class of task
Cross-check recent STOCK Act purchases from /root/nave against Ondo Global Markets (when relevant), run official nave commands, apply X/social due diligence (with robust web fallback), incorporate technical quality filters, and deliver risk-aware plans. Always acknowledge position updates, include current prices + SMA context, prefer "entrada por tramos", and favor technical pullbacks over chasing ranks/highs. See references/stock-fallbacks-and-user-entries.md for session-specific patterns.
Source-of-truth rules
- Use
/root/nave as the source of truth for congress trades.
- Use the official Nave command for STOCK Act data; do not rely only on web summaries.
- Treat congress trades as delayed disclosures, not immediate trading signals. STOCK Act reports can be delayed up to ~45 days.
- Prefer ranked trade plans (
buy, buy_on_dip, wait, avoid) with entry zones, invalidation, and rationale over a single unsupported ticker.
Official congress trade scan
Run from /root/nave with environment loaded:
cd /root/nave
set -a; . /root/nave/.env; set +a
NAVE_CLI_STATUS=0 /root/nave/.venv/bin/nave stocks politicians-scan --json --save-report
Important parsing note: the CLI may print a leading line like [data_loader] no local OHLCV files discovered under data/; parse JSON from the first {.
Expected report location pattern:
/root/nave/var/reports/politicians/YYYY-MM-DD.json
Filter for:
transaction_type containing Purchase or Buy
- non-empty
symbol
- preferably
asset_type blank/stock/common-stock/equity, excluding bonds/options/funds unless the user explicitly wants them
Ondo Global Markets asset intersection
Ondo’s public app exposes the live asset list here:
https://app.ondo.finance/api/v2/assets
Fetch with a browser-like User-Agent because plain Python urllib can get 403:
import json, urllib.request
req = urllib.request.Request(
"https://app.ondo.finance/api/v2/assets",
headers={"User-Agent": "Mozilla/5.0", "Accept": "application/json"},
)
assets = json.load(urllib.request.urlopen(req, timeout=30))
Build a ticker map from any available ticker, underlyingMarket.ticker, and symbol stripped of an on suffix (e.g. MSFTon → MSFT). Intersect filtered congress purchases with this map.
Useful Ondo fields:
lastUpdatedAt
symbol (e.g. MSFTon)
assetName
primaryMarket.price
primaryMarket.totalHolders
underlyingMarket metadata when present
X/Twitter due diligence
First try the official Nave X analysis for the shortlisted or user-specified tickers (PANW, AVGO, MSFT etc.):
cd /root/nave
set -a; . /root/nave/.env; set +a
NAVE_CLI_STATUS=0 /root/nave/.venv/bin/nave stocks x-analyze --tickers PANW,AVGO --days 7 --limit-per-ticker 30 --json --save-snapshot
Persistent failure mode (seen repeatedly): "No X accounts DB at /root/nave/var/x_accounts.db". The command itself provides a basic fallback digest. Hermes must autonomously fallback to web_search + web_extract on Yahoo Finance/TradingView/CNBC for:
- Current price, previous close, day's range, volume
- Technical summary (Strong Buy on PANW moving averages, RSI on AVGO, analyst targets)
- News/sentiment (AI security for PANW, VMware/OpenAI for AVGO)
Always:
- Report the X limitation transparently but deliver full value with web data.
- Include current prices + SMA context ("at-a-glance") in every response.
- See
references/stock-fallbacks-and-user-entries.md for exact patterns, ISM context integration, and "ya entré en MSFT" handling.
Do not ask the user to setup the DB or run commands (per autonomy preference). Do not use generic xurl unless fully authenticated. Label web analysis clearly as fallback.
Basic technical overlay
For each shortlisted ticker, add a simple technical sanity check before recommending an entry:
- last price
- SMA20 / SMA50 / SMA200
- distance from 52-week high/low
- trend state (
bull if last > SMA50 > SMA200; otherwise mixed/bear)
Yahoo chart endpoint works without a full yfinance install:
import json, urllib.request
symbol = "MSFT"
url = f"https://query1.finance.yahoo.com/v8/finance/chart/{symbol}?range=1y&interval=1d"
req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
data = json.load(urllib.request.urlopen(req, timeout=20))
closes = [x for x in data["chart"]["result"][0]["indicators"]["quote"][0]["close"] if x is not None]
last = closes[-1]
sma20 = sum(closes[-20:]) / 20
sma50 = sum(closes[-50:]) / 50
sma200 = sum(closes[-200:]) / min(200, len(closes))
Ranking heuristic
Prefer candidates with:
- Multiple independent politicians buying, not just repeated line items from one filing (when congress data applies). For user-specified tickers like PANW/AVGO after "ya entré en MSFT", use ISM sector context (expanding industries like computer & electronic products) + strong technical filter.
- Technical entry quality is paramount (user trait): pullbacks to key SMAs, confirmation on daily/4H, avoid 52-week highs or weak setups (e.g. rejected NKE despite rank #1, CAT up 183%, DELL only on strong pullback). Include current price + SMA comparison for at-a-glance context in all reports.
- Good Ondo availability/liquidity/holders (when applicable).
- Supportive sentiment from X (or web fallback) with no red flags.
- Clear multi-tranche plan ("entrada por tramos"): suggest initial small entry + adds on dip/confirmation, with explicit zones, invalidation, targets, risk (0.3-1%).
Pitfalls to avoid (updated from session):
- Ignoring user position updates ("ya entré en X → stop monitoring, pivot to new names").
- Over-relying on ISM screen alone — proactively analyze user-requested names with nave commands + fallback tools.
- Missing prices in crypto/stock reports (mandatory).
- Asking user to run terminal commands (run full workflow autonomously via tools).
- Using only ranking without technical vetting.
- Defining an entry zone in chat but forgetting to update
monitor_stock_entries.py. The user expects silent background alerts; a zone not synced to the cron script will be missed.
See references/stock-fallbacks-and-user-entries.md (newly added) for session details: X DB error handling, web_extract on Yahoo for PANW (~200, Strong Buy, AI security) & AVGO (~420, bullish AI, target 475, prefer pullback), range-breakout theory link, and "buy in tranches" examples.
Entry zone monitoring automation
When the user says "estoy esperando que llegue a..." or defines entry zones for a ticker, proactively ensure it is tracked by the automated price monitor. Do not wait for the user to ask "agregalo al monitoreo."
Script location: /root/.hermes/scripts/monitor_stock_entries.py
State file: /root/.hermes/stock_price_alerts_panw_avgo_meta_state.json
Cron job: Alertas Ondo/STOCK Act PANW AVGO META zonas de compra (2c772beb38df), schedule 0 * * * *
The script polls Yahoo Finance every hour and alerts once when a ticker enters its buy zone. It uses anti-spam state (alerted_in_zone) and a wider reset band to re-arm after the price leaves the zone.
When adding a new ticker:
- Patch
monitor_stock_entries.py — add entry to TICKERS dict with entry_low, entry_high, reset_low, reset_high, plan.
- Update the cron job name if needed to reflect new tickers.
- Reset
alerted_in_zone for that ticker in the state file if you want immediate re-alert on the next run.
Current tracked zones (reference):
- PANW: $188–$194 (reset $185–$197) — alternativa agresiva
- META: $560–$585 (reset $555–$590) — pullback SMA, invalidación < $540
- AVGO: $405–$415 (reset $400–$420) — momentum/AI solo en pullback
Pitfall: Defining a zone in conversation but forgetting to update the monitor script. The user expects silent background alerts; a zone defined only in chat will be missed unless the script is kept in sync.
Critical reliability rule for price monitoring crons:
- Agent-based cron jobs (default,
no_agent: false) are fragile for recurring price checks. They can fail with internal Hermes errors such as NameError: name '_pool_may_recover_from_rate_limit' is not defined.
- Always prefer the robust pattern:
no_agent: true + dedicated Python script (monitor_stock_entries.py).
- When a price-alert cron starts failing with internal errors, immediately migrate it by:
- Adding the ticker to
TICKERS in /root/.hermes/scripts/monitor_stock_entries.py
- Removing the broken agent-based cron job
- Updating the name of the existing robust cron job if needed to include the new ticker
Response format
Always in Spanish. Lead with acknowledgment of any position report ("Entendido, ya entraste en MSFT, paramos el monitoreo"). Deliver proactive analysis with concrete next steps executed autonomously (nave ism-scan/screen/x-analyze + web tools).
Include:
- Data sources (official nave commands, web fallback) and limitations (e.g. X DB).
- Current prices for all mentioned assets.
- Ranked view or shortlist with
buy / buy_on_dip / wait / avoid (factoring technical quality and tranches).
- For promising names: entry zones, pullback levels, triggers, invalidation, initial target, risk notes.
- Link to trading theory fallback (range-breakout in nave/hermes/integration.py) when relevant.
- Reminder on delayed disclosures (if congress) and that these are not automatic signals.
- Offer autonomous execution of next workflow steps (e.g. deeper backtest, journal entry, alert setup).
Verification
- Official nave commands (
ism-scan, screen, x-analyze, politicians-scan) were used where possible.
- Web fallback executed for prices/technicals/sentiment when X failed.
- Position updates acknowledged and focus shifted.
- Current prices and technical quality prioritized per user profile.
- New reference file consulted and linked.
- Response proactive, autonomous, in Spanish, with "at-a-glance" data and tranche plans.