Commit Graph

217 Commits

Author SHA1 Message Date
Maximilian Schneider f94709a7a4 correctly import trading view 2022-08-17 15:43:26 +02:00
Maximilian Schneider 99664f97e9 fixed wallet adapter type issues 2022-07-30 17:40:11 +02:00
Maximilian Schneider 92a128438d remove Alerts 2022-07-26 21:36:54 +02:00
Nicholas Clarke 0abc758cfd Remove expensive historic prices API call 2022-04-14 11:45:24 -07:00
Maximilian Schneider 0bd925ee6d switch v2 to new candle api 2021-12-27 20:20:48 -07:00
Maximilian Schneider df16b65dd6
Update AlphaModal.tsx 2021-09-19 15:55:42 +02:00
Tyler Shipe 54c5cb10e9 change refresh intervals of v2 2021-09-10 13:00:54 -04:00
Tyler Shipe 73cde8f5ad show txid if it exists 2021-09-01 11:18:22 -04:00
Tyler Shipe 9ffba0b898 add more info to deposit err notif 2021-09-01 11:16:55 -04:00
Tyler Shipe c8c96d954c update alpha modal 2021-08-31 14:05:55 -04:00
Tyler Shipe bf10c601e4 add v3 mango link 2021-08-31 13:52:52 -04:00
saml33 79f55bc1e1 correct interest rate tooltip copy 2021-08-11 13:13:59 +10:00
Tyler Shipe 999e2e1a98 fix stats on mobile 2021-08-08 21:40:44 -04:00
Tyler Shipe a96603fcbe show 24h and 7d average deposit and borrow interest 2021-08-06 13:31:39 -04:00
Tyler Shipe 8b517651d8 yarn format 2021-08-05 12:00:59 -04:00
Tyler Shipe 8695a7f397 show deposit err message in notification 2021-08-01 21:35:19 -04:00
Maximilian Schneider bfb2bed514
fixed liquidation price estimate (#55) 2021-07-21 18:52:49 +02:00
ImpossiblePairs 52a4aa3a7a
Add Cumulative Size To Orderbook (#54)
Added toggle on Orderbook Flipcard to toggle between size and cumulative size order display. Sizepercent also updated to show opposite scale.
2021-07-20 11:21:32 +02:00
saml33 3b28b3aba9
Estimated liquidation price (#52)
* estimate liquidation price

* make space for elp in margininfo

* display N/A if account won't be liq'd
ensure recalculation on market change

Co-authored-by: dboures <dboures@att.net>
2021-07-19 12:30:00 +02: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
saml33 cae7d92a16 filter stats chart by time range 2021-07-11 10:39:20 +10:00
saml33 ca6514bb38 fix fallback account names 2021-07-09 20:40:31 +10: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
rjpeterson 0ef18df358
Make orderbook depth change dynamically with layout (#41)
* Make orderbook size change dynamically with layout

This change causes the depth value passed to the orderbook component to change in response to the height of the resizable container.
This allows users to show more or less of the depth of the orderbook depending on their preference.
Old behavior was to always show a depth of 8 rows regardless of the size of the container.

* revert changes to yarn.lock

* adjust depth formula, add assymetric depth in vertical mode

The depth of the orderbook now more closely matches the size of the container.
The scrollbar has also been disabled in the orderbook panel to enable the space to be used as efficiently as possible without the annoyance of the scrollbar appearing.
The vertical orientation of the orderbook now allows an odd number of ask rows and an even number of bid rows if it is able to use more of the available space.

* Make orderbook depth adjust on breakpoint change

Add orderbookDepth state which is managed by onBreakpointChange and onLayoutChange functions.

* Add orderbookDepth value to useMangoStore

* Simplify state management and move orderbook adjustments into useEffect

Remove orderbook state object from useMangoStore
This change solves the issue of the orderbook not adjusting on a new session, as well eliminates instances of repeated calls to adjustOrderBook()

* Fix lodash compile errors
2021-07-05 22:10:35 +02:00
saml33 0800a63987
Margin info height (#40)
* Updated Margin Info Tile Card
Minor UI update to provide more actionable information on Margin Collateral Information.
* Removed formula error
Removed division of collateral dollars by 100
* update margin info
* fix margin info height and connect wallet empty state

Co-authored-by: ImpossiblePairs <47860274+ImpossiblePairs@users.noreply.github.com>
Co-authored-by: Maximilian Schneider <mail@maximilianschneider.net>
2021-07-03 12:12:47 +02:00
Tyler Shipe 46ca5248ab only update the market header data on market change 2021-07-02 14:42:46 -04:00
saml33 cfc09fb3c4
User account history (#33)
* deposit/withdraw table

* liquidations table and details

* connect to api data

* move history data to store

* nicks feedback on liquidations

* update history endpoint url

* update history when account changes
2021-06-22 19:50:40 +02:00
saml33 4062b7fe82
Validate min-size and fix misaligned trade page layout (#29)
* validate min-size and fix misaligned trade page layout

* check for null market
2021-06-22 13:50:56 +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
Riordan Panayides 1157d55307 Fix NaN error in market header 2021-06-20 01:54:33 +01:00
Riordan Panayides 71e1275ca7 Remove log 2021-06-20 01:41:28 +01:00
Riordan Panayides 11b082c2cd Improve volume null check 2021-06-20 01:39:22 +01:00
Maximilian Schneider 3dbbe87ded
fix data issues when switching markets (#31) 2021-06-12 22:03:05 -04:00
Maximilian Schneider 3b66cf9090
fix volume sometimes null (#30) 2021-06-12 20:04:13 -04:00
Tyler Shipe 4476a2254e rebate gui hoster fees to users 2021-06-12 13:46:06 -04:00
saml33 e14350e624
disable 0 bal assets for deposits and fix withdraw validations (#25) 2021-06-11 14:23:51 -04:00
ImpossiblePairs 2f066cb92c
Updated TradeForm.tsx UI Bugs
Added handling of USDT orders below minimum size (e.g. $1), removed ability to execute trades at half minimum order size due to rounding, and allowing user input leading with numerical input that is not strictly a number (e.g. decimal point).
2021-06-09 15:30:53 -07:00
Tyler Shipe 956664b91f show accounts in select when length is greater than two 2021-06-09 12:28:33 -04:00
Tyler Shipe f3a86a5a0c combine quote currency balances now that we're showing all markets 2021-06-09 11:52:32 -04:00
Tyler Shipe e68211a56b adding settle all button temporarily to test issue in ui 2021-06-08 18:49:53 -04:00
Tyler Shipe 15bb7c56d1 fix link 2021-06-08 11:04:56 -04:00
Tyler Shipe 1afe59e4e0 update modal with sol srm info 2021-06-08 10:59:39 -04:00
Tyler Shipe 9e16290300 fix NaN on account change modal 2021-06-07 19:33:59 -04:00
Tyler Shipe 31dc68d120 add back fee discounts table 2021-06-07 18:06:00 -04:00
Tyler Shipe 485718cd1b fix borrow modal 2021-06-07 17:56:56 -04:00
Tyler Shipe 330ef82a32 fix default margin account select 2021-06-07 16:55:10 -04:00
Tyler Shipe aa5355e70c fix pnl on accounts page 2021-06-07 13:28:54 -04:00
Tyler Shipe 3a57263452 fix pnl 2021-06-07 13:01:41 -04:00
Tyler Shipe c44105e4cd fetch trade history when switching accounts 2021-06-07 13:00:00 -04:00