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: Individually Start Bots / Live Updates #2738

Merged
merged 4 commits into from
May 16, 2024

Commits on May 16, 2024

  1. mm: Individually Start Bots / Live Updates

    This diff adds the ability to start/stop bots individually and also to
    perform live updates to bot settings and the amount of funds controlled
    by bots.
    
    All balance fields are removed from the BotConfig. These are now specified
    when a bot is started.
    
    Bots and exchange adaptors are now dex.Connectors. To perform an update,
    the bot is first paused, the updates are made, and then the bot is resumed
    again. A botConnectionMaster that wraps a dex.ConnectionMaster is added to
    facilitate pausing and resuming of bots.
    
    To perform a balance update, we need to know the exact amount that is
    available in the wallets and on the CEX that is not currently reserved
    by a running bot. To do this, we first check the available amounts
    according to the wallet/cex, then we sync the state of all pending trades,
    deposits, and withdrawals, and then we recheck the available amounts. If
    the first check is the same as the last, we know nothing has changed and
    we have the correct amounts, so we can proceed. In order for this to work
    properly, the `WalletTransaction` function of wallets must return
    `Confirmed == true` if and only if the any incoming funds from that
    transaction are part of the available balance.
    
    The priceOracle is also refactored. Instead of having a “synced”
    priceOracle used for markets on which a bot is running, and an “unsynced”
    one for any other markets, there is now only one priceOracle.
    `startAutoSyncingMarket` and `stopAutoSyncingMarket` are called whenever
    bots are started / stopped.
    
    A testing program is added that tracks the available balances in
    wallets/cexes that are unused by any bots. This amount should not change
    unless the user start, stops, or updates a bot. If there are any unexpected
    changes, this means there is a bug in the balance tracking.
    martonp committed May 16, 2024
    Configuration menu
    Copy the full SHA
    4d2ebcc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a837e36 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6c2a3cf View commit details
    Browse the repository at this point in the history
  4. create transitional ui

    buck54321 authored and martonp committed May 16, 2024
    Configuration menu
    Copy the full SHA
    6c00f9a View commit details
    Browse the repository at this point in the history