Skip to content

Commit

Permalink
[Community] fix order & trading sync
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Nov 12, 2023
1 parent 8cdfd9b commit fabf986
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions octobot/community/models/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def format_trades(trades: list, exchange_name: str, bot_id: str) -> list:
return [
_format_trade(trade, exchange_name, bot_id)
for trade in trades
if trade.get(trading_enums.ExchangeConstantsOrderColumns.SYMBOL.value, None) # ignore incomplete trades
]


Expand Down Expand Up @@ -70,6 +71,9 @@ def format_orders(orders: list, exchange_name: str) -> list:
trading_enums.ExchangeConstantsOrderColumns.AMOUNT.value],
}
for storage_order in orders
if storage_order.get(trading_constants.STORAGE_ORIGIN_VALUE, {}).get(
trading_enums.ExchangeConstantsOrderColumns.SYMBOL.value, None
) # ignore incomplete orders
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ async def fetch_product_config(self, product_id: str) -> commons_profiles.Profil
"product_config:product_configs!current_config_id(config, version)"
).eq(enums.ProductKeys.ID.value, product_id).execute()).data[0]
except IndexError:
raise errors.MissingProductConfigError(f"product_id is '{product_id}'")
raise errors.MissingProductConfigError(f"Missing product_id is '{product_id}'")
profile_data = commons_profiles.ProfileData.from_dict(
product["product_config"][enums.ProfileConfigKeys.CONFIG.value]
)
Expand Down

0 comments on commit fabf986

Please sign in to comment.