<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Miguel</title>
    <description>The latest articles on DEV Community by Miguel (@miggie8888).</description>
    <link>https://dev.to/miggie8888</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3877566%2F65c59ecc-b88e-4de4-80ed-e8f8da82bcf8.png</url>
      <title>DEV Community: Miguel</title>
      <link>https://dev.to/miggie8888</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/miggie8888"/>
    <language>en</language>
    <item>
      <title>I Built a Verified LEI + FIGI Lookup Agent for $5/month — Callable by Any AI Agent via x402</title>
      <dc:creator>Miguel</dc:creator>
      <pubDate>Tue, 14 Apr 2026 00:39:52 +0000</pubDate>
      <link>https://dev.to/miggie8888/i-built-a-verified-lei-figi-lookup-agent-for-5month-callable-by-any-ai-agent-via-x402-3lm</link>
      <guid>https://dev.to/miggie8888/i-built-a-verified-lei-figi-lookup-agent-for-5month-callable-by-any-ai-agent-via-x402-3lm</guid>
      <description>&lt;p&gt;Here is what I built: a financial data normalization agent that any autonomous AI agent can discover and pay for in USDC on Base — with zero signup, zero API keys, and zero human involvement.&lt;/p&gt;

&lt;p&gt;It went from idea to live production in one afternoon, entirely from my iPhone.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem It Solves
&lt;/h2&gt;

&lt;p&gt;If you are building a trading pipeline, compliance agent, or portfolio tool, you constantly deal with messy financial data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dates in a dozen formats&lt;/li&gt;
&lt;li&gt;Currency written as “USD”, “usd”, “$”, “dollars”&lt;/li&gt;
&lt;li&gt;Counterparties identified by nickname, abbreviation, or internal code&lt;/li&gt;
&lt;li&gt;No ISIN, no LEI, no FIGI — just a ticker that may or may not be unique&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before your agent can act on this data, something has to clean it. That something is expensive to build yourself and boring to maintain. So I built it once and made it callable by any agent.&lt;/p&gt;




&lt;h2&gt;
  
  
  What It Does
&lt;/h2&gt;

&lt;p&gt;The agent exposes four tools over a standard HTTP API:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;normalize_financial_record&lt;/strong&gt; — Takes any raw trade, transaction, or position record in any format and returns structured JSON with standardized dates (ISO 8601), currency codes (ISO 4217), inferred asset class, and data quality flags.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;validate_regulatory_fields&lt;/strong&gt; — Checks a record against MiFID II, Dodd-Frank, EMIR, or SEC Rule 605 and returns a list of missing or invalid fields.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;enrich_counterparty&lt;/strong&gt; — Given a company name, returns a verified LEI code, jurisdiction, and entity status from the GLEIF Global LEI Index — the same database used by regulators and central banks worldwide. Zero AI inference. Real verified data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;lookup_instrument&lt;/strong&gt; — Given an ISIN, CUSIP, SEDOL, or ticker, returns a verified FIGI code, exchange, and security type from OpenFIGI. Auto-detects the identifier type.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Part That Makes It Different
&lt;/h2&gt;

&lt;p&gt;The counterparty enrichment and instrument lookup tools do not call an AI model. They call real financial databases directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;enrich_counterparty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Goldman Sachs International&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lei&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;549300R83Q2VTICWNV15&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;legal_name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GOLDMAN SACHS INTERNATIONAL&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jurisdiction&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GB&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;status&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ACTIVE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;verified&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;source&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GLEIF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That LEI code is pulled live from GLEIF at query time. It is the same code regulators use for MiFID II reporting. No LLM could hallucinate its way to that with confidence.&lt;/p&gt;

&lt;p&gt;This matters because it means those two tools cost essentially nothing to run — no AI tokens, no model inference, just a free API call. The margin on counterparty enrichment calls is close to 100%.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FastAPI&lt;/strong&gt; on Python — the server&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Haiku&lt;/strong&gt; — cheapest capable model, ~$0.00025 per call&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GLEIF API&lt;/strong&gt; — free, no key required, returns verified LEI data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenFIGI API&lt;/strong&gt; — free, returns verified FIGI data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Railway&lt;/strong&gt; — deployment, ~$5/month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stripe&lt;/strong&gt; — metered billing for API key customers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;x402&lt;/strong&gt; — USDC micropayments on Base for autonomous agents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total infrastructure cost at low volume: under $10/month.&lt;/p&gt;




&lt;h2&gt;
  
  
  Two Payment Rails
&lt;/h2&gt;

&lt;p&gt;This is the part I find most interesting architecturally.&lt;/p&gt;

