Open WillRuddick opened 8 months ago
Yes, well described! Use case 1 is basically https://interledger.org - multi-hop payments. See also an old blog post of mine about Ripple Classic, Interledger, and multihop with hashlocks.
Use case 2 is different from that because the user is not synchronously waiting for a payment to complete; the rebalancing can happen asynchronously, so the time constraints are much less strict. And indeed instead of path finding we then call it cycle detection, like in https://ledgerloops.com.
And use case 3 is maybe the combination of the two, but taking into account how one trade can sometimes block the possibility of a different trade? As in "find an optimal set of trades". A trade might be beneficial in itself, but in the bigger picture it can lead to a suboptimal end result for the network as a whole.
Do read https://www.mdpi.com/1911-8074/13/12/295 if you haven't yet.
This optimization task will likely be computationally intensive and require sophisticated mathematical models to execute effectively.
Not if you start with a complete bird's eye view of the market. You could use the algorithm that Slovenia uses (I can't find the link right now, I think there is a 4-letter acronym for it but I forgot, so quoting from memory):
source
and drain
source
to that node. If the balance is negative, add an edge with the absolute value of that balance as its weight from that node to the drain
.source
to drain
. There are algorithms that do this in time that in basically linear time (see that Wikipedia link).My research interest is also in solving this without a bird's eye view of the network, so by only sending signalling messages through the network. One way of doing that is using market forces, to get netting at equilibrium although we had a discussion about this at CoFi'24, since it may be optimal for individual agents to incentivise market makers, but of course society as a whole is better off without brokers who just exploit their network position to charge a toll.
Specification for Developing Optimization Algorithms for Networks of SwapPools:
Use Case #1: Optimal Pathfinding
Use Case #2: Pool Balancing (Obligation Clearing)
For both use cases, the algorithms should be designed to run at specified intervals or triggered by certain thresholds being met (e.g., liquidity imbalance). They should also be robust enough to handle the dynamic nature of the pools, where liquidity and valuations can change frequently. The algorithms must be transparent and verifiable to maintain trust among participants in the network. Additionally, the implementation should prioritize security and auditability, especially when integrating with blockchain-based SwapPools.
Use Case #3: Multi-Asset Exchange Maximization
Objective: Formulate an algorithm akin to Math Trades that handles a multitude of individual "want" lists across the network of SwapPools, optimizing for the maximum number of completed trades.
Optimization Criteria:
Data Inputs:
Algorithm Design:
For this use case, the algorithm should consider the liquidity in each SwapPool to fulfill orders without causing significant imbalance. It must also be capable of handling complex multi-party trades that could involve more than two participants to find the optimal trade cycles. This optimization task will likely be computationally intensive and require sophisticated mathematical models to execute effectively.