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

chore: Add EIGEN,BOME as isolatd market in default test genesis #2651

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

teddyding
Copy link
Contributor

@teddyding teddyding commented Dec 12, 2024

Changelist

Copied over EIGEN,BOME params from prod

Test Plan

Tested on localnet

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Summary by CodeRabbit

  • New Features

    • Introduced new perpetual markets: "EIGEN-USD" and "BOME-USD" with updated configurations.
    • Enhanced logging in the pregenesis script for better user feedback during execution.
  • Bug Fixes

    • Removed strict sequential ID checks for ClobPair and Perpetual entries, simplifying validation processes.
  • Documentation

    • Updated app version from "7.0.0-dev0-129-g2b9a6b6dd" to "7.0.0-dev0-149-g12cfb908b".
  • Tests

    • Removed test cases related to gaps in ClobPair and Perpetual IDs, focusing on other validation aspects.

Copy link
Contributor

coderabbitai bot commented Dec 12, 2024

Walkthrough

The pull request introduces modifications to several scripts and configuration files related to the genesis setup of a blockchain protocol. Key changes include enhanced logging in the prod_pregenesis.sh script, the addition of new market configurations for assets "EIGEN" and "BOME" in sample_pregenesis.json, and updates to validation logic in the genesis.go files for both perpetuals and clob types. The overall structure remains consistent, focusing on improving user feedback and expanding the range of tradable assets.

Changes

File Path Change Summary
protocol/scripts/genesis/prod_pregenesis.sh Added logging statements in create_pregenesis_file function to indicate execution steps.
protocol/scripts/genesis/sample_pregenesis.json Introduced new liquidity tiers and market configurations for "EIGEN-USD" and "BOME-USD"; updated app_version; expanded clob section with new configurations.
protocol/testing/genesis.sh Added new perpetual markets "EIGEN-USD" and "BOME-USD" with corresponding configurations; updated existing market parameters and prices.
protocol/x/clob/types/genesis.go Removed sequential ID checks from Validate method in GenesisState, allowing non-sequential Id values for ClobPair.
protocol/x/clob/types/genesis_test.go Removed test case for gaps in ClobPair IDs; retained other validation tests for GenesisState.
protocol/x/perpetuals/types/genesis.go Simplified validation logic for perpetual IDs by removing sequential checks; ensured uniqueness and non-empty Ticker.
protocol/x/perpetuals/types/genesis_test.go Removed test case for gaps in perpetual IDs; maintained other validation tests for GenesisState.

Possibly related PRs

Suggested reviewers

  • vincentwschau
  • chenyaoy

Poem

In the fields where markets grow,
New assets bloom, as traders know.
With logs that guide and paths that weave,
A brighter genesis, we believe!
Hops and trades, a joyful dance,
In this new world, we take our chance! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Experiment)
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@teddyding teddyding changed the title Add EIGEN,BOME as isolatd market in default test genesis chore: Add EIGEN,BOME as isolatd market in default test genesis Dec 12, 2024
@teddyding teddyding marked this pull request as ready for review December 12, 2024 20:27
@teddyding teddyding requested a review from a team as a code owner December 12, 2024 20:27
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (1)
protocol/scripts/genesis/prod_pregenesis.sh (1)

171-174: Correct the typographical error in the log message

There is a typo in the echo statement on line 174. The word "Overwriting" is misspelled as "Oerwriting."

Apply this diff to correct the typo:

- echo "Oerwriting genesis params for production..."
+ echo "Overwriting genesis params for production..."
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d59131 and 903d013.

📒 Files selected for processing (7)
  • protocol/scripts/genesis/prod_pregenesis.sh (1 hunks)
  • protocol/scripts/genesis/sample_pregenesis.json (7 hunks)
  • protocol/testing/genesis.sh (4 hunks)
  • protocol/x/clob/types/genesis.go (0 hunks)
  • protocol/x/clob/types/genesis_test.go (0 hunks)
  • protocol/x/perpetuals/types/genesis.go (1 hunks)
  • protocol/x/perpetuals/types/genesis_test.go (0 hunks)
💤 Files with no reviewable changes (3)
  • protocol/x/clob/types/genesis.go
  • protocol/x/clob/types/genesis_test.go
  • protocol/x/perpetuals/types/genesis_test.go
🔇 Additional comments (8)
protocol/testing/genesis.sh (4)