&lt;p&gt;The agent accepts payment two ways:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stripe metered billing&lt;/strong&gt; is for developers who want to integrate the agent into their pipeline the traditional way — sign up, get an API key, pay monthly. Standard SaaS pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;x402&lt;/strong&gt; is for autonomous agents. Any agent with a funded wallet on Base can call the endpoint right now, with no signup required. The server responds with HTTP 402 + payment instructions, the agent pays in USDC, and the data comes back. No humans involved at any step.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET https://your-agent.railway.app/.well-known/x402

→ {
    "version": 2,
    "resources": {
      "/invoke": {
        "price": "$0.002",
        "network": "eip155:8453",
        "token": "USDC"
      }
    }
  }
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The price per call is $0.002 regardless of which rail the caller uses. Consistent pricing, two very different buyer journeys.&lt;/p&gt;




&lt;h2&gt;
  
  
  Discovery Endpoints
&lt;/h2&gt;

&lt;p&gt;The agent is machine-readable at multiple standard endpoints so orchestrators and discovery services can find it automatically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /tools                          — MCP tool listing
GET /.well-known/agent.json         — Google A2A manifest
GET /.well-known/x402               — x402 payment manifest
GET /.well-known/mcp.json           — MCP discovery (upcoming standard)
GET /health                         — Status + active payment rails
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any agent that knows to look at &lt;code&gt;/.well-known/agent.json&lt;/code&gt; or &lt;code&gt;/.well-known/x402&lt;/code&gt; can discover this agent, understand what it does, and pay for it — without any human writing documentation or sending an email.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Economics
&lt;/h2&gt;

&lt;p&gt;Here is the per-call cost breakdown at the current price of $0.002:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Cost to run&lt;/th&gt;
&lt;th&gt;Gross margin&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;normalize_financial_record&lt;/td&gt;
&lt;td&gt;~$0.00025 (Haiku)&lt;/td&gt;
&lt;td&gt;~87%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;validate_regulatory_fields&lt;/td&gt;
&lt;td&gt;~$0.00025 (Haiku)&lt;/td&gt;
&lt;td&gt;~87%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;enrich_counterparty (GLEIF hit)&lt;/td&gt;
&lt;td&gt;~$0.00001 (API call)&lt;/td&gt;
&lt;td&gt;~99%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;lookup_instrument (OpenFIGI hit)&lt;/td&gt;
&lt;td&gt;~$0.00001 (API call)&lt;/td&gt;
&lt;td&gt;~99%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At 10,000 calls/month the price drops to $0.0015/call. At 10,001+ it drops to $0.001. Infrastructure cost stays flat. Margin improves at scale.&lt;/p&gt;




&lt;h2&gt;
  
  
  How I Built It on iPhone
&lt;/h2&gt;

&lt;p&gt;The entire build happened from my iPhone. No laptop, no VS Code, no local terminal.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code editing: Textastic (iPhone app)&lt;/li&gt;
&lt;li&gt;Deployment: Railway connected to GitHub, auto-deploys on commit&lt;/li&gt;
&lt;li&gt;API testing: API Tester app&lt;/li&gt;
&lt;li&gt;Billing setup: Stripe Dashboard mobile&lt;/li&gt;
&lt;li&gt;Monitoring: Railway logs in Safari&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main challenge was iPhone autocorrect converting straight quotes to curly quotes in Python code, which causes syntax errors. The fix was using single quotes throughout the codebase — iPhone never autocorrects single quotes.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is Next
&lt;/h2&gt;

&lt;p&gt;The agent is live on Nevermined, listed in the MCP registries, and discoverable via x402. The next meaningful upgrade is adding OpenFIGI batch processing — the API supports up to 100 identifier lookups per call, which would make bulk trade normalization dramatically faster and cheaper.&lt;/p&gt;

&lt;p&gt;The longer-term bet is that financial compliance pipelines become a high-volume source of A2A transactions. Every trade that goes through a reporting agent needs normalized data. That is a large number of calls, and the agents running those pipelines will eventually have wallets.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;Live endpoint: &lt;code&gt;https://niche-agent-production.up.railway.app&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Discovery: &lt;code&gt;https://niche-agent-production.up.railway.app/tools&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;x402 manifest: &lt;code&gt;https://niche-agent-production.up.railway.app/.well-known/x402&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A2A manifest: &lt;code&gt;https://niche-agent-production.up.railway.app/.well-known/agent.json&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built with FastAPI, Claude Haiku, GLEIF, OpenFIGI, Railway, Stripe, and x402.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tags: fintech, mcp, a2a, x402, python, fastapi, financial-data, compliance, lei, figi&lt;/em&gt;&lt;/p&gt;

</description>
      <category>fintech</category>
      <category>mcp</category>
      <category>a2a</category>
      <category>x402</category>
    </item>
  </channel>
</rss>
