Giter Club home page Giter Club logo

ref-ui's People

Contributors

0xbchain avatar aidai524 avatar benjamingreenberg avatar caozm599 avatar gavinchen8914 avatar harry1115 avatar ilblackdragon avatar joeatref avatar max-mainnet avatar mehtaphysical avatar naturexie avatar referencedev avatar rock-jp avatar thisisjoshford avatar xieqiancaosissi avatar zavodil avatar

Stargazers

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

Watchers

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

ref-ui's Issues

Refactor "Deposit" page into "Account" page

Overview

With the implementation of #97, the "Deposit" page is no longer necessary. Instead, this page should function as an "Account" page, which shows the user's active balances (they can still withdraw), LP positions, and swap history

Acceptance Criteria

  • "Deposit" is renamed "Account"
  • Users can view their balances in Ref and withdraw
  • Active LP positions are displayed
  • Swap history is displayed

Implement instant swap (no deposit)

Overview

We should implement ref-finance/ref-contracts#30. This way, users will not need to deposit before swapping. Additionally, we will need to refactor the "Deposit" page, as it is no longer relevant.

Acceptance Criteria

  • Users can swap tokens without depositing
  • If the user is swapping for an unregistered token, the token is first registered
  • Users can add liquidity without depositing

Create an airdrop claim UI

Overview

The skyward team has developed contracts that can be used for an airdrop claim. We need a page for users to call the claim function to retrieve their $REF.

Acceptance Criteria

  • Logged in users can view their $REF airdrop balance (using the get_account function)
  • Users with a > 0 balance can click "Claim", and receive their $REF after authorizing the transaction

Screen Shot 2021-07-06 at 5 31 59 PM

change initial deposit flow

Currently, when logging in for the first time user is asked to make initial deposit for account storage...

A more ideal flow would be to combine this with the users first deposit. We should always show if more storage deposit is required and bundle that transaction call (which we are already doing): “Extra 0.01 N will be deposited to cover storage. You can withdraw it later. Read here about storage deposits for Ref Finance.” (edited)

Liquidity Pools: Show liquidity for each token, not shares

Overview

On the /pools page, we should remove the "Total Shares", add "Market Price", and show the totals of each token.

Acceptance Criteria

  • For each pool, the total # of each token in the pool is shown under "Liquidity" (see image below)
  • For each pool, the "Market Price" is shown (see calculation)
  • "Total Shares" isn't shown

Calculating Market Price
If the pool is nDAI - wNEAR

  • 10,000 DAI
  • 2,000 wNEAR
Market price = 10000 / 2000  = 5 nDAI

Screen Shot 2021-04-29 at 5 12 41 PM

CoinGecko Price API: https://www.coingecko.com/api/documentations/v3

Farming details display

Overview

Let's display the following for each farm card:

When user hasn't staked

  • Rewards per week
  • APR
  • Total Staked (in NEAR)

When user has staked

  • Your Shares
  • APR
  • Total Staked (in NEAR)
  • Unclaimed Rewards

Total Staked calculation
If the pair is BANANA <> NEAR, and there are 3000 BANANA to 500 NEAR, display 500 NEAR

APR Calculation
( (1/Total Shares Staked) * (Rewards per week * price of reward token) * 52 ) * 100)

To get the price of the reward token, get the market price in wNEAR and multiply by the USD price of NEAR from CoinGecko API

Combine "Claim" and "Withdraw" on the Farms page

Overview

Once #97 is implemented, there is no reason to have both "Claim" and "Withdraw" actions in Farming. Instead, there should be one button "Claim", which should both claim the tokens on the user's behalf, and withdraw them.

Acceptance Criteria

  • There is no "Withdraw" button
  • Selecting the "Claim" button for a specific farm claims and withdraws the tokens to the user's account
  • Remove "Claim" from the side menu, so users must claim each token individual

Feedbacks on UI

Overview

Feedbacks on UI:

  • Definitely need to show the account id for the token traded everywhere. Right now there is "SKY" token with the same icon which is not SKYWARD token but people will be confused
  • Please add a space in after ":" in "Balance:0" on Swap page and in adding liquidity/deposits.
  • Swap screen should default to exchanging 1 NEAR to DAI - e.g. have default 1 entered if there is nothing entered in the Swap screen - even if it's not logged in. This way one can see the everything in action and as they switch tokens they also see the price.
  • Let's show not just Swap rate but Buy and Sell rate (e.g. both ways). And have ~$ amounts under it.
  • Say somewhere after the swap that need to withdraw to see it in the wallet.
  • In "View Pools": it right away shows "No more pools" and only then loading screen. Please just show loading screen right away.
  • In View Pools TVL column doesn't have "," separators in the numbers
  • Generally I find the Liquidity and Market price a bit confusing. But I don't have a good suggestion how to improve it. Market Price is def a confusing name there too, as this is specific pool's price vs global market price which I would expect. Not sure if we need to show this pool info there. Yield/APR when they are available def a better use of the space.
  • Going into Pool details: Total liquidity is missing, even though it's shown in "View Pools" (TVL). Really need to show the token addresses here (with links to explorer).
  • Change "Rainbow Bridge" at the top to "Move assets to/from Ethereum" and may be just an icon of rainbow.
  • When i click double in max its directly send me to swap even i dont click in swap.

Wrap / unwrap Ⓝ should be part of deposit / withdraw

People are confused on how to wrap / unwrap NEAR and should be more visible.

Solution:

  • have deposit default to Ⓝ token and when depositing Ⓝ auto wrap _and_deposit.
  • have withdraw default to Ⓝ and auto unwrap and withdraw

