<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://diepdao.me/feed.xml" rel="self" type="application/atom+xml" /><link href="https://diepdao.me/" rel="alternate" type="text/html" /><updated>2026-05-23T22:50:25+00:00</updated><id>https://diepdao.me/feed.xml</id><title type="html">Diep Dao</title><subtitle>A blog about interesting things.</subtitle><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><entry><title type="html">AI Agents in Production: Planning, Tool Use, and Safety Boundaries</title><link href="https://diepdao.me/ai/2026/04/06/ai-agents-tool-use/" rel="alternate" type="text/html" title="AI Agents in Production: Planning, Tool Use, and Safety Boundaries" /><published>2026-04-06T02:00:00+00:00</published><updated>2026-04-06T02:00:00+00:00</updated><id>https://diepdao.me/ai/2026/04/06/ai-agents-tool-use</id><content type="html" xml:base="https://diepdao.me/ai/2026/04/06/ai-agents-tool-use/"><![CDATA[<p>This is Post 4 in the <a href="/ai/2026/02/27/welcome-to-ai/">AI Series</a>. The <a href="/ai/2026/04/05/llm-systems-and-rag/">previous post</a> covered LLM system design and RAG.</p>

<h2 id="what-makes-an-agent-different">What Makes an Agent Different</h2>

<p>A chatbot answers once. An agent loops:</p>
<ul>
  <li>plans,</li>
  <li>chooses tools,</li>
  <li>executes,</li>
  <li>checks results,</li>
  <li>retries or escalates.</li>
</ul>

<h2 id="production-agent-architecture">Production Agent Architecture</h2>

<ul>
  <li><strong>Planner</strong>: decomposes goals into steps.</li>
  <li><strong>Executor</strong>: calls APIs/tools.</li>
  <li><strong>Memory</strong>: persists relevant state.</li>
  <li><strong>Evaluator</strong>: checks correctness and policy compliance.</li>
</ul>

<h2 id="safety-boundaries">Safety Boundaries</h2>

<p>Essential controls:</p>
<ol>
  <li>Least-privilege credentials</li>
  <li>Action confirmation for irreversible operations</li>
  <li>Sandboxed tool execution</li>
  <li>Immutable audit logs</li>
  <li>Policy-based deny lists</li>
</ol>

<h2 id="references">References</h2>

<ul>
  <li>ReAct prompting paper: https://arxiv.org/abs/2210.03629</li>
  <li>Toolformer paper: https://arxiv.org/abs/2302.04761</li>
  <li>Anthropic agentic patterns (engineering notes): https://www.anthropic.com/engineering</li>
</ul>

<h2 id="best-books">Best Books</h2>

<ul>
  <li>Ronald T. Kneusel, <em>Practical Deep Learning</em> (deployment mindset).</li>
  <li>Martin Kleppmann, <em>Designing Data-Intensive Applications</em> (systems thinking).</li>
  <li>Chip Huyen, <em>AI Engineering</em>.</li>
</ul>]]></content><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><category term="ai" /><category term="ai-agents" /><category term="tool-use" /><category term="planning" /><category term="safety" /><summary type="html"><![CDATA[This is Post 4 in the AI Series. The previous post covered LLM system design and RAG.]]></summary></entry><entry><title type="html">LLM Systems and RAG: Building Useful AI Beyond Prompt Demos</title><link href="https://diepdao.me/ai/2026/04/05/llm-systems-and-rag/" rel="alternate" type="text/html" title="LLM Systems and RAG: Building Useful AI Beyond Prompt Demos" /><published>2026-04-05T02:00:00+00:00</published><updated>2026-04-05T02:00:00+00:00</updated><id>https://diepdao.me/ai/2026/04/05/llm-systems-and-rag</id><content type="html" xml:base="https://diepdao.me/ai/2026/04/05/llm-systems-and-rag/"><![CDATA[<p>This is Post 3 in the <a href="/ai/2026/02/27/welcome-to-ai/">AI Series</a>. The <a href="/ai/2026/04/04/mlops-and-evaluation/">previous post</a> covered MLOps and evaluation.</p>

