taproot-assets
taproot-assets copied to clipboard
[bug]: How can EdgeNode obtain RFQ execution details for rebalancing?
Background
We have the following scenario:
Alice --(BTC Channel)--> EdgeNode --(USDT Channel)--> Bob
When Bob creates an invoice for 100 USDT, Alice pays Bob’s invoice using BTC. According to Tapd’s EdgeNode logic, during this process, Bob effectively sells BTC to EdgeNode at a certain price and receives 100 USDT as part of an RFQ.
Since Bob’s invoice creation and Alice’s payment are asynchronous events, how does EdgeNode determine that Bob’s RFQ has been successfully executed and what the executed price is? This information is crucial for EdgeNode as it needs to perform rebalancing and update its data statistics based on the RFQ outcome.
Any guidance or suggestions on how to capture this execution information ?
I think this information is not yet available to the edge node (outside of looking at the log files). IMO this ties in with https://github.com/lightninglabs/taproot-assets/issues/1005, so we'd want to also expose the RFQ and potentially asset amounts in the forwarding history. Both of which hasn't been implemented yet. But definitely something we'll want to add soon!
Might relate to this also: https://github.com/lightninglabs/taproot-assets/issues/1362
I think this information is not yet available to the edge node (outside of looking at the log files). IMO this ties in with #1005, so we'd want to also expose the RFQ and potentially asset amounts in the forwarding history. Both of which hasn't been implemented yet. But definitely something we'll want to add soon!
will this feature be added in next version? Its hard for edge-node to work
I'll see if I can add this functionality to https://github.com/lightningnetwork/lnd/pull/9504, since what needs to be done is kind of similar.
Since Bob’s invoice creation and Alice’s payment are asynchronous events, how does EdgeNode determine that Bob’s RFQ has been successfully executed and what the executed price is?
Until #1005 is finished, they can use the SubscribeHtlcEvents. It doesn't have the extra TLV data yet, but the edge node knows their topology, and the scid's used for the RFQ routes, so they can correlate those to construct a view on what's going on as far as transfers.
If EdgeNode can’t clearly determine its own routing info, it won’t rebalance in time. The only workaround would be to raise fees to cover the free call option issue. That would make it hard to offer a competitive Lightning Stablecoin experience and hurt user onboarding.