An active, daily regulatory intelligence agent that monitors primary regulatory sources, dockets, and key industry press for new stablecoin rules and commentary. It parses updates using GPT-4o, maps developments against five critical tracking questions, rates their materiality (1โ5), logs structured metrics and state deduplication hashes to Google Sheets, and alerts stakeholders with suggested outreach talking points via Gmail.
[ AWS EventBridge (Daily at 8am PT) ]
โ
โผ
[ AWS Lambda (Python 3.11) ]
โ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ โผ
[ Federal Register ] [ Regulations.gov ] [ RSS Feeds ] [ OpenAI GPT-4o ]
API conditions: Polling /v4/comments โข CoinDesk โข Analyze entries
"stablecoin", โข "stablecoin" query โข Cointelegraph โข Match vs. Q1-Q5
"digital asset", โข OCC-2025-0372 docket โข Sheppard Mullin โข Materiality (1-5)
"payment token" โข FDIC-2026-0001 docket โข K&L Gates โข Suggested Outreach
โ โ โ โ
โโโโโโโโโโโโโฌโโโโโโโโโโดโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ โ
โผ โผ โผ
[ Fetch & Validate ] โโโบ [ SeenItems Deduplication ] โโโโโโโบ [ Deliver Brief ]
โ
โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ
โผ โผ
[ Gmail SMTP ] [ Google Sheets ]
Daily Alert Email โข SeenItems (State log)
โข StructuredLog (Metrics)
stablecoin-regulatory-agent/
โโโ .env # Local environment variables (ignored by git)
โโโ .gitignore # Excludes environment files, credentials, and zip packages
โโโ Stablecoin Radar Logger.json # Google Cloud Service Account credentials (ignored by git)
โโโ requirements.txt # Python dependencies (requests, feedparser, openai, gspread, oauth2client)
โโโ package.sh # Shell packaging script for AWS Lambda (compiles x86_64 binaries)
โโโ lambda_function.py # Main application handler (polling, deduplication, LLM, logging, emailing)
โโโ test_regs_api.py # Standalone verification script for the Regulations.gov API v4
โโโ deployment.zip # Compiled Lambda deployment package (ignored by git)
โโโ README.md # Project documentation and architectural setup guide
The agent aggregates primary regulatory documents, official agency feeds, legal analysis, and trade press:
| Source Category | Endpoint / Details | Target Content |
|---|---|---|
| Federal Register | https://www.federalregister.gov/api/v1 |
Documents matching "stablecoin", "digital asset", or "payment token" |
| Regulations.gov | https://api.regulations.gov/v4/comments |
Comment letters matching search "stablecoin", and full docket reviews for high-value rulemaking: โข OCC-2025-0372 (National Bank Reserve Accounts) โข FDIC-2026-0001 (Deposit Insurance Rules) |
| Federal Reserve | Official RSS Press Feed | Press releases, policy statements, and discount window/payment system risk updates |
| FDIC | Official RSS Press Feed | Board decisions, enforcement actions, and deposit insurance proposals |
| Top-Tier Legal Blogs | Law firm RSS Feeds | Regulatory analysis and legal briefs: โข K&L Gates (FinTech Law Watch) โข Sheppard Mullin (Law of the Ledger) |
| Crypto Press | Industry News RSS Feeds | Market sentiment, legislative drafts, and policy reactions: โข CoinDesk โข Cointelegraph |
Regulatory developments are evaluated by the LLM and categorized against the five open regulatory gaps of the GENIUS Act (Guiding and Establishing National Innovation for US Stablecoins):
- Q1: Issuer Definition โ Who qualifies as a "permitted payment stablecoin issuer" in white-label and platform-mediated arrangements?
- Q2: Attestation Standard โ What does "examined by a registered public accounting firm" require in practice? (AICPA 2025 Criteria vs. Lighter standard)
- Q3: Capital Requirements โ What capital, liquidity, and risk management requirements apply to stablecoin issuers?
- Q4: State Equivalence โ How will Treasury certify state regulatory regimes as "substantially similar" to federal?
- Q5: AML/Sanctions Program Requirements โ What AML, KYC, sanctions screening, and suspicious activity reporting (SAR) regulations apply?
Ensure you have Python 3.11+ installed.
pip install -r requirements.txtCreate a .env file at the root of the workspace:
# API Keys
OPENAI_API_KEY="your-openai-api-key"
REGULATIONS_GOV_API_KEY="your-regulations-gov-api-key"
GMAIL_APP_PASSWORD="your-gmail-app-password"
# Email Settings
RECIPIENT="your-email@gmail.com"
SENDER="your-email@gmail.com"
# Google Sheets Logging
SPREADSHEET_ID="your-spreadsheet-id"
GOOGLE_SHEETS_CREDENTIALS_PATH="/path/to/your/google-credentials.json"
SHEET_NAME="Sheet1"The script contains a CLI runner to easily run historic checks and perform dry-runs without triggering emails or sheets logs.
Run a scan from a specific historical date and print the analysis to your terminal without sending emails or writing to Sheets:
python3 lambda_function.py --since 2026-05-01 --dry-runFetch, analyze, and force-send the generated brief to your inbox (even if no updates are found):
python3 lambda_function.py --since 2026-05-01 --test-emailRun standard execution (which looks back 24 hours):
python3 lambda_function.pyVerify that Regulations.gov API v4 is communicating and parsing comment letters correctly:
python3 test_regs_api.pySince command-line tools like aws might not be configured, you can build the deployment archive and configure it through the AWS Web Console.
Run the provided packaging script. This compiles all dependencies into a clean deployment.zip alongside lambda_function.py:
./package.sh- Open the AWS Lambda Console.
- Click Create function.
- Choose Author from scratch:
- Function name:
stablecoin-radar - Runtime:
Python 3.11 - Architecture:
x86_64
- Function name:
- For permissions, let AWS create a basic execution role.
- Click Create function.
- On the Lambda function details page, locate the Code tab.
- In the Code source section, click Upload from -> .zip file.
- Select and upload the
deployment.zipgenerated in Step 1. - Click Save.
- Go to the Configuration tab.
- In the General configuration card, click Edit and set Timeout to
2 minutes(to allow for feed fetching and LLM calls). Save changes. - In the Environment variables sidebar, click Edit and add:
OPENAI_API_KEY=sk-proj-...GMAIL_APP_PASSWORD=xxxx xxxx xxxx xxxx(Your Gmail App Password)RECIPIENT=your-email@gmail.comSENDER=your-email@gmail.comSPREADSHEET_ID=(Optional)GOOGLE_SHEETS_CREDENTIALS=(Optional JSON string)SHEET_NAME=Sheet1(Optional)
- Save changes.
- In the Lambda details page, click Add trigger.
- Select EventBridge (CloudWatch Events).
- Choose Create a new rule:
- Rule name:
daily-8am-pacific - Rule type:
Schedule expression - Schedule expression:
cron(0 15 * * ? *)(Note: 15:00 UTC corresponds to 8:00 AM PT)
- Rule name:
- Click Add.
If you prefer to deploy and manage resources via the terminal, use the following commands.
Create a trust policy document:
cat <<EOF > trust-policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
EOFCreate the role and attach the execution policy:
# Create IAM role
aws iam create-role \
--role-name stablecoin-radar-execution-role \
--assume-role-policy-document file://trust-policy.json
# Attach standard Lambda execution policy (for CloudWatch logging)
aws iam attach-role-policy \
--role-name stablecoin-radar-execution-role \
--policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRoleWait a few seconds for the IAM changes to propagate, then fetch the Role ARN:
ROLE_ARN=$(aws iam get-role --role-name stablecoin-radar-execution-role --query "Role.Arn" --output text)Package the zip (using ./package.sh) and run (using your target region, e.g., us-east-2):
aws lambda create-function \
--function-name stablecoin-radar \
--runtime python3.11 \
--handler lambda_function.handler \
--zip-file fileb://deployment.zip \
--role "$ROLE_ARN" \
--timeout 120 \
--memory-size 128 \
--region us-east-2 \
--environment "Variables={OPENAI_API_KEY=sk-proj-...,GMAIL_APP_PASSWORD=xxxx,RECIPIENT=your-email@gmail.com,SENDER=your-email@gmail.com}"Create the Cron trigger rule (15:00 UTC = 8:00 AM PT):
# Create Rule
aws events put-rule \
--name daily-8am-pacific \
--schedule-expression "cron(0 15 * * ? *)"
# Save the Rule ARN
RULE_ARN=$(aws events describe-rule --name daily-8am-pacific --query "Arn" --output text)Authorize EventBridge to invoke the Lambda function:
# Grant permissions to trigger Lambda
aws lambda add-permission \
--function-name stablecoin-radar \
--statement-id EventBridgeTrigger \
--action lambda:InvokeFunction \
--principal events.amazonaws.com \
--region us-east-2 \
--source-arn "$RULE_ARN"Map the EventBridge trigger target to the Lambda function:
# Get the Lambda Function ARN
LAMBDA_ARN=$(aws lambda get-function --function-name stablecoin-radar --region us-east-2 --query "Configuration.FunctionArn" --output text)
# Map the Target to EventBridge
aws events put-targets \
--rule daily-8am-pacific \
--region us-east-2 \
--targets "Id"="1","Arn"="$LAMBDA_ARN"- Standard classification instruction. Q1-Q4 tags assigned based on simple topic matching.
- "Direction" left to the LLM's default reasoning without formal definitions.
- Problem: Analysis showed over-tagging (assigning Q1-Q4 tags to tangential news) and ambiguous direction values.
- Change: Added explicit
TAGGING & CLASSIFICATION RULESdefining strict criteria:- Conservative tagging threshold (material proposals/actionable insights only).
- Concrete boundaries for "Stricter", "More Permissive", "Clarifying", and "Ambiguous".
- Result: Drastically reduced classification noise, improving clarity in daily summary briefs.
- Problem: Coordinated Federal Reserve proposals (Reg D, Reg A, and Payment System Risk policies) regarding special-purpose payment accounts for stablecoin reserves were being under-classified as "None" because they did not explicitly mention "stablecoin" by name.
- Change: Added specific instruction directing the LLM to analyze Fed proposals on reserve account access, payment system risk, and discount window eligibility, mapping them directly to Q3 (Capital Requirements) and Q1 (Issuer Definition).
- Result: Correctly tags and analyzes coordinated central bank rulemaking impacting stablecoin reserve infrastructure.
- Problem: Monitoring was purely passive RSS and Federal Register scraping; it missed active regulatory comments (e.g. fromCircle, ABA, Fiserv), could log duplicate items on consecutive runs, lacked structured metrics logging, and would crash if OpenAI failed.
- Change:
- Integrated Regulations.gov API v4 for active comment letter monitoring.
- Implemented Google Sheets-based persistent state deduplication (
SeenItemsworksheet). - Created a daily structured metrics logger (
StructuredLogworksheet) to feed dashboards. - Expanded categories to include Q5 AML/Sanctions tracking.
- Introduced Materiality scoring (1-5) and conditional Suggested Outreach BD directives for Materiality 4-5 items.
- Wrapped LLM calls in a robust fallback block to generate raw-links briefs on API failures.
- Result: Transformed the aggregator into a resilient, production-grade intelligence infrastructure.
The roadmap for the next phase focuses strictly on acting on the generated intelligence to drive business development outreach (warm lead generation), rather than adding monitoring noise.
- Automatic Stakeholder Recommendations (Warm Leads): Scrapes public comments on OCC/FDIC dockets to identify and pre-qualify commenters. This turns the radar into a lead-generation engine, enabling opening outreach like: "I read your public comment on FDIC-2026-0001..."
- Auto-Drafting Outreach (Activation-Starter): Generates a ready-to-customize email or message template directly within the brief for the matched stakeholder. This lowers the activation energy of starting outreach (to be used as first drafts only, avoiding automated sending).
- LegiScan Integration: Track 50-state bills matching "stablecoin". Deferred until post-customer acquisition, as state bills move over quarters/seasons rather than days.
- Wyoming STC Scraper: Dropped. Wyoming Commission filings are monthly and should be read manually to ensure personal alignment with targets.
- Law Firm Web Scrapers: Dropped. Bypass engineering effort is too high. Regulatory updates can be tracked via free, open Baker McKenzie feeds.
- Materiality 5 SMS/Slack Alerts: Dropped. Major critical events happen infrequently (3-4 times a quarter). The daily 8:00 AM summary email is completely sufficient.