Skip to content

Fetch and log (and cache) buy/sell quote token symbols#4396

Merged
jmg-duarte merged 3 commits into
mainfrom
jmgd/quotes/symbols
May 12, 2026
Merged

Fetch and log (and cache) buy/sell quote token symbols#4396
jmg-duarte merged 3 commits into
mainfrom
jmgd/quotes/symbols

Conversation

@jmg-duarte
Copy link
Copy Markdown
Contributor

@jmg-duarte jmg-duarte commented May 11, 2026

Description

Logs quote token symbols, keeps them in a cache to avoid the network

Changes

  • Add the token info fetcher into the QuoteHandler
  • The fetcher provides us with generalized caching

How to test

N/A

@jmg-duarte jmg-duarte requested a review from a team as a code owner May 11, 2026 14:16
@jmg-duarte jmg-duarte force-pushed the jmgd/quotes/symbols branch from 06363a9 to bfa67f7 Compare May 11, 2026 14:18
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements token symbol caching in the QuoteHandler using the moka library. It introduces a token_name_cache and integrates an AlloyProvider to fetch symbols for sell and buy tokens, which are then included in debug logging. No critical issues were found, and I have no feedback to provide.

Copy link
Copy Markdown
Contributor

@MartinquaXD MartinquaXD left a comment

Choose a reason for hiding this comment

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

We already have a token-info crate that queries and caches symbol and decimals. Can this be used here?

Copy link
Copy Markdown
Contributor

@tilacog tilacog left a comment

Choose a reason for hiding this comment

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

Apart from @MartinquaXD's comment, LGTM

(I was also not aware of that crate)

Copy link
Copy Markdown
Contributor

@MartinquaXD MartinquaXD left a comment

Choose a reason for hiding this comment

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

LGTM. 2 nits:

  1. description needs to be updates
  2. the log does not contain the new fields if the symbol ends up being None. I asked on slack if this would be acceptable or if another behavior is preferred.

Comment thread crates/orderbook/src/quoter.rs Outdated
Co-authored-by: Martin Magnus <martin.beckmann@protonmail.com>
@jmg-duarte jmg-duarte added this pull request to the merge queue May 12, 2026
Merged via the queue into main with commit 05506aa May 12, 2026
20 checks passed
@jmg-duarte jmg-duarte deleted the jmgd/quotes/symbols branch May 12, 2026 08:58
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants