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: Add BotProblems to BotStatus #2808

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

Conversation

martonp
Copy link
Contributor

@martonp martonp commented Jun 10, 2024

This PR adds a BotProblems struct to BotStatus that reports issues that bots are facing. Some problems such as wallet sync and connectivity are checked preemptively while others are reported when errors arise during determining what orders to place and when actually placing them. The preemptive checks are especially important for the Arb bot which additionally confirms that the trading limits allow for an additional trade. Balance deficiencies are also reported in BotProblems.

@martonp martonp force-pushed the botProblems branch 2 times, most recently from 16239b3 to 4bcdffe Compare June 17, 2024 01:23
@martonp martonp marked this pull request as ready for review June 21, 2024 00:58
client/core/errors.go Outdated Show resolved Hide resolved
client/core/core.go Outdated Show resolved Hide resolved
client/mm/exchange_adaptor.go Outdated Show resolved Hide resolved
client/mm/mm.go Outdated Show resolved Hide resolved
client/mm/mm_basic.go Outdated Show resolved Hide resolved
client/mm/mm_arb_market_maker.go Outdated Show resolved Hide resolved
client/mm/exchange_adaptor.go Outdated Show resolved Hide resolved
client/mm/mm.go Outdated
Comment on lines 252 to 263
// DeterminePlacementsErr is true if there was an unidentified error when
// attempting to determine the rates at which to place orders.
DeterminePlacementsErr error `json:"determinePlacementsErr"`
// PlaceBuyOrdersErr is true if there was an unidentified error while
// placing buy orders.
PlaceBuyOrdersErr error `json:"placeBuyOrdersErr"`
// PlaceBuyOrdersErr is true if there was an unidentified error while
// placing sell orders.
PlaceSellOrdersErr error `json:"placeSellOrdersErr"`
Copy link
Member

Choose a reason for hiding this comment

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

Lash three are type error but description says "is true"

problems.AccountSuspended = false
problems.NoOracleAvailable = false
problems.EmptyMarket = false
}
Copy link
Member

Choose a reason for hiding this comment

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

Missing problems.CEXOrderbookUnsynced

@JoeGruffins
Copy link
Member

Unsure if related to these changes but will see a lot of errors running on simnet with a bot:

2024-06-27 06:11:02.064 [ERR] CORE: notify: |ERROR| (order) Swap reporting error - Error notifying DEX of swap for match 75738e143d8220928c55c0599ac65c3b2c21df15cfff1da538ea52911b64aea7: error sending 'init' message: timed out waiting for "init" response (timeout) - Order: 4a527c9e2e9f4985f79e90d20823fecb60e1b75954850fe11b6371a1fbf60f02
2024-06-27 06:11:02.064 [ERR] CORE[wss://127.0.0.1:17273/ws]: No handler found for response: {"type":2,"id":196,"payload":{"result":null,"error":{"code":24,"message":"failed to find contract coin f3714c2c324210f2c9c28e81b7136c1ecf59d2bd32d693bc5f37a998322d32f9:0"}},"sig":""}

The one below this may be fixed in #2843

2024-06-27 06:11:45.180 [ERR] MM[MM-127.0.0.1:17273-60-0]: Error getting tx 68434de5cbaa0e27d5204512db08c45e3487ddfcc077fe5d4f8bbd396f09c1cf00000000: tx database not initialized
2024-06-27 06:13:45.063 [ERR] CORE: failed to send trade request: new order request with DEX server 127.0.0.1:17273 market eth_btc failed: rpc error: error code 53: order quantity exceeds user limit

Can be fixed later.

This PR adds a BotProblems struct to BotStatus that reports issues that
bots are facing. Some problems such as wallet sync and connectivity are
checked preemptively while others are reported when errors arise during
determining what orders to place and when actually placing them. The
preemptive checks are especially important for the Arb bot which
additionally confirms that the trading limits allow for an additional
trade. Balance deficiencies are also reported in BotProblems.
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.

3 participants