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: Epoch reporting #2808

Merged
merged 1 commit into from
Oct 30, 2024
Merged

mm: Epoch reporting #2808

merged 1 commit into from
Oct 30, 2024

Conversation

martonp
Copy link
Contributor

@martonp martonp commented Jun 10, 2024

This diff updates the market makers to generate a report of their
activities during each epoch. If the rates of each placement is unable
to be determined, this is reported as a `PreOrderProblem`, otherwise
an `OrderReport` is generated for the orders placed on each side of the
market containing information such as lots the bot is required to place,
the current number of lots standing, the number of lots booked, the
balances required and used for each placement, etc. This information is
all displayed on the UI.

A bug is also fixed in this diff. Previously, on a call to
`core.MultiTrade`, it was possible for some of the orders to be placed,
and some of them to result in an error. In this case, an error was returned
from `core.MultiTrade`, and the market makers would assume that none
of the trades were placed. Now a `core.MultiTradeResult` is returned for
each of the requested orders in the `MultiTrade` call containing either
the order or an error.
Screenshot 2024-10-29 at 3 59 37 PM Screenshot 2024-10-29 at 4 00 00 PM Screenshot 2024-10-29 at 4 00 20 PM

@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 Show resolved Hide resolved
client/mm/utils.go Outdated Show resolved Hide resolved
@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.

@martonp martonp force-pushed the botProblems branch 5 times, most recently from 3da7e10 to c1f4fd4 Compare September 29, 2024 11:59
This diff updates the market makers to generate a report of their
activities during each epoch. If the rates of each placement is unable
to be determined, this is reported as a `PreOrderProblem`, otherwise
an `OrderReport` is generated for the orders placed on each side of the
market containing information such as lots the bot is required to place,
the current number of lots standing, the number of lots booked, the
balances required and used for each placement, etc. This information is
all displayed on the UI.

A bug is also fixed in this diff. Previously, on a call to
`core.MultiTrade`, it was possible for some of the orders to be placed,
and some of them to result in an error. In this case, an error was returned
from `core.MultiTrade`, and the market makers would assume that none
of the trades were placed. Now a `core.MultiTradeResult` is returned for
each of the requested orders in the `MultiTrade` call containing either
the order or an error.
@martonp martonp changed the title mm: Add BotProblems to BotStatus mm: Epoch reporting Oct 29, 2024
Copy link
Contributor

@dev-warrior777 dev-warrior777 left a comment

Choose a reason for hiding this comment

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

I just looked for general code issues since I am not as familiar as I should be with this area of the code.
UI looks great btw.

cexWithdrawProblem
)

func (u *unifiedExchangeAdaptor) updateCEXProblems(typ cexProblemType, assetID uint32, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this func be simplified?

Copy link
Member

Choose a reason for hiding this comment

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

I don't disagree. The locking scheme seems like overkill. We'll follow up.

Copy link
Member

@buck54321 buck54321 left a comment

Choose a reason for hiding this comment

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

This is stellar work. I could nit-pick at stuff and I have some followup, but I'm going to merge this as is. It's going in the patch.

@buck54321 buck54321 merged commit bad00f9 into decred:master Oct 30, 2024
5 checks passed
buck54321 pushed a commit that referenced this pull request Oct 30, 2024
This diff updates the market makers to generate a report of their
activities during each epoch. If the rates of each placement is unable
to be determined, this is reported as a `PreOrderProblem`, otherwise
an `OrderReport` is generated for the orders placed on each side of the
market containing information such as lots the bot is required to place,
the current number of lots standing, the number of lots booked, the
balances required and used for each placement, etc. This information is
all displayed on the UI.

A bug is also fixed in this diff. Previously, on a call to
`core.MultiTrade`, it was possible for some of the orders to be placed,
and some of them to result in an error. In this case, an error was returned
from `core.MultiTrade`, and the market makers would assume that none
of the trades were placed. Now a `core.MultiTradeResult` is returned for
each of the requested orders in the `MultiTrade` call containing either
the order or an error.
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.

4 participants