<h2 id="why-rag-became-default">Why RAG Became Default</h2>

<p>LLMs are strong general reasoners but weak on private, current, or domain-specific facts. Retrieval-Augmented Generation (RAG) solves this by injecting grounded context at inference time.</p>

<h2 id="rag-pipeline">RAG Pipeline</h2>

<ol>
  <li>Chunk and clean source documents</li>
  <li>Create embeddings</li>
  <li>Index in vector database</li>
  <li>Retrieve top-k relevant chunks</li>
  <li>Re-rank / filter</li>
  <li>Generate answer with citations</li>
</ol>

<h2 id="design-pitfalls">Design Pitfalls</h2>

<ul>
  <li>Overly large chunks reduce precision.</li>
  <li>Missing metadata hurts filtering.</li>
  <li>No eval set means no measurable quality.</li>
  <li>Ignoring latency budgets kills UX.</li>
</ul>

<h2 id="practical-guardrails">Practical Guardrails</h2>

<ul>
  <li>Structured output schemas</li>
  <li>Tool calling with explicit permissions</li>
  <li>Citation enforcement</li>
  <li>Human escalation for high-stakes tasks</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li>Lewis et al., <em>Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks</em>: https://arxiv.org/abs/2005.11401</li>
  <li>OpenAI cookbook (RAG patterns): https://cookbook.openai.com/</li>
  <li>LangChain docs (retrieval architecture): https://python.langchain.com/docs/concepts/rag/</li>
</ul>

<h2 id="best-books">Best Books</h2>

<ul>
  <li>Jurafsky &amp; Martin, <em>Speech and Language Processing</em> (latest draft).</li>
  <li>Chip Huyen, <em>AI Engineering</em>.</li>
  <li>Building LLM apps community playbooks by O’Reilly (practitioner references).</li>
</ul>]]></content><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><category term="ai" /><category term="llm" /><category term="rag" /><category term="embeddings" /><category term="vector-database" /><category term="agents" /><summary type="html"><![CDATA[This is Post 3 in the AI Series. The previous post covered MLOps and evaluation.]]></summary></entry><entry><title type="html">MLOps and Evaluation: From Notebook Models to Reliable Production</title><link href="https://diepdao.me/ai/2026/04/04/mlops-and-evaluation/" rel="alternate" type="text/html" title="MLOps and Evaluation: From Notebook Models to Reliable Production" /><published>2026-04-04T02:00:00+00:00</published><updated>2026-04-04T02:00:00+00:00</updated><id>https://diepdao.me/ai/2026/04/04/mlops-and-evaluation</id><content type="html" xml:base="https://diepdao.me/ai/2026/04/04/mlops-and-evaluation/"><![CDATA[<p>This is Post 2 in the <a href="/ai/2026/02/27/welcome-to-ai/">AI Series</a>. The <a href="/ai/2026/02/27/learning-ml-andrew-ng/">previous post</a> covered the learning journey and foundations.</p>

<h2 id="the-real-problem-reliability-not-demos">The Real Problem: Reliability, Not Demos</h2>

<p>A model that looks great in a notebook often fails in production because:</p>
<ul>
  <li>data distribution shifts,</li>
  <li>labels arrive late,</li>
  <li>business constraints are ignored.</li>
</ul>

<h2 id="production-ml-lifecycle">Production ML Lifecycle</h2>

<ol>
  <li>Data contracts and feature definitions</li>
  <li>Reproducible training pipeline</li>
  <li>Offline evaluation with leakage checks</li>
  <li>Online rollout with guardrails (canary, shadow)</li>
  <li>Monitoring and retraining triggers</li>
</ol>

<h2 id="metrics-that-matter">Metrics That Matter</h2>

<p>Beyond accuracy:</p>
<ul>
  <li>Precision/recall/F1 (imbalance)</li>
  <li>Calibration (probability quality)</li>
  <li>Latency and throughput SLOs</li>
  <li>Drift metrics (feature + prediction drift)</li>
  <li>Business KPI lift</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li>Google, <em>Rules of Machine Learning</em>: https://developers.google.com/machine-learning/guides/rules-of-ml</li>
  <li>Google, <em>Hidden Technical Debt in ML Systems</em>: https://papers.nips.cc/paper_files/paper/2015/file/86df7dcfd896fcaf2674f757a2463eba-Paper.pdf</li>
  <li>Evidently AI docs (monitoring): https://docs.evidentlyai.com/</li>
