Skip to content

feat(asb): Take ongoing swaps into consideration when crafting quote #245

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

Einliterflasche
Copy link

This PR checks for ongoing swaps and subtracts the Monero needed for them from new quotes.

})?;
// From our full balance we need to subtract any Monero that is 'reserved' for ongoing swaps
// (where the Bitcoin has been (or is being) locked but we haven't sent the Monero yet).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a TODO comment that this is "naive" to some degree due to the 20min lock of outputs / utxo issue

Copy link

@binarybaron binarybaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick

@Einliterflasche Einliterflasche marked this pull request as ready for review January 14, 2025 14:20
Copy link

@binarybaron binarybaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feedback

@binarybaron
Copy link

Can you also print how much is missing, and recommend refilling the wallet?

@binarybaron
Copy link

Building this branch on our public testnet asb.

@binarybaron binarybaron changed the title asb: subtract reserved monero from quote volume feat(asb): Take ongoing swaps into consideration when crafting quote Apr 18, 2025
@binarybaron
Copy link

binarybaron commented Apr 18, 2025

So far we are not taking the reserved volume into consideration in the swap_setup protocol. We only subtract it when a quote is request over the quote protocol. I'd say this is fine though as the taker always requests an offer over quote before initiating swap_setup. If the taker decides to ignore the maximum returned via quote and attempt to initiate a swap anymore they won't impact the maker negatively.

They might risk the maker not locking the Monero but that'd only affect them negatively.

@Einliterflasche Einliterflasche added the P2 Priority 2 label Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Priority 2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants