Skip to content

Hydromancer trades support - #185

Merged
hacheigriega merged 1 commit into
mainfrom
feat/trades
Oct 8, 2026
Merged

hacheigriega merged 1 commit into
mainfrom
feat/trades

Conversation

@hacheigriega

@hacheigriega hacheigriega commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The Hydromancer module now supports the trades data type, allowing an OP to retrieve the trades executed within a configured time range.

Explanation of Changes

Set up a cache that filters out trades that are older than a configured time period upon receiving a request or a frame for that coin.

Note that since we process inbound frames outside Effect, the cache write calls retrieve the current time using unsafeCurrentTimeMillis, which reads from the clock we install on the fiber.

Testing

Added test cases

Related PRs and Issues

Related: #183

@hacheigriega hacheigriega changed the title Hydromancer trades & Lighter order book Hydromancer trades support Oct 6, 2026
@hacheigriega
hacheigriega marked this pull request as ready for review October 6, 2026 19:02
Add support for trades type data for Hydromancer module. Set up a cache
that filters out trades that are older than a configured time period
upon receiving a request or a frame for that coin.

@Thomasvdam Thomasvdam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks ok, but I'm missing why we want/need this? There's probably a Slack thread or Notion page somewhere but that's hard to find 😅

Comment thread workspace/data-proxy/src/modules/shared/price-cache.ts
@hacheigriega

Copy link
Copy Markdown
Contributor Author

Looks ok, but I'm missing why we want/need this? There's probably a Slack thread or Notion page somewhere but that's hard to find 😅

Monaco spec states

  1. Qualify Monaco’s book. Require a current, two-sided book with enough depth to execute the configured trade size on both sides. Reject a crossed book or a spread above the configured limit.

So simply to determine book quality based on current trade size. @Tommytrg could confirm :)

@hacheigriega
hacheigriega merged commit 4361473 into main Oct 8, 2026
2 checks passed
@hacheigriega
hacheigriega deleted the feat/trades branch October 8, 2026 15:57
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.

2 participants