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

Add a switch for Balancer <> Gnosis trading #757

Merged
merged 7 commits into from
Oct 14, 2021

Conversation

evgenyboxer
Copy link
Contributor

@evgenyboxer evgenyboxer commented Aug 30, 2021

Description

This PR implements the new trade switch once Gnosis becomes the default interface. This allows the user to switch between gasless (Gnosis) and Balancer trades.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

How should this be tested?

Please provide instructions so we can test. Please also list any relevant details for your test configuration.

  • Hit the switch button and watch rates change.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code where relevant, particularly in hard-to-understand areas
  • My changes generate no new console warnings
  • The base of this PR is master if hotfix, develop if not

@vercel
Copy link

vercel bot commented Aug 30, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

kovan-app – ./

🔍 Inspect: https://vercel.com/balancer/kovan-app/B8FzsY9dhQz4wpd3PVfZtoApkMti
✅ Preview: Canceled

app – ./

🔍 Inspect: https://vercel.com/balancer/app/HLPeZ1byVG6S6fuTrnxQYV5zSXdp
✅ Preview: Canceled

[Deployment for 43c11e8 canceled]

polygon – ./

🔍 Inspect: https://vercel.com/balancer/polygon/6VhkYmFR7BhEMnBH5C3YgRXbG6Cu
✅ Preview: Canceled

[Deployment for 43c11e8 canceled]

arbitrum – ./

🔍 Inspect: https://vercel.com/balancer/arbitrum/DXNh6peSetmnE2dK5NZZuJRSxg3z
✅ Preview: Canceled

[Deployment in progress for 43c11e8]

staging-app – ./

🔍 Inspect: https://vercel.com/balancer/staging-app/3Ano5u74BfyiARWMYj9J4MTsi6R5
✅ Preview: https://staging-app-git-evgeny-ui-725-switch-gnosis-bal-8f0461-balancer.vercel.app

staging-kovan-app – ./

🔍 Inspect: https://vercel.com/balancer/staging-kovan-app/CeL7gWnH6EGgRDBkeTVHKpJyk2zY
✅ Preview: https://staging-kovan-app-git-evgeny-ui-725-switch-gnos-0b6917-balancer.vercel.app

beta-arbitrum – ./

🔍 Inspect: https://vercel.com/balancer/beta-arbitrum/HyTApUC6oZCKSYcGWHfwKkVXvBM7
✅ Preview: https://beta-arbitrum-git-evgeny-ui-725-switch-gnosis-b-3ce212-balancer.vercel.app

beta-polygon – ./

🔍 Inspect: https://vercel.com/balancer/beta-polygon/7eve7xtEguqWF7cvsruYJJEj7RTz
✅ Preview: https://beta-polygon-git-evgeny-ui-725-switch-gnosis-ba-456781-balancer.vercel.app

gnosis – ./

🔍 Inspect: https://vercel.com/balancer/gnosis/3Gw25r3qLsjiw4bGX7A4J518D8zt
✅ Preview: https://gnosis-git-evgeny-ui-725-switch-gnosis-balancer-c3c38b-balancer.vercel.app

beta-kovan – ./

🔍 Inspect: https://vercel.com/balancer/beta-kovan/738a1gdDMLvBsQgTExRVdV79cBPU
✅ Preview: https://beta-kovan-git-evgeny-ui-725-switch-gnosis-bala-467b2b-balancer.vercel.app

kovan – ./

🔍 Inspect: https://vercel.com/balancer/kovan/3aMtjMkRc4JgWv5zed1QwKdpd1Mj
✅ Preview: In Progress

[Deployment for 43c11e8 canceled]

beta-app – ./

🔍 Inspect: https://vercel.com/balancer/beta-app/2pJnpbc8dJfSBfSNuXQoJYCsujX1
✅ Preview: https://beta-app-git-evgeny-ui-725-switch-gnosis-balanc-e85647-balancer.vercel.app

@linear
Copy link

linear bot commented Aug 30, 2021

@vercel vercel bot temporarily deployed to Preview – kovan October 14, 2021 10:01 Inactive
@vercel vercel bot temporarily deployed to Preview – arbitrum October 14, 2021 10:01 Inactive
@vercel vercel bot temporarily deployed to Preview – app October 14, 2021 10:01 Inactive
@vercel vercel bot temporarily deployed to Preview – polygon October 14, 2021 10:01 Inactive
@evgenyboxer
Copy link
Contributor Author

evgenyboxer commented Oct 14, 2021

@garethfuller I've pushed the fixes.

I forgot to mention it should only work on the supported Gnosis networks. (So on Polygon/Arbitrum/etc - the feature should not be visible and properly use Balancer route instead)

<div class="mt-6 text-sm flex items-center">
<BalTooltip
width="64"
:disabled="!trading.isGaslessTradingDisabled.value"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm something doesn't seem right here. Could you wrap the trading export in toRefs(trading) to see if that helps?

