Skip to content

In the HandleOpenEstimation function, there is a problem with the logic processing. #1206

@icehawk-hyb

Description

@icehawk-hyb

Description:
In the HandleOpenEstimation function, there is a problem with the logic processing.
The TakeProfitPrice variable is used first and then assigned, resulting in the values ​​calculated by CalcMTPTakeProfitCustody and CalcMTPTakeProfitLiability being always 0.

Code logic:

Image

Image

suggestion:Assign value before use
1、mtp.TakeProfitPrice = req.TakeProfitPrice
2、mtp.TakeProfitCustody = types.CalcMTPTakeProfitCustody(*mtp)
mtp.TakeProfitLiabilities, err = k.CalcMTPTakeProfitLiability(ctx, *mtp)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions