ref-finance / ref-ui Goto Github PK
View Code? Open in Web Editor NEWUI for Ref Finance
License: MIT License
UI for Ref Finance
License: MIT License
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
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.
For example: https://explorer.near.org/transactions/CCQbe9fpTFrqW1YnCbi725oA3ZDZtKHGjwaTeRWHUvfQ
If exchange is not registered in the token, the error is very unclear. Potentially UI should suggest user to register the exchange in the token when user registering this token in the exchange.
Context: for exchange to receive new token, the exchange must be registered on the token contract (deposit 0.0125N) to prevent storage blowup
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.
get_account
function)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)
On the /pools page, we should remove the "Total Shares", add "Market Price", and show the totals of each token.
Calculating Market Price
If the pool is nDAI - wNEAR
Market price = 10000 / 2000 = 5 nDAI
CoinGecko Price API: https://www.coingecko.com/api/documentations/v3
May be have a "wrap" with more - and allow to unregister those tokens if user wants.
Let's display the following for each farm card:
When user hasn't staked
When user has staked
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
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.
make adboard available for all funcions
Feedbacks on UI:
On the /deposit page, if the user has a balance of 0 on their account for a selected token, the "Deposit to Stake" button should be inactive.
Add titles: "Pair" and "Shares Owned" to the table
On the /swaps page, if the user has a 0 balance of the base token in Ref, the button should say "Deposit". After clicking this button, the user should be redirected to /deposit
For example, see the current implementation on https://app.ref.finance. Instead of being inactive, the button should be clickable and redirect.
Long account addresses display undefined
at the end.
People are confused on how to wrap / unwrap NEAR and should be more visible.
Solution:
Steps:
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)
Add the UI for the farming contracts: ref-finance/ref-contracts#3
Implement the mobile views from the designs, and make the other views scale to smaller screen sizes.
https://www.figma.com/file/fuv8rWM8NGxKUKw2OAFsbn/Ref.Finance?node-id=134%3A1
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.
Users need clarification on many parts of the app. Tool tips need to be added to explain:
Porfolio
Swap
Pools
Clicking "Connect to NEAR" on the navbar doesn't redirect. The "Connect to NEAR" button on the /swaps page is implemented correctly
Swap page todo list:
Feature List:
Bug List:
Implement the new fonts, backgrounds, colors, and UI elements in these designs: https://www.figma.com/file/fuv8rWM8NGxKUKw2OAFsbn/Ref.Finance?node-id=134%3A1
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?
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.
/pools/add
page, including the 0.05% feeLots of users think their funds are "missing" when trying to swap non-deposited assets, could be easily avoided by adding a CTA pointing to the deposit view
README for this project needs to be updated for new developers to onboard
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
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.
Implement the "Your Liquidity" page from the designs. This page will show the user's active LP positions.
Designs: https://www.figma.com/file/fuv8rWM8NGxKUKw2OAFsbn/Ref.Finance?node-id=710%3A65
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".
To better promote the earning opportunities for LPs, we should show the historical fee totals for LPs.
Currently it only shows first X pools but doesn't have pages.
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.
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.
ref-finance.near
account
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
Add URL for selected markets to swap. Ex. https://app.ref.finance/swap#nusd-wnear
Users should be able to claim and withdraw their farming rewards with a single clickl
currently this Icon is used per default for Tokens with no Icon assigned to them (Exp: nComp). However that same Icon is used by Pulse for wNear, which might confuse some users.
It'd be better to use another Icon that indicates clearly that it's a placeholder, and won't be confused for something else.
some images use 'https://imgur.com/' storage. the website is blocked in china by GFW. please fix it.
I have another question,Why use https://coinmarketcap.com/ website image?
Currently, you can create fake tokens, we should prevent users from trading scam tokens.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.