Interledger has some unique properties as a value transfer protocol with exchange rates. The plan is to use it for paying with anything, but could we create a decentralized exchange (market and limit orders, orderbooks, users hold their keys, etc.) on top of Interledger, assuming ideal deployment of the protocol?
A couple characteristics draw attention to this and offer a competitive advantage for Interledger:
Interledger provides front running resistance.
- Front-running is the practice of a broker or trader stepping in front of large orders to gain an economic advantage. The way this is currently done on platforms like Ethereum is by having someone submitting an order to an on-chain contract, where a miner can avoid publishing certain orders and arbitrage by publishing their own order to the same on chain contract. This doesn’t have to be a miner, it can also be someone who cheats the max-heap transaction fee selector in the individual blockchain clients by outbidding other transactions in the gas market. The main reason this is exploitable is because of the latency of on-chain settlement.
- With the low latency nature of transfers and settlement via Interledger, a client can avoid the cases of front-running. In the case of a counterparty settling later on purpose and trying to arbitrage off trades in the same currency with other counterparties, this could be handled by refusing to trade after an expiration.
Interledger can pool liquidity from multiple areas in parallel, thereby being the most distributed in nature.
- Interledger is powerful because of how easy it is to just make money flow given any supported currency. Fulfilling a buy or sell order through multiple streams seemed like a cool idea, but getting it optimal is more complex than just using distance vector routing. This is because we’re not routing from point A to B, we are searching for an optimal set of points that sum to a limit order (bin-packing, which is NP-Complete).
- This is restricted by the fact we don’t have some kind of order aggregation like the orderbooks posted by Relayers in 0x. Perhaps you could recreate the Relayers on Interledger and have them collect an order matching fee or payment on API request. Would result in an interesting meta-protocol.
Interledger is token agnostic.
- Interledger requires no underlying token or platform lock-in. Every other DEX is a smart contract on Ethereum that requires this or is built into the consensus rules of a blockchain (i.e. Stellar). We can support any ledger that offers payment channels.
Some other issues:
- How do you receive the other currency when doing an exchange?
- We need to keep in mind that to use a blockchain platform on Interledger requires opening a payment channel, at least for scalable decentralized exchange. Therefore if you had a two currency swap, you’d have to open a second payment channel to receive the final settlement in your desired currency. This could get crazy if you need to find a payment route that requires including two different counterparties! To find the best path is essentially a traveling salesman problem in terms of network topology and bin-packing in terms of fulfilling limit order. Pretty ugly. However, playing around with heuristics could reduce this to a distance vector routing problem, but I haven’t thought this through yet. This problem is basically the equivalent of sending payments to yourself, but in a different currency! Pretty cool if you could do HFT with it.