Coder Social home page Coder Social logo

Comments (9)

MonsieurNicolas avatar MonsieurNicolas commented on July 2, 2024

Can you expand on scenarios - properties on Offers themselves may help and be more generic

from stellar-protocol.

jedmccaleb avatar jedmccaleb commented on July 2, 2024

I have $10 and I want to send all of it to you but you only want EUR.
Actually maybe this should just be accomplished in 2 steps. a normal order to convert the USD -> EUR and then a payment. A little gross since you have to also add/remove the trust line to EUR.

from stellar-protocol.

istrau2 avatar istrau2 commented on July 2, 2024

@jedmccaleb I don't think that 2 step method works though (because an offer is a limit order and path payment is a market order).

To me, a path payment is mechanism for conversion between assets at market rate, a very useful function. While there are obviously scenarios where you want to specify the destination amount (like paying a merchant in their preferred asset), there are a host of scenarios where one would want to specify the source amount.

I think we should think about hard forking (or whatever the term is in stellar) to modify the protocol.

from stellar-protocol.

jedmccaleb avatar jedmccaleb commented on July 2, 2024

a limit order is a market order if you set the limit low enough. (path payment is also a limit order anyway since you put in the max to send)

The real issue is that the 2 step method isn't atomic. But this is probably solvable by allowing a payment that sends as much of an asset as it can. So then in one tx you would have 4 operations:

  • add trust for EUR
  • sell USD for EUR
  • send as much EUR as you can to B
  • remove trust for EUR

from stellar-protocol.

istrau2 avatar istrau2 commented on July 2, 2024

@jedmccaleb
Yeah, I guess you are right about the real issue (not having the two operations be atomic).

Couple of points with your proposed solution:

  1. Why solve it that way? It seems like quite a roundabout way of solving the issue (as opposed to simply allowing a path payment that specifies a source amount)?

  2. Also, I think that kind of a series of operations would run into issues if the user already has a balance of EUR (then that balance would get sent as well). Additionally, it seems to me that there is no way to specify a maximum amount on the payment operation since you don't know what cumulative rate the trade will execute at ahead of time.

from stellar-protocol.

jedmccaleb avatar jedmccaleb commented on July 2, 2024

Yeah I'm open to a protocol change to add this I just want to make sure we need to first

from stellar-protocol.

istrau2 avatar istrau2 commented on July 2, 2024

@jedmccaleb Wouldn't adding a maximum amount for a payment require a protocol change as well?

from stellar-protocol.

MonsieurNicolas avatar MonsieurNicolas commented on July 2, 2024

reason I was asking about offers and clarification on scenarios in the first place was that I was thinking we could create offers that cannot be taken partially for example which seems like a very useful building block.

from stellar-protocol.

jonjove avatar jonjove commented on July 2, 2024

Addressed by CAP-24

from stellar-protocol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.