Commit Graph

291 Commits

Author SHA1 Message Date
saml33 d9dc870a24 activity feed 2021-08-12 23:14:54 +10:00
saml33 602637cc7e Merge branch 'main' into account-activity-feed 2021-08-12 22:59:01 +10: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 6f491f28d3 do settle funds before settle borrows in settleAll 2021-08-06 14:08:04 -04:00
Tyler Shipe a96603fcbe show 24h and 7d average deposit and borrow interest 2021-08-06 13:31:39 -04:00
Tyler Shipe 63b02b3313 node updates 2021-08-05 17:33:50 -04:00
Tyler Shipe 8b517651d8 yarn format 2021-08-05 12:00:59 -04:00
Tyler Shipe 43ca4871f8 send two transactions when settling all in ui 2021-08-05 11:58:31 -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 d99af29965 activity feed layout 2021-07-15 23:04:08 +10: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
Tyler Shipe f1ce7ba132 use latest mango-client 2021-07-04 11:15:34 -04: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 0d8a6a4143
fix balance calculations (#35) 2021-06-16 16:52:18 -04:00
Maximilian Schneider bfebd8a900 fix babelrc to handle logical assignment ops 2021-06-16 12:05:03 -04:00
Tyler 02183890ef
Merge pull request #34 from blockworks-foundation/dd/place_settle_fix
only send pre-settle instructon if open orders account already exists
2021-06-16 10:24:19 -04:00
dd 1087750421 only send pre-settle instructon if open orders account already exists 2021-06-16 10:23:01 -04:00
Tyler 3bd8343f3d
Merge pull request #32 from blockworks-foundation/dd/improve_place_settle
Added a settle instruction before place and settle to reduce compute …
2021-06-15 15:31:43 -04:00
dd 5b66381805 Added a settle instruction before place and settle to reduce compute by 30k 2021-06-15 15:29:10 -04: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 3c65fc267e fix bug showing fee rebate in wrong balances col 2021-06-12 17:55:27 -04:00
Tyler Shipe 69bb0e02d3 add back US to countries list 2021-06-12 17:26:56 -04:00
Tyler Shipe 8171b25167 use latest mango-client version 2.1 2021-06-12 17:17:59 -04:00
Tyler Shipe 2f5f489bd2 Merge branch 'development' into main 2021-06-12 17:10:05 -04:00
Tyler Shipe 82678a3447 fix net balances 2021-06-12 16:57:09 -04:00
dd c3fedf9f80 fixed placeAndSettle to round properly 2021-06-12 15:49:04 -04:00
Tyler Shipe 09df840c6a use correct quote net balance 2021-06-12 15:23:15 -04:00
Tyler Shipe 48374fa3fb update devnet ws url 2021-06-12 15:10:56 -04:00
Tyler Shipe f6101964f2 clean up quote balance logic 2021-06-12 14:04:30 -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
Tyler Shipe 147c702f3e update devnet url 2021-06-11 10:42:08 -04:00
Tyler 32346a75c0
Merge pull request #27 from ImpossiblePairs/trade-form-ui-bugs
Updated TradeForm.tsx UI Bugs
2021-06-10 19:42:17 -04:00