Swarm Markets: a BaFin-regulated DEX for tokenized assets
Protofire built Swarm Markets' on-chain DEX core on a fork of Balancer, added the subgraph data layer the interface reads from, and contributed to Swarm's dOTC block-trading contracts. Swarm Markets is a Berlin-based, BaFin-regulated venue where tokenized stocks and gold trade next to crypto and every wallet is KYC-verified (source: Swarm Markets).
Rather than write a regulated exchange's AMM from scratch, a multi-year audit liability, Protofire forked Balancer's weighted-pool contracts, audited and in production since 2020, so Swarm inherited that hardening instead of restarting it. The verifiable output is public: the forked core and subgraph repositories, both created February 2021.
“Protofire owned the on-chain half of a product whose compliance and licensing Swarm keeps.”
Why building the AMM from scratch was the wrong risk
Swarm's BaFin license and KYC permissioning are its own product. But compliance does not trade anything by itself: underneath the permissioning sits an automated market maker that has to price swaps, hold liquidity in pools, and settle on-chain, for assets regulators watch closely.
For a regulated venue, a bespoke AMM written from zero is the largest single source of technical and audit risk: every line of custom pool math is new attack surface a smart contract audit has to cover, and a regulated operator cannot ship unreviewed code that holds user funds. The pragmatic path is to build on an AMM design the industry has already audited and run in production, then add only what the product needs: configurable pools an operator can govern, a data layer fast enough to power a live trading interface, and a way for institutions to move size without walking the public order book.
How Protofire built Swarm's DEX on a Balancer core
The swarm-markets-balancer-core repository, Protofire's fork of balancer/balancer-core created in February 2021, holds its Solidity commit history on the pool contracts, including the configurable pool parameters a regulated operator needs to govern. The fork also carries a full Trail of Bits security audit and Echidna and Manticore test harnesses, so the Swarm-specific changes shipped against the same review bar as the upstream code.
The exchange settled on Polygon rather than Ethereum mainnet, which kept a swap in the range of a few cents ($0.05 to $0.10) instead of the several dollars ($5 to $10) a comparable mainnet trade cost, roughly a 98% lower transaction fee.
So the interface can read chain state quickly, Protofire built the exchange's data layer as a subgraph on The Graph. The swarm-markets-subgraph repository, forked from balancer/balancer-subgraph, indexes the pools, swaps, transactions, and user balances the front end depends on.
For institutional flow, Protofire also contributed to Swarm's decentralized OTC (dOTC) block-trading contracts, which let large trades execute on-chain with private offers and configurable order terms instead of moving the public pools. Across the engagement, Protofire owned the on-chain half of a product whose compliance and licensing Swarm keeps.
Results
Protofire delivered the on-chain engineering behind Swarm's exchange. The verifiable output is public code, not a marketing metric:
Swarm Markets separately reports the exchange's business traction: over 7,000 KYC-verified users, 50+ trading pairs including tokenized Apple, Tesla, and gold, and monthly trading volume that grew from under $1M to over $15M within six months of launch (source: Swarm Markets).