</ul>

<h2 id="best-books">Best Books</h2>

<ul>
  <li>Chip Huyen, <em>Designing Machine Learning Systems</em>.</li>
  <li>Mark Treveil &amp; Alok Shukla et al., <em>Introducing MLOps</em>.</li>
  <li>Emmanuel Ameisen, <em>Building Machine Learning Powered Applications</em>.</li>
</ul>]]></content><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><category term="ai" /><category term="mlops" /><category term="evaluation" /><category term="monitoring" /><category term="deployment" /><summary type="html"><![CDATA[This is Post 2 in the AI Series. The previous post covered the learning journey and foundations.]]></summary></entry><entry><title type="html">Blockchain Scalability: Layer 2 Rollups, Data Availability, and Trade-offs</title><link href="https://diepdao.me/blockchain/2026/04/03/blockchain-scalability-and-rollups/" rel="alternate" type="text/html" title="Blockchain Scalability: Layer 2 Rollups, Data Availability, and Trade-offs" /><published>2026-04-03T02:00:00+00:00</published><updated>2026-04-03T02:00:00+00:00</updated><id>https://diepdao.me/blockchain/2026/04/03/blockchain-scalability-and-rollups</id><content type="html" xml:base="https://diepdao.me/blockchain/2026/04/03/blockchain-scalability-and-rollups/"><![CDATA[<p>This is Post 4 in the <a href="/blockchain/2026/02/27/welcome-to-blockchain/">Blockchain Series</a>. The <a href="/blockchain/2026/04/02/defi-protocol-design/">previous post</a> covered DeFi protocol design.</p>

<h2 id="why-layer-2-exists">Why Layer 2 Exists</h2>

<p>Base layers optimize decentralization and security, but throughput is limited. Layer 2 systems move execution off-chain while inheriting L1 settlement.</p>

<h2 id="rollup-types">Rollup Types</h2>

<ul>
  <li><strong>Optimistic rollups</strong>: assume valid by default; fraud proofs during challenge windows.</li>
  <li><strong>ZK rollups</strong>: validity proofs (SNARK/STARK) submitted to L1.</li>
</ul>

<h2 id="data-availability-da">Data Availability (DA)</h2>

<p>State validity is not enough; users need transaction data to reconstruct state.</p>

<p>DA approaches:</p>
<ul>
  <li>Post calldata/data blobs on Ethereum.</li>
  <li>Validium/volition (trade-offs in DA trust).</li>
  <li>Modular DA layers for high throughput.</li>
</ul>

<h2 id="choosing-the-right-architecture">Choosing the Right Architecture</h2>

<ul>
  <li>Need fastest finality and high security assumptions? → ZK rollup.</li>
  <li>Need EVM compatibility with mature tooling? → Often optimistic first.</li>
  <li>Need lowest costs for consumer apps? → Hybrid with strong DA guarantees.</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li>Ethereum rollup-centric roadmap notes: https://ethereum-magicians.org/</li>
  <li>OP Stack docs: https://docs.optimism.io/</li>
  <li>zkSync docs: https://docs.zksync.io/</li>
  <li>Arbitrum docs: https://docs.arbitrum.io/</li>
</ul>

<h2 id="best-books">Best Books</h2>

<ul>
  <li>Alex Xu, <em>System Design Interview</em> (scalability mindset, complementary).</li>
  <li>Narayanan et al., <em>Bitcoin and Cryptocurrency Technologies</em>.</li>
  <li>Andreas M. Antonopoulos &amp; Gavin Wood, <em>Mastering Ethereum</em>.</li>
