Closed DanDanielD closed 2 months ago
Based on the assumptions regarding the market and target audience discussed during our Zoom call, the current market logic is functioning as intended.
During our discussion, we also identified two additional related issues that will be addressed through separate tickets:
1) Wallet balance depletion: funds are being drained from the Wallet Balance and not being returned, preventing further position opening. 2) Initial Margin visibility: upon order placement, Initial Margin is deducted from Wallet Balance but not reflected in Market Deposit or anywhere else until the order fills. This lack of visibility can create confusion and an illusion of a funds discrepancy.
Thank you, @Klapeyron, for the fruitful conversation on this topic.
Description: Users are currently able to submit orders with a cost higher than the current market deposit. For example, users can have a 1000 USD market deposit and place an order with a cost of 1600 USD. This order, when matched will create position and creates change in Market Deposit.
Steps to Reproduce:
Expected behaviour: It's an industry standard that when typing a required amount of contracts, and its cost exceeds the available balance (Market Deposit in this cas), the platform should disable the Buy/Sell buttons (including the Place Order button). If the user enters a number of units resulting in an Order Cost higher than the Market Deposit, the user should be notified, for example, by the text color in the UNIT field changing to red.
Additional Information: When an invalid order, one that exceeds the Market Deposit, is matched, the Market Deposit value increases automatically.
A screenshot illustrating the Tesla market with a deposit of 1000 USD, sourced from a wallet with a balance of 20,000 USD. The calculations between Wallet Balance, Total Deposits, and Market Deposit are correct.![image](https://github.com/bigshortbets/market-frontend/assets/106878771/bfec761d-6fd1-4a56-aa76-d700019f5ece)
Screenshot displaying an order with a cost exceeding the current Market Deposit, placed in the order book. The Wallet Balance, Total Deposits, and Market Deposit amounts have changed and the calculations between them are incorrect.![image](https://github.com/bigshortbets/market-frontend/assets/106878771/7583c200-325e-4056-a041-fe4bd75321dd)
Orders have been matched, and positions have been created. Wallet Balance, Total Deposits, and Market Deposit amounts have changed.![image](https://github.com/bigshortbets/market-frontend/assets/106878771/4fceded5-963f-4c0c-9101-603ef6353137)