web icon indicating copy to clipboard operation
web copied to clipboard

Swapper quotes without a wallet 2: split between quote and rates

Open gomesalexandre opened this issue 4 months ago • 1 comments

Overview

Issue 2/2 created after https://github.com/shapeshift/web/issues/7865 spike. See https://gist.github.com/gomesalexandre/b1cb6d3a90019e570ecfa1d3a74a193d

This issue is for all swappers to work without a wallet.

References and additional details

Spike: https://gist.github.com/gomesalexandre/b1cb6d3a90019e570ecfa1d3a74a193d ZRX price vs. quote implementation

  • Type https://github.com/shapeshift/web/blob/ddd7c540789b519e0cfb1d14aa00b965167c81dc/packages/swapper/src/swappers/ZrxSwapper/utils/fetchFromZrx.ts#L15
  • Quote https://github.com/shapeshift/web/blob/ddd7c540789b519e0cfb1d14aa00b965167c81dc/packages/swapper/src/swappers/ZrxSwapper/endpoints.ts#L45-L50
  • Rate https://github.com/shapeshift/web/blob/ddd7c540789b519e0cfb1d14aa00b965167c81dc/packages/swapper/src/swappers/ZrxSwapper/getZrxTradeQuote/getZrxTradeQuote.ts#L74-L75

Acceptance Criteria

  • All swappers follow the ZRX model of price/rate vs. actual quote
  • Addresses (sell and/or receive) are removed from input at rate time if and only if we don't have a wallet connected (can still pass them as before when we do have one, as it makes gas estimations more reliable)
  • The CoW specific case of 0x0000000000000000000000000000000000000000 as from is handled
  • Ensure we're able to get trade quotes for all swappers without a wallet connected

Need By Date

No response

Screenshots/Mockups

No response

Estimated effort

3

gomesalexandre avatar Oct 15 '24 15:10 gomesalexandre