Skip to content
MaatX
DeFidark interfacedemo

APEX

Institutional DeFi Platform

Programmable financial infrastructure for digital assets.

APEX
APEX, institutional defi platform — product interface

Run on-chain credit and liquidity positions with the risk visibility a desk expects before it commits capital.

  • Solidity
  • Risk engine
  • Oracle safety
  • Cross-margin
  • Event indexing

A lending, liquidity and collateral platform built for desks that need position-level risk visibility before they need yield.

Product overview

What the product is built around.

APEX treats a DeFi position the way a prime broker treats a margin account: one account view, one health number, one audit trail. The protocol layer is abstracted so a desk reasons about exposure and collateral rather than about which pool a position happens to live in.

Risk before yield

Health factor, liquidation distance and correlated-collateral exposure are first-class, computed continuously rather than polled on page load.

Protocol as a detail

A single position abstraction spans lending markets, so adding a venue does not change how the desk works.

Explainable returns

Every basis point of yield is attributed to a source — base rate, incentive emissions or fee share — so returns can be underwritten.

The problem

What makes this hard.

Institutional desks want the capital efficiency of on-chain credit markets without giving up the controls they already run off-chain. The tooling forces a choice: retail-grade interfaces with no risk surface, or custodial products with none of the programmability.

  • 01

    Collateral health is spread across a dozen protocol UIs with no consolidated view

  • 02

    Liquidation risk is discovered after the price move, not before it

  • 03

    Yield strategies are opaque — desks cannot see where the return is actually coming from

  • 04

    Treasury, risk and trading teams work from different numbers on the same positions

  • 05

    Position sizing decisions need pre-trade impact simulation that no dashboard provides

The solution

What the system does.

APEX consolidates positions across lending venues into one account view with a single health number. A risk engine evaluates collateral continuously off an event stream rather than on page load, simulates price shocks before a trade, and blocks new leverage when a price feed goes stale. Yield is attributed to its source so a return can be underwritten rather than hoped for.

  • One position view across venues, chains and asset classes

  • Continuous health-factor evaluation with liquidation projection

  • Pre-trade shock simulation before capital is committed

  • Declarative risk limits that a reviewer can diff

  • Yield attributed to base rate, fees and incentives separately

Product interface

APEX, as working interface.

Rendered UI, not a mockup. Switch between screens, and try ⌘K for the command palette.

DEMO
APEXOverview
OverviewExposureYieldLiquidation riskActivity● LIVE
APEX

Consolidated exposure across venues, with allocation and yield attribution.

Total portfolio

$48.24M

+2.8% 24h

Collateral posted

$31.60M

65.5% of portfolio

Borrowed

$12.84M

40.6% LTV

Net APY

7.42%

+0.31 bps w/w

Portfolio value

90D
$48,243,910+$1.31M (2.8%) 24hprev period
JunJulAugSep

Collateral composition

Collateral$31.6M
  • ETH & LSTs44.9%
  • Stablecoins29.7%
  • wBTC16.1%
  • Alt L2 assets9.2%

Yield attribution

bps
318 bps
Base
204 bps
Fees
148 bps
Emis.
96 bps
Rehyp.
124 bps
Cost
System architecture

How it is put together.

Risk sits between the API and the protocol layer deliberately — no write path reaches a contract without passing a policy check first.

  1. 01

    Frontend

    Position and risk surfaces, streamed updates, pre-trade simulation UI.

    • Next.js
    • React
    • TypeScript
    • WebSocket
  2. 02

    API Gateway

    Auth, rate limiting, request signing and idempotency keys on every mutation.

    • Node.js
    • REST
    • JWT
    • Idempotency
  3. 03

    Risk Engine

    Continuous health-factor evaluation, haircut model, concentration limits and shock simulation.

    • Rust
    • Redis
    • Event stream
  4. 04

    Protocol Layer

    Venue adapters normalising lending markets into one position abstraction.

    • Adapter pattern
    • TypeScript
    • Simulation
  5. 05

    Smart Contracts

    Vaults, collateral accounting, liquidation hooks and role-gated admin paths.

    • Solidity
    • Foundry
    • OpenZeppelin
  6. 06

    Blockchain

    EVM execution with indexed event streams feeding state reconstruction.

    • EVM
    • Indexer
    • Oracles

What the product does.

The capability set the demonstration is built around.

Liquidity pools

Provision and monitor pool positions with depth, utilisation and fee-share attribution.

Lending & borrowing

Supply and borrow across markets with unified rate discovery and term comparison.

Collateral management

Cross-margin collateral baskets with per-asset haircuts and concentration limits.

Yield strategies

Composable strategy templates with modelled drawdown and attribution breakdown.

Risk monitoring

Continuous health-factor evaluation with threshold alerting and liquidation projection.

Portfolio management

Consolidated exposure across venues, chains and asset classes in one account view.

Engineering focus

Challenges, and the MaatX approach.

The problems that actually decide whether a system like this survives production — and how we address each one.

Position state is spread across venues and never agrees at a single instant

State is reconstructed from indexed events rather than read live from each protocol. Every figure carries the block height it was derived from, so a stale number is visibly stale instead of silently wrong.

A health factor computed on page load is already out of date

The risk engine evaluates continuously off the event stream and pushes changes. The UI subscribes to derived risk, not raw chain data, which keeps the client thin and the maths in one place.

Transaction reliability under reorgs and mempool congestion

Mutations are idempotent and keyed. Submissions are tracked through a state machine with explicit replacement and cancellation paths rather than fire-and-forget signing.

Oracle failure is a solvency event, not a UI bug

Feeds are checked for deviation and staleness before entering the risk model. On breach the engine holds last-known-good and blocks new leverage instead of computing on bad prices.

Risk policy must be auditable, not buried in application code

Haircuts, concentration caps and LTV ceilings are declarative configuration with versioned history, so a limit change is a reviewable diff.

The stack behind it.

Risk engine

  • Rust
  • Redis
  • Event-stream evaluation
  • Health-factor model
  • Collateral haircut matrix
  • Concentration limits
  • Price-shock simulation

Oracle safety

  • Chainlink price feeds
  • Multi-source median
  • Deviation bounds
  • Staleness thresholds
  • Last-known-good hold
  • New-leverage circuit breaker

Smart contracts

  • Solidity
  • Foundry
  • OpenZeppelin
  • Slither
  • Invariant tests
  • Liquidation hooks
  • Role-gated admin paths

Venue adapters

  • TypeScript
  • viem
  • Adapter pattern
  • Position normalisation
  • eth_call simulation
  • Slippage bounds

API & execution

  • Node.js
  • REST
  • WebSocket
  • JWT
  • Idempotency keys
  • Rate limiting
  • Transaction state machine

Position state & indexing

  • PostgreSQL
  • ClickHouse
  • Kafka
  • Reorg-safe indexer
  • Event sourcing
  • Block-height stamped reads

Desk interface

  • Next.js
  • React
  • TypeScript
  • Tailwind CSS
  • WebSocket streams
  • Streaming risk subscriptions
  • Virtualised position tables
Product evolution

How it grows with the business.

The same system at three stages. Most products should not start at the third — but the architecture should not have to be thrown away to get there.

MVP

A single venue and asset class, with the risk surface right from the start.

  • One lending market, one chain
  • Position and collateral views
  • Health factor with alerting
  • Read-only portfolio reporting
Scale

Multiple venues behind one position abstraction, with execution.

  • Venue adapters for additional markets
  • Cross-margin collateral baskets
  • Pre-trade simulation and slippage bounds
  • Yield attribution and strategy templates
Enterprise

Desk-grade controls, reporting and segregation of duties.

  • Policy-as-code limits with approval workflows
  • Middle-office reporting exports
  • Multi-entity and multi-desk segregation
  • Scenario library for stress regimes
Future expansion

Where it could go next.

Directions this system would extend into.

  • 01

    Cross-margin netting across venues to reduce total collateral requirement

  • 02

    Policy-as-code risk limits with approval workflows and change history

  • 03

    Intent-based execution so desks express target exposure rather than individual transactions

  • 04

    Scenario library for stress testing against historical volatility regimes

  • 05

    Institutional reporting exports aligned to existing middle-office formats

Building lending, collateral or liquidity where a desk has to see its risk before it commits capital?

We built APEX to work through exactly this. Tell us where you are and we will tell you what we would do differently for your constraints.