umaprotocol / emp-tools Goto Github PK
View Code? Open in Web Editor NEWA tool for minting and managing your position with UMA's expiring tokens.
Home Page: https://tools.umaproject.org
A tool for minting and managing your position with UMA's expiring tokens.
Home Page: https://tools.umaproject.org
I was thinking about how we might avoid the null checks in normal logic throughout the dapp. In the past I've generally used loading guards to block off the logic until the data is all non-null.
However, @adrianmcli mentioned is that the user shouldn't have to connect their wallet to view read-only info. I like that philosophy a lot, but there are a few issues with it in this dapp right now:
I think we should:
if (someDataFromContainer === null || otherDataFromContainer === null || ... ) {
return (
<LoadingJSX />
);
}
Thoughts @nicholaspai @chrismaree @adrianmcli?
These should be the same standard. I think bot being the collateral type is good.
Ideally, the UI should NOT let me submit any tx that would make my CR < CR requirement.
Here the "CR of newly created tokens" is red. the color here is correct but perhaps only make it red if the value is > 0 & < GCR so it does not start as red by default.
After a successful tx the user is shown their tx hash. This should be a link to etherscan
Right now there is no way to transfer a position from the app.
If the user has not connected metamask the app should still work to show contract information. It should gracefully use infura directly to show EMP contract info but disable the manage tab until they connect their wallet.
Thre are a few places in the dapp where promises are dealt with like this:
const res = await Promise.all([
This is pretty messy as each response needs to be quired as res[0]
,res[1]
etc.
Consider refactoring this to something more like:
const [hasPriceResult, finalFeeResult] = Promise.all...
EIP747 enables a UI sugar facilitating a button that adds a known token to a users metamask account. This could be nice for tracking the synthetic tokens created in the dapp. See EIP747 for implementation details.
Right now some of the components look fine on mobile, but others really don't. Overall, the app styling needs major refinement for mobile screen sizes.
Some candidate helpful links (Wrapped in IconButtons):
n/t
Latest subgraph explorer
GraphQL can be queried via traditional REST API client like axios
or graphql client like apollo
:
axios
: pools.visionapollo
: uniswap.inforight now there is no way to see if you are liquidated other than your collateral & tokens will be lower. there should be feedback to the user showing the liquidation state.
Currently, container data read from on-chain is returned as a combination of string
and number
types, however this opens the door for precision loss. Containers should return raw data and let downstream modules cast the data as they wish.
Example:
Position
container returns position stats as strings
and numbers
but all should just be returned as BigNumbers, including derivative stats such as GCR
Currently queries first 1000 uma:positions and balancer:shares but should also be able to pass in a skip paramater to paginate.
Input fields all over the dapp can have negative input numbers. This should be prevented.
There are a number of key places where a tooltip would be useful in explaining what's going on exactly.
Redeem fails if amount to redeem > # tokens outstanding, the "MAX" button should be set to this limit
This is valuable for potential liquidators & disputers, and new sponsors who want to have an idea about EMP activity
There is a lot of common logic repeated through the app. much of this could be pulled into a utils folder for simplicity.
Official pricefeeds introduced in this UMIP
right now there is no way to see if a position's health
is it being liquidated? pending transfer? this information should be shown.
Right now the CR is calculated only with position size and collateral. No price is included which means you cant actually represent the CR as a percentage. If a price feed was added we would be able to show a CR % based off the current price of the underlier. Simply divide the current CR by the price to get the CR expressed as a percent.
Relevant for yCOMP and yUSD
Right now how we check for null types is inconsistent in some places of the dapp. Additionally, some places use a renderComponent
and others do not.
We should define one consistent pattern any apply this through the dapp. For example, early returns which have two major readability advantages:
Show at what price position is liquidatable
Right now the dapp does not have any favicon. Current candidates:
It would be awesome if the all positions tab would let the user liquidate or top up any position in a given EMP.
All sponsors tab takes a bit longer to load than the rest of the app. The user should be told that it's currently loading while the data is retrieved.
The dapp should be able to be pointed at Kovan contracts for testing.
In the smart contracts, the create
function can be called once a use already has a position. This increases their debt and collateral in the same tx. The front end currently does not gracefully deal with the case where the use already has a position. If this is the case they should be told what the resultant CR will be after making the position and show them the delta on their position stats.
The screenshot below shows how this could potentially be appended to the current components:
You need to cancel or execute your pending withdrawal request before creating additional tokens.
Instead we should probably have a different message if an EMP has not been selected, like:
Please first select an EMP from the dropdown above
We have deployed our contracts + many EMP's to the Kovan network. We should be able to switch networks on our web3 provider when using the dApp seamlessly
Right now the dapp only supports metamask. This is very limiting.
Consider adding onboard.js. While doing it consider adding notify.js
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.