@evgenyboxer evgenyboxer merged commit 68dd71a into develop Oct 14, 2021
@evgenyboxer evgenyboxer deleted the evgeny/ui-725-switch-gnosis-balancer-interface branch October 14, 2021 10:22
garethfuller added a commit that referenced this pull request Oct 20, 2021
* 1.23.0 (#932)

* Only include sentry source map plugin if token provided

* 1.23.1

* Fix approvals in old invest flow

* 1.23.2

* Fix vue warning

* Don't display unnecessary warnings

* 1.23.3

* Correctly handle wallet not connected error

* Clean up conditionals

* hotfix/1.23.4 (#943)

* Hotfix 1.23.3 - Fix trade errors display logic (#939)

* Don't display unnecessary warnings

* 1.23.3

* Correctly handle wallet not connected error

* Clean up conditionals

* fix: guard provider from possibly being null

* fix: check pending transactions only when a wallet is connected

* 1.23.4

Co-authored-by: Gareth Fuller <[email protected]>

* Allow ETH investments in WETH pools (#944)

* Fix weight string/number vue warning

* More accuretly type computed properties

* Refactor BalPopover

* Fix props

* Pass in tokensIn instead of pulling from pool

* Allow ETH investments in WETH pools

* Add wrappedNativeAsset property to tokens provider

* Refactor and used wrappedNativeAsset instead of reference to WETH

* Fix tooltip widths

* Remove proportional suggestions from stable pool investments

* fix: add missing entry for Arbitrum in network prefix map (#945)

* Add a switch for Balancer <> Gnosis trading (#757)

* feat: toggle switch

* fix: gasless trading toggle + gasless query param

* fix: error msg

* feat: enable gnosis trading on supported networks only

* remove trade interface references

* fix: change casing of local storage key

* Add unit test for hotfix 1206 (#918)

* Create unit test for useSor

- Create a basic unit test for useSor with mocked dependencies.
- Add a test that calls setSwapCost and ensures the correct token price
is passed to SorManager.
- Rather than manually defining each mock in every test file, move them
to mock files that can be loaded when required. This way mocks can be
used amongst many tests easily.
- Move all test files out of tests directory to be beside the files that
they are testing.
- Use jsdom and vue-composable-tester to mount useSor to a component.
- Change jest.config.js to use nodejs runner for spec.node.ts files and
jsdom runner for others.
- Add new mocks for vue store and tokens.

* Add 'My pool tokens' card to invest flow (#948)

* Refactor BalBreakdown

* Refactor calculator service to adjust if investing with native asset

* Update calculator inputs

* Update usage of BalBreakdown

* Add MyWalletTokensCard and allow for native asset selection

* Update locales

* Fix fiatTotal and update labels

* Add network name 'eyebrow'

* Minro style fix

* fix: Border colors in darkMode

* fix: Remove dividing lines

* refactor: Remove redundant computed property and re-org imports

* Add 'My pool balance' card to invest flow (#949)

* feat: Add MyPoolBalancesCard to invest page

* chore: Update locales

* fix: Add missing PoolCalculator input

* version bump

* Update MultiTokenLiquidityMining.json (#954)

## Ethereum

- No changes this week. 

## Arbitrum

- Reduce DEFI5/WETH/WBTC 33/33/33 to 0 Flexible BAL per week. This pool will now receive 0 BAL per week.
- Increase BAL/WETH 60/40 by 500 Flexible BAL per week. This pool will now receive 4,000 BAL per week.

## Polygon

- No changes this week.

Co-authored-by: bakamoto20 <[email protected]>

* fix: update tooltip (#951)

* bring back trade interface (#957)

* Responsive design for invest flow (#952)

* style: Allow hiding of component header

* feat: Add BalAccordian component

* style: Move invest flow side modules into accordians on mobile

* fix: Remove stray z

* fix: Remove Saf log

* fix: BalAccordian hover state in dark mode

* UI 568 trade UI improvements (#882)

* merge: dev

* feature: add trade ui widgets

* feature: add balcarousel

* update: add more customisation to the ballinechart component

* feature: add trade pair snapshots to the subgraph service

* add widgets to the trade page

* update: add in shared trade state among widgets and fix bugs and add error state

* update: add in wallet connection button and loading state to my wallet widget

* update: lazy loading of price graph widget data and fix change calcs

* update: add aggregation options to the pricing service

* fix: loading states

* fix: make charts actually show trends properly

* update: add ability to switch timespans and some style changes

* update: use css transforms instead of moving position

* update: convert pairpricegraph widget to script setup

* update: convert mywallet widget to script setup

* update: use native asset instead of hardcoded eth symbol

* update: remove unecesary props from balcard

* update: add comments to ballinechart

* fix: lint

* fix: add guard for price

* update: move functions out of tradestate composable

* update: add explicit types

* update: capitalise constants

* update: move trending pairs query to querykeys and add network dep

* update: querykeyify pairpricegraph

* fix: lint

* update: adjust animation

* update: mobile adjustments

* fix: lint

* fix: locales

* fix: maximise button placement

* fix: style bugs

* fix: style bugs

* fix: max assets per line

* fix: balassetset

* fix: lint

* feature: balaccordion to replace carousel on mobile

* fix: mobile styles

* fix: more mobile styles

* temp: test transform

* temp: test height moving transform

* update: add opacity

* update: speed up the easing

* update: chart modal

* fix: more bugfixes

* update: make link

* update: pon adjustments

* update: cleanup

* update: cleanup and feature flag widgets

* fix: build

* sync defaults

* fix: Remove log

* fix: Hide trade timeout setting if not gasless and if invest context

* 1.24.0

* fix: Prop type syntax

* fix: chart height and add comments

* fix: lint

* Revert version update

* 1.24.0

Co-authored-by: Evgeny Boxer <[email protected]>
Co-authored-by: Tom French <[email protected]>
Co-authored-by: Tim Robinson <[email protected]>
Co-authored-by: Markus Buhatem Koch <[email protected]>
Co-authored-by: bakamoto20 <[email protected]>
Co-authored-by: Ansaf Ahmed <[email protected]>
Co-authored-by: 1saf <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants