FX quote engine for Lintasan
A rate service that locks a quote for 90 seconds without letting the company eat the market move. Lintasan: remittance from Malaysia to Indonesia, the Philippines and Bangladesh.
0.3%
- Lintasan
- Contract engineer, solo build
- 10 weeks
- 2025.01, v1.0
- Go, Redis, PostgreSQL, gRPC
Problem
Lintasan's senders are mostly workers sending part of their pay home on a Sunday. The app showed a rate, the sender typed an amount, and by the time they confirmed, the rate had often moved. The app then showed a new rate and asked again. 3.2% of transfers failed at this step, and app reviews said the price was a trick.
The finance lead wanted longer quote holds. The treasury lead did not, because every second of hold is market risk the company carries.
Constraints
- Rates from two liquidity providers that disagree, update at different speeds and sometimes go silent.
- A hard cap on the company's open FX exposure per corridor, set by treasury each morning.
- Every shown rate has to be reproducible later for complaints and audits.
Architecture
Code
Spread is a small, testable function. Treasury can read it, which is why they agreed to the longer hold.
// Spread returns basis points to add to the mid for a quote held holdSec seconds.func Spread(base, holdSec int, used, limit float64) int { bps := base bps += holdSec / 30 // 1 bp per 30 s of hold if limit > 0 && used/limit > 0.8 { bps += int((used/limit - 0.8) * 50) // lean against a full book } return min(bps, base*3)}
Result
- quote hold
- 90 s
- transfers failing at confirm
- 0.3%
- exposure cap breaches in 9 months
- 0
- average spread change
- +0.4 bp
The quote log turned out to be the most used part: support can now show a sender exactly what they saw and when.