</ul>]]></content><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><category term="blockchain" /><category term="layer2" /><category term="rollups" /><category term="scalability" /><category term="data-availability" /><summary type="html"><![CDATA[This is Post 4 in the Blockchain Series. The previous post covered DeFi protocol design.]]></summary></entry><entry><title type="html">DeFi Protocol Design: AMMs, Lending, and On-Chain Risk</title><link href="https://diepdao.me/blockchain/2026/04/02/defi-protocol-design/" rel="alternate" type="text/html" title="DeFi Protocol Design: AMMs, Lending, and On-Chain Risk" /><published>2026-04-02T02:00:00+00:00</published><updated>2026-04-02T02:00:00+00:00</updated><id>https://diepdao.me/blockchain/2026/04/02/defi-protocol-design</id><content type="html" xml:base="https://diepdao.me/blockchain/2026/04/02/defi-protocol-design/"><![CDATA[<p>This is Post 3 in the <a href="/blockchain/2026/02/27/welcome-to-blockchain/">Blockchain Series</a>. The <a href="/blockchain/2026/04/01/smart-contracts-and-evm/">previous post</a> covered smart contracts and the EVM.</p>

<h2 id="amms-market-making-in-code">AMMs: Market Making in Code</h2>

<p>The canonical constant-product AMM uses:</p>

<p><code class="language-plaintext highlighter-rouge">x * y = k</code></p>

<p>Where <code class="language-plaintext highlighter-rouge">x</code> and <code class="language-plaintext highlighter-rouge">y</code> are token reserves. A swap changes reserves and implied price. Deeper liquidity means lower slippage.</p>

<h2 id="lending-protocol-basics">Lending Protocol Basics</h2>

<p>Lending markets depend on over-collateralization:</p>
<ul>
  <li>Supply collateral.</li>
  <li>Borrow below collateral factor.</li>
  <li>Liquidation triggers if health factor drops.</li>
</ul>

<p>Critical parameters:</p>
<ul>
  <li>Loan-to-value (LTV)</li>
  <li>Liquidation threshold</li>
  <li>Liquidation bonus</li>
  <li>Oracle heartbeat/staleness checks</li>
</ul>

<h2 id="risk-surfaces">Risk Surfaces</h2>

<p>Top failure modes in DeFi:</p>
<ol>
  <li><strong>Smart contract bugs</strong></li>
  <li><strong>Oracle manipulation</strong></li>
  <li><strong>Liquidity crunches</strong></li>
  <li><strong>Governance capture</strong></li>
</ol>

<p>Engineering mitigations:</p>
<ul>
  <li>Timelocks + multi-sig for upgrades</li>
  <li>Circuit breakers / pause guardians</li>
  <li>Formal verification for core math</li>
  <li>Real-time risk monitoring dashboards</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li>Uniswap v2 whitepaper: https://uniswap.org/whitepaper.pdf</li>
  <li>Aave docs: https://docs.aave.com/</li>
  <li>Chainlink docs (oracle architecture): https://docs.chain.link/</li>
</ul>

<h2 id="best-books">Best Books</h2>

<ul>
  <li>Campbell R. Harvey, Ashwin Ramachandran, Joey Santoro, <em>DeFi and the Future of Finance</em>.</li>
  <li>Andreas M. Antonopoulos, <em>Mastering Bitcoin</em> (for transaction and security foundations).</li>
  <li>Linda Xie et al., <em>DeFi Developer Road Map</em> (community resource/book-length guide).</li>
</ul>]]></content><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><category term="blockchain" /><category term="defi" /><category term="amm" /><category term="lending" /><category term="risk" /><category term="tokenomics" /><summary type="html"><![CDATA[This is Post 3 in the Blockchain Series. The previous post covered smart contracts and the EVM.]]></summary></entry><entry><title type="html">Smart Contracts and the EVM: How Ethereum Actually Executes Code</title><link href="https://diepdao.me/blockchain/2026/04/01/smart-contracts-and-evm/" rel="alternate" type="text/html" title="Smart Contracts and the EVM: How Ethereum Actually Executes Code" /><published>2026-04-01T02:00:00+00:00</published><updated>2026-04-01T02:00:00+00:00</updated><id>https://diepdao.me/blockchain/2026/04/01/smart-contracts-and-evm</id><content type="html" xml:base="https://diepdao.me/blockchain/2026/04/01/smart-contracts-and-evm/"><![CDATA[<p>This is Post 2 in the <a href="/blockchain/2026/02/27/welcome-to-blockchain/">Blockchain Series</a>. The <a href="/blockchain/2026/02/27/blockchain-introduction/">previous post</a> covered blockchain fundamentals.</p>

