pickle-finance / pickle-ui

UI to interact with the PICKLE protocol
https://app.pickle.finance
52 stars 51 forks source link

[6.33] Integrate CowSwap as `/swap` page on new app (aka PickleSwap) #391

Open manymoneymanny opened 2 years ago

manymoneymanny commented 2 years ago

Abstract

This product backlog item consists of an enhancement to our Pickle UIv2 that provides a functional swapping module consisting of a page in the Pickle UIv2 app with a swapping interface that allows users to select between two any tokens and uses the CowSwap service behind-the-scenes to route the swaps. Besides presenting graphic familiarity with DEX swapping interfaces in general and the CowSwap interface in specific, the different states of the swapping flow in the app should follow the same UX as found in the CowSwap app itself.

Job Stories

Job Story no. 1

When users need to sell or buy tokens I want to keep them on the Pickle app So that I can study their behavior and offer them add-on services

Job Story no. 2

When users need to sell or buy tokens I want to offer affiliated swapping services on the Pickle app So that DILL holders can have another revenue stream

Priority

ICE Score 5.67
Impact 9
Confidence 5
Ease 5

Impact

We believe this release can generate a new revenue stream for Pickle. As Pickle users can be quite active traders, this new revenue stream is likely to be significant. Currently, Pickle has annualised revenues of around $4.3M. Should this revenue stream amount to an additional $500k–1M in new revenues it would bring in significant economic benefits to $DILL holders.

Confidence

I am 50% confident we will realise the predicted Impact. This is because CowDAO has not enabled incentives for an affiliate programme yet, therefore there are no terms and conditions we could use to evaluate. What we know is that given we process yield, we generate trading volumes of about $25M annually at present and adding 10,000 trading users to that we could be generating $30-35M in annual volume for an affiliated DEX. Using a meta-DEX aggregator like CowSwap which will integrate DEXs from many chains means that an affiliate fee of 1.5–3% or so would give us the desired Impact. This is quite high, as $35M of volume generates a DEX about $100k in fees, and as an affiliate maybe we could expect 10-20% of that. Of course, our volume would grow as we grow in users and processed yield.

Ease

This should take an experienced full-stack engineer familiar with Web3 around 35-40 man-hours to design, develop, test, deploy, and integrate.

Deliverables / Acceptance Criteria

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Assets

draft mock of PickleSwap module

(Balancer implementation of CowSwap integration) https://github.com/balancer-labs/frontend-v2/tree/develop/src/services/gnosis (Balancer swap UI) https://app.balancer.fi/#/trade (uses CowSwap when users toggle "trade gasless" on) (CowSwap app UI) https://cowswap.exchange/#/swap (frontend code review and guidance) please ping @janklimo (jan#7608 on https://discord.gg/pickle-finance) (graphics and illustrations) please ping @fennec (fennec#1000 on https://discord.gg/pickle-finance) (CowSwap GitHub) https://github.com/gnosis/cowswap (CowSwap Discord) https://discord.gg/cowprotocol

cryptokage1996 commented 2 years ago

@mannyreimi88 based on reading above Abstract, according to my understanding we are trying to create a swap similar to cowswap right?

manymoneymanny commented 2 years ago

@mannyreimi88 based on reading above Abstract, according to my understanding we are trying to create a swap similar to cowswap right?

@26vivek06 we'll integrate the CowSwap contracts into our UI and use the Balancer UI integration and CowSwap's official UI as templates to our own UI. So, yes, it shall be virtually identical to CowSwap and will use the same Cow Protocol contracts on the backend to get quotes, do token approvals, do the gasless swaps, provide the end-results, etc.

manymoneymanny commented 2 years ago

@26vivek06 please move the issue to "in-progress" (or let me know and I'll move it) once you have a PR of your development branch attached.