Clicking on withdraw leads to an error on TestNet

Steps:

  1. go to https://testnet.ref.finance/
  2. login
  3. go to https://testnet.ref.finance/portfolio
  4. Click "Withdrawal"
  5. Observe error:
errors.js:18 Uncaught (in promise) Error: Querying call/NEAR/ft_balance_of,DHcDMR9nKJkkBNH6cvhy24vc6cHXs8TGTnHb5uceES69DSHS failed: Contract ID "NEAR" is not valid.
{
  "error": "Contract ID \"NEAR\" is not valid",
  "logs": [],
  "block_height": 43224406,
  "block_hash": "ERk7whDDfKk4TRR9T5BTYTpHFXE79QiqVRmyd9F7D4QZ"
}
    at f.query (json-rpc-provider.js:80)
    at async r.viewFunction (account.js:271)

Show existing pools when adding new pool

Currently users keep adding new pools (and can't see them).

Show existing pools for given two tokens when adding new pool, to avoid people adding new ones and instead provide liquidity.

There should be also a message that says that it's better to provide liquidity to existing pool instead of adding new one. Probably people are confused that adding pool is not providing liquidity.

Add tool tips

Users need clarification on many parts of the app. Tool tips need to be added to explain:

Porfolio

  • deposit / withdraw
  • deposit NEAR actually wraps and deposits
  • withdraw NEAR actually unwraps and withdraws
  • whitelist token
  • balances only reflect deposited balances

Swap

  • what is slippage?
  • what is a swap?

Pools

  • add liquidity
  • remove liquidity
  • add liquidity pool
  • what is register token?

Swap page tasks

Overview

Swap page todo list:

Feature List:

  • A button to display the price reverted on swap page
  • Refresh the price on swap page every x seconds to avoid slippage errors
  • Keep slippage setting after doing a trade

Bug List:

  • Sometimes when typing the prices don't load correctly (probably cause old requests are answered with delay)
  • When doing two trades in a row, trading pairs are reset to default
  • When add liquidity or do swap action, use ft_metadata to check token id is right.

Logo and decimal place not showing

This is my code with 18 decimals

fn ft_metadata(&self) -> FungibleTokenMetadata {
FungibleTokenMetadata {
spec: FT_METADATA_SPEC.to_string(),
name: String::from("Avrit fungible token"),
symbol: String::from("AVRIT"),
icon: None,
reference: None,
reference_hash: None,
decimals: 18,
}
}

1×10^25 should show 1*10^7 tokens, but ref finance shows 1×10^19. Am I doing everything right?

ref

When creating a pool, show that the actual fee will be 0.05% higher

Overview

There is a 0.05% fee added to all pools (which goes to the protocol). Currently, users don't realize this fee is included, and their fees end up being higher than they expect. We should make this clear to users upfront.

Acceptance Criteria

  • The total fee is shown on the /pools/add page, including the 0.05% fee
  • It is explained to users that 0.05% is added to the fee they select
  • The default is 0.25

Screen Shot 2021-06-15 at 9 25 13 PM

update README

README for this project needs to be updated for new developers to onboard

MAX button should account for % needed for transaction

If I hit the MAX button in swap, the numbers are off and I get an error when trying to initalize the transaction.

requesting the transfer of
Ⓝ
9.99801
Available Balance: Ⓝ
9.99508
Sorry an error has occurred. You may want to try again.
Error: Sender mikey.near does not have enough balance 9995384510879566600000000 for operation costing 10038268808077530345929833

Liquidity Pools: Display the most liquid pool per pair

Overview

We currently have over 1000 liquidity pools (almost as many as the number of users!). To make it easier for users to pick a pool for a given pair (e.g. nDAI <> NEAR), we should display only the most liquid pool per pair.

Additionally, we should sort by the most liquid token pairs. So if nUSDT <> wNEAR is most liquid, it should be the first displayed.

Acceptance Criteria

  • For each pair, only one pool is displayed in the list and in search
  • The most liquid pool is displayed per pair
  • If a pool has farming rewards, this is indicated next to it in the list
  • The list is sorted by the most liquid pairs

Remove the "n" from whitelisted tokens

Overview

We should hide the "n" from tokens like nETH that are whitelisted, and instead just show "ETH". Several users have reported this as confusing, and it benefits Ref if users feel like they are using "real ETH".

Acceptance

  • For tokens on the whitelist, the "n" is parsed and doesn't appear (nETH shows as ETH)
  • wNEAR is displayed as NEAR

Show historical fee totals

Overview

To better promote the earning opportunities for LPs, we should show the historical fee totals for LPs.

[enhancement] allow wrapped Near withdrawals

currently the withdraw method unwraps wNear first, then withdraws it from the exchange, however some users need their wNear for other applications so it's useful to allow direct wNear withdrawals and save them the hassle of wrapping it all over again.

Use indexer to track and load user's LP positions

Overview

The current implementation of the "Your Liquidity" page requires 1000+ RPC calls to load all LP positions. It should instead use the Indexer to keep track of these positions.

Acceptance Criteria

  • An instance of the indexer is running for Ref
  • The instance indexes the following for the ref-finance.near account
    • add_liquidity calls for each pool_id and account
    • remove_liquidity calls for each pool_id and account
  • The pools a given account has provided liquidity too, and the current totals can be returned and displayed

add warning banner on swap screen

This project has not yet been audited and user needs to be informed of this.

A banner of “Community developed. Not audited. Use at your risk.” should be added to swap screen

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.