1274-1310: Ensure accurate configuration of market mappings for new assets

The market mappings for EIGEN-USD and BOME-USD are added. Please verify:

  • The decimals are set appropriately ('9' for EIGEN-USD and '12' for BOME-USD).
  • The min_provider_count is correctly set to '1'.
  • The provider_configs include accurate off_chain_ticker values and normalization parameters.
  • The metadata_JSON contains valid JSON with correct market metadata.

1718-1741: Confirm the consistency of price parameters for new markets

New price parameters and initial prices are set for EIGEN-USD (ID 300) and BOME-USD (ID 301). Please ensure:

  • The exponent values ('-9' for EIGEN-USD and '-12' for BOME-USD) are appropriate for the assets' price scales.
  • The min_price_change_ppm is set to 800 (0.08%), which differs from the standard 1000 or 2500 ppm. Verify that this deviation is intentional.
  • The initial price values ('4973000000' for EIGEN-USD and '8695478191' for BOME-USD) accurately reflect the current market prices multiplied by 10^9 and 10^12 respectively, based on the exponents.

2108-2125: Validate the CLOB pair configurations for new markets

The CLOB pairs for EIGEN-USD (ID 300) and BOME-USD (ID 301) are added. Please confirm:

  • The status is set to the intended initial state ("$INITIAL_CLOB_PAIR_STATUS").
  • The perpetual_id matches the IDs assigned in the perpetuals section.
  • The step_base_quantums, subticks_per_tick, and quantum_conversion_exponent are appropriate for the assets' trading increments and precision requirements.

545-564: Verify the uniqueness and correctness of the new perpetual IDs

The new perpetual markets EIGEN-USD and BOME-USD are assigned IDs 300 and 301 respectively. Ensure that these IDs are unique across the perpetuals.perpetuals array and do not conflict with existing IDs. Also, verify that these IDs are correctly referenced in other parts of the genesis configuration.

Run the following script to check for duplicate perpetual IDs:

✅ Verification successful

Perpetual IDs 300 and 301 are unique and correctly configured

Based on the comprehensive output, I can verify that:

  1. The perpetual IDs 300 (EIGEN-USD) and 301 (BOME-USD) are unique in the genesis configuration. The existing perpetuals use IDs 0-32, making 300 and 301 non-conflicting.
  2. The market IDs match their respective perpetual IDs (300 for EIGEN-USD and 301 for BOME-USD).
  3. The tickers are properly configured in both the perpetuals section and the marketmap section with their corresponding currency pairs and settings.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for duplicate perpetual IDs in the genesis configuration.

# Extract all perpetual IDs and check for duplicates
grep -oP "\.perpetuals\.\[\d+\]\.params\.id' -v '\K\d+" ./protocol/testing/genesis.sh | sort | uniq -d

Length of output: 110


Script:

#!/bin/bash
# Let's try a different approach to extract and check perpetual IDs
# First, let's get all lines containing perpetual IDs and market IDs

# Get all perpetual ID assignments
echo "=== Perpetual IDs ==="
grep -n "perpetuals\.perpetuals\.[[:digit:]]\+\.params\.id.*-v" protocol/testing/genesis.sh

# Get all market ID assignments
echo -e "\n=== Market IDs ==="
grep -n "perpetuals\.perpetuals\.[[:digit:]]\+\.params\.market_id.*-v" protocol/testing/genesis.sh

# Get all ticker assignments for context
echo -e "\n=== Tickers ==="
grep -n "perpetuals\.perpetuals\.[[:digit:]]\+\.params\.ticker.*-v" protocol/testing/genesis.sh

Length of output: 445


Script:

#!/bin/bash
# Let's try a simpler approach using single quotes and basic pattern matching
echo "=== Perpetual IDs ==="
grep -n "params.id.*'.*'" protocol/testing/genesis.sh

echo -e "\n=== Market IDs ==="
grep -n "market_id.*'.*'" protocol/testing/genesis.sh

echo -e "\n=== Tickers ==="
grep -n "ticker.*'.*'" protocol/testing/genesis.sh

Length of output: 34702

protocol/x/perpetuals/types/genesis.go (1)

48-48: Confirm the removal of sequential ID validation for perpetuals

The sequential ID check for perpetuals has been removed. Now, the validation only ensures that perpetual IDs are unique and that the Ticker field is non-empty. This change accommodates non-sequential IDs like 300 and 301 for the new markets.