<h2 id="why-smart-contracts-matter">Why Smart Contracts Matter</h2>

<p>A smart contract is code stored on-chain that executes deterministically on every validating node. The same input must always produce the same state transition.</p>

<p>Core ideas:</p>
<ul>
  <li><strong>State machine</strong>: contracts map old state + transaction input → new state.</li>
  <li><strong>Determinism</strong>: no hidden randomness, no local file/network access.</li>
  <li><strong>Economic metering</strong>: computation costs gas.</li>
</ul>

<h2 id="evm-execution-model">EVM Execution Model</h2>

<p>Ethereum transactions either transfer ETH or call contract bytecode.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>User signs transaction
  → node gossips transaction to mempool
  → validator includes it in a block
  → each node runs EVM bytecode
  → state root updates if execution succeeds
</code></pre></div></div>

<p>Important mechanics:</p>
<ul>
  <li><strong>Stack machine</strong> (256-bit words).</li>
  <li><strong>Storage</strong> persists across transactions (expensive).</li>
  <li><strong>Memory</strong> is transient per call (cheaper).</li>
  <li><strong>Calldata</strong> is read-only function input.</li>
</ul>

<h2 id="gas-fees-and-safety">Gas, Fees, and Safety</h2>

<p>Gas prevents denial-of-service. Every opcode has cost. If gas runs out, state changes revert (except gas spent).</p>

<p>Practical design rules:</p>
<ol>
  <li>Minimize storage writes.</li>
  <li>Prefer pull-over-push payment patterns.</li>
  <li>Validate inputs early and fail fast.</li>
  <li>Use reentrancy guards on external calls.</li>
</ol>

<h2 id="minimal-secure-contract-pattern">Minimal Secure Contract Pattern</h2>

