Power-Trade / api-docs

0 stars 1 forks source link

Calculation of Account Health has gaps, display could be improved [Web] #18

Open laisee opened 4 months ago

laisee commented 4 months ago

On Web site I can enter an AVAX perpetual trade order. When I change the order quantity shows different values for Account Health after trade execution.

Enter order qty for 10, see health is "88%"

Screenshot 2024-02-13 at 11 21 45 am

Enter order qty for 100, see health is "100%"

Screenshot 2024-02-13 at 11 22 04 am

Enter order qty for 80, see health is "11%"

Screenshot 2024-02-13 at 11 22 55 am

Enter order qty for 90, see health is "0%"

Screenshot 2024-02-13 at 11 23 24 am

Also, the margin balance is not being recalculated - depending on the order quantity entered.

klugjo commented 4 months ago

Enter order qty for 100, see health is "100%"

This is a "known" limitation of the system. If the order were to blow up your account, the system is incapable of calculating the margin available. cc @kernelbee

Also, the margin balance is not being recalculated - depending on the order quantity entered.

@laisee can you give me more details on what that means ? I am not too sure what that means, thanks

laisee commented 4 months ago

here are some screen shots taken from prod web UI

ADA Perpetual with order qty 10 - health @ 98%, margin is non-zero

Screenshot 2024-02-14 at 3 33 01 pm

ADA Perpetual with order qty 100 - health @ 97%, margin is non-zero

Screenshot 2024-02-14 at 3 33 10 pm

ADA Perpetual with order qty 1000 - health @ 83%, margin is non-zero

Screenshot 2024-02-14 at 3 33 26 pm

ADA Perpetual with order qty 10000 - health now back @ 98% margin value at zero

Screenshot 2024-02-14 at 3 33 36 pm

reduce order quantity to 1000 and health / margin both recalculated to previous values

Screenshot 2024-02-14 at 3 34 20 pm
klugjo commented 4 months ago

Thanks @laisee so no issue on the web app.

Only issue here is that system limitation around calculating margin and account health when the result would liquidate the account.

This is a known bug

laisee commented 4 months ago

If the order size will cause liquidation should it not show new account health as 0? As a trader I'd prefer to see visible clues and even a warning that my trade is beyond account limits. Another option is to use a slider with 25/50.75/100 percentage of available account collateral that can be applied to a trade.

On Wed, 14 Feb 2024 at 15:44, Klughertz Jonathan @.***> wrote:

Thanks @laisee https://github.com/laisee so no issue on the web app.

Only issue here is that system limitation around calculating margin and account health when the result would liquidate the account.

This is a known bug

— Reply to this email directly, view it on GitHub https://github.com/Power-Trade/api-docs/issues/18#issuecomment-1943230190, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNBV2ULXUZSADLA2ZPHYXDYTRTMRAVCNFSM6AAAAABDFZGUMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBTGIZTAMJZGA . You are receiving this because you were mentioned.Message ID: @.***>

klugjo commented 4 months ago

I agree with you, unfortunately it is an API limitation that prevents us from doing that (instead of telling us that the account would blow up, it tells us nothing, making it undistinguishable from a "no margin usage for the trade" scenario). Hopefully a fix will be available soon

laisee commented 4 months ago

Understand - can change this issue to "Improvement in Account Health calculation & display". Then leave it open till API allows improvement. How does that sound?

klugjo commented 4 months ago

sounds good thanks

laisee commented 4 months ago

Closing until the issue can be resolved with Vendor through API updates etc

laisee commented 2 months ago

re-opening as issue still seen in test and prod version of system.

klugjo commented 1 month ago

@laisee this has been improved:

In case there is not enough margin you get this message:

image

We are still unable to compute exactly how much margin you would need when you don't have enough but at least you get notified that the order would not go through.

For cases where there are enough funds to cover margin, correct number is displayed:

image