Skip to content
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

Merged
merged 5 commits into from
Nov 16, 2023
Merged

Simulator #2470

merged 5 commits into from
Nov 16, 2023

Conversation

GuillaumeDSM
Copy link
Member

No description provided.

@GuillaumeDSM GuillaumeDSM self-assigned this Nov 14, 2023
@@ -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):
Copy link
Member

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
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea 👍

@GuillaumeDSM GuillaumeDSM changed the title WIP Simulator Simulator Nov 15, 2023
Comment on lines +273 to +274
if trading_api.is_usd_like_coin(profile_data.trading.reference_market):
usd_like_asset = profile_data.trading.reference_market
Copy link
Member

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)
Copy link
Member

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 ?

Copy link
Member Author

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 :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@GuillaumeDSM GuillaumeDSM enabled auto-merge (rebase) November 16, 2023 15:01
@GuillaumeDSM GuillaumeDSM merged commit 2a1b6b8 into dev Nov 16, 2023
13 checks passed
@GuillaumeDSM GuillaumeDSM deleted the simulator branch November 16, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants