Commit Graph

311 Commits

Author SHA1 Message Date
Maximilian Schneider 6f506c469f switch to switchboard oracles 2023-11-14 14:42:24 +00:00
tjs 4517d756f5 phantom adapter 2023-02-16 13:06:57 -05:00
Maximilian Schneider 443cd8a3d7 downgrade recharts 2022-08-17 15:52:26 +02:00
Maximilian Schneider f94709a7a4 correctly import trading view 2022-08-17 15:43:26 +02:00
Maximilian Schneider 8ff82eb75a fix type issues on build 2022-08-17 15:23:11 +02:00
Maximilian Schneider e18a4ba1cd upgrade mango client to support pyth oracles 2022-08-17 15:08:55 +02:00
Maximilian Schneider 48ff4e7209 upgrade mango client with newest deps as well 2022-07-30 17:43:15 +02:00
Maximilian Schneider 99664f97e9 fixed wallet adapter type issues 2022-07-30 17:40:11 +02:00
Maximilian Schneider 1b7c251870 upgrade project dependencies web3 & next 2022-07-30 17:25:06 +02:00
Maximilian Schneider cc6ae1cd0b upgrade mango client for improved pyth support 2022-07-26 22:36:50 +02:00
Maximilian Schneider 92a128438d remove Alerts 2022-07-26 21:36:54 +02:00
tjshipe d67883cb3a
Merge pull request #60 from blockworks-foundation/clarkeni/delete_prices
Remove expensive historic prices API call
2022-04-14 15:02:12 -04: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 c4705937dc compat w/ solana 1.7 2021-10-07 18:28:47 +01:00
Maximilian Schneider df16b65dd6
Update AlphaModal.tsx 2021-09-19 15:55:42 +02:00
Tyler Shipe e7fb104bfa add env var for endpoint url 2021-09-13 15:51:04 -04:00
Tyler Shipe 54c5cb10e9 change refresh intervals of v2 2021-09-10 13:00:54 -04:00
Tyler Shipe f59abff414 use 2.1.5 client 2021-09-10 13:00:02 -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 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 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