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 'My pool balance' card to invest flow #949

Merged
merged 3 commits into from
Oct 15, 2021

Conversation

garethfuller
Copy link
Collaborator

@garethfuller garethfuller commented Oct 14, 2021

Description

This PR adds a card to the right of the investment form that displays any existing pool balance the user has. The balances for individual pool tokens are derived from a proportional exit using their full BPT balance.

Again, this PR does not cover the mobile layout, that will be done in a later PR when all the page elements are included.

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.

  • Test correct pool balances and total are displayed for a pool you are invested in.
  • Test that 0s are displayed for a pool that you are not invested in but have a wallet connected.
  • Test the 0s are displayed when you don't have a wallet connected.

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

@garethfuller garethfuller added the enhancement New feature or request label Oct 14, 2021
@vercel
Copy link

vercel bot commented Oct 14, 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 – ./

🔍 Inspect: https://vercel.com/balancer/kovan/65a8ZnxDmzTmcqV2SJLwUjsxDWX3
✅ Preview: Canceled

[Deployment in progress for 9a8ba55]

app – ./

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

[Deployment for 9a8ba55 canceled]

beta-app – ./

🔍 Inspect: https://vercel.com/balancer/beta-app/7xFLAuc14YsCeuTcNLvFkEGSRVy6
✅ Preview: https://beta-app-git-gareth-pool-balances-card-balancer.vercel.app

beta-kovan – ./

🔍 Inspect: https://vercel.com/balancer/beta-kovan/J6SmHgUXeysNvw7g3CYQF7GaVCSY
✅ Preview: https://beta-kovan-git-gareth-pool-balances-card-balancer.vercel.app

polygon – ./

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

[Deployment for 9a8ba55 canceled]

beta-polygon – ./

🔍 Inspect: https://vercel.com/balancer/beta-polygon/2STL2Ytm7kNyDXwtWnZvoEgdoLoc
✅ Preview: https://beta-polygon-git-gareth-pool-balances-card-balancer.vercel.app

beta-arbitrum – ./

🔍 Inspect: https://vercel.com/balancer/beta-arbitrum/XiKY3Un6kGZ2x8ReMpqGcMRqKFeD
✅ Preview: https://beta-arbitrum-git-gareth-pool-balances-card-balancer.vercel.app

arbitrum – ./

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

[Deployment for 9a8ba55 canceled]

/**
* COMPUTED
*/
const bptBalance = computed((): string => balanceFor(props.pool.address));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a difference between this way of typing and computed<string>? (I've mostly been using it when it isn't inferred correctly.

Copy link
Contributor

@evgenyboxer evgenyboxer left a comment

Choose a reason for hiding this comment

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

lgtm! just one quick note - the previous design also showed how much % you have in each token, I guess it was dismissed?

@garethfuller
Copy link
Collaborator Author

garethfuller commented Oct 15, 2021

@evgenyboxer

the previous design also showed how much % you have in each token, I guess it was dismissed?

It only showed the pool weights essentially, which we show in the main form. We could potentially add to this side module as well but I'm not sure it will add much.

@garethfuller garethfuller merged commit 0e23fc8 into develop Oct 15, 2021
@garethfuller garethfuller deleted the gareth/pool-balances-card branch October 15, 2021 11:14
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
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants