Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client/mm: Move shared logic from bots to unifiedExchangeAdaptor
This diff moves as much shared logic from bot implementations to the unifiedExchangeAdaptor as possible. - All fiat rate and order fee tracking is moved to the unifiedExchangeAdaptor. - The MultiTrade function of the unifiedExchangeAdaptor now takes all of the placements that a bot would make, if they had not placed any trades yet, and if they had unlimited balance. All of the logic that used to be in the basic market maker and mm+arb strategies involving determining which trades need to be cancelled/replaced and how many trades the bot has balance for is now handled in the MultiTrade function. - The rebalancing functionalities in simple arb and arb+mm are now handled by the PrepareRebalance and FreeUpFunds functions. - An OrderFeesInUnits function is added that calculates the total order fees in either the base or quote units. This greatly simplifies the basic market maker’s logic that determines the break even half-spread. The simple arb and arb+mm bots also use this function to take into account order fees, which they did not do previously. - The base/quote wallet settings were repeated in each of the bot strategy settings, and the auto-rebalance config was repeated in both the simple arb and arb+mm. These are moved to the top level config / the bot CEX config, respectively.
- Loading branch information