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

mm: Handle market params update #2846

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

martonp
Copy link
Contributor

@martonp martonp commented Jun 26, 2024

This diff updates the market maker to listen for updates to the server config. If the lot size of a market that a bot is currently trading on is updated, the number of placements that the bot makes is updated so that the bot places as many lots as possible without exceeding the amount that was placed before the lot size update.

Additionally, the lot size is not saved with the BotConfig. An additional overrideLotSizeChange parameter is added to StartBot, which if false, will return an error if the lot size has changed since the bot was configured. This will allow the UI to prompt the user to either update their configuration, or continue with the old one even though the lot size has changed.

After #2808 is merged, BotProblems can be updated to let the user know that a lot size change has taken place, and the bot is currently placing smaller quantities on the books than originally configured.

This diff updates the market maker to listen for updates to the server
config. If the lot size of a market that a bot is currently trading on
is updated, the number of placements that the bot makes is updated so
that the bot places as many lots as possible without exceeding the amount
that was placed before the lot size update.
quoteLots: quoteLots,
}
}

Copy link
Member

Choose a reason for hiding this comment

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

The *ArbMarketMakerConfig methods don't look thread safe, is that ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both of these are fine for how it's being currently used. I'll add comments about this though.

p.Lots = (p.Lots * originalLotSize) / newLotSize
}
}

Copy link
Member

Choose a reason for hiding this comment

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

*BasicMarketMakingConfig methods also do not look thread safe

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