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

Path payment api is awkward for general currency conversion #243

Closed
vcarl opened this issue Nov 20, 2018 · 4 comments
Closed

Path payment api is awkward for general currency conversion #243

vcarl opened this issue Nov 20, 2018 · 4 comments
Labels
CAP Represents an issue that requires a CAP.

Comments

@vcarl
Copy link
Contributor

vcarl commented Nov 20, 2018

The existing API of recipient address, sender address, recipient asset, and recipient amount works very well when seeking paths that ensure a specified payment will be received at the end. However, we're trying to provide a UI for converting asset A into asset B as part of our SEP-6 withdrawal flow, and this API isn't a good fit for the use case. We're constrained by:

  • the amount being sent (instead of how much should be received)
  • what asset is being sent
  • what asset is received
  • we don't know who the recipient is at this stage

This seems to me like a common alternative to a path payment—a path conversion if you will, analogous to changing all the cash in your wallet when you arrive in a new country. The UI we imagine is a list of all (e.g.) BTC tokens you hold and how much you'd receive from a SEP-6 anchor after converting them.

It seems like we should be able to work around this without any changes, but I wanted to surface it as a pain point we encountered.

@tomquisel
Copy link
Contributor

Transferring to stellar-protocol, as this will require a protocol change to address.

@tomquisel tomquisel transferred this issue from stellar/go Jan 24, 2019
@tomquisel tomquisel added the CAP Represents an issue that requires a CAP. label Jan 24, 2019
@theaeolianmachine theaeolianmachine added help wanted Open especially for those who want to write a CAP/SEP! needs draft This an issue that has no corresponding draft, and as such has not entered the CAP/SEP process. and removed help wanted Open especially for those who want to write a CAP/SEP! labels Feb 2, 2019
@theaeolianmachine theaeolianmachine added the help wanted Open especially for those who want to write a CAP/SEP! label Mar 15, 2019
@tomquisel
Copy link
Contributor

tomquisel commented Aug 1, 2019

CAP-24 proposes a new kind of path payment that takes a fixed amount to send and maximizes the amount of destination asset received (the mirror of existing path payment). It addresses this issue, and it ensures that the full send amount that the caller requires is consumed.

@tomquisel tomquisel removed needs draft This an issue that has no corresponding draft, and as such has not entered the CAP/SEP process. help wanted Open especially for those who want to write a CAP/SEP! labels Aug 1, 2019
@tomquisel
Copy link
Contributor

@morleyzhi I just wanted to check that you think the CAP-24 solution meets Vega's needs.

To summarize the new path payment's semantics:

If PathPaymentStrictSendOp succeeds then the source account is debited exactly sendAmount of sendAsset and the destAccount is credited at least destMin of destAsset.

Let me know if that sounds good!

@theaeolianmachine @jonjove

@jonjove
Copy link
Contributor

jonjove commented Aug 5, 2020

Implemented in stellar/stellar-core#2269

@jonjove jonjove closed this as completed Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CAP Represents an issue that requires a CAP.
Projects
None yet
Development

No branches or pull requests

4 participants