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 Nov 1, 2024
1 parent 3506117 commit 6c0d7cf
Show file tree
Hide file tree
Showing 12 changed files with 605 additions and 180 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 6c0d7cf

Please sign in to comment.