shapeshift / web

ShapeShift Web
https://app.shapeshift.com
MIT License
167 stars 176 forks source link

[spike] integrate portals zaps into swapper #6981

Closed 0xean closed 2 months ago

0xean commented 4 months ago

Some Qs

Output from this spike would be

  1. tickets for the full implementation work with some general estimate on level of effort
  2. documentation of above questions and any other's that arise from that
  3. communicate any concerns with product on UX that might need to be considered that would be different than the existing swapper
0xean commented 4 months ago

https://shapeshift.notion.site/Two-Smol-Swappers-646613460477490497f91287e4966fbc - just focus on the portals part of this specification

gomesalexandre commented 3 months ago

can we charge fees?

Absolutely:

image

https://api.portals.fi/docs#/Portal/PortalController_portalV2

gomesalexandre commented 3 months ago

how do we find these assets? / how do we display these tokens / positions after a user has them?

  1. How do we find them?

https://api.portals.fi/v2/tokens is the goer, and we should update the asset generation script to parse and use these as assets. We could start as a low lift with one chain only, and only one page, to validate this!

Edit: done in df17bfeaf456b8ad4b7dc2c5895426767a337009 as a 250 Avalanche assets PoC and follow-up fixes

  1. How do we display them

Once added to generated asset data, these will live as ERC20 tokens in the app, business as usual

Edit: confirmed business as usual after df17bfeaf456b8ad4b7dc2c5895426767a337009 and its follow-up fixes, things just work

image image image image image
  1. How do we display the DeFi positions?

ideally: we don't and let Zapper do it effectively: Zapper isn't so good with all chains and will miss many opportunities. IMO, having them as tokens is a good MVP, but eventually, we could use the DeFi opportunities abstraction to parse and upsert https://api.portals.fi/v2/tokens list as DeFi opportunities. For all intents and purposes, the shape is very similar to Zapper's, which will make things relatively easy to work with (effectively a lot of copypasta to do the Zapper/Portals translation)

  1. What about market-data?

Historical market data isn't going to be available, but that's nothing different than e.g how we used to do UNI-V2 opportunities - we absolutely can and should upsert the current price of all https://api.portals.fi/v2/tokens tokens in the market-data slice

gomesalexandre commented 3 months ago

Actual issues to be created from this, and spike to be closed on Monday if we agree we're there spike-wise

gomesalexandre commented 3 months ago

https://github.com/shapeshift/web/issues/7305 https://github.com/shapeshift/web/issues/7304 https://github.com/shapeshift/web/issues/7303 https://github.com/shapeshift/web/issues/7306