-
Notifications
You must be signed in to change notification settings - Fork 105
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
[TRA-611] Get MarketPrice exponent from marketmap #2324
Changes from 7 commits
49fd999
65cb01b
7f9e572
0859b2d
c9eb62e
0cece3f
6dcd8fc
b17bdc7
6160cf5
f48bae2
7352992
48b82f6
4a484fc
cc33da3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4002,7 +4002,7 @@ const GenesisState = `{ | |
}, | ||
{ | ||
"exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"LINKUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"LINKUSD\\\"\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"LINK-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"LINK_USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"linkusdt\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"LINKUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"LINK-USDT\"},{\"exchangeName\":\"Okx\",\"ticker\":\"LINK-USDT\"}]}", | ||
"exponent": -8, | ||
"exponent": -9, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Inconsistency Found in The 🔗 Analysis chainVerify the intentionality and impact of increased LINK-USD price precision The Please confirm if this change is intentional and consistent with other parts of the system. Let's verify its impact: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for any hardcoded uses of the old exponent (-8) for LINK-USD
rg -i 'link.*usd.*-8' --type go
# Check for any price-related calculations specific to LINK that might be affected
rg -i 'link.*usd.*price' --type go
# Look for any other occurrences of LINK-USD market ID (2) that might need updating
rg -i 'market.*id.*2.*link' --type go
Length of output: 798 |
||
"id": 2, | ||
"min_exchanges": 1, | ||
"min_price_change_ppm": 2000, | ||
|
@@ -4170,7 +4170,7 @@ const GenesisState = `{ | |
}, | ||
{ | ||
"exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"MKRUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"MKRUSD\\\"\"},{\"exchangeName\":\"Bitfinex\",\"ticker\":\"tMKRUSD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"MKR-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"MKR_USDT\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"mkrusdt\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"MKR-USDT\"},{\"exchangeName\":\"Okx\",\"ticker\":\"MKR-USDT\"}]}", | ||
"exponent": -7, | ||
"exponent": -6, | ||
chenyaoy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"id": 23, | ||
"min_exchanges": 1, | ||
"min_price_change_ppm": 2000, | ||
|
@@ -4186,7 +4186,7 @@ const GenesisState = `{ | |
}, | ||
{ | ||
"exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"XLMUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"XLMUSD\\\"\"},{\"exchangeName\":\"Bitfinex\",\"ticker\":\"tXLMUSD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"XLM-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"XLM_USDT\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XXLMZUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"XLM-USDT\"},{\"exchangeName\":\"Okx\",\"ticker\":\"XLM-USDT\"}]}", | ||
"exponent": -11, | ||
"exponent": -10, | ||
chenyaoy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"id": 25, | ||
"min_exchanges": 1, | ||
"min_price_change_ppm": 2000, | ||
|
@@ -4261,7 +4261,7 @@ const GenesisState = `{ | |
"price": 1500000000 | ||
}, | ||
{ | ||
"exponent": -8, | ||
"exponent": -9, | ||
"id": 2, | ||
"price": 700000000 | ||
}, | ||
|
@@ -4366,7 +4366,7 @@ const GenesisState = `{ | |
"price": 2200000000 | ||
}, | ||
{ | ||
"exponent": -7, | ||
"exponent": -6, | ||
"id": 23, | ||
"price": 7100000000 | ||
}, | ||
|
@@ -4376,7 +4376,7 @@ const GenesisState = `{ | |
"price": 7000000000 | ||
}, | ||
{ | ||
"exponent": -11, | ||
"exponent": -10, | ||
"id": 25, | ||
"price": 10000000000 | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Deprecation of
exponent
Field Requires Further UpdatesThe
exponent
field inproto/dydxprotocol/prices/market_param.proto
has been deprecated as intended. However, multiple references toexponent
were identified across various parts of the codebase, including but not limited to:protocol/x/vault/keeper/*.go
protocol/testutil/*.go
protocol/x/revshare/keeper/*.go
protocol/x/clob/keeper/*.go
protocol/daemons/slinky/client/*.go
This indicates that the deprecation is not fully propagated, and residual dependencies on the
exponent
field may lead to inconsistencies or legacy issues within the system.Recommended Actions:
exponent
field, ensuring all components rely on the new mechanism provided by the market map.exponent
does not adversely affect system functionality.Analysis chain
Deprecation of
exponent
field looks good, but consider additional documentation.The deprecation of the
exponent
field has been correctly implemented using thedeprecated = true
option. The added comment provides clear information about when the field was deprecated and where the value is now determined.However, to ensure a smooth transition for users of this protobuf definition, consider the following suggestions:
Consider updating the comment to include more details:
Let's check if there are any other references to
exponent
in the file that might need updating:Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 134285