<div class="language-solidity highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">contract</span> <span class="n">Vault</span> <span class="p">{</span>
    <span class="k">mapping</span><span class="p">(</span><span class="kt">address</span> <span class="o">=&gt;</span> <span class="kt">uint256</span><span class="p">)</span> <span class="k">public</span> <span class="n">balances</span><span class="p">;</span>

    <span class="k">function</span> <span class="n">deposit</span><span class="p">()</span> <span class="k">external</span> <span class="k">payable</span> <span class="p">{</span>
        <span class="n">balances</span><span class="p">[</span><span class="n">msg</span><span class="p">.</span><span class="n">sender</span><span class="p">]</span> <span class="o">+=</span> <span class="n">msg</span><span class="p">.</span><span class="n">value</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="k">function</span> <span class="n">withdraw</span><span class="p">(</span><span class="kt">uint256</span> <span class="n">amount</span><span class="p">)</span> <span class="k">external</span> <span class="p">{</span>
        <span class="nb">require</span><span class="p">(</span><span class="n">balances</span><span class="p">[</span><span class="n">msg</span><span class="p">.</span><span class="n">sender</span><span class="p">]</span> <span class="o">&gt;=</span> <span class="n">amount</span><span class="p">,</span> <span class="s">"insufficient"</span><span class="p">);</span>
        <span class="n">balances</span><span class="p">[</span><span class="n">msg</span><span class="p">.</span><span class="n">sender</span><span class="p">]</span> <span class="o">-=</span> <span class="n">amount</span><span class="p">;</span>
        <span class="p">(</span><span class="kt">bool</span> <span class="n">ok</span><span class="p">,</span> <span class="p">)</span> <span class="o">=</span> <span class="n">msg</span><span class="p">.</span><span class="n">sender</span><span class="p">.</span><span class="nb">call</span><span class="p">{</span><span class="n">value</span><span class="o">:</span> <span class="n">amount</span><span class="p">}(</span><span class="s">""</span><span class="p">);</span>
        <span class="nb">require</span><span class="p">(</span><span class="n">ok</span><span class="p">,</span> <span class="s">"transfer failed"</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>

<p>This follows checks-effects-interactions ordering.</p>

<h2 id="references">References</h2>

<ul>
  <li>Gavin Wood, <em>Ethereum: A Secure Decentralised Generalised Transaction Ledger (Yellow Paper)</em>: https://ethereum.github.io/yellowpaper/paper.pdf</li>
  <li>Ethereum docs (EVM, gas, execution): https://ethereum.org/en/developers/docs/</li>
  <li>Solidity docs: https://docs.soliditylang.org/</li>
</ul>

<h2 id="best-books">Best Books</h2>

<ul>
  <li>Andreas M. Antonopoulos &amp; Gavin Wood, <em>Mastering Ethereum</em>.</li>
  <li>Chris Dannen, <em>Introducing Ethereum and Solidity</em>.</li>
  <li>Camila Russo, <em>The Infinite Machine</em> (history/context).</li>
</ul>]]></content><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><category term="blockchain" /><category term="smart-contracts" /><category term="ethereum" /><category term="evm" /><category term="solidity" /><category term="gas" /><summary type="html"><![CDATA[This is Post 2 in the Blockchain Series. The previous post covered blockchain fundamentals.]]></summary></entry><entry><title type="html">Risk Management and Trader Dashboards: From Trades to Decisions</title><link href="https://diepdao.me/finance/2026/03/22/risk-management-and-trader-dashboards/" rel="alternate" type="text/html" title="Risk Management and Trader Dashboards: From Trades to Decisions" /><published>2026-03-22T01:00:00+00:00</published><updated>2026-03-22T01:00:00+00:00</updated><id>https://diepdao.me/finance/2026/03/22/risk-management-and-trader-dashboards</id><content type="html" xml:base="https://diepdao.me/finance/2026/03/22/risk-management-and-trader-dashboards/"><![CDATA[<p>Risk dashboards are decision systems. They must be fast, consistent, and explainable under pressure.</p>

<h2 id="what-traders-and-risk-managers-need">What Traders and Risk Managers Need</h2>

<ul>
  <li>PnL by desk/book/strategy.</li>
  <li>Intraday changes with attributable drivers.</li>
  <li>Limit utilization and breaches.</li>
  <li>Sensitivities by factor and maturity bucket.</li>
  <li>Stress and scenario impact views.</li>
</ul>

<h2 id="data-to-decision-pipeline">Data-to-Decision Pipeline</h2>

<p><code class="language-plaintext highlighter-rouge">Trades -&gt; Enrichment -&gt; Valuation -&gt; Sensitivities -&gt; Aggregation -&gt; Limits -&gt; Dashboard</code></p>

<h2 id="engineering-requirements">Engineering Requirements</h2>

<ul>
  <li>Low-latency incremental recalculation.</li>
  <li>As-of snapshots and replay capability.</li>
  <li>Idempotent aggregation and deterministic totals.</li>
  <li>Drill-through from top-line number to individual trades.</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li><a href="https://www.bis.org/bcbs/publ/d457.htm">FRTB Overview (BIS)</a></li>
  <li><a href="https://www.cftc.gov/">CFTC Market Risk Advisory Resources</a></li>
  <li><a href="https://www.iosco.org/">IOSCO Risk and Market Reports</a></li>
</ul>

<h2 id="best-books-to-read">Best Books to Read</h2>

<ul>
  <li><em>Value at Risk</em> — Philippe Jorion</li>
  <li><em>Financial Risk Manager Handbook</em> — Philippe Jorion</li>
  <li><em>Active Portfolio Management</em> — Grinold &amp; Kahn</li>
</ul>]]></content><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><category term="finance" /><category term="risk-management" /><category term="dashboards" /><category term="traders" /><category term="pnl" /><summary type="html"><![CDATA[Risk dashboards are decision systems. They must be fast, consistent, and explainable under pressure.]]></summary></entry><entry><title type="html">Corporate Banking Systems: Loans, Facilities, and Controls</title><link href="https://diepdao.me/finance/2026/03/21/corporate-banking-systems/" rel="alternate" type="text/html" title="Corporate Banking Systems: Loans, Facilities, and Controls" /><published>2026-03-21T01:00:00+00:00</published><updated>2026-03-21T01:00:00+00:00</updated><id>https://diepdao.me/finance/2026/03/21/corporate-banking-systems</id><content type="html" xml:base="https://diepdao.me/finance/2026/03/21/corporate-banking-systems/"><![CDATA[<p>Corporate banking platforms handle long-lived relationships, complex limits, and strict operational controls.</p>

