Skip to content

swapserverrpc: arbitrary static swap amount #951

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 1 commit into
base: master
Choose a base branch
from

Conversation

hieblmi
Copy link
Collaborator

@hieblmi hieblmi commented Jun 11, 2025

This PR adds an amount field to the ServerStaticAddressLoopInRequest.

    The optional swap amount the client is attempting to swap. If specified the
    server will take out this amount from the total value of provided
    deposit_outpoints and will send the change back to the static address. If
    not specified the server will use the total amount of the deposit_outpoints
    as swap amount.

@hieblmi hieblmi self-assigned this Jun 11, 2025
@hieblmi hieblmi requested review from bhandras, starius and sputn1ck June 11, 2025 13:31
Copy link
Member

@bhandras bhandras left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@hieblmi hieblmi force-pushed the swap-amount-rpcs branch 2 times, most recently from a6133eb to f87ec32 Compare June 17, 2025 12:05
Copy link
Collaborator

@starius starius left a comment

Choose a reason for hiding this comment

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

LGTM! 🌴
One comment.

server will take out this amount from the total value of provided
deposit_outpoints and will send the change back to the static address. If
not specified the server will use the total amount of the deposit_outpoints
as swap amount.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens, if the amount is too close to the total amount (so the change would be dust)? I think it makes sense if it fails and suggests to remove the flag to use the whole amount.
Could you add the actual expected behavior in this case to the comment, please?

Also, if the amount is equal to the total amount, it makes sense just to succeed, right? And if higher - fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants