Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: How can EdgeNode obtain RFQ execution details for rebalancing? #1408

Open
lukegao209 opened this issue Feb 25, 2025 · 6 comments
Open
Labels
bug Something isn't working needs triage

Comments

@lukegao209
Copy link
Contributor

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 ?

@lukegao209 lukegao209 added bug Something isn't working needs triage labels Feb 25, 2025
@guggero
Copy link
Member

guggero commented Feb 25, 2025

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!

@ffranr
Copy link
Contributor

ffranr commented Feb 25, 2025

Might relate to this also: #1362

@lukegao209
Copy link
Contributor Author

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

@guggero
Copy link
Member

guggero commented Feb 25, 2025

I'll see if I can add this functionality to lightningnetwork/lnd#9504, since what needs to be done is kind of similar.

@Roasbeef
Copy link
Member

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.

@lukegao209
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

4 participants