* 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>
* 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>
* 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>
* 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>
* 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
* 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