Skip to content

Conversation

@aarmoa
Copy link
Collaborator

@aarmoa aarmoa commented Jun 16, 2025

  • Created ChainClientV2 to support exchange V2 queries.
  • Created V2 markets to allow users to load either human readable or chain format markets.
  • Updated proto definitions from core v1.16.0-beta.3 and indexer v1.16.16. Updated queries with requests or response changes

Solves CP-447

aarmoa added 2 commits June 16, 2025 09:35
…2 markets to allow users to load either human readable or chain format markets
…v1.16.16. Updated queries with requests or response changes
@aarmoa aarmoa requested a review from Copilot June 16, 2025 16:03
@coderabbitai
Copy link

coderabbitai bot commented Jun 16, 2025

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

87 files out of 297 files are above the max files limit of 200.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@socket-security
Copy link

socket-security bot commented Jun 16, 2025

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors market support to enable both Exchange V1 and V2 usage by introducing a new ChainClientV2, updating the MarketsAssistant to handle human-readable V2 markets, and bumping proto and SDK dependencies to v1.16+.

  • Added ChainClientV2 and human-readable markets assistant constructors
  • Updated MarketsAssistant internals and tests to initialize and query V2 markets
  • Bumped proto definitions and SDK clone targets to core v1.16.0-beta.3 and indexer v1.16.16

Reviewed Changes

Copilot reviewed 356 out of 356 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
client/chain/markets_assistant.go Refactored to support V1/V2 initialization methods
client/chain/markets_assistant_test.go Expanded tests for both V1 and human-readable V2
chain/exchange/types/v2/params.go Updated default V2 parameter MaxDerivativeOrderSideCount
chain/types/chain_id.go Added validation and parsing for chain ID formats
README.md Documented selection between Exchange V1 and V2
Comments suppressed due to low confidence (3)

client/chain/markets_assistant.go:28

  • Storing binary option markets as core.DerivativeMarket may confuse consumers; change this to the appropriate core.BinaryOptionMarketV2 type (and update related methods) to match the domain model.
binaryOptionMarkets map[string]core.DerivativeMarket

client/chain/markets_assistant_test.go:137

  • The test uses strings.Split but the import for "strings" is missing; add import "strings" to the test file.
symbols := strings.Split(injUsdtSpotMarketInfo.Ticker, "/")

auth_vote/authz_vote.go:102

  • [nitpick] Using a tab for indentation in json.MarshalIndent may conflict with project styling; consider using a consistent space-based indent (e.g., two or four spaces).
str, _ := json.MarshalIndent(response, "", "\t")

)

var (
regexChainID = `[a-z]*`
Copy link

Copilot AI Jun 16, 2025

Choose a reason for hiding this comment

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

Current regex allows an empty prefix before the dash; change [a-z]* to [a-z]+ to require at least one letter in the chain name.

Suggested change
regexChainID = `[a-z]*`
regexChainID = `[a-z]+`

Copilot uses AI. Check for mistakes.
@aarmoa aarmoa merged commit be05f2b into dev Jun 16, 2025
5 of 6 checks passed
@aarmoa aarmoa deleted the cp-447/refactor_support_for_exchange_v2 branch June 16, 2025 16:33
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