vegaprotocol / frontend-monorepo

Toolkit for building apps that interact with Vega
https://vega.xyz
MIT License
24 stars 14 forks source link

Confirm closing position and orders from positions table #6658

Open barnabee opened 1 month ago

barnabee commented 1 month ago

Description

Suggestion to add a popup/modal to the "close position" button to allow a user to confirm closing their position when they click the [ × ] button on the position table, and to select whether to also cancel their active orders.

This was requested by a user on Discord or the forums a little while back (I forget which) and is especially needed where auto confirm is enabled in the wallet so there's literally no confirmation before the txn is sent.

Also, while using the front end myself I've found that probably >50% of the time I want to close the position but keep any open orders, and other times I want to cancel the orders too, hence the suggestion to combine the confirmation with deciding whether orders should be cancelled too.

I've suggested two different ways a modal/popover could look below.

Example modal layout

e.g.


                                 Confirm closing position on BTC/USDT.PERP

                 [ Cancel ]       [ Close position only ]       [ Close position and orders ] 

OR


                                   Confirm closing position on BTC/USDT.PERP

                                      [ x ] Also close all active orders

                                [ Cancel ]       [ Close position [and orders] ] 

Acceptance Criteria

JonRay15 commented 1 month ago

Go with option 1

Lets use the TP / SL popup shown, and lets fire off the normal toasts.

image