<h2 id="domain-model-essentials">Domain Model Essentials</h2>

<ul>
  <li><strong>Client hierarchy</strong>: parent/subsidiary and obligor mapping.</li>
  <li><strong>Facilities</strong>: committed/uncommitted, utilization and headroom.</li>
  <li><strong>Loans</strong>: drawdown, repayment schedules, interest accrual.</li>
  <li><strong>Collateral</strong>: eligibility, haircut, valuation refresh.</li>
</ul>

<h2 id="platform-requirements">Platform Requirements</h2>

<ul>
  <li>End-to-end lifecycle state machine.</li>
  <li>Complete audit history for every decision/action.</li>
  <li>Covenant monitoring with automated triggers.</li>
  <li>Reconciliation across source systems and finance ledgers.</li>
</ul>

<h2 id="integration-patterns">Integration Patterns</h2>

<ul>
  <li>Event-driven updates for exposure and utilization.</li>
  <li>Batch + streaming coexistence for reporting and intraday views.</li>
  <li>Contract-driven APIs for product and risk engines.</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li><a href="https://www.ifc.org/en/what-we-do/sector-expertise/financial-institutions/sme-finance">IFC SME Banking Knowledge Guide</a></li>
  <li><a href="https://www.worldbank.org/en/topic/financialsector">World Bank: Financial Infrastructure</a></li>
  <li><a href="https://www.lsta.org/">Loan Syndications and Trading Association (LSTA)</a></li>
</ul>

<h2 id="best-books-to-read">Best Books to Read</h2>

<ul>
  <li><em>The Handbook of Loan Syndications and Trading</em> — LSTA contributors</li>
  <li><em>Corporate Banking</em> — Brian Coyle</li>
  <li><em>Bank Credit Risk Management</em> — Donald van Deventer et al.</li>
</ul>]]></content><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><category term="finance" /><category term="corporate-banking" /><category term="loans" /><category term="facilities" /><category term="credit-risk" /><summary type="html"><![CDATA[Corporate banking platforms handle long-lived relationships, complex limits, and strict operational controls.]]></summary></entry><entry><title type="html">Banking and Financial Institutions: Operating Model for Engineers</title><link href="https://diepdao.me/finance/2026/03/20/banking-and-financial-institutions/" rel="alternate" type="text/html" title="Banking and Financial Institutions: Operating Model for Engineers" /><published>2026-03-20T01:00:00+00:00</published><updated>2026-03-20T01:00:00+00:00</updated><id>https://diepdao.me/finance/2026/03/20/banking-and-financial-institutions</id><content type="html" xml:base="https://diepdao.me/finance/2026/03/20/banking-and-financial-institutions/"><![CDATA[<p>Banks are federations of specialized teams tied together by shared data, controls, and regulation.</p>

<h2 id="functional-layers">Functional Layers</h2>

<ul>
  <li><strong>Front office</strong>: sales, trading, origination.</li>
  <li><strong>Middle office</strong>: risk, controls, limit monitoring.</li>
  <li><strong>Back office</strong>: settlement, reconciliation, confirmations.</li>
  <li><strong>Treasury and finance</strong>: funding, liquidity, ledger, reporting.</li>
</ul>

<h2 id="engineering-implications">Engineering Implications</h2>

<ul>
  <li>The same trade needs multiple validated views.</li>
  <li>Golden-source reference data is non-negotiable.</li>
  <li>Entitlements and audit trails must be first-class.</li>
  <li>Workflow tooling is as important as analytics.</li>
