Skip to content

Not handling outboundAccountPosition #253

@Antifrajz

Description

@Antifrajz

Currently we are not handling outboundAccountPosition event in spot.
The reason is that two years ago is commit c4af9a1 this the Event Balance struct is changed from

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct EventBalance {
    #[serde(rename = "a")]
    pub asset: String,
    #[serde(rename = "f")]
    pub free: String,
    #[serde(rename = "l")]
    pub locked: String,
}

To

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct EventBalance {
    #[serde(rename = "a")]
    pub asset: String,
    #[serde(rename = "wb")]
    pub wallet_balance: String,
    #[serde(rename = "cw")]
    pub cross_wallet_balance: String,
    #[serde(rename = "bc")]
    pub balance_change: String, // Balance Change except PnL and Commission
}

And therefor we wan't match this kind of event

{
  "e": "outboundAccountPosition", // Event type
  "E": 1564034571105,             // Event Time
  "u": 1564034571073,             // Time of last account update
  "B": [                          // Balances Array
    {
      "a": "ETH",                 // Asset
      "f": "10000.000000",        // Free
      "l": "0.000000"             // Locked
    }
  ]
}

I can fix this but I don't understand for what is the new EventBalance used. Should I add just a new struct to support this again

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions