MULTI/DEX Since Version 1.30 — Phase II, Open Source, Earn, Proof of Reserves and More
I haven't posted a MULTI/DEX update here since version 1.30, and quite a lot has changed around the project since then. The biggest development is probably that Phase I has ended and MULTI/DEX has entered Phase II. DFINITY says the Phase I ledger was frozen for review so accounts involved in wash trading, collusion or other manipulation can be removed before prizes are finalized. Phase II has now started with a fresh competition, and—more importantly—the source code has finally been released publicly. The repository is here: https://github.com/dfinity/public-multidex That was one of the things several of us were waiting for. The repository now exposes the Motoko backend, frontend, bridge, arbitrage component, tests, deployment scripts and design documentation. DFINITY currently labels it a research prototype under active development and explicitly says it has not been audited and should not be used with real funds yet. The Exchange Is Becoming Much More Than a Swap Interface The current architecture is considerably broader than the early version we were experimenting with. MULTI/DEX now documents: order-book spot trading leveraged margin positions segregated margin pools an automated market-making vault an insurance fund protocol-controlled arbitrage progressive maker/taker fee levels permanent account history an on-chain treasury a public exchange ledger AI and external MCP access The margin design is particularly interesting. Positions are grouped into separate pools, so losses in one margin pool are intended to stop at that pool rather than reaching a user's normal wallet or unrelated positions. Liquidations first collect a 5% penalty into an insurance buffer, with the insurance pool absorbing insolvent bad debt before losses reach the AMM liquidity providers. That is a much more serious risk model than simply adding a "5x leverage" button onto a swap page. Earn: LPs and an Insurance Backstop There is now an Earn section with two very different ways of providing capital. The first is the AMM vault. Users can deposit assets into a shared inventory vault that quotes across MULTI/DEX's markets. Rather than having isolated liquidity pools for every pair, the design treats the vault as common market-making inventory. The second is the insurance fund. Users can stake ICPUSD into the margin system's backstop and earn liquidation penalties, but there is real downside: if positions become insolvent, the insurance fund absorbs those losses before AMM LPs do. I actually like that the UI says this explicitly instead of presenting everything as "yield." Yield exists because somebody is accepting risk. MULTI/DEX is starting to make that relationship unusually visible. The Treasury Now Has an Actual Economic Purpose One of the things we in the ICF criticized earlier was MULTI/DEX burning an enormous number of cycles while still being a play-money exchange. The newer treasury design at least provides an answer for how this is supposed to become sustainable. Every fill charges a fee on the ICPUSD leg. Those fees are split 50/50 between the AMM vault and the protocol treasury. Fee rates are progressive and decrease as a trader's rolling contribution increases, with maker activity weighted more heavily than taker activity. The highest maker rate can eventually fall to zero, but never become negative, apparently to avoid creating profitable wash-trading incentives. The more interesting part is what happens to treasury revenue. MULTI/DEX now describes an automated loop where treasury ICPUSD can be swapped internally into ICP and then converted into cycles through the ICP ledger and Cycles Minting Canister. A watchdog can trigger that process when the exchange's available compute fuel gets low. In other words: trading fees → ICP → cycles → exchange keeps running That's considerably more elegant than somebody at DFINITY periodically noticing the canister has six hours of life left and topping it up manually. Whether the fees generated by a real exchange would actually cover the current cycle burn is another question entirely. That's one of the metrics I really want to see once real-money trading exists. A Public, Hash-Chained Exchange Ledger This may be my favorite addition. MULTI/DEX now maintains an append-only public ledger for balance-changing events: trades, deposits, withdrawals, margin debt, liquidations, vault movements and insurance activity. Each record contains the SHA-256 hash of the preceding record, forming a hash chain. The current head is then placed into ICP's certified_data, meaning the subnet cryptographically certifies the latest state. Archived history is moved into separate archive canisters that can eventually be sealed. The site even provides a browser-side verification tool that recomputes the hashes rather than simply trusting the exchange's own UI. The eventual objective is continuous proof of reserves. If user liabilities can be reconstructed from the public event ledger while custody addresses can independently be inspected on their native chains, then you theoretically don't need to wait for a quarterly auditor to tell you whether customer assets still exist. That's a much stronger application of "on-chain exchange" than merely putting the order matcher inside a canister. Permanent Trading History Account history has also become much more extensive. MULTI/DEX now describes a dedicated history archive containing fills, deposits, withdrawals, transfers, liquidations, position closures and Earn activity. Users can search the archive and export it to CSV or JSON. That sounds boring until real money enters the system. Then it becomes tax records. The architecture also buffers history inside the main exchange if the archive canister temporarily runs out of cycles, then ships those records once the archive comes back online. Protocol Arbitrage Because the assets in Play Mode are synthetic, there aren't external arbitrage traders moving real assets between MULTI/DEX and outside exchanges. So MULTI/DEX now has its own protocol arbitrage component. Its job is to identify when the internal market moves significantly away from the oracle price and trade against that deviation. Importantly, DFINITY says the arbitrageur uses the same staged trading path as normal traders and cannot trade directly against the AMM. Its activity is also written into the public event log. That makes sense in Play Mode. What I'm more interested in is whether any version of this survives into production once actual external arbitrageurs can move real BTC, ETH, ICP and stablecoins between venues. Fee Levels and Reputation MULTI/DEX now has a contribution-based fee system from L0 through L4. Levels aren't manually assigned. They're calculated from rolling 30-day activity, with maker volume weighted double and higher levels also considering things like two-sided quoting uptime. As users contribute more liquidity and trading activity, fees decline and execution priority can improve. Stop contributing and the level eventually decays. There are also permanent badges recording milestones. This adds an interesting social/economic layer because MULTI/DEX isn't treating every anonymous trader identically forever. It is building an on-chain reputation around actual exchange participation without necessarily attaching a real-world identity to it. AI Is Becoming More Integrated The AI assistant is still present, but there is now considerably more infrastructure around it. Users can inspect how much AI capacity they've consumed, including data lookups, proposed actions, executed actions and refusals. More interestingly, MULTI/DEX exposes the same exchange data/query layer to outside AI systems through MCP. So theoretically you don't need to use MULTI/DEX's built-in assistant at all. An external agent could query your positions, history and exchange state through the same structured interface, subject to account permissions. That feels much closer to the original "AI-native exchange" pitch than merely putting a chatbot next to the order book. And Yes, It Is Actually Open Source Now This deserves repeating because it was one of the largest concerns we were waiting for in this community. MULTI/DEX is now public under the MIT license. The repository includes the exchange backend, frontend, simulated bridge, arbitrage canister, deployment modes, tests and design documents. There are already public issues and pull requests. So Richard finally gets to unleash his repository auditor on it. Have fun. The repository also makes clear that the current Bridge is still a stub and that the actual production chain-key custody architecture remains design work. That is probably the largest reminder that MULTI/DEX is still a prototype rather than an exchange awaiting somebody to flip the "real money" switch. My Impression Since 1.30 I think MULTI/DEX is becoming considerably more interesting technically. The public ledger, continuous proof-of-reserves model, protocol-funded cycles, unified AMM inventory, segregated margin pools, insurance backstop and agent-accessible data layer aren't really what ICPSwap is trying to build. But, that doesn't automatically make MULTI/DEX better. The questions I'd put to everyone using Phase II are: Does it actually feel better to trade now than it did since my last version post? Has anyone looked through the newly released source yet and found anything interesting? And perhaps most importantly: what would you need to see audited, changed or proven before you would trust this architecture with actual BTC rather than $100,000 of DFINITY's imaginary money? Full release notes
Replies
Antwand ·
I'm still waiting for this to start using real money. I just can't take it seriously, and I feel like I've said it before. As for the code, it'd be nice to slide the whole repository into powerful engines built to specifically look for bugs.