Code Monkey home page Code Monkey logo

mstable-apps's Introduction

mStable Apps

Web frontends for interacting with the mStable contracts.


Apps

This repository comprises multiple mStable apps, all built using common libraries and a common UI.

Status Name Nx project Port Public hosts
mStable Protocol protocol 3000 Google Cloud
mStable Governance governance 3200 Google Cloud

Development

This project was generated using Nx.

Quickstart

# Copy the default env vars so they can be overridden
cp .env .env.local

# Now edit the Subgraph API key env vars to add a local API key
# e.g. `vim .env.local`

# Then install, codegen, and run the apps
yarn
yarn codegen:typechain
yarn nx serve <PROJECT>

Running an app

yarn nx serve protocol
yarn nx serve governance

Building an app

yarn nx run build protocol
yarn nx run build governance

NX module boundaries

To get the benefit of nx modules, it's important to avoid creating dependency cycles. ESlint is set up to catch this, so simply run:

yarn nx affected:lint

mstable-apps's People

Contributors

biendeveloper avatar brymut avatar calvinkei avatar chrisjgf avatar dimlbc avatar dimsome avatar jameslefrere avatar lrnt avatar rafaelugolini avatar toniocodo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mstable-apps's Issues

The Graph Production Endpoints

About

We need to change the current 2 Apps (Staking and main) to use the published subgraphs. For this we need to topup our billing account on Polygon

Subissues

  • #213
  • Topup TheGraph billing account

[Dials] Current epoch stays loading

Describe the bug
On Governance app, when reaching https://staking.mstable.app/#/dials, the EpochDetails and Dials sections stay pending when current Epoch is selected. Note that you need to clear your local storage in order to reproduce the bug.

image

To Reproduce
Steps to reproduce the behavior:

  1. Clear local storage
  2. Got to https://staking.mstable.app/#/dials
  3. Screen stays in loading state

Expected behavior
App should display dials and epoch details for current epoch

Notify users with legacy EARN, add withdrawal process

We want to sunset old staking contracts (EARN) and propose a easy withdraw process for users still having funds there.

=> Create a notification button when user has positive balance on old contracts

image

=> Clicking on it opens modal with staked assets list, each card proposes a Withdraw action button calling the withdraw method on the contract

image

[App] Dashboard Pools page is shifting upon hover

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to https://mstable.app/#/
  2. Click on Pools
  3. Hover over the rows, and items jump around.
  4. (in particular when hovering on and off from the deprecated pool)
  5. (or also when hovering over a pool that has not yet loaded the APY)

Expected behaviour
Everything stays the same size.

Screenshots
Screen Recording 2022-05-23 at 11 38 59

Wallet and Network behaviour is inconsistent/unexpected


name: Bug report
about: Create a report to help us improve
title: Wallet and Network behaviour is inconsistent/unexpected
labels: UI, staking, app

Describe the bug
The Wallet behaviour is unexpected for some actions. This applied to both, the staking and the main app. But point 5 is specific to the staking app.

  • When changing to a non-supported network from MM, the app prompts to change to Ethereum back

Should not prompt to change the network, because this app might be in another Tab and the users try to change network using another app. After rejection, there is no indication in the app that the wrong network has been selected. The wrong network appears for a split second but changes back to the default network.

  • When selecting a non-supported network, the app has no indication that a non-supported network is selected.

Should have something to tell the user that the current network is not supported

  • When Polygon is selected in MM, upon opening the app it prompts to change to mainnet (should detect that Polygon is selected)

This does not happen every time, I am not sure what triggers this.

  • Staking App allows Polygon to have selected, but it doesn't support polygon.

The app is still normally accessible but all the content does not get loaded, no indication that the network is not supported

  • When changing networks, the wallet shows for a split second that the wrong network is connected

This should really happen only when a wrong network is selected and persist until it is changed

  • When changing from polygon to mainnet, subgraph errors appear.

Screen Shot 2022-05-12 at 18 12 36

  • When promoting to change networks from the app, MM change network appears and elements of the APP get rerendered.

Polygon connect

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
0. Have your wallet disconnected from mstable.app

  1. Set your wallet on polygon
  2. Go to https://mstable.app
  3. Change to polygon
  4. Click connect

You are asked to change to mainnet

Expected behavior
Connect to polygon

Screenshots
image

[Staking App] BAL APY at 0%

Describe the bug
BAL APY is at 0%

To Reproduce
Steps to reproduce the behaviour:

  1. Go to https://staking.mstable.app/#/stake
  2. Click on BPT

Screen Shot 2022-05-18 at 16 47 01

Expected behaviour
Should find a way where to pull the BAL APY. Pre Staking Upgrade it was working based on a weekly amount?

Additional context
Might need to look into an API for fetching the distribution amount of BAL and how much of the Pool is staked

unable to withdraw funds with polygon

Describe the bug
Having imusd in the vault, I am not able to withdraw.
The funds appear as if they are staked, when I try to unstake, a red pop up appears with the mention "transaction failed"