</ul>

<h2 id="regulatorycontrol-themes">Regulatory/Control Themes</h2>

<ul>
  <li>Data lineage and model governance.</li>
  <li>Segregation of duties.</li>
  <li>Exception management and break resolution.</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li><a href="https://www.bis.org/bcbs/publ/">Basel Committee Publications</a></li>
  <li><a href="https://www.occ.treas.gov/">OCC: Risk Management Guidance</a></li>
  <li><a href="https://www.federalreserve.gov/supervisionreg.htm">Federal Reserve Supervision and Regulation</a></li>
</ul>

<h2 id="best-books-to-read">Best Books to Read</h2>

<ul>
  <li><em>The Banker’s Handbook</em> — Wouter de Ploey et al.</li>
  <li><em>International Banking</em> — Robert Grosse, Luiz R. Mesquita</li>
  <li><em>Risk Management in Banking</em> — Joël Bessis</li>
</ul>]]></content><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><category term="finance" /><category term="banking" /><category term="institutions" /><category term="middle-office" /><category term="operations" /><summary type="html"><![CDATA[Banks are federations of specialized teams tied together by shared data, controls, and regulation.]]></summary></entry><entry><title type="html">Financial Engineering for Builders: Pricing, Curves, and Risk</title><link href="https://diepdao.me/finance/2026/03/19/financial-engineering-for-builders/" rel="alternate" type="text/html" title="Financial Engineering for Builders: Pricing, Curves, and Risk" /><published>2026-03-19T01:00:00+00:00</published><updated>2026-03-19T01:00:00+00:00</updated><id>https://diepdao.me/finance/2026/03/19/financial-engineering-for-builders</id><content type="html" xml:base="https://diepdao.me/finance/2026/03/19/financial-engineering-for-builders/"><![CDATA[<p>Financial engineering in production is the discipline of turning models into reliable, explainable, and testable systems.</p>

<h2 id="core-building-blocks">Core Building Blocks</h2>

<ul>
  <li><strong>Discounting</strong> and present value</li>
  <li><strong>Curves</strong> (OIS, LIBOR fallback/term benchmarks, credit curves)</li>
  <li><strong>Volatility surfaces</strong> for options</li>
  <li><strong>Sensitivities</strong> (DV01, delta, gamma, vega)</li>
  <li><strong>Scenario and stress engines</strong></li>
</ul>

<h2 id="engineering-priorities">Engineering Priorities</h2>

<ul>
  <li>Deterministic valuation runs for reproducibility.</li>
  <li>Version everything: models, market data, conventions.</li>
  <li>Explainability: contribution analysis by trade and factor.</li>
  <li>Fast incremental recalculation after trade events.</li>
</ul>

<h2 id="common-failure-modes">Common Failure Modes</h2>

<ul>
  <li>Hidden convention mismatches (day count, calendars).</li>
  <li>Mixing stale and live market snapshots.</li>
  <li>Non-idempotent risk aggregation jobs.</li>
</ul>

<h2 id="references">References</h2>

<ul>
  <li><a href="https://www.isda.org/category/risk/">ISDA: Risk and Initial Margin</a></li>
  <li><a href="https://www.bankofengland.co.uk/">Bank of England: Yield Curves and Discounting</a></li>
  <li><a href="https://www.cmegroup.com/education.html">CME Education: Options Greeks</a></li>
</ul>

<h2 id="best-books-to-read">Best Books to Read</h2>

<ul>
  <li><em>Options, Futures, and Other Derivatives</em> — John C. Hull</li>
  <li><em>Paul Wilmott Introduces Quantitative Finance</em> — Paul Wilmott</li>
  <li><em>Interest Rate Markets</em> — Siddhartha Jha</li>
</ul>]]></content><author><name>Diep Dao</name><email>diepdaocs@gmail.com</email></author><category term="finance" /><category term="financial-engineering" /><category term="pricing" /><category term="quantitative-finance" /><category term="risk" /><summary type="html"><![CDATA[Financial engineering in production is the discipline of turning models into reliable, explainable, and testable systems.]]></summary></entry></feed>