Commit Graph

49 Commits

Author SHA1 Message Date
Tyler Shipe 8b517651d8 yarn format 2021-08-05 12:00:59 -04:00
saml33 ecd9ac4033
Account health calculator (#47)
* create calculator page

* page layout

* Link Input Fields and Formuals

Linked up the inputs and added the calculations.

State objects/functions are not optimized, as they were built one by one to make sure each was working. Once all components are working, this should be refined.

* Slider Fixes, Additional Details

Fixed slider to manipulate all prices equally instead of collateral.

Added additional information to scenario details: Min Collateral Ratio, Risk rating, and Percent move to liquidation.

* Negative number handling

Updated details to zero out negative equity or leverage, as neither should occur.

* Update liquidation-calculator.tsx

- Updated handling of state by asset instead of action (BTC.deposit instead of deposit.BTC)
- Fixed slider percentage lag (was one state change behind)
- Cleaned up handling of scenario liquidation
- Handling of some dust borrows/NaN calculations found in testing

* Handling User Input (decimal / sign first)

Delaying update of state until a number is present (allows decimal place or sign to be entered).

Convert user inputs into absolute values to avoid unwanted calculator output (such as a double negative).

* Added Calculator For Disconnected State

- Added ability to use liquidation calculator without requiring user to connect a wallet.
- Fixed rounding of prices during slider manipulation and out of focus.
- Reset slider position when price inputs are in focus (erroneous calculations when manually inputting price with slider at percentages other than 100%)

* responsive, layout tweaks and link from trade page

* Account Switching Reload & Leverage Rounding Fix

Switching margin accounts now triggers the Risk Calculator to reload balances.

Rounding method for calculations standardized to floorToDecimal to remove borrow rounding errors causing incorrect leverage calculations.

* fix typo

* Update Slider & Price Input Behavior

Updated slider & price input behavior after receiving some feedback from Sam and Dboures about price input field and slider interaction.

Originally clicking on the price input would reset the slider and return the prices in the input form back to the reference prices held in state, Now when the slider is in use, users can click on a price input and the price and slider will remain in the same position. If a change is made, the reference prices of all assets will be updated to their currently displayed value and the slider will be reset. If no changes are made, the reference prices remain unchanged and the slider remains at it's current setting.

* Update collateral ratio rounding & liquidation message criteria

Co-authored-by: ImpossiblePairs <47860274+ImpossiblePairs@users.noreply.github.com>
Co-authored-by: dboures <dboures@att.net>
2021-07-19 12:04:04 +02:00
saml33 522425d90b
Pnl leaderboard (#43)
* leaderboard layout

* hook up pnl endpoint

* api limits, offset and start_date

* pnl history charts

* support account names

* ui feedback updates

* play with leaderboard 🙈

* fix chart bug

Co-authored-by: Maximilian Schneider <mail@maximilianschneider.net>
2021-07-19 11:51:40 +02:00
dboures 27c6c8b36d
Add account names (#44)
* handle account names on account page

* handle name in new account form

* handle marginbalances, responsive

* Add account name uses smart contract

* remove localStorage account name references

* adjust name validation message and label name as public

* new accounts are initialized with names

Co-authored-by: saml33 <slam.uke@gmail.com>
Co-authored-by: Tyler Shipe <tjshipe@gmail.com>
2021-07-08 21:35:14 +02:00
saml33 8a59b00347
Stats page alignment (#28)
* total deposit/borrow value charts, new chart styles

* responsive and bar chart

* reduce icon size to match trade page

* round large numbers

* use historic prices for total deposits/borrows

* fix lint errors

* use current price if no match from prices api

* fix data passed to borrow chart

* update prices endpoint url

Co-authored-by: Maximilian Schneider <mail@maximilianschneider.net>
2021-06-22 13:49:52 +02:00
Tyler Shipe 956664b91f show accounts in select when length is greater than two 2021-06-09 12:28:33 -04:00
Tyler Shipe 1afe59e4e0 update modal with sol srm info 2021-06-08 10:59:39 -04:00
Tyler Shipe f4efd78b9d better spacing between accounts on alert page 2021-06-07 13:14:58 -04:00
Tyler Shipe ba8ef82703 update acct labels 2021-06-07 13:03:51 -04:00
saml33 3b5f22b815
User account page (#22)
* layout, overview, start on assets, borrows and open orders

* trade history, sortable data hook for tables, borrow page

* handle deposit and withdraw buttons

* borrow modal ui and integration + settle borrow for individual assets

* in orders balance to asset table and totals, responsive css, new connected wallet button + small tweaks

* account switch/creation flow

* accounts modal, update to usebalances hook

* handle settle, deposit before settle, save last account

* disable borrow/withdraw button when no account
2021-06-05 10:11:44 -04:00
Ralfs a9ad62ee83
use the 5_token USDC group (#16) 2021-05-26 16:35:45 +03:00
Ralfs 7a110f9ea5 Fixed build bugs 2021-05-20 23:43:18 +03:00
Maximilian Schneider 935129c45e
simulate withdraw operation so we can preview equity & coll (#10)
* show margin details in withdraw ui

Co-authored-by: saml33 <slam.uke@gmail.com>
2021-05-18 19:27:09 +03:00
saml33 a49f7e2fe9
add market data header to trade page (#9)
* add market data header to trade page
2021-05-18 08:33:04 +03:00
saml33 806b527502
Bring alert details and notifications into the UI (#5)
* hook to get alerts, add triggered alerts to alerts list
* alerts page, count unseen alerts, clear alerts from nav view
* consolidate components, add custom value to alert modal dropdown, sort margin accounts alphanumerically
* ring bell when count increments and ping animation on count
* create/fetch alerts from store, filter by account, populate modal state from triggered alert
* fix alert sorting
* enable MA selection also for re-activate
2021-05-07 22:41:26 +03:00
Maximilian Schneider 9c0c94eb4b fix broken margin account selector invocation 2021-05-02 15:58:12 +03:00
Tyler Shipe 90d219e83c hide select if no margin accounts 2021-05-02 00:51:55 -04:00
Tyler Shipe f18d61b216 add margin account selector 2021-04-26 01:26:12 -04:00
Tyler Shipe 2d489b29c4 add Lagzda's alerts 2021-04-24 22:10:28 -04:00
saml33 fc751fe00c
More timeframes to charts and chart theming (#2)
* topbar action tooltips. flip refresh icon. max with borrow button
* more timeframes and chart theming
* fix asymmetric header button
2021-04-25 01:02:13 +03:00
saml33 4285339e5a responsive tables and start on stats page 2021-04-21 00:19:08 +10:00
Tyler Shipe ea015a4dc9 fix saved grid layout and add formatting for some large nums 2021-04-17 20:04:18 -04:00
saml33 f66710f14a font styling 2021-04-16 21:50:56 +10:00
Tyler Shipe b5d72c0b55 remove ant library and fix tailwind config for lato 2021-04-15 23:32:03 -04:00
Tyler Shipe ecf81a41b8 fix issue with wallet disconnect when changing pages 2021-04-15 17:54:42 -04:00
Tyler Shipe e33bc5feca add alpha popup message 2021-04-15 12:34:59 -04:00
Tyler Shipe faa466ca17 prevent extra rerenders 2021-04-15 02:16:36 -04:00
Tyler Shipe a674ff74d3 texting fixes 2021-04-14 18:46:36 -04:00
Tyler Shipe 062ac4105a all the fixes 2021-04-13 19:41:04 -04:00
Tyler Shipe 132802fe12 add manifest and fix favicon 2021-04-13 16:45:07 -04:00
Tyler Shipe d97f63ced8 add favicons 2021-04-13 16:34:06 -04:00
Tyler Shipe d2fe9ce4c0 set default theme for netlify 2021-04-13 16:23:28 -04:00
Tyler Shipe 08e3c7a6a7 testing netlify deploy 2021-04-13 15:48:36 -04:00
Tyler Shipe 59f1156703 Add UiLock toggle and themed the stats page 2021-04-13 12:51:42 -04:00
Tyler Shipe e0370f4b0f Merge branch 'ui-styling-2' into main 2021-04-13 10:42:42 -04:00
saml33 f5cf996c41 more theme updates and ui tweaks 2021-04-14 00:10:57 +10:00
Tyler Shipe 56c0372a7f wire up trade history 2021-04-13 00:40:26 -04:00
Tyler Shipe ff260643dd Add switch component and replaced classes with theme vars 2021-04-12 18:15:15 -04:00
Tyler Shipe 6605cbdd48 convert trade form inputs to tailwind and continue theming 2021-04-12 16:01:55 -04:00
Tyler Shipe 932b52f649 remove xwind and convert to className prop 2021-04-12 12:49:02 -04:00
Tyler Shipe 70d4240b74 Merge branch 'ui-styling' into main 2021-04-12 10:19:37 -04:00
saml33 d9c27cca3c support for more than two themes 2021-04-12 23:32:01 +10:00
Tyler Shipe 799b9d843c add notifications 2021-04-12 00:17:23 -04:00
cryptopherhitchens 4e06be9bb8 theme start 2021-04-12 07:25:01 +10:00
Tyler Shipe 10e4fff211 add stats page 2021-04-07 19:06:02 -04:00
Tyler Shipe a0c0768473 add market select dropdown 2021-04-06 18:11:42 -04:00
Tyler Shipe f03f1919a4 add trade form component 2021-04-02 14:26:21 -04:00
Tyler Shipe 37cf5bae14 create next app with trading view form and orderbook 2021-03-30 18:47:08 -04:00
Tyler Shipe f8825bd246 Initial commit from Create Next App 2021-03-26 12:44:55 -04:00