Ensure that all components of the system that interact with perpetual IDs are compatible with non-sequential IDs and do not assume sequential ordering.

protocol/scripts/genesis/sample_pregenesis.json (3)

4093-4093: LGTM: Version update is appropriate

The app version update to "7.0.0-dev0-149-g12cfb908b" is consistent with the addition of new markets.


3757-3770: ⚠️ Potential issue

Review price parameter configurations

Several unique configurations need attention:

  1. Both markets use min_price_change_ppm: 800, lower than other markets (1000-4000)
  2. Both introduce a new parameter min_exchanges: 1
  3. BOME's exponent (-12) is unusually low

Consider aligning these parameters with other markets:

   {
     "exponent": -12,
     "id": 301,
-    "min_exchanges": 1,
-    "min_price_change_ppm": 800,
+    "min_price_change_ppm": 1000,
     "pair": "BOME-USD"
   }

478-497: Verify the large gap in CLOB pair IDs

The new CLOB pairs use IDs 300 and 301, while existing pairs use 0-32. While this might be intentional for isolated markets, we should verify this design choice.

✅ Verification successful

Let me gather more context about the CLOB pair IDs to understand if this gap pattern is documented or follows a specific design.


Let me check if there's any documentation or configuration that explains the CLOB pair ID ranges.


From the search results, I can see references to isolated markets and their implementation in the codebase. Let me check the genesis configuration to understand the ID ranges better.


From the search results, I can see that IDs 300 and 301 are specifically for isolated markets (market_type: 2), while IDs 0-32 are for cross-margin markets (market_type: 1). Let me verify the market types in the codebase.


Based on the search results, I can see that IDs 300 and 301 are specifically designated for isolated markets (market_type: 2), while IDs 0-32 are used for cross-margin markets (market_type: 1). This is an intentional design choice to separate isolated markets from cross-margin markets using different ID ranges.

The gap in CLOB pair IDs is intentional to distinguish isolated markets (300+) from cross-margin markets (0-32)

The codebase shows clear evidence that:

  1. Markets with IDs 0-32 are configured as PERPETUAL_MARKET_TYPE_CROSS
  2. Markets with IDs 300+ are configured as PERPETUAL_MARKET_TYPE_ISOLATED
  3. This separation in ID ranges helps in easily identifying and managing different market types
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if there are any CLOB pairs with IDs between 32 and 300
# to ensure we're not missing any intermediate IDs

rg -U "\"id\": \d{2,3}[^0]" --json | jq -r '.data.lines.text' | sort -n | \
  awk 'BEGIN{prev=0} {curr=$2+0; if(curr-prev>1) printf "Gap found between IDs %d and %d\n", prev, curr; prev=curr}'

Length of output: 283


Script:

#!/bin/bash
# Check documentation and configuration files for any mentions of CLOB pair ID ranges or patterns
rg -i "clob.*id|market.*id" README.md docs/ protocol/ -A 3 -B 3

# Also check for any comments or documentation near the CLOB definitions
rg -U "\"id\":\s*(300|301)" -B 10

Length of output: 79701


Script:

#!/bin/bash
# Search for documentation about CLOB pair ID ranges or market types
rg -i "clob.*id.*range|market.*id.*range|isolated.*market" -A 3 -B 3 protocol/

# Also check for any comments near the CLOB pair definitions in genesis files
rg -U "\"id\":\s*\d+" protocol/scripts/genesis/ -B 5 -A 5

Length of output: 71681


Script:

#!/bin/bash
# Search for CLOB pair definitions and any comments about ID ranges in genesis files
rg -U "\"id\":|\"perpetual_id\":|\"market_id\":" protocol/scripts/genesis/ -B 2 -A 2

# Also check for any documentation about market types and ID ranges
rg -i "market.*type|isolated.*market|cross.*market" protocol/docs/ protocol/README.md -A 3 -B 3

Length of output: 65769


Script:

#!/bin/bash
# Search for market type definitions and documentation
rg -U "PERPETUAL_MARKET_TYPE|market_type.*=.*2|market_type.*isolated" protocol/ -B 3 -A 3

# Also check for any comments or documentation about market ID ranges
rg -i "market.*id.*range|clob.*id.*range|isolated.*id" protocol/ -B 3 -A 3

Length of output: 70740

