Back to Case Studies
Case Study DeFi • Digital Assets • Financial Infrastructure

Core API Migration &
Performance Enablement for Bonzo Finance

Migrating critical APIs from .NET to JavaScript/TypeScript while maintaining performance, data integrity, and operational resilience for DeFi-critical endpoints.

Client

Bonzo Finance

Industry

DeFi • Digital Assets • Financial Infrastructure

Overview

Bonzo Finance is a decentralized lending and borrowing protocol whose application stack relies heavily on real-time market data, account-level analytics, and liquidation monitoring. These capabilities are delivered through a set of core APIs that power Bonzo's dashboard, analytics, and third-party integrations.

To support future growth, improve maintainability, and align more closely with modern web tooling, Bonzo Finance initiated a migration of its core APIs from a legacy .NET implementation to a JavaScript/TypeScript-based architecture compatible with its Next.js frontend and ecosystem integrations.

Hgraph was engaged as an infrastructure and ecosystem partner to design and deliver the migration, with a focus on performance, data integrity, and operational resilience for Bonzo's most critical endpoints.

Challenge

Bonzo's existing .NET APIs were deeply embedded in the operation of the protocol's frontend and analytics stack. Any disruption or regression risked breaking the application entirely, as the website depends on these APIs for live data.

Key challenges included:

  • Migrating critical APIs without introducing downtime or data inconsistencies.
  • Preserving response formats and behaviour expected by the existing Next.js frontend and third-party services (such as DeFi analytics platforms).
  • Ensuring near real-time accuracy for sensitive metrics such as health factors and liquidation thresholds.
  • Defending the API against ongoing DDoS and abusive traffic while maintaining acceptable response times.
  • Avoiding a full rewrite of complex protocol logic inherited from AAVE V2-based contracts.

Solution

Hgraph designed a phased migration strategy that focused first on Bonzo's highest-impact APIs, while leveraging and strengthening the existing JavaScript SDK rather than rebuilding protocol logic from scratch. The approach prioritized correctness, performance, and compatibility, ensuring Bonzo could transition to a modern stack without disrupting users or integrators.

Key Capabilities

Targeted Migration of Core Endpoints

Hgraph migrated Bonzo's highest-priority endpoints, ensuring functional parity with the existing .NET API and strict compatibility with the frontend and external consumers.

SDK-Driven Architecture

Instead of duplicating complex on-chain logic, the migration integrated and extended Bonzo's JavaScript SDK, reducing risk while improving maintainability and consistency across services.

Performance-Oriented Design

Heavy computations were identified and redesigned for precomputation and background processing, enabling most API responses to meet a sub-3 second performance target even under load.

Near Real-Time Data Integrity

Short caching intervals, finality checks, and careful aggregation logic were applied to ensure sensitive metrics, particularly liquidation and health factor calculations, remain accurate and timely.

Security & Resilience Enhancements

In addition to Cloudflare-based protection, the new architecture supports rate limiting, throttling, and IP-based blocking to mitigate abusive behaviour and sustained attack traffic.

How It Works

1

On-chain data is retrieved via Hedera Mirror Nodes or JSON-RPC sources.

2

Core protocol data is processed using the JavaScript SDK and optimised service layers.

3

Expensive calculations are handled through background jobs rather than synchronous requests.

4

Responses are returned in formats compatible with Bonzo's existing frontend and integrations.

5

Monitoring, logging, and performance tracking ensure operational visibility and rapid issue response.

This design ensures the API remains both responsive and dependable, even during periods of high usage or attack traffic.

Impact

The migration enables Bonzo Finance to:

Modernize its backend stack without disrupting users or integrations.
Improve developer velocity by standardizing on JavaScript/TypeScript across frontend and backend.
Maintain accurate, near real-time analytics for DeFi-critical metrics.
Reduce operational risk through improved performance tuning and security controls.
Create a foundation for expanding additional endpoints, bots, and third-party integrations.

Outcome

Hgraph successfully delivered the core API migration milestones, with priority endpoints implemented, tested, and validated with Bonzo Finance.

The work establishes a scalable, resilient API foundation that supports:

Ongoing protocol growth

Expanded analytics and liquidation tooling

Future endpoint development and ecosystem integrations

By combining deep protocol understanding with infrastructure-grade engineering, Hgraph helped Bonzo Finance transition to a more maintainable and performant architecture without compromising reliability, security, or user experience.

Explore Our API & Infrastructure Services

Looking to migrate, modernize, or scale your protocol's infrastructure? Let's discuss how Hgraph can help.

Get in Touch