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

Include the slippage tolerance in the settings of the user when we submit the order #332

Closed
anxolin opened this issue Apr 2, 2022 · 4 comments
Assignees
Labels
app:CowSwap CowSwap app

Comments

@anxolin
Copy link
Contributor

anxolin commented Apr 2, 2022

We want to pass the slippage tolerance value as an order parameter to the API's and/or also to the Sentry.

Screenshot from 2022-03-31 10-43-00.png

Original issue gnosis/cowswap#2617 by @nenadV91

@anxolin anxolin added the app:CowSwap CowSwap app label Apr 2, 2022
@anxolin
Copy link
Contributor Author

anxolin commented Apr 5, 2022

Bringing back the comment from our sprint session:

Coordinate with backend, the initial Idea:

  • When we get the quote, backend will send an ID that identififies the quote. This id helps them to debug and we should include it in the posting of the order
  • Include slippage in the post i.e in bips? or '0.5' (to agree with backend)
  • [good to have] Ideally include this information in the metadata (IPFS)

Depend on cowprotocol/services#131

@anxolin
Copy link
Contributor Author

anxolin commented Apr 26, 2022

Adding some document to help with the definition and coordination https://docs.google.com/document/d/1N8K-ueKxxuuFfKjnegbPUYx30Qk1H8zjeiLo3jg-X14/edit#

@anxolin
Copy link
Contributor Author

anxolin commented Apr 26, 2022

Nick created a task for the quoteId cowprotocol/services#170

@alfetopito alfetopito self-assigned this May 19, 2022
@alfetopito
Copy link
Collaborator

alfetopito commented May 19, 2022

Implementation details (based on the gdoc shared above)

CowSwap:

  1. New field quoteId received as part of the /quote api response
  2. Propate/store in the internal state 3 new fields (2 might be there already, need to check)
    • sellAmount
    • buyAmount
    • quoteId
  3. Before placing an order, create the appData doc(1)(2)
  4. Upload given doc to IPFS
  5. Use appData hash in the order as it's already done

4 is non-blocking
For added resilience we could send it to backend endpoint in case upload/pinning fails on client side.
5 can be derived from appData doc without depending on

(1) Need to merge with any potential affiliate link data present. Will likely require a re-work on that flow, though

(2) Requires a model change and probably version bump on metadata doc definition:
Cow-sdk:

  1. Add quote metadata (see gdoc with definition)
  2. Add related json validation
  3. Make sure it's still backwards compatible (we are simply adding a field, no changes for existing fields)
  4. Publish new npm package

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

No branches or pull requests

2 participants