Commit Graph

316 Commits

Author SHA1 Message Date
Tyler Shipe 855a6e6d58 add ws watching for mangoAccount 2021-12-05 20:13:23 -05:00
dd 60b2c4b92d updated MarketClose to have maxSlippage at 2.5% 2021-12-03 00:15:03 -05:00
dd 588ae8dd18 Looks like max slippage on perp Market orders is working 2021-12-02 21:38:44 -05:00
dd f248ab7805 Added code for maxSlippage and removal of market order type; Changed mark price to just be book mid. 2021-12-02 17:33:35 -05:00
Tyler Shipe 84233b2a56 improve rerender when cancelling orders for a market other than the one selected 2021-11-30 18:35:49 -05:00
Tyler Shipe 2d824c2213 add lastUpdatedAt to improve useMangoAccount rerendering trigger 2021-11-30 16:04:55 -05:00
Tyler Shipe 4eb7cd3934 forceReload components when mango account is updated in store 2021-11-30 12:32:14 -05:00
Riordan Panayides 2f6ceef7a9 Revert UK IP block 2021-11-23 13:36:48 +00:00
Denmark 36f6585b6a
add bitpie wallet (#86) 2021-11-23 13:25:31 +01:00
Riordan Panayides edac2473fc Allow UK spot trading 2021-11-22 23:54:51 +00:00
Riordan Panayides dd6ea25527
Block UK users :( 2021-11-22 22:48:44 +00:00
Tyler Shipe 6ed230d900 add deposit and withdraw history to account page 2021-11-17 15:51:17 +00:00
Tyler Shipe a1e0e82990 reconnect to phantom on each page change 2021-11-15 18:27:57 +00:00
Tyler Shipe af88a1486d support solflare extension 2021-11-14 18:58:30 +00:00
Tyler Shipe 010be224e0 remove console logs 2021-11-14 18:57:00 +00:00
saml33 d216ec1f1a add solflare 2021-11-10 22:46:54 +11:00
saml33 859432fdb2 fix: match oracle and markprice decimals to tick size 2021-11-02 20:43:28 +11:00
Tyler Shipe cb462eb47a fix: error when hourly interest is undefined 2021-11-01 11:14:43 -04:00
Tyler Shipe 6b28aa3666 Merge branch 'hourly-stats-tables' into main 2021-10-27 12:44:09 -04:00
Tyler Shipe 97250b8c74 immediately refresh order book when switching markets 2021-10-27 11:53:07 -04:00
Tyler Shipe 3da0b240f5 add paginated tables for account interest and funding 2021-10-25 15:21:54 -04:00
Tyler Shipe eecf9a919d move useOrderbook login into useHydrateStore to reduce rerenders 2021-10-21 15:45:13 -04:00
rjpeterson bf679598bb
Add next-i18next translation framework & Traditional and Simplified Chinese UI Translations (#54)
* start english localization

* fix typo

* add to english localization

* add some zh translations, fix discrepencies in en

* add more chinese translations

* finish trad chinese translations

* add simplified folder, add locales.json with meta info, add latest ui updates in english

* add latest ui changes for chinese-trad and sort

* fix typo

* convert trad to simp

* Update common.json

* add review changes by @HZ2078

* fix typos

* add latest ui changes

* new ui change & trad-simp convert

* delete monospace from locales.json

* add next-i18next translation framework. Add translations up to #103

* replace more html with traslate tags

* lint & add more phrases

* add missing translations

* add language select dropdown

* add new update transltations

* add latest gui update translations

* add useTranslation to lang switch

* sort common.json, add lang descriptions

* update netlify config to support i18n

* make translations more consistent

Co-authored-by: Hz2078 <92381714+HZ2078@users.noreply.github.com>
Co-authored-by: Tyler Shipe <tjshipe@gmail.com>
2021-10-20 13:42:40 +01:00
Tyler Shipe c53c35b2e4 fix: handle when no funding stats exist for acct 2021-10-18 18:00:47 -04:00
Tyler Shipe e049456edd MSRM deposit and withdraw 2021-10-18 16:38:03 -04:00
Tyler Shipe 3b65fed87d fix: format decimals for perp trigger orders 2021-10-12 16:59:21 -04:00
Maximilian Schneider 93abdab9f6 Merge remote-tracking branch 'origin/main' into max/stoploss 2021-10-05 23:02:01 +02:00
Maximilian Schneider 97bb02e593
show unsettled pnl (#46)
* display unsettled pnl more dominantly (#43)

* display perp markets that have unsettled pnl

* fix dependencies to a working version

* add back unrealized pnl vs unsettled pnl

* add todo

* settle all

* cleanup

* catch error

* fix crash in market position & refactor

* bugfixes

* correct unrealized pnl
* remove unsetlled pnl from table
* only show unsettled balances after closing position
2021-10-05 22:22:47 +02:00
Maximilian Schneider eb2568672c fix fee calc & respect reduceOnly 2021-10-01 18:21:09 +02:00
Tyler Shipe 7feb881bb3 rename fetchMangoAccounts to fetchAllMangoAccounts; prefer reloadMangoAccount over fetchAllMangoAccounts 2021-09-29 18:09:58 -04:00
Maximilian Schneider 724bb77ef4 fetch open orders on wallet connect 2021-09-23 22:52:16 +02:00
Maximilian Schneider d310e0b66f [wip] visualize & cancel trigger order and fuck up order reloading 😭 2021-09-23 13:50:34 +02:00
Maximilian Schneider 5da4887736 add slope wallet 2021-09-21 12:08:28 +02:00
saml33 9123e63344
Trade page mobile (#35)
* mobile styles for chart, position, account

* mobile styles for trade form

* trade page mobile styles

* tab layout

* fix unknown property fill-rule

* test swipeable tabs

* fix container height

* fix orderbook mobile styles

* account page mobile styles

* fix swipeable container height

* stats page mobile styles
2021-09-20 02:36:02 +02:00
Tyler Shipe efe7990056 update useEffect dependencies 2021-09-14 14:09:33 -04:00
Tyler Shipe c1269298b9 use custom endpoint url 2021-09-13 17:14:59 -04:00
Tyler Shipe 13a48cd2dc use cloudflare worker in ipAddress hook 2021-09-10 16:10:22 -04:00
Tyler Shipe 732d854c36 add manual refresh to ui 2021-09-09 20:23:02 -04:00
Tyler Shipe 5bcec8dd69 change interval to refresh trade history 2021-09-08 14:08:54 -04:00
Tyler Shipe fa082d09bd change reload mango acct interval time 2021-09-08 13:52:52 -04:00
Tyler Shipe 33070aef91 reduce getProgramAccount calls 2021-09-07 19:31:02 -04:00
tjshipe 3c38928ffc
Merge pull request #24 from rjpeterson/orderbook-grouping
Orderbook grouping
2021-09-07 17:23:50 -04:00
Tyler Shipe 58737a9783 fewer getProgramAccount calls 2021-09-07 15:56:25 -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 c4707086ed Fix stats service URL 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 206cd98b46 change group sizes, increase orderbook entries to 40, fix bids display bug 2021-09-06 21:38:28 +08:00
saml33 6d15756581 add rates to balances table 2021-09-06 21:51:18 +10:00
saml33 50380107cf improve balances table 2021-09-05 16:50:16 -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 6cc64dda39 fix maker taker display 2021-09-03 21:59:10 -04:00
Tyler Shipe 1798cfa3e0 increase interval 2021-09-03 10:18:49 -04:00
Tyler Shipe 5b8f4dd155 change interval time and add position market name 2021-09-03 02:39:37 -04:00
Tyler Shipe 4f20fc6542 use client reloadMangoAccount 2021-08-31 13:47:03 -04:00
Tyler Shipe e0f2398dab remove old hooks 2021-08-29 20:37:31 -04:00
Tyler Shipe 009259c35f compare pks with .equals 2021-08-28 14:09:08 -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 38ab3f9914 refresh mango acct more frequently; add error notification on failure 2021-08-25 11:50:39 -04:00
Tyler Shipe 19a42b9c7c mark price decimal formatting 2021-08-25 10:44:06 -04:00
Tyler Shipe f92eb09ddb add account loading message 2021-08-24 15:45:59 -04:00
Tyler Shipe dbd831bca5 fix quote balance display 2021-08-24 15:16:40 -04:00
Tyler Shipe f268201e09 tweak decimal precision on stats 2021-08-24 13:04:43 -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 3f1e91399e add stat totals 2021-08-23 17:09:16 -04:00
Tyler Shipe de052ace29 add collateral available and market margin available 2021-08-23 15:35:59 -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
Tyler Shipe 99355dac38 use latest client to fix settle pnl 2021-08-23 11:21:26 -04:00
saml33 945f8a1a90 add orders/position count 2021-08-22 22:45:10 +10:00
saml33 a4da1f6272 use balance instead of deposits/borrows 2021-08-22 12:59:54 +10:00
Maximilian Schneider aa999f1a0f correctly trigger connected state 2021-08-20 11:53:44 +02:00
Tyler Shipe 8b310acc9b rename marginDeposits to deposits 2021-08-18 16:43:51 -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
Tyler Shipe 7790b7e062 run yarn format 2021-08-17 16:51:02 -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 46d909ef6d add market fees to trade form box 2021-08-17 15:37:07 -04:00
Tyler Shipe afb09d828b add srm dex fee discount table 2021-08-17 13:14:39 -04:00
Tyler Shipe 5ff5fb2914 use latest client 2021-08-16 20:05:57 -04:00
Tyler Shipe 17d73fc3cf more frequent mango acct updates 2021-08-16 18:10:06 -04: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
Tyler Shipe 654f9487c5 add trade history to account page 2021-08-13 16:02:12 -04:00
Tyler Shipe b2f6eece1c fetch perp trade history from db 2021-08-13 11:05:49 -04:00
Tyler Shipe 5154292e7d filter out fills if open orders account doesnt exist for mkt 2021-08-09 10:55:48 -04:00
Tyler Shipe 3dadee255a remove console logs, use latest client 2021-08-06 18:49:17 -04:00
Tyler Shipe f8ee52eb7f fix to show trade history even when spot open order acct doesnt exist 2021-08-06 18:35:10 -04:00
Tyler Shipe c5866ee610 make health ratio red if init health is at or below zero 2021-08-04 17:47:05 -04:00
Tyler Shipe 77716dc7ee fix account name 2021-08-04 14:51:17 -04:00
Tyler Shipe 52d98d28c2 flip side in trade history based on maker or taker 2021-08-04 13:15:28 -04:00
Tyler Shipe 85ed076fe0 sort trade history for perps 2021-08-04 12:46:14 -04:00
Tyler Shipe f6bafcc6f1 fix balances 2021-08-03 19:32:24 -04:00
Tyler Shipe 65eea96aa8 add fetchTradeHistory fn 2021-08-03 13:59:16 -04:00
Tyler Shipe 2e33486dbb use latest group 2021-07-28 19:03:21 -04:00
Tyler Shipe e20506bd66 fix top bar links 2021-07-27 11:41:33 -04:00
Tyler Shipe be031cc0fe consistency with user info tabs 2021-07-24 16:15:27 -04:00
Tyler Shipe d35304e84f hide perp positions table if none open 2021-07-24 14:29:24 -04:00
Tyler Shipe 267639dec5 update positions and history tables 2021-07-24 14:12:52 -04:00
Tyler Shipe f79bc1639f remove alerts from v3 2021-07-23 13:14:18 -04:00
Tyler Shipe 784c1c9d50 format stat numbers with commas 2021-07-21 17:47:10 -04:00
Tyler Shipe 2ed5d759ef more stats improvements 2021-07-21 17:31:28 -04:00
Tyler Shipe 05a46993ba add basic stats page 2021-07-21 17:26:18 -04:00
Tyler Shipe 562753f937 Merge branch 'main' into stats-page 2021-07-21 17:12:04 -04:00
Tyler Shipe 5c48d96775 don't try load market before group is loaded 2021-07-21 13:40:42 -04:00
Tyler Shipe f26ec2165c remove root bank rpc calls 2021-07-19 17:28:30 -04:00
Riordan Panayides 03349b7892 Merge remote-tracking branch 'origin/main' into stats-page 2021-07-13 14:46:09 +01:00
dd ca85a90b38 changed Balances interface for net; use toFixedUi 2021-07-08 10:16:39 -04:00
Tyler Shipe 0c82280855 fix trade history and refresh data bugs 2021-07-07 17:18:54 -04:00
Tyler Shipe c11890582d handle rounding errors 2021-07-07 16:38:04 -04:00
Tyler Shipe 6606dc1bff update tradeForm 2021-07-07 13:27:11 -04:00
Tyler Shipe 53163e07a8 add more account values 2021-07-07 00:34:21 -04:00
Tyler Shipe 54b6230314 fill in account asset values 2021-07-06 20:13:17 -04:00
Tyler Shipe a0ba6f44e8 update notifications, wire up account change modal 2021-07-06 18:04:20 -04:00
Tyler Shipe c355f7132e add Borrows page and health ratio 2021-07-05 11:03:57 -04:00
Riordan Panayides aea7b84b21 WIP stats page, market header oracle price 2021-07-03 02:18:57 +01:00
Tyler Shipe 671e50eba0 wip: max borrow calculations 2021-07-01 13:35:47 -04:00
Tyler Shipe 619295d2e0 parsed trade history for perps 2021-06-24 16:57:11 -04:00
Tyler Shipe 25d41f2f58 display unparsed perp history 2021-06-24 12:30:45 -04:00
Tyler Shipe 84692e4cd2 remove console.logs 2021-06-23 16:18:00 -04:00
Tyler Shipe cb44650367 connect perp market to websocket for orderbook 2021-06-23 15:09:19 -04:00
Tyler Shipe 1b02a53314 update naming to match client 2021-06-23 11:32:33 -04:00
Tyler Shipe 0d64771bc2 show spot balances 2021-06-22 23:32:10 -04:00
Tyler Shipe 2a1e13a1b0 show current market event queue fills 2021-06-21 15:02:12 -04:00
Tyler Shipe c4ccc37110 more errors 2021-06-20 23:22:45 -04:00
Tyler Shipe 8d4dabb6d0 add spot trade history fills and raw health score 2021-06-20 15:11:36 -04:00
Maximilian Schneider 107c2e8ed3 add cancel perp order call and remove unused imports 2021-06-19 00:26:47 -04:00
Maximilian Schneider 2c487348f6 open orders are kinda adapted 2021-06-18 23:07:57 -04:00
Tyler Shipe 3f3ffb1a37 spot market orderbook on websockets 2021-06-18 19:57:02 -04:00
Maximilian Schneider eb42f877fd fix perp order book render 2021-06-18 19:19:17 -04:00
Maximilian Schneider 08a6a8dfdf one more 2021-06-18 18:59:00 -04:00
Maximilian Schneider e256ed4754 small fixes 2021-06-18 18:57:13 -04:00
Maximilian Schneider dcbb37fbb7 simple json stuff 2021-06-18 18:51:34 -04:00
Tyler Shipe 054cc5c82e remove console logs and fetch all markets 2021-06-18 18:38:09 -04:00
Tyler Shipe d3af1ac5b1 show open orders and wire up cancel order 2021-06-18 16:46:20 -04:00
Maximilian Schneider 60665d19fe cleanup orderbook types 2021-06-18 11:29:52 -04:00
Tyler Shipe 3df663614a use imported mangoClient in trade form; display userInfo component 2021-06-18 11:17:49 -04:00
saml33 b2fd941223 update prices endpoint url 2021-06-18 13:43:49 +10:00
Tyler Shipe a16608c95d implement deposit 2021-06-17 18:39:16 -04:00
Maximilian Schneider 12b69398d2 make bids & asks invariant between perp & spot, also reenable trade form 2021-06-17 18:37:03 -04:00
Maximilian Schneider 4d3dae3b1a load order books both from perp & spot 2021-06-17 17:07:10 -04:00
Tyler Shipe c6dab39463 add interest rates 2021-06-17 14:40:44 -04:00
Maximilian Schneider 275fafa4c4 refactor deposit modal 2021-06-17 14:03:47 -04:00
Maximilian Schneider 8aed0f0840 expose market config in store and switch between spot & perp 2021-06-17 01:38:49 -04:00
Tyler Shipe cb331fb2c7 comment out stuff in the ui so it works 2021-06-16 21:50:16 -04:00
Maximilian Schneider 6c4507cfc6 fix lint errors 2021-06-16 12:17:51 -04:00