Project
Pan-African FX Grid
Decentralized FX liquidity mesh for African currency markets. Bellman-Ford arbitrage detection. Mobile money settlement.
Problem
African FX markets are fragmented across 40+ currencies, multiple mobile money providers, and parallel market structures. No unified liquidity mesh exists.
Solution
A decentralized mesh connecting regional monetary fragments (UEMOA, CEMAC, WAMZ, EAC, SADC) with Bellman-Ford negative cycle detection for cross-currency arbitrage.
Architecture
Regional fragments maintain independent order books. BFT consensus for rate attestation. Mobile money APIs for settlement (MTN, Orange, M-Pesa, Wave).
Implementation
fn find_arbitrage_cycle(graph: &Graph, start: Currency) -> Option<Vec<Currency>> {
let mut distances = HashMap::new();
for node in graph.nodes() {
distances.insert(node, f64::INFINITY);
}
distances.insert(start, 0.0);
for _ in 0..graph.node_count() - 1 {
for edge in graph.edges() {
let new_dist = distances[&edge.from] + edge.weight;
if new_dist < distances[&edge.to] - 1e-12 {
distances.insert(edge.to, new_dist);
}
}
}
for edge in graph.edges() {
if distances[&edge.from] + edge.weight < distances[&edge.to] - 1e-12 {
return Some(reconstruct_cycle(&predecessors, edge.from));
}
}
None
}Vision
A single API that routes any African currency to any other, optimized for cost and speed, settling through whichever mobile money rail provides the best terms in real time.