-
-
Notifications
You must be signed in to change notification settings - Fork 819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulator #2470
Simulator #2470
Conversation
@@ -133,3 +138,13 @@ def format_portfolio_history(history: dict, unit: str, portfolio_id: str) -> lis | |||
] | |||
except KeyError: | |||
return [] | |||
|
|||
|
|||
def get_adapted_portfolio(usd_like_asset, portfolio): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
portfolio = (bot_config.get( | ||
enums.BotConfigKeys.OPTIONS.value | ||
) or {}).get("portfolio") | ||
usd_like_asset = "USDT" # todo use dynamic value when exchange is not supporting USDT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use the strategy reference market if it's an usd like asset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea 👍
3d73b5e
to
7a1dbd3
Compare
if trading_api.is_usd_like_coin(profile_data.trading.reference_market): | ||
usd_like_asset = profile_data.trading.reference_market |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
async def refresh_selected_bot_if_unset(self): | ||
if not self.user_account.has_selected_bot_data(): | ||
self.user_account.set_selected_bot_raw_data( | ||
await self.supabase_client.fetch_bot(self.user_account.bot_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also check that self.user_account.bot_id
is not None ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's initialized in constructor, it should never be None, we are fine :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
No description provided.