A technical tutorial on building a custom indexer and API for the YieldBlox blend pool using Mercury and Zephyr. The guide covers setting up a Rust-based indexer to track borrow, repay, and collateral actions on Stellar, with real-time data retrieval through a custom API.

This comprehensive technical guide demonstrates how to build a production-ready indexer and API for the YieldBlox blend pool using Mercury's cloud execution environment and Zephyr SDK. The tutorial walks through creating a Rust program that indexes Soroban contract events, storing borrow, repay, and collateral operations in a structured database. It covers project setup, database schema design, ingestion logic for processing YieldBlox events, and building a custom API for querying indexed data by action type and user address. The guide includes local testing strategies, deployment instructions, and catchup procedures to backfill historical data efficiently. It emphasizes Mercury's advantages over traditional approaches, including no vendor lock-in, faster catchups compared to running Stellar Core nodes, and simplified infrastructure requirements.