Commit Graph

677 Commits

Author SHA1 Message Date
rjpeterson 4fe35a4417 fix inconsistent decimal count upon grouping change 2021-09-07 15:42:07 +08:00
Tyler Shipe df8b65d9a9 add usePrevious to trigger immediate rerender on group size change 2021-09-06 16:43:08 -04:00
Tyler Shipe f956af73db fix funding rate label display 2021-09-06 13:28:35 -04:00
Tyler Shipe 7416988dcd Revert "wip"
This reverts commit ebf0e6fa4d2d9640afa938a9aaee6b0fc95815a4.
2021-09-06 12:59:13 -04:00
Tyler Shipe cf20d48c51 wip 2021-09-06 12:59:13 -04:00
Riordan Panayides b8251361f5 Make number formatting consistent 2021-09-06 12:59:13 -04:00
Riordan Panayides 7b836cae64 Arrange graphs in grid 2021-09-06 12:59:13 -04:00
Riordan Panayides 5c752cca78 Add funding rate and open interest graphs 2021-09-06 12:59:13 -04:00
rjpeterson 3afabced6b adjust text position in dropdown button 2021-09-06 22:37:07 +08:00
rjpeterson 2317b9aeb6 adjust styling & fix build error 2021-09-06 22:30:55 +08:00
rjpeterson a179790b0e set default grouping to 1 cent 2021-09-06 21:56:34 +08:00
rjpeterson 90a0117d0d prevent grouping from resetting to default on market refresh 2021-09-06 21:56:04 +08:00
rjpeterson bb0a4594cc prevent grouping from resetting to default on market refresh 2021-09-06 21:50:11 +08:00
rjpeterson cc517d1508 revert unnecessary changes 2021-09-06 21:44:32 +08:00
rjpeterson c6c54f27bf make select box width consistent 2021-09-06 21:38:36 +08:00
rjpeterson f6dddddd53 make grouping function more clear 2021-09-06 21:38:33 +08:00
rjpeterson acf91fa3d2 fix orders not grouping properly due to js floats 2021-09-06 21:38:31 +08:00
rjpeterson 206cd98b46 change group sizes, increase orderbook entries to 40, fix bids display bug 2021-09-06 21:38:28 +08:00
rjpeterson c3c1eb3651 adjust decimal count when grouping is changed 2021-09-06 21:38:25 +08:00
rjpeterson 3d962d7707 adjust dropdown styling 2021-09-06 21:38:23 +08:00
rjpeterson d16395eb9a reset groupSize on new market, make sure all array entries are numbers 2021-09-06 21:38:20 +08:00
rjpeterson e4b70ae4ae add GroupSize select component 2021-09-06 21:38:17 +08:00
rjpeterson 6fb724de11 initial rough grouping solution 2021-09-06 21:38:14 +08:00
saml33 6d15756581 add rates to balances table 2021-09-06 21:51:18 +10:00
saml33 0117358268
Merge pull request #23 from blockworks-foundation/action-buttons-balances-table
add deposit/withdraw buttons to balances table
2021-09-06 16:26:36 +10:00
saml33 67156f49d9 update zebra stripe colors 2021-09-06 16:22:30 +10:00
saml33 65cb1e9c63 add deposit/withdraw buttons to balances table 2021-09-06 16:08:33 +10:00
Tyler Shipe bb2d4ffc10 fix orderbook row bar width 2021-09-06 01:36:27 -04:00
Tyler Shipe 2ae45146c1 fix stats page on safari 2021-09-05 22:27:50 -04:00
Tyler Shipe 494ea98e33 add default width; add show zero balances 2021-09-05 20:20:21 -04:00
saml33 50380107cf improve balances table 2021-09-05 16:50:16 -04:00
Tyler Shipe c5615254bf extract health variables in accountInfo component 2021-09-04 18:41:02 -04:00
Tyler Shipe 097d96def0 improve health ratio updates 2021-09-04 18:20:49 -04:00
Tyler Shipe e5b67857af retry transaction more frequently; use tx callback for notifications 2021-09-04 17:59:53 -04:00
Tyler Shipe e306915a45 Increase frequency of background mangoAccount updates 2021-09-04 12:40:43 -04:00
Tyler Shipe 221b6f06f5 Show negative balance when borrowing 2021-09-03 16:25:09 -04:00
Tyler Shipe 73fa197d5d remove unnecessary emotion styling; use asyncawait for sleeps 2021-09-03 15:02:51 -04:00
Tyler Shipe d4f643aa02 remove source maps from prod 2021-09-03 12:14:11 -04:00
Tyler Shipe 1aead03db3 remove reloadMangoAccount after settlPnl 2021-09-03 11:54:12 -04:00
Tyler Shipe 4a145f5878 use latest client and only reload mango account after settling 2021-09-03 10:36:53 -04:00
Tyler Shipe a566e6795e fix inconsistent coloring 2021-09-03 03:00:59 -04:00
Tyler Shipe 21b11aaa80 rearrange title order 2021-09-03 02:41:53 -04:00
Tyler Shipe 5b8f4dd155 change interval time and add position market name 2021-09-03 02:39:37 -04:00
Tyler Shipe 8e4e818e49 fix orderbook display 2021-09-03 01:45:58 -04:00
Tyler Shipe 50c9fc07c1 add open order to orderbook 2021-09-03 01:32:27 -04:00
Tyler Shipe 6e7cca78a5 add perp 24hr vol 2021-09-03 00:33:10 -04:00
Tyler Shipe dbc66498a9 use abs value for notional value 2021-09-02 23:39:24 -04:00
Tyler Shipe 3b59771145 immediately resize orderbook on depth change 2021-09-02 18:29:03 -04:00
Tyler Shipe c39e20a744 add loading indicator to settle pnl 2021-09-02 17:35:37 -04:00
saml33 4334a5c08b fix mobile menu transition 2021-09-02 15:04:09 +10:00
Tyler Shipe 6833602681 fix balance rounding issue in market balances 2021-09-01 14:43:27 -04:00
Tyler Shipe 08934bd74f fix borrow rates on borrow page 2021-09-01 12:39:17 -04:00
Tyler Shipe 65b2f2a978 hide daily volume stat until new api is up 2021-09-01 12:27:10 -04:00
Tyler Shipe edd45fc6cf add guard against market type in market header 2021-09-01 11:43:42 -04:00
saml33 a47e678c2f improve mobile menu 2021-09-02 00:30:34 +10:00
Tyler Shipe 33959a0e74 fix sol collateral avail and add alpha banner 2021-08-31 21:27:13 -04:00
Tyler Shipe 6820ac854f update market position faster for perp accounts 2021-08-31 19:28:39 -04:00
Tyler Shipe ae99437cea Load all mango accounts when depositing for the first time 2021-08-31 17:50:17 -04:00
Tyler Shipe b55b945bd8 refresh the funding rate on interval 2021-08-31 16:31:35 -04:00
Tyler Shipe 89d990a5f9 increment zero balance key 2021-08-31 15:14:07 -04:00
Tyler Shipe 27c7349c94 default show zero balance to true 2021-08-31 15:13:21 -04:00
Tyler Shipe bc56ac2759 tweak alpha modal 2021-08-31 14:42:33 -04:00
Tyler Shipe 99148a149c tweak alpha modal 2021-08-31 14:41:27 -04:00
Tyler Shipe ba731617cc reload tokens after deposit 2021-08-31 14:11:41 -04:00
Tyler Shipe 9b1c05e3c7 add link to alpha modal 2021-08-31 14:03:26 -04:00
Tyler Shipe 4f20fc6542 use client reloadMangoAccount 2021-08-31 13:47:03 -04:00
Tyler Shipe 44ed905eb6 Fix trade form quote rounding 2021-08-31 10:55:49 -04:00
saml33 71e55964fa responsive market header 2021-09-01 00:25:09 +10:00
tjshipe b2228d446a
Merge pull request #17 from blockworks-foundation/dynamic-orderbook-depth
Dynamic orderbook depth
2021-08-30 17:18:21 -04:00
Tyler Shipe c6e09c1ba1 fix alpha modal issue 2021-08-30 16:40:32 -04:00
Tyler Shipe 2c50835a21 update alpha message 2021-08-30 14:50:37 -04:00
Tyler Shipe 3ef85d773b add individual spot asset stats 2021-08-30 14:41:42 -04:00
Tyler Shipe 9c3c0677bd perp position pnl using breakeven price 2021-08-30 02:33:41 -04:00
Tyler Shipe bc447a5296 add value to open orders table, add color to perp pnl 2021-08-30 02:17:36 -04:00
Tyler Shipe 6630e29707 upgrade nextjs 2021-08-30 00:56:27 -04:00
rjpeterson de7fc9c15a prevent scrollbar from appearing 2021-08-30 12:24:10 +08:00
rjpeterson 43a01683e9 undo tailwind class reordering 2021-08-30 11:24:02 +08:00
rjpeterson 531720b290 inital conversion from v2 2021-08-30 11:24:01 +08:00
Tyler Shipe e0f2398dab remove old hooks 2021-08-29 20:37:31 -04:00
Tyler Shipe 7dd454c23c handle rounding issues when withdrawing max with borrows 2021-08-29 20:25:36 -04:00
Tyler Shipe 7aa7feadb0 Use latest client to fix rounding issues 2021-08-29 15:15:37 -04:00
Tyler Shipe dde1555b69 don't use floor on potentially negative numbers 2021-08-29 12:55:34 -04:00
Tyler Shipe 83037b722e show change percent when zero 2021-08-28 22:02:22 -04:00
dd a07acca6e0 applied floor to deps and net; applied ceil to borrows; don't recommend merging changes in BalancesTable.tsx unless you also make it work with the 0 balances checker etc. But I think as long as we aim to show precision up to native units, these changes are good. 2021-08-28 17:16:10 -04:00
dd 471b07396d now applying .floor() to getAvailBalance 2021-08-28 16:33:41 -04:00
Tyler Shipe d09b9a4283 add cummulative and step size orderbook toggle 2021-08-27 20:37:45 -04:00
Tyler Shipe 63e151f516 prevent useOrderbook from updating during market change
fixes white screen error
2021-08-27 20:15:25 -04:00
Tyler Shipe 2ecd1b2122 perp market close position button 2021-08-26 11:58:13 -04:00
saml33 f6ad6fbc56 update close position modal button text 2021-08-26 11:08:21 -04:00
saml33 04904203b0 add market close 2021-08-26 11:08:21 -04:00
Tyler Shipe 0e7a83fc36 simplify market select component 2021-08-25 18:22:40 -04:00
Tyler Shipe 18d0a08d6c disable trade button if no mango account 2021-08-25 17:57:01 -04:00
Tyler Shipe 052567de21 disable trade button if mangoAccount doesn't exist 2021-08-25 17:48:35 -04:00
Tyler Shipe fdc3e75c78 market header now uses serum-history data for high, low, open, close 2021-08-25 17:39:48 -04:00
Tyler Shipe 161882738b hide day range until perp range is available 2021-08-25 17:23:11 -04:00
Tyler Shipe 639f36bd99 revert new account modal on first deposit 2021-08-25 17:20:59 -04:00
Tyler Shipe 44e0d8ad21 make it more obvious when opening new position with slider 2021-08-25 17:07:25 -04:00
Tyler Shipe 01796922c8 close accounts list after creating first account 2021-08-25 15:05:18 -04:00
Tyler Shipe ecbe76a2f4 alpha modal with emoji 2021-08-25 14:55:31 -04:00
Tyler Shipe 5b413a9089 update alpha modal 2021-08-25 14:49:04 -04:00
Tyler Shipe 8ac108ce35 update alpha modal 2021-08-25 14:47:57 -04:00
Tyler Shipe f8c14d193d Merge remote-tracking branch 'origin/name-account-first-deposit' into main 2021-08-25 13:52:00 -04:00
Tyler Shipe 3c6638357b show funding rate even when its 0 2021-08-25 13:43:17 -04:00
Tyler Shipe dd20e6223d fix stats api params 2021-08-25 13:40:32 -04:00
Tyler Shipe 66bf66fc7c remove unused utils fns 2021-08-25 10:23:30 -04:00
saml33 383a82e2d0 use new account modal for first deposit 2021-08-25 23:56:52 +10:00
saml33 2a1b8f59ea disable withdraw button when no account 2021-08-25 20:54:39 +10:00
Tyler Shipe b1215906a9 add more precision to trading view chart 2021-08-24 19:22:20 -04:00
Tyler Shipe b61e0b2f13 use latest client 2021-08-24 17:17:01 -04:00
Tyler Shipe d9019b961a reduce margin in trade form; remove leverage text from slider 2021-08-24 16:40:43 -04:00
Tyler Shipe f08e323e6c remove console logs 2021-08-24 16:01:43 -04:00
Tyler Shipe d51f4419ba clean up notification console logs 2021-08-24 15:43:34 -04:00
Tyler Shipe f46a7cec4b dont validate account name 2021-08-24 14:34:54 -04:00
Tyler Shipe 1c0962031b add notification when sol balance is low and when connecting wallet; disable connect button until walletadapter is loaded 2021-08-24 12:28:25 -04:00
Tyler Shipe d39e52de76 fix NaN under slider on perp side 2021-08-24 10:30:15 -04:00
Tyler Shipe 325b6c2424 fix the max withdraw modal to use client fn 2021-08-24 10:15:12 -04:00
saml33 e6c1cfca08 balance rounding in balances panel 2021-08-24 20:09:42 +10:00
saml33 072f450f18 remove rounding from balances on account page 2021-08-24 16:44:58 +10:00
Tyler Shipe 72eda925c1 use event-history-api for spot trades 2021-08-23 18:37:48 -04:00
Tyler Shipe 251b0a1d8d use the correct pk to get the perpmarket 2021-08-23 18:19:20 -04:00
Tyler Shipe 3f1e91399e add stat totals 2021-08-23 17:09:16 -04:00
Tyler Shipe 9c75a0dbd2 add available balance tooltip; update client for market margin available fix 2021-08-23 15:46:29 -04:00
Tyler Shipe de052ace29 add collateral available and market margin available 2021-08-23 15:35:59 -04:00
Tyler Shipe 1e45e2cc03 use maxWithBorrows amount if maxWithoutBorrows is greater 2021-08-23 14:36:02 -04:00
Tyler Shipe 1bbdc2a12e remove total asset and total liabs vals 2021-08-23 14:21:23 -04:00
Tyler Shipe 5e51ac46c3 add leverage to acct modal; fix rounding in withdraw modal 2021-08-23 14:18:34 -04:00
Tyler Shipe 3c47775de9 only clear current market if it's for a different market then whatsin the store 2021-08-23 14:04:18 -04:00
Tyler Shipe fbd6eeda3b use loaded perp market to display open interest 2021-08-23 13:58:37 -04:00
Tyler Shipe a7b5c8a96a more tweaks to improve orderbook websocket 2021-08-23 13:21:20 -04:00
Tyler Shipe b3cc717c86 use context slot to sync orderbook updates 2021-08-23 13:12:48 -04:00
saml33 246ac3d385 account page tweaks 2021-08-24 00:14:03 +10:00
saml33 945f8a1a90 add orders/position count 2021-08-22 22:45:10 +10:00
saml33 12db262794 remove extra 0 from orderbook price/size 2021-08-22 14:03:43 +10:00
saml33 287b71a476 remove rounding from orderbook markprice 2021-08-22 13:56:48 +10:00
saml33 a4da1f6272 use balance instead of deposits/borrows 2021-08-22 12:59:54 +10:00
saml33 b8a5b06ef2 market header loaders 2021-08-21 23:02:51 +10:00
saml33 af8db468bf fix position panel padding 2021-08-21 22:11:14 +10:00
saml33 5cc4719ef8 fix panel layout 2021-08-21 11:42:59 +10:00
saml33 978f72a381 remove double % on health ratio 2021-08-21 08:11:19 +10:00
dd 1b5cac89a1 fixed getPnl and settlePnl functions and updated client 2021-08-20 16:39:44 -04:00
Maximilian Schneider 40bb8ec7e5 reduce health ratio overflow 2021-08-20 17:42:50 +02:00
Maximilian Schneider e7ff1b7234 re-enable connect wallet button 2021-08-20 17:42:50 +02:00
dd 41022ac45b Fixed funding rate display issue; can be improved once stats server fixed 2021-08-20 11:01:18 -04:00
Maximilian Schneider 62c578d28d correctly set max lev 2021-08-20 15:41:43 +02:00
Maximilian Schneider e7557e3101 fix issue on account load 2021-08-20 15:37:49 +02:00
Maximilian Schneider 739d805310 add max button to leverage slider 2021-08-20 15:34:04 +02:00
Maximilian Schneider e68d128d8f add available margin & leverage slider 2021-08-20 15:34:04 +02:00
Maximilian Schneider 2ed82f222b refactor for clarity 2021-08-20 15:34:04 +02:00
saml33 51741bc9a3 loading states for connect wallet 2021-08-20 23:17:02 +10:00
saml33 cbd0e0b934 fill trade size from position size 2021-08-20 21:51:29 +10:00
Maximilian Schneider f59a9fed73 remove broken total borrows display 2021-08-20 12:07:51 +02:00
Maximilian Schneider b0d4b9353a display recent trades 2021-08-20 04:47:25 +02:00
Maximilian Schneider 665b824fa4 enable perp trading view 2021-08-20 04:20:36 +02:00
Tyler Shipe 56d9eb00ab fix perp position table 2021-08-19 20:14:04 -04:00
Tyler Shipe 8103a3cc85 disable leverage slider 2021-08-19 17:46:31 -04:00
saml33 afaa6b85ec consolidate new account flow to one step 2021-08-19 16:15:25 +10:00
Tyler Shipe 56b590589e fix new sub account modal 2021-08-18 21:05:16 -04:00
Tyler Shipe 2036b77de3 pass in decimal count to leverage slider 2021-08-18 20:37:50 -04:00
Tyler Shipe 1c64a8a252 show position closing in leverage slider 2021-08-18 20:33:45 -04:00
Tyler Shipe 8b310acc9b rename marginDeposits to deposits 2021-08-18 16:43:51 -04:00
Tyler Shipe 9bfa880be0 add padding to slider 2021-08-18 16:31:22 -04:00
Tyler Shipe 27760cd7c3 tweak slider styling 2021-08-18 16:29:39 -04:00
Tyler Shipe 0af7a8b8ee more trade form improvements 2021-08-18 16:15:17 -04:00
Tyler Shipe 86ea7afcff add leverage slider 2021-08-18 14:23:12 -04:00
Tyler Shipe 2105827769 reduce sleep after placing a trade 2021-08-18 11:01:42 -04:00
Tyler Shipe c0ec5655a3 fix taker fee in trade form 2021-08-18 10:33:03 -04:00
Tyler Shipe c598f79a4a remove fee tab; set trade form price on page load 2021-08-18 10:24:29 -04:00
saml33 abe87fba96 switch perp/spot order in menu 2021-08-18 22:55:04 +10:00
Tyler Shipe b3424df63e fix account naming when new sub account 2021-08-17 17:52:53 -04:00
Tyler Shipe deda8e58d6 position display tweaks 2021-08-17 17:01:00 -04:00
Tyler Shipe a7fc2c6c4d refactor 2021-08-17 16:50:16 -04:00
Tyler Shipe f7aa5b6bed fix lint errors 2021-08-17 16:48:42 -04:00
dd 800bea3306 added in self cranking for perp orders 2021-08-17 16:36:31 -04:00
Tyler Shipe 5c44d1fd34 fix when creating new mango accoung 2021-08-17 16:09:27 -04:00
Tyler Shipe dd074685e3 fix max withdraw with no borrows 2021-08-17 15:52:33 -04:00
Tyler Shipe 46d909ef6d add market fees to trade form box 2021-08-17 15:37:07 -04:00
Tyler Shipe 7d02331953 fetch mango account state if place trade fails 2021-08-17 14:05:25 -04:00
Tyler Shipe 65494917c1 add back account naming; await root bank loading 2021-08-17 13:47:52 -04:00
Tyler Shipe b8c203de74 move deposit withdraw button higher 2021-08-17 13:32:12 -04:00
Tyler Shipe afb09d828b add srm dex fee discount table 2021-08-17 13:14:39 -04:00
Tyler Shipe 8da8d0d973 handle when mango group isn't loaded 2021-08-17 11:10:32 -04:00
Tyler Shipe 6d5dbd8265 high side bade if no perp position 2021-08-16 18:40:56 -04:00
Tyler Shipe 17d73fc3cf more frequent mango acct updates 2021-08-16 18:10:06 -04:00
Tyler Shipe f44acbab27 handle large health ratio number 2021-08-16 17:35:40 -04:00
Tyler Shipe 1917ba41c7 reuse tooltip for settle pnl 2021-08-16 17:35:16 -04:00
Tyler Shipe 55aa3782c2 open Learn link in new tab 2021-08-16 17:34:43 -04:00
Tyler Shipe d3839c7268 open Learn link in new tab 2021-08-16 14:20:19 -04:00
Tyler Shipe 4431da772b add price to market select 2021-08-16 14:00:04 -04:00
Tyler Shipe 7cf80b566c remove blur from modals 2021-08-16 13:59:44 -04:00
Tyler Shipe 00a85cded2 Merge in styling changes 2021-08-16 13:00:43 -04:00
saml33 d7692f88cf move buttons to margininfo panel 2021-08-16 23:31:25 +10:00
Tyler Shipe 5d8bf9969e Finish max withdrawal simulation 2021-08-15 18:36:06 -04:00
Tyler Shipe 9c1f8edf20 rename positions table; fix rounding issues 2021-08-15 13:06:52 -04:00
saml33 df6e97763a format usd values and small ui fixes 2021-08-15 23:31:59 +10:00
Tyler Shipe 935cd46345 exclude perp liqs from trade history table 2021-08-14 19:24:55 -04:00
Tyler Shipe 99a6184cb1 add leverage 2021-08-14 17:14:43 -04:00
Tyler Shipe 5f5c703c5d wire up positions box 2021-08-14 16:05:31 -04:00
Tyler Shipe d4927731ee add breakeven and avg open price 2021-08-14 14:16:15 -04:00
saml33 4f4cd77c2d fix range percentage calc 2021-08-14 20:26:54 +10:00
Tyler Shipe 2e83ad6805 tweak page container width 2021-08-13 18:14:44 -04:00