Skip to content

Commit 37eb402

Browse files
authored
feat: perp whole (#3269)
* feat: base perps and name space * feat: add close position and edit marin tp sl modal * feat: toast show center & liq.price update * fix: update deposit amount limit * fix: revert no use change in swap * fix: update margin and edit tp sl tag * feat: update edit tp sl tag and init value * fix: loading skeleton in perp * fix: some ui update * fix: singe coin hover hot area and tp sl price * fix: loading center in perp home and text * feat: perps slider update when price change * fix: update ui
1 parent 37bedc4 commit 37eb402

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3395
-1324
lines changed

_raw/locales/en/messages.json

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,14 @@
764764
"deposit": "Deposit",
765765
"withdraw": "Withdraw",
766766
"positions": "Positions",
767+
"closeAll": "Close All",
768+
"closeAllPopup": {
769+
"title": "Confirm Close All Positions",
770+
"description": "All your open positions will be closed at market price."
771+
},
767772
"toast": {
768-
"setAutoCloseSuccess": "Auto close position set successfully",
773+
"takeProfitSuccess": "Take profit set successfully",
774+
"stopLossSuccess": "Stop loss set successfully",
769775
"closePositionSuccess": "Closed {{direction}} {{coin}}-USD: Size {{size}} at Price ${{price}}",
770776
"openPositionSuccess": "Opened {{direction}} {{coin}}-USD: Size {{size}} at Price ${{price}}"
771777
},
@@ -859,6 +865,7 @@
859865
"lastUsed": "Last used",
860866
"selectTokenToDeposit": "Select Token to Deposit",
861867
"tradePerps": "Trade Perps",
868+
"position": "Position",
862869
"yourPosition": "Your Position",
863870
"pnl": "PNL",
864871
"size": "Size",
@@ -927,6 +934,115 @@
927934
"hyperliquidBalance": "Perps Balance",
928935
"notActivatedAddress": "Not Activated",
929936
"noPosition": "No Position"
937+
},
938+
"riskLevel": {
939+
"title": "Risk Level",
940+
"subTitle": "Real-time liquidation distance (%)",
941+
"liquidationDistance": "Liquidation Distance",
942+
"currentPrice": "Current Price",
943+
"liquidationPrice": "Liquidation Price",
944+
"liquidationDistanceTips": "Liquidation Distance (%) shows how far the current price is from your liquidation price. A larger distance indicates a safer position, while a smaller distance means higher liquidation risk.",
945+
"danger": {
946+
"title": "Danger",
947+
"description": "Your position is at high risk of liquidation. The distance to liquidation price is ≤3%. Consider adding margin or closing your position to avoid liquidation."
948+
},
949+
"warning": {
950+
"title": "Warning",
951+
"description": "Your position is approaching liquidation risk. The distance to liquidation price is between 3% and 8%. Monitor your position carefully and consider adding margin."
952+
},
953+
"safe": {
954+
"title": "Safe",
955+
"description": "Your position is at a safe level. The distance to liquidation price is >8%. Continue to monitor market conditions."
956+
},
957+
"gotIt": "Got it"
958+
},
959+
"searchPerpsPopup": {
960+
"openPosition": "Open Position",
961+
"searchPerps": "Search Perps",
962+
"onePosition": "1 Position",
963+
"searchPosition": "Search position",
964+
"searchPlaceholder": "Search perps",
965+
"empty": "No markets found",
966+
"hasPosition": "Position"
967+
}
968+
},
969+
"perpsDetail": {
970+
"PerpsOpenPositionPopup": {
971+
"newPosition": "Open Position",
972+
"margin": "Margin",
973+
"long": "Long",
974+
"short": "Short",
975+
"available": "Available",
976+
"leverage": "Leverage",
977+
"size": "Size",
978+
"sizeTips": "The total value or quantity of your trade, set by margin and leverage.",
979+
"takeProfitWhenPriceAbove": "Take Profit When Price Above",
980+
"takeProfitWhenPriceBelow": "Take Profit When Price Below",
981+
"stopLossWhenPriceAbove": "Stop Loss When Price Above",
982+
"stopLossWhenPriceBelow": "Stop Loss When Price Below",
983+
"invalidNumber": "Invalid number",
984+
"insufficientBalance": "Insufficient balance",
985+
"free": "Free",
986+
"rabbyFee": "Rabby Fee",
987+
"providerFee": "Hyperliquid Fee",
988+
"minimumOrderSize": "The minimum order size is $10",
989+
"maximumOrderSize": "The maximum order size is {{amount}}"
990+
},
991+
"PerpsEditMarginPopup": {
992+
"margin": "Margin",
993+
"title": "Adjust Margin",
994+
"addMargin": "Add Margin",
995+
"reduceMargin": "Reduce Margin",
996+
"currentPrice": "Current Price",
997+
"amountToAdd": "Amount to Add",
998+
"amountToReduce": "Amount to Reduce",
999+
"perpsBalance": "Perps Balance",
1000+
"available": "Available",
1001+
"liqPrice": "Liq. Price:",
1002+
"reduceMarginTooltip": "Insufficient margin to reduce position.",
1003+
"confirm": "Confirm",
1004+
"insufficientBalance": "Insufficient balance",
1005+
"exceedMaxReduction": "Exceeds maximum reduction",
1006+
"addMarginSuccess": "Margin added successfully",
1007+
"reduceMarginSuccess": "Margin reduced successfully"
1008+
},
1009+
"PerpsClosePositionPopup": {
1010+
"title": "Close Position",
1011+
"amount": "Amount",
1012+
"total": "Total",
1013+
"minimumWarning": "Minimum close amount is {{percent}}%",
1014+
"receive": "Receive",
1015+
"closedPnl": "Closed PNL",
1016+
"fee": "Fee",
1017+
"confirm": "Confirm"
1018+
},
1019+
"PerpsAutoCloseModal": {
1020+
"title": "Auto Close Position",
1021+
"takeProfitWhen": "Take Profit When",
1022+
"takeProfitWhenPriceAbove": "Take Profit When Price Above",
1023+
"takeProfitWhenPriceBelow": "Take Profit When Price Below",
1024+
"stopLossWhen": "Stop Loss When",
1025+
"stopLossWhenPriceAbove": "Stop Loss When Price Above",
1026+
"stopLossWhenPriceBelow": "Stop Loss When Price Below",
1027+
"currentPrice": "Current Price: ",
1028+
"EntryAndCurrentPrice": "Entry: ${{entryPrice}} Current: ${{currentPrice}}",
1029+
"priceAbove": "Price above",
1030+
"priceBelow": "Price below",
1031+
"youGain": "You gain",
1032+
"youLoss": "You lose",
1033+
"takeProfitExpectedPNL": "Take Profit Expected PNL",
1034+
"stopLossExpectedPNL": "Stop Loss Expected PNL",
1035+
"confirm": "Confirm",
1036+
"takeProfit": "Take Profit",
1037+
"stopLoss": "Stop Loss",
1038+
"noPosition": "You must input margin first",
1039+
"takeProfitTipsLong": "Take profit price must be higher than current price",
1040+
"takeProfitTipsShort": "Take profit price must be lower than current price",
1041+
"stopLossTipsLong": "Stop loss price must be lower than current price",
1042+
"stopLossTipsShort": "Stop loss price must be higher than current price",
1043+
"stopLossTipsLongLiquidation": "Price is lower than the liq.price ({{price}})",
1044+
"stopLossTipsShortLiquidation": "Price is higher than the liq.price ({{price}})",
1045+
"cancel": "Cancel"
9301046
}
9311047
},
9321048
"sendPoly": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@rabby-wallet/eth-walletconnect-keyring": "2.1.7",
6464
"@rabby-wallet/eth-watch-keyring": "1.0.0",
6565
"@rabby-wallet/gnosis-sdk": "1.4.5",
66-
"@rabby-wallet/hyperliquid-sdk": "1.0.9",
66+
"@rabby-wallet/hyperliquid-sdk": "1.0.10",
6767
"@rabby-wallet/page-provider": "0.4.10",
6868
"@rabby-wallet/rabby-action": "0.1.14",
6969
"@rabby-wallet/rabby-api": "0.9.47",
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/ui/assets/perps/IconEditCC.svg

Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

src/ui/assets/perps/IconSpin.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)