Nodes = currencies (USD, MXN, BTC, USDT, NGN, GBP...) Edges = conversion paths, each carrying: - exchange_rate - fee_pct - estimated_minutes - provider name CODE_BLOCK: Nodes = currencies (USD, MXN, BTC, USDT, NGN, GBP...) Edges = conversion paths, each carrying: - exchange_rate - fee_pct - estimated_minutes - provider name CODE_BLOCK: Nodes = currencies (USD, MXN, BTC, USDT, NGN, GBP...) Edges = conversion paths, each carrying: - exchange_rate - fee_pct - estimated_minutes - provider name CODE_BLOCK: INR → USDT (CoinDCX, 0.5%) → BTC (MEXC, 0.1%) → GBP (Kraken, 0.16%) = 0.76% total CODE_BLOCK: INR → USDT (CoinDCX, 0.5%) → BTC (MEXC, 0.1%) → GBP (Kraken, 0.16%) = 0.76% total CODE_BLOCK: INR → USDT (CoinDCX, 0.5%) → BTC (MEXC, 0.1%) → GBP (Kraken, 0.16%) = 0.76% total COMMAND_BLOCK: def _dijkstra(graph, start, end, amount, optimize="cost", max_routes=5, max_steps=4): heap = [(0.0, 0, 0, start, amount, [])] results = [] visited_states = {} while heap and len(results) < max_routes: priority, _, steps, curr, curr_amount, path = heapq.heappop(heap) # Prune by (currency, provider_set) — allows different # exchange combos through the same intermediate currency providers_key = frozenset(e.via for e in path) state = (curr, providers_key) if state in visited_states and visited_states[state] <= priority: continue visited_states[state] = priority if curr == end and path: # Compound cost: 1 - ∏(1 - fee_i/100) product = 1.0 for e in path: product *= (1 - e.fee_pct / 100) results.append(((1 - product) * 100, curr_amount, path)) continue if steps >= max_steps: continue for edge in graph.get(curr, []): # No provider appears twice in a path if any(e.via == edge.via for e in path): continue new_amount = (curr_amount * edge.exchange_rate * (1 - edge.fee_pct / 100)) new_priority = priority + ( edge.fee_pct if optimize == "cost" else edge.estimated_minutes) heapq.heappush(heap, ( new_priority, ..., steps + 1, edge.to_currency, new_amount, path +
[edge])) COMMAND_BLOCK: def _dijkstra(graph, start, end, amount, optimize="cost", max_routes=5, max_steps=4): heap = [(0.0, 0, 0, start, amount, [])] results = [] visited_states = {} while heap and len(results) < max_routes: priority, _, steps, curr, curr_amount, path = heapq.heappop(heap) # Prune by (currency, provider_set) — allows different # exchange combos through the same intermediate currency providers_key = frozenset(e.via for e in path) state = (curr, providers_key) if state in visited_states and visited_states[state] <= priority: continue visited_states[state] = priority if curr == end and path: # Compound cost: 1 - ∏(1 - fee_i/100) product = 1.0 for e in path: product *= (1 - e.fee_pct / 100) results.append(((1 - product) * 100, curr_amount, path)) continue if steps >= max_steps: continue for edge in graph.get(curr, []): # No provider appears twice in a path if any(e.via == edge.via for e in path): continue new_amount = (curr_amount * edge.exchange_rate * (1 - edge.fee_pct / 100)) new_priority = priority + ( edge.fee_pct if optimize == "cost" else edge.estimated_minutes) heapq.heappush(heap, ( new_priority, ..., steps + 1, edge.to_currency, new_amount, path +
[edge])) COMMAND_BLOCK: def _dijkstra(graph, start, end, amount, optimize="cost", max_routes=5, max_steps=4): heap = [(0.0, 0, 0, start, amount, [])] results = [] visited_states = {} while heap and len(results) < max_routes: priority, _, steps, curr, curr_amount, path = heapq.heappop(heap) # Prune by (currency, provider_set) — allows different # exchange combos through the same intermediate currency providers_key = frozenset(e.via for e in path) state = (curr, providers_key) if state in visited_states and visited_states[state] <= priority: continue visited_states[state] = priority if curr == end and path: # Compound cost: 1 - ∏(1 - fee_i/100) product = 1.0 for e in path: product *= (1 - e.fee_pct / 100) results.append(((1 - product) * 100, curr_amount, path)) continue if steps >= max_steps: continue for edge in graph.get(curr, []): # No provider appears twice in a path if any(e.via == edge.via for e in path): continue new_amount = (curr_amount * edge.exchange_rate * (1 - edge.fee_pct / 100)) new_priority = priority + ( edge.fee_pct if optimize == "cost" else edge.estimated_minutes) heapq.heappush(heap, ( new_priority, ..., steps + 1, edge.to_currency, new_amount, path +
[edge])) - 21 crypto exchanges via CCXT (Binance, Kraken, Coinbase, OKX...)
- Wise live FX rates
- Regional exchanges with direct REST APIs (Bitso, Buda, VALR, CoinDCX, WazirX)
- Binance P2P real-time median prices for 12 emerging market currencies - 10 central bank official rates (Banxico, BCB, TRM, TCMB...) - 28 estimated remittance providers (Remitly, Western Union, Paysend, Nala...)
- Reference FX bridges for exotic corridors (CurrencyAPI, Frankfurter, FloatRates)
- FastAPI with 4 uvicorn workers
- SQLite (WAL mode) for rate history and analytics
- Tailwind CSS built from source (34KB, not the 300KB CDN)
- Zero JavaScript frameworks — vanilla JS, template literals
- One Python process on one Linux server
- Live: coinnect.bot
- API: GET https://coinnect.bot/v1/quote?from=USD&to=MXN&amount=500
- Code: github.com/coinnect-dev/coinnect (MIT)
- Whitepaper: coinnect.bot/whitepaper