You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
empty value of entity after writing with .save() and reading with ::find()
in that case, AccountBalanceChangeEventsBatch contains only 1 value of 5
We have a very important value in our contracts called open_interest, it is calculated by the formula open_interest = open_interest - abs(old_account_balance.taker_open_notional) + abs(account_balance.taker_open_notional)
(if account_balance and position are the same thing)
to calculate this value I used OpenInterestEntity::find(OpenInterestEntity::id().eq(open_interest_id.clone())) in account_balance_change_event_handler, but judging by the logs it returned a zero value of OpenInterestEntity when it was not zero, please tell me what can be the matter here.
more logs are here
looks like getting the order by ID returns a zero value
because we are saving value 21074050192 and straight after that we see open_interest_entity isn't None, but value 0 after unwrap
Just for the sake of sanity, could you print
open_interest_entity.save()
info!("{open_interest_entity}");
info!("{}", OpenInterestEntity::find(OpenInterestEntity::id().eq(open_interest_entity.id.clone()).unwrap());
That is, save, print, lookup, print.
This way we’d know if it was saved properly.
The id and market are correct, though. So, it finds a value, but the value has OI zero, just after .save() and even on the next tx handler
empty value of entity after writing with
.save()
and reading with::find()
in that case,
AccountBalanceChangeEventsBatch
contains only 1 value of 5We have a very important value in our contracts called
open_interest
, it is calculated by the formulaopen_interest = open_interest - abs(old_account_balance.taker_open_notional) + abs(account_balance.taker_open_notional)
(if account_balance and position are the same thing)
to calculate this value I used
OpenInterestEntity::find(OpenInterestEntity::id().eq(open_interest_id.clone()))
inaccount_balance_change_event_handler
, but judging by the logs it returned a zero value ofOpenInterestEntity
when it was not zero, please tell me what can be the matter here.more logs are here
looks like getting the order by ID returns a zero value
because we are saving value 21074050192 and straight after that we see open_interest_entity isn't None, but value 0 after unwrap
The id and market are correct, though. So, it finds a value, but the value has OI zero, just after .save() and even on the next tx handler
My toolchain
The text was updated successfully, but these errors were encountered: