OrderExecutionResult
Closed this issue · 3 comments
acamill commented
Should this type be added too
acamill commented
And probably these who were shared earlier
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct OrderPlacementResult {
pub order_id: u64,
pub status_code: OrderPlacementStatus,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct OrderCancellationResult {
pub order_id: u64,
pub status_code: OrderCancellationStatus,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct OrderExecutionResult {
pub order_id: u64,
pub status_code: OrderExecutionStatus,
pub execution_price: Decimal,
pub executed_quantity: Decimal, // In base
pub total_notional: Decimal, // In quote
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
pub enum OrderPlacementStatus {
Success = 0,
FailedInsufficientCollateral = 1,
FailedInvalidLeverage = 2,
FailedInsufficientPositionToClose = 3,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
pub enum OrderCancellationStatus {
Success = 0,
FailedOrderNotExist = 1,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
pub enum OrderExecutionStatus {
FullyExecuted = 0,
PartiallyExecuted = 1,
NotExecuted = 2,
}
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
pub struct GetOrderEstimateResponse {
pub order_fee_estimate: SignedDecimal,
pub deposits_required: Coin,
}
#[derive(Copy, Clone, Serialize, Deserialize, PartialEq, JsonSchema, Debug, Eq)]
pub struct SignedDecimal {
pub decimal: Decimal,
pub negative: bool,
}
wade-liwei commented
do you have the error:
error: the lock file /code/Cargo.lock needs to be updated but --locked was passed to prevent this
Kbhat1 commented
This has been updated, the Sei cosmwasm types now reflect the latest dex types. Please re create another issue if there are still problems