To Reproduce
Steps to reproduce the behavior:

  1. Go to deposit tab
  2. Click on deposit money in imusd
  3. go to stake tab
  4. stake
  5. try to unstake
    6 see error "transaction failed with the amount unable to be withdrawn

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
The transactions seem stuck as "pending"

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser Brave Chromium to 99.0.4844.88.
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Polygon transaction estimation

Describe the bug
When trying to send a transaction on Polygon some information is wrong:

  • Ethereum is displayed (should display matic)
  • Transaction cost estimation is done with the Ethereum price, looks very expensive.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://mstable.app/#/musd/swap
  2. Select polygon
  3. Try to swap
  4. Click on Redeem/Swap
  5. See Transaction modal.
    Screen Shot 2022-07-08 at 00 14 24

Expected behavior
Should estimate Polygon fees in Matic and change icon to Matic.

[App] While depositing, default to Vault

Is your feature request related to a problem? Please describe.
A user wants in most cases to stake the tokens. The UI however defaults to the step before. (Save and Pools)

Screen Shot 2022-05-23 at 11 50 01

Describe the solution you'd like
Should directly select the Vault, similar when redeeming, should directly offer to redeem from the Vault. Alternatively, can fetch the balance and suggest to redeem from the Vault or Save (Pool).

MTA Apy not correct when rewards are not updated

Describe the bug
Many dials got disabled, however, the UI still shows the same APY for MTA rewards. This is because the rewards Rate does not get updated anymore. The UI has to be aware that if the last time the rewardsRate was updated longer than 7 days, the rewards are empty and no new rewards got added.

To Reproduce
Steps to reproduce the behavior:

https://mstable.app/#/mbtc/save

https://mstable.app/#/mbtc/pools

https://mstable.app/#/musd/pools

Also Single Pools Page, e.g. https://mstable.app/#/musd/pools/0x4eaa01974b6594c0ee62ffd7fee56cf11e6af936

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

Screen Shot 2022-08-29 at 15 14 41

Screen Shot 2022-08-29 at 15 14 49

Screen Shot 2022-08-29 at 15 15 06

Add renBTC banner

Since renBTC project is closing, we need to warn users to withdraw their assets.

image

Allow withdrawal on any pool when liquidity is low

The fp contract can block a withdraw if weights of a certain token are getting imbalanced, it asks for an exact withdraw where assets are pulled proportionnally from the pool with the exact methods.

Unstoppable Domains Login integration request

The app does not currently support Unstoppable Domains as a login option so people who would like to login with UD extensions: .crypto, .x, .nft and .wallet have to use Metamask or other login options.

Adding Unstoppable Domains as a login option would solve this and make the app more accessible. Bonus is that the app could get featured on their website to reach out to more people. I would like to develop this feature with a pull request if possible!

[Staking App] Disabled Dials - indication and warning

We recently disabled a few underutilized dials with MCCP 22: https://mips.mstable.org/MCCP/mccp-22.html

The now disabled dials are the following:

Dial | Recipient address | Dial Id

  • alUSD Feeder Pool Vault 0x0997dDdc038c8A958a3A3d00425C16f8ECa87deb 6
  • FEI Feeder Pool Vault 0xD24099Eb4CD604198071958655E4f2D263a5539B 8
  • HBTC Feeder Pool Vault 0xF65D53AA6e2E4A5f4F026e73cb3e22C22D75E35C 9
  • tBTCv2 Feeder Pool Vault 0x97e2a2f97a2e9a4cfb462a49ab7c8d205abb9ed9 10
  • Visor Finance 0xceF5df9d514bF0619c2ee87e2dDF1Af93FfAc0F6 16

The UI does not reflect this, it does not prevent the user to vote for a disabled dial.

  1. Show disabled dials in the UI, e.g.:
    Screen Shot 2022-06-23 at 18 35 24

But replace with disabled, make it optionally gray out.

  1. Prevent a user to allocate votes for the dial:
  • Disable the slider and set it to 0%
    Screen Shot 2022-06-23 at 18 36 57
    %
  • Should work for someone that just votes for the first time, or if you had previously votes allocated to the dial
  1. Display a warning on the top to vote again, if the user has allocated votes towards the disabled dials
    Screen Shot 2022-06-23 at 18 38 04
  • A warning box with the message.

[App] Move deprecated pools

Is your feature request related to a problem? Please describe.
Move deprecated pool either to the bottom or a new tab?

Describe the solution you'd like
The deprecated pool should be not at the top of the page. The easiest solution is just to move the pool to the bottom.

Additional context
Screen Shot 2022-05-23 at 11 42 46

[App] Blocknumber missmatch error message

Describe the bug
Some data gets mixed up in the app, subgraph requests a blocknumber that is much higher than what is possible on Ethereum. Might be the wrong number from polygon.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to https://mstable.app/#/musd/stats
  2. Select Mainnet
  3. Click on the top graph on 90 Days
  4. See error as per screenshot

Expected behavior
Should fetch from subgraph the correct blocknumber with the data

Screenshots
Screen Shot 2022-05-16 at 21 26 40

Desktop (please complete the following information):

  • OS: MAC/WIN
  • Browser Chrome/Brave

Additional context
This error happens in various places, but this is the most reproducible example.

[App] Clicking on the arrow should reverse the assets.

Is your feature request related to a problem? Please describe.
A common pattern in UIs that offer swaps from one asset to the other is that the arrow in the middle can act as a button that can swap the assets. Should be able to click and reserves the order.

In Save Page

  1. Go from deposit to redeem and vice versa
    Screen Shot 2022-05-23 at 11 53 34

In Swap Page

  1. Arrow should reverse the assets, example screenshot: sUSD -> USDC, reverse to USDC to sUSD.
    Screen Shot 2022-05-23 at 11 53 53

[Staking App & Main App] Feeder Pool Subgraph Error

Describe the bug
The staking app throws an error when loading.

Normal App subgraph error, doesn't show Feeder Pools anymore.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://staking.mstable.app/
  2. See Error
    Screen Shot 2022-08-02 at 17 39 52
    Screen Shot 2022-08-02 at 17 40 54

Screen Shot 2022-08-02 at 17 42 29

Expected behavior
The Feeder Pool subgraph is not really used for the Staking app, should not throw the error or use the FeederPool subgraph.

The Subgraph should be use for the Feeder Pool in the main app/

Polygon gas estimation is always 30

Describe the bug
The Gas estimation always returns 30 for standard, Fast, and Instant. Despite actually gas being higher. Maybe the gas API doesn't return proper values?

Also: standard < Fast < Instant.

Screen Shot 2022-07-15 at 17 32 45

[Staking App] Button to stake is activated despite needing ERC20 Approval first

Describe the bug
The button "Stake" is clickable despite needing ERC-20 Approval first.

Screen Shot 2022-05-20 at 12 20 03

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://staking.mstable.app/#/stake
  2. Click on staking MTA or mBPT
  3. Enter the amount in stake App
  4. Lock appears, and is enabled, but "Stake" button is also clickable

Expected behavior
Throwing the error is expected if there is a missing approval. However, the Stake button should not be activated until such approval has gone through.
This results in users missing the approval button.

  1. Simple solution: deactivate the button until the approval is done. Replace text with "Allow the Staking contract to use your MTA" or "Allow the Staking contract to use your mBPT"
  2. Probably better solution: Add button above staking to create tx for approval.

See Uniswap example:
Screen Shot 2022-05-20 at 12 19 40

Screenshots

Trying to send transactions without approval throws an error.
Screen Shot 2022-05-20 at 12 13 43

Balances not updating

Describe the bug
On Polygon, after any transaction, the balance does not update (or it takes a really long time to do so).

  • Ideally, after the transactions, it should reflect the change in balances.
  • When the app is open and the balance changes based on some other application, it should also update the balance (e.g. I received some mUSD while I had the App already loaded.)

Bug: Feeder Pool withdraw when pool balance is low

About

When redeeming LPtokens from a pool that is low in balance or if the withdrawer is the majority holder of the LPtokens, the normal single sided withdrawal does not work anymore. The user needs to withdraw proportionally.

Issue

Feeder Pool page: https://mstable.app/#/musd/pools/0x4eaa01974b6594c0ee62ffd7fee56cf11e6af936

Cannot specify how many pooltokens should be used.

image

Steps

https://dashboard.tenderly.co/dimsome/project/simulator/74b3cc5e-baae-407b-b2ad-f3e351f3be18

Staking App goes blank when wallet is connected and dials is clicked (Edge)

Describe the bug
The staking App goes blank when the wallet is connected and dials is clicked

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://staking.mstable.org/#/
  2. Connect Connect Wallet
  3. Click Dials in Menu
  4. Page goes blank

Expected behaviour
Should navigate normally to dials and show content

Screenshots
Screen Shot 2022-05-09 at 22 24 31
Screen Shot 2022-05-09 at 22 24 42

Desktop (please complete the following information):

  • OS: MacOS and Windows tested
  • Browser Edge
  • Version 101.0.1210.39 (Official build) (x86_64)

Additional context
Add any other context about the problem here.

[Staking App] Process to adjust or add delegate Profile

Is your feature request related to a problem? Please describe.
Currently, we have no process when it comes to adding new delegates or adjusting the profiles (Bio, profile picture). For the future to remain decentralised and to support delegation by known individuals we should have a way to add new profiles and adjust existing ones.

Describe the solution you'd like
A dedicated UI would be probably to cumbersome, but I would imagine a repo where individuals can add themselves into a JSON file that we then can use to upload periodically when required.

Uploading Screen Shot 2022-05-20 at 13.14.59.png…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.