Comment on lines +1826 to +1869
"EIGEN/USD": {
"provider_configs": [
{
"invert": false,
"name": "okx_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "EIGEN-USDT"
},
{
"invert": false,
"name": "bybit_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "EIGENUSDT"
},
{
"name": "crypto_dot_com_ws",
"off_chain_ticker": "EIGEN_USD"
},
{
"name": "coinbase_ws",
"off_chain_ticker": "EIGEN-USD"
},
{
"name": "kraken_api",
"off_chain_ticker": "EIGENUSD"
}
],
"ticker": {
"currency_pair": {
"Base": "EIGEN",
"Quote": "USD"
},
"decimals": 9,
"enabled": true,
"metadata_JSON": "{\"reference_price\":3648941500,\"liquidity\":3099304,\"aggregate_ids\":[{\"venue\":\"coinmarketcap\",\"ID\":\"30494\"}]}",
"min_provider_count": 1
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Review min_provider_count for EIGEN market

Similarly, the EIGEN market is configured with min_provider_count: 1, which could lead to price reliability issues.

Consider increasing the min_provider_count to 3:

   "ticker": {
     "currency_pair": {
       "Base": "EIGEN",
       "Quote": "USD"
     },
     "decimals": 9,
     "enabled": true,
     "metadata_JSON": "{\"reference_price\":3648941500,\"liquidity\":3099304,\"aggregate_ids\":[{\"venue\":\"coinmarketcap\",\"ID\":\"30494\"}]}",
-    "min_provider_count": 1
+    "min_provider_count": 3
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"EIGEN/USD": {
"provider_configs": [
{
"invert": false,
"name": "okx_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "EIGEN-USDT"
},
{
"invert": false,
"name": "bybit_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "EIGENUSDT"
},
{
"name": "crypto_dot_com_ws",
"off_chain_ticker": "EIGEN_USD"
},
{
"name": "coinbase_ws",
"off_chain_ticker": "EIGEN-USD"
},
{
"name": "kraken_api",
"off_chain_ticker": "EIGENUSD"
}
],
"ticker": {
"currency_pair": {
"Base": "EIGEN",
"Quote": "USD"
},
"decimals": 9,
"enabled": true,
"metadata_JSON": "{\"reference_price\":3648941500,\"liquidity\":3099304,\"aggregate_ids\":[{\"venue\":\"coinmarketcap\",\"ID\":\"30494\"}]}",
"min_provider_count": 1
}
},
"EIGEN/USD": {
"provider_configs": [
{
"invert": false,
"name": "okx_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "EIGEN-USDT"
},
{
"invert": false,
"name": "bybit_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "EIGENUSDT"
},
{
"name": "crypto_dot_com_ws",
"off_chain_ticker": "EIGEN_USD"
},
{
"name": "coinbase_ws",
"off_chain_ticker": "EIGEN-USD"
},
{
"name": "kraken_api",
"off_chain_ticker": "EIGENUSD"
}
],
"ticker": {
"currency_pair": {
"Base": "EIGEN",
"Quote": "USD"
},
"decimals": 9,
"enabled": true,
"metadata_JSON": "{\"reference_price\":3648941500,\"liquidity\":3099304,\"aggregate_ids\":[{\"venue\":\"coinmarketcap\",\"ID\":\"30494\"}]}",
"min_provider_count": 3
}
},

Comment on lines +3521 to +3542
},
{
"params": {
"atomic_resolution": -6,
"default_funding_ppm": 0,
"id": 300,
"liquidity_tier": 4,
"market_id": 300,
"market_type": 2,
"ticker": "EIGEN-USD"
}
},
{
"params": {
"atomic_resolution": -3,
"default_funding_ppm": 0,
"id": 301,
"liquidity_tier": 4,
"market_id": 301,
"market_type": 2,
"ticker": "BOME-USD"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

⚠️ Potential issue

Review atomic resolution and funding rate configurations

Based on the verification results:

  1. The atomic resolution of -3 for BOME-USD is indeed an outlier. Most markets use values between -5 and -9, with -6 being the most common (49 instances), followed by -5 (32 instances).

  2. Regarding default_funding_ppm, while 100 is common (33 instances), having 0 is actually not unusual (104 instances). This suggests that zero funding rate is a valid configuration choice and doesn't require adjustment.

Recommendation:

  • Consider adjusting BOME-USD's atomic_resolution from -3 to a value between -5 and -6 to align with similar markets and ensure appropriate price precision.
🔗 Analysis chain

Review atomic resolution and funding rate configurations

Two potential concerns in the perpetual configurations:

  1. BOME's atomic_resolution (-3) is unusually high compared to other markets (typically -6 to -10)
  2. Both markets have default_funding_ppm set to 0, while other markets use 100

Consider adjusting these parameters:

   "params": {
     "atomic_resolution": -3,
-    "default_funding_ppm": 0,
+    "default_funding_ppm": 100,
     "id": 301,
     "liquidity_tier": 4,
     "market_id": 301,
     "market_type": 2,
     "ticker": "BOME-USD"
   }

Let me verify the default funding rate configurations before making the final response.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the range of atomic_resolution values across all markets
rg -U "atomic_resolution.*-\d+" --json | jq -r '.data.lines.text' | sort | uniq -c

Length of output: 5615


Script:

#!/bin/bash
# Check the range of default_funding_ppm values across all markets
rg -U "default_funding_ppm.*\d+" --json | jq -r '.data.lines.text' | sort | uniq -c

Length of output: 4738

Comment on lines +1420 to +1483
"BOME/USD": {
"provider_configs": [
{
"invert": false,
"metadata_JSON": "",
"name": "kucoin_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "BOME-USDT"
},
{
"invert": false,
"metadata_JSON": "",
"name": "huobi_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "bomeusdt"
},
{
"invert": false,
"metadata_JSON": "",
"name": "bybit_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "BOMEUSDT"
},
{
"invert": false,
"metadata_JSON": "{\"base_token_vault\":{\"token_vault_address\":\"FBba2XsQVhkoQDMfbNLVmo7dsvssdT39BMzVc2eFfE21\",\"token_decimals\":6},\"quote_token_vault\":{\"token_vault_address\":\"GuXKCb9ibwSeRSdSYqaCL3dcxBZ7jJcj6Y7rDwzmUBu9\",\"token_decimals\":9},\"amm_info_address\":\"DSUvc5qf5LJHHV5e2tD184ixotSnCnwj7i4jJa4Xsrmt\",\"open_orders_address\":\"38p42yoKFWgxw2LCbB96wAKa2LwAxiBArY3fc3eA9yWv\"}",
"name": "raydium_api",
"normalize_by_pair": {
"Base": "SOL",
"Quote": "USD"
},
"off_chain_ticker": "BOME,RAYDIUM,UKHH6C7MMYIWCF1B9PNWE25TSPKDDT3H5PQZGZ74J82/SOL,RAYDIUM,SO11111111111111111111111111111111111111112"
},
{
"invert": false,
"metadata_JSON": "",
"name": "okx_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "BOME-USDT"
}
],
"ticker": {
"currency_pair": {
"Base": "BOME",
"Quote": "USD"
},
"decimals": 12,
"enabled": true,
"metadata_JSON": "{\"reference_price\":6051284618,\"liquidity\":748591,\"aggregate_ids\":[{\"venue\":\"coinmarketcap\",\"ID\":\"29870\"}]}",
"min_provider_count": 1
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Review min_provider_count for BOME market

The BOME market is configured with min_provider_count: 1, which is lower than the standard min_provider_count: 3 used by other markets. This could potentially impact price reliability.

Consider increasing the min_provider_count to 3 for better price accuracy and manipulation resistance:

   "ticker": {
     "currency_pair": {
       "Base": "BOME",
       "Quote": "USD"
     },
     "decimals": 12,
     "enabled": true,
     "metadata_JSON": "{\"reference_price\":6051284618,\"liquidity\":748591,\"aggregate_ids\":[{\"venue\":\"coinmarketcap\",\"ID\":\"29870\"}]}",
-    "min_provider_count": 1
+    "min_provider_count": 3
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"BOME/USD": {
"provider_configs": [
{
"invert": false,
"metadata_JSON": "",
"name": "kucoin_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "BOME-USDT"
},
{
"invert": false,
"metadata_JSON": "",
"name": "huobi_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "bomeusdt"
},
{
"invert": false,
"metadata_JSON": "",
"name": "bybit_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "BOMEUSDT"
},
{
"invert": false,
"metadata_JSON": "{\"base_token_vault\":{\"token_vault_address\":\"FBba2XsQVhkoQDMfbNLVmo7dsvssdT39BMzVc2eFfE21\",\"token_decimals\":6},\"quote_token_vault\":{\"token_vault_address\":\"GuXKCb9ibwSeRSdSYqaCL3dcxBZ7jJcj6Y7rDwzmUBu9\",\"token_decimals\":9},\"amm_info_address\":\"DSUvc5qf5LJHHV5e2tD184ixotSnCnwj7i4jJa4Xsrmt\",\"open_orders_address\":\"38p42yoKFWgxw2LCbB96wAKa2LwAxiBArY3fc3eA9yWv\"}",
"name": "raydium_api",
"normalize_by_pair": {
"Base": "SOL",
"Quote": "USD"
},
"off_chain_ticker": "BOME,RAYDIUM,UKHH6C7MMYIWCF1B9PNWE25TSPKDDT3H5PQZGZ74J82/SOL,RAYDIUM,SO11111111111111111111111111111111111111112"
},
{
"invert": false,
"metadata_JSON": "",
"name": "okx_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "BOME-USDT"
}
],
"ticker": {
"currency_pair": {
"Base": "BOME",
"Quote": "USD"
},
"decimals": 12,
"enabled": true,
"metadata_JSON": "{\"reference_price\":6051284618,\"liquidity\":748591,\"aggregate_ids\":[{\"venue\":\"coinmarketcap\",\"ID\":\"29870\"}]}",
"min_provider_count": 1
}
},
"BOME/USD": {
"provider_configs": [
{
"invert": false,
"metadata_JSON": "",
"name": "kucoin_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "BOME-USDT"
},
{
"invert": false,
"metadata_JSON": "",
"name": "huobi_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "bomeusdt"
},
{
"invert": false,
"metadata_JSON": "",
"name": "bybit_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "BOMEUSDT"
},
{
"invert": false,
"metadata_JSON": "{\"base_token_vault\":{\"token_vault_address\":\"FBba2XsQVhkoQDMfbNLVmo7dsvssdT39BMzVc2eFfE21\",\"token_decimals\":6},\"quote_token_vault\":{\"token_vault_address\":\"GuXKCb9ibwSeRSdSYqaCL3dcxBZ7jJcj6Y7rDwzmUBu9\",\"token_decimals\":9},\"amm_info_address\":\"DSUvc5qf5LJHHV5e2tD184ixotSnCnwj7i4jJa4Xsrmt\",\"open_orders_address\":\"38p42yoKFWgxw2LCbB96wAKa2LwAxiBArY3fc3eA9yWv\"}",
"name": "raydium_api",
"normalize_by_pair": {
"Base": "SOL",
"Quote": "USD"
},
"off_chain_ticker": "BOME,RAYDIUM,UKHH6C7MMYIWCF1B9PNWE25TSPKDDT3H5PQZGZ74J82/SOL,RAYDIUM,SO11111111111111111111111111111111111111112"
},
{
"invert": false,
"metadata_JSON": "",
"name": "okx_ws",
"normalize_by_pair": {
"Base": "USDT",
"Quote": "USD"
},
"off_chain_ticker": "BOME-USDT"
}
],
"ticker": {
"currency_pair": {
"Base": "BOME",
"Quote": "USD"
},
"decimals": 12,
"enabled": true,
"metadata_JSON": "{\"reference_price\":6051284618,\"liquidity\":748591,\"aggregate_ids\":[{\"venue\":\"coinmarketcap\",\"ID\":\"29870\"}]}",
"min_provider_count": 3
}
},

@teddyding teddyding merged commit 7117942 into main Dec 13, 2024
21 of 22 checks passed
@teddyding teddyding deleted the td/isolated-in-genesis branch December 13, 2024 02:45
@teddyding
Copy link
Contributor Author

@Mergifyio backport release/protocol/v8.x

Copy link
Contributor

mergify bot commented Dec 13, 2024

backport release/protocol/v8.x

✅ Backports have been created

@teddyding
Copy link
Contributor Author

@Mergifyio backport release/protocol/v7.x

Copy link
Contributor

mergify bot commented Dec 13, 2024

backport release/protocol/v7.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Dec 13, 2024
(cherry picked from commit 7117942)

# Conflicts:
#	protocol/scripts/genesis/sample_pregenesis.json
teddyding added a commit that referenced this pull request Dec 16, 2024
teddyding added a commit that referenced this pull request Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants