Work Services About Journal
Start a project →
sean@integralstack.io
Case Study

Real-time pricing service for a
crypto lending platform.

SALT lends cash against crypto collateral, so every part of the business runs on prices. We designed and built Price Service V2, a streaming Rust service that replaced 30-second polling and now feeds wallets, user interfaces and risk management across the platform.

Client SALT Lending
Industry Fintech · Crypto-backed lending
Engagement Backend architecture and build
Stack Rust, gRPC, ZeroMQ, PostgreSQL
Overview

When prices drive loans, stale prices are risk.

SALT's borrowers pledge crypto as collateral for cash loans. The value of that collateral drives loan-to-value monitoring, margin calls and liquidation decisions, and crypto markets can move sharply in seconds.

The legacy price service polled and refreshed every 30 seconds. We designed and built its replacement, then moved every consuming system onto it.

The Challenge

One price, everywhere, right now.

Every part of the platform needed fresh, consistent prices from one place: wallet management, the prices users see, and the risk system that watches every loan. The service had to stay accurate when individual trades were noisy, keep working when its primary data feed failed, and leave a record of exactly which trades produced each price.

Freshness

Thirty-second-old prices are a real exposure when collateral is volatile.

Resilience

A pricing outage would blind wallets, user interfaces and risk management at the same moment.

Accountability

Loan-to-value events needed an audit trail of the exact price and source trades behind them.

The Solution

A streaming price service in Rust.

Price Service V2 is a gRPC server written in Rust. It consumes a live trade feed and turns every new trade into a fresh price for each supported asset, filtering out stale and outlying trades so one noisy print can't move the number.

A broadcaster holds the latest price for every asset and streams updates to any service that subscribes. Consumers can also request the latest price, the list of supported assets, or historical prices over a time range.

Streaming by default

A server-streaming gRPC call pushes every new price to subscribers the moment it's calculated, with simple calls alongside it for systems that only need a single price.

Built-in fallback

If prices go stale or the primary feed drops, the service switches to a backup market data source automatically and switches back when the feed recovers.

Audit-ready history

Every price is stored with the trades behind it, so any price can be traced back to its source and historical queries stay fast.

The Results

Live prices across the whole platform.

Key Outcome

Risk sees changes the moment they happen

With prices streaming instead of polled, SALT's risk management recognizes drops in loan-to-value instantly, and wallets and user interfaces show the same live price.

30s to live Polling replaced with streaming
12 Crypto assets priced in real time
1 Price source for the whole platform

Every consuming service moved onto the new service. With live and historical prices coming from one place, prices are consistent across every system, and an older historical price service could be retired.

Our team, end to end

Our team owned the architecture and implementation, and coordinated the migration of every consuming service with SALT's engineering team.

Technology

Tech Stack

Rust Price service
gRPC Unary and server-streaming APIs
ZeroMQ Live trade feed
Automatic failover Backup market data source
PostgreSQL Price history and source trades
Materialized views Fast historical queries
Start a project

Let's build
something worth
shipping.

Tell us a bit about your project. We reply within 24 hours, usually with questions and sometimes with sketches.

Or email sean@integralstack.io