Skip to content

Commit

Permalink
mm: Internal transfers
Browse files Browse the repository at this point in the history
This diff updates the market maker to attempt to reallocate available funds
to bots before doing a deposit or a withdrawal. For example, if a deposit
is required, and the user has additional available funds on the CEX that are
not allocated to any bots, funds will be allocated to the bot on the CEX
and unallocated from the bot on the wallet to simulate a deposit. Bots may
be configured to only attempt these "internal transfers", to attempt both
internal and external transfers, or to do no rebalancing at all.
  • Loading branch information
martonp committed Feb 5, 2025
1 parent 732cd01 commit 6a88645
Show file tree
Hide file tree
Showing 12 changed files with 650 additions and 186 deletions.
4 changes: 4 additions & 0 deletions client/mm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ type CEXConfig struct {
type AutoRebalanceConfig struct {
MinBaseTransfer uint64 `json:"minBaseTransfer"`
MinQuoteTransfer uint64 `json:"minQuoteTransfer"`
// InternalOnly means that the bot will only simulate transfers by
// allocating unallocated funds to the bot's balance and never actually
// perform deposits and withdrawals with the CEX.
InternalOnly bool `json:"internalOnly"`
}

// BotBalanceAllocation is the initial allocation of funds for a bot.
Expand Down
Loading

0 comments on commit 6a88645

Please sign in to comment.