-
Notifications
You must be signed in to change notification settings - Fork 129
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
[OTE-272] update DB and APIs to add OI caps info #1305
Conversation
WalkthroughThe recent updates involve enhancing the comparison method for liquidity tier properties in tests, refining data parsing in the Changes
Recent Review StatusConfiguration used: CodeRabbit UI Files selected for processing (3)
Files skipped from review as they are similar to previous changes (3)
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
indexer/services/comlink/public/swagger.json
is excluded by!**/*.json
Files selected for processing (17)
- indexer/packages/postgres/tests/helpers/constants.ts (1 hunks)
- indexer/packages/postgres/src/db/migrations/migration_files/20240329154240_liquidity_tier_update.ts (1 hunks)
- indexer/packages/postgres/src/models/liquidity-tiers-model.ts (4 hunks)
- indexer/packages/postgres/src/types/db-model-types.ts (1 hunks)
- indexer/packages/postgres/src/types/liquidity-tiers-types.ts (1 hunks)
- indexer/packages/postgres/src/types/websocket-message-types.ts (1 hunks)
- indexer/services/comlink/tests/controllers/api/v4/perpetual-markets-controller.test.ts (1 hunks)
- indexer/services/comlink/tests/lib/request-helpers/request-transformer.test.ts (1 hunks)
- indexer/services/comlink/public/api-documentation.md (6 hunks)
- indexer/services/comlink/src/request-helpers/request-transformer.ts (1 hunks)
- indexer/services/comlink/src/types.ts (1 hunks)
- indexer/services/ender/tests/handlers/liquidity-tier-handler.test.ts (2 hunks)
- indexer/services/ender/tests/helpers/constants.ts (1 hunks)
- indexer/services/ender/src/handlers/liquidity-tier-handler.ts (1 hunks)
- indexer/services/ender/src/helpers/kafka-helper.ts (1 hunks)
- indexer/services/ender/src/lib/block-processor.ts (1 hunks)
- indexer/services/ender/src/scripts/handlers/dydx_liquidity_tier_handler.sql (2 hunks)
Files skipped from review due to trivial changes (2)
- indexer/services/comlink/tests/controllers/api/v4/perpetual-markets-controller.test.ts
- indexer/services/ender/src/lib/block-processor.ts
Additional Context Used
Path-based Instructions (15)
indexer/packages/postgres/src/db/migrations/migration_files/20240329154240_liquidity_tier_update.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/packages/postgres/src/types/liquidity-tiers-types.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/ender/src/handlers/liquidity-tier-handler.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/packages/postgres/src/models/liquidity-tiers-model.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/ender/src/scripts/handlers/dydx_liquidity_tier_handler.sql (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/packages/postgres/src/types/websocket-message-types.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/packages/postgres/src/types/db-model-types.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/ender/__tests__/handlers/liquidity-tier-handler.test.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/ender/src/helpers/kafka-helper.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/comlink/__tests__/lib/request-helpers/request-transformer.test.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/ender/__tests__/helpers/constants.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/comlink/src/types.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/comlink/src/request-helpers/request-transformer.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/packages/postgres/__tests__/helpers/constants.ts (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/comlink/public/api-documentation.md (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.
Learnings (1)
indexer/services/ender/__tests__/handlers/liquidity-tier-handler.test.ts (1)
The `stats` import was not entirely removed; only the `STATS_FUNCTION_NAME` was removed from the import. This led to an incorrect comment about the `stats` object usage.
Additional comments not posted (22)
indexer/packages/postgres/src/db/migrations/migration_files/20240329154240_liquidity_tier_update.ts (1)
3-17
: The migration script correctly addsopenInterestLowerCap
andopenInterestUpperCap
columns to theliquidity_tiers
table and provides a way to revert these changes. It follows best practices for database migrations, ensuring that the new columns are nullable and have a default value ofnull
.indexer/packages/postgres/src/types/liquidity-tiers-types.ts (3)
8-9
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
as optional fields in theLiquidityTiersCreateObject
interface is correctly implemented, following the established patterns for optional fields.
17-18
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
as optional fields in theLiquidityTiersUpdateObject
interface is correctly implemented, following the established patterns for optional fields.
26-27
: The update to theLiquidityTiersColumns
enum to includeopenInterestLowerCap
andopenInterestUpperCap
is consistent with the naming and structure of existing entries.indexer/services/ender/src/handlers/liquidity-tier-handler.ts (1)
26-27
: The adjustment in castingresultRow.liquidity_tier
toLiquidityTiersFromDatabase
usingLiquidityTiersModel.fromJson
enhances clarity and ensures type safety by correctly parsing and validating the data.indexer/packages/postgres/src/models/liquidity-tiers-model.ts (3)
30-32
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
to the JSON schema with nullable string types andNumericPattern
validation is correctly implemented, ensuring appropriate data validation and consistency with other numeric fields.
49-50
: The updates to thesqlToJsonConversions
foropenInterestLowerCap
andopenInterestUpperCap
ensure correct data conversion from SQL to JSON, aligning with best practices for database models.
64-66
: The inclusion ofopenInterestLowerCap
andopenInterestUpperCap
as optional class properties is correctly implemented, following the established patterns for optional fields in models.indexer/services/ender/src/scripts/handlers/dydx_liquidity_tier_handler.sql (2)
18-19
: The use ofdydx_from_jsonlib_long
to extractopenInterestLowerCap
andopenInterestUpperCap
from the event data is appropriate, assuming this function correctly handles the conversion from JSON to the expected data type.
28-30
: The update to theINSERT INTO
statement to includeopenInterestLowerCap
andopenInterestUpperCap
ensures that these new fields are correctly updated in the database.indexer/packages/postgres/src/types/websocket-message-types.ts (1)
215-216
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
as optional fields in theTradingPerpetualMarketMessage
interface is correctly implemented, enhancing the system's functionality and information accuracy regarding Open Interest caps.indexer/packages/postgres/src/types/db-model-types.ts (1)
183-184
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
as optional fields in theLiquidityTiersFromDatabase
interface is correctly implemented, accurately representing the Open Interest caps information at the database model level.indexer/services/ender/__tests__/handlers/liquidity-tier-handler.test.ts (2)
172-177
: The updates to theexpectLiquidityTier
function to directly compareopenInterestLowerCap
andopenInterestUpperCap
by converting these fields to numbers for comparison are correctly implemented, ensuring accurate verification of the data handling.
233-238
: The updates to thevalidateLiquidityTierRefresher
function to directly compareopenInterestLowerCap
andopenInterestUpperCap
by converting these fields to numbers for comparison are correctly implemented, ensuring accurate verification of the data handling.indexer/services/ender/src/helpers/kafka-helper.ts (1)
329-330
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
fields to thegeneratePerpetualMarketMessage
function aligns with the PR's objectives. Ensure that downstream components that consume this message can handle these new fields appropriately.Verification successful
The review of the provided script outputs indicates that the downstream components are using the updated
generatePerpetualMarketMessage
function. While direct evidence of howopenInterestLowerCap
andopenInterestUpperCap
fields are specifically handled within these components is not provided, the usage of the function suggests that any messages generated will include these fields, assuming the function itself correctly incorporates them. Further verification of the specific handling within each component would require a more detailed inspection or additional test outputs.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify that downstream components handle the new fields correctly. # This is a placeholder for a more specific verification script. echo "Verify downstream components for handling of openInterestLowerCap and openInterestUpperCap fields."Length of output: 206
Script:
#!/bin/bash # Search for references to generatePerpetualMarketMessage to identify downstream components rg "generatePerpetualMarketMessage"Length of output: 1483
Script:
#!/bin/bash # Display contents of handlers and test files to check for updates related to new fields cat indexer/services/ender/__tests__/helpers/indexer-proto-helpers.ts cat indexer/services/ender/src/handlers/liquidity-tier-handler.ts cat indexer/services/ender/src/handlers/update-perpetual-handler.ts cat indexer/services/ender/src/handlers/update-clob-pair-handler.ts cat indexer/services/ender/src/handlers/perpetual-market-handler.tsLength of output: 30076
indexer/services/comlink/__tests__/lib/request-helpers/request-transformer.test.ts (1)
80-81
: The update to includeopenInterestLowerCap
andopenInterestUpperCap
fields in therequest-transformer
test is appropriate and ensures that the new fields are correctly integrated into the system.indexer/services/ender/__tests__/helpers/constants.ts (1)
152-152
: The update to theopenInterestUpperCap
value in thedefaultLiquidityTierUpsertEvent
is noted. Ensure that this new value aligns with the system's requirements for open interest limits.indexer/services/comlink/src/types.ts (1)
270-271
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
fields to thePerpetualMarketResponseObject
interface is appropriate and aligns with the PR's objectives to integrate Open Interest caps information. Ensuring these fields are optional maintains backward compatibility.indexer/services/comlink/src/request-helpers/request-transformer.ts (1)
357-358
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
to theperpetualMarketToResponseObject
function aligns well with the PR's objectives to integrate Open Interest caps information. This ensures the API responses will now include these new fields, enhancing the system's functionality and information accuracy regarding Open Interest caps.indexer/packages/postgres/__tests__/helpers/constants.ts (1)
665-666
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
to thedefaultLiquidityTier2
object in the test constants file is a logical step towards integrating Open Interest caps information into the system. The provided initial values seem appropriate for testing purposes, assuming they align with expected system ranges.indexer/services/comlink/public/api-documentation.md (2)
1724-1725
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
fields to thePerpetualMarketResponse
object is consistent with the PR objectives to enhance the system's functionality by incorporating Open Interest (OI) caps information. This change ensures that the API documentation accurately reflects the new fields in the system, allowing API consumers to understand and utilize the new OI caps information effectively.
1745-1746
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
fields to another instance of thePerpetualMarketResponse
object further ensures consistency across the documentation. It's important that all instances of this object in the documentation are updated to reflect these new fields, providing a comprehensive and accurate representation of the API's capabilities.
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
indexer/services/comlink/public/swagger.json
is excluded by!**/*.json
Files selected for processing (7)
- indexer/packages/postgres/tests/helpers/constants.ts (1 hunks)
- indexer/packages/postgres/src/types/db-model-types.ts (1 hunks)
- indexer/packages/postgres/src/types/websocket-message-types.ts (1 hunks)
- indexer/services/comlink/tests/lib/request-helpers/request-transformer.test.ts (1 hunks)
- indexer/services/comlink/public/api-documentation.md (6 hunks)
- indexer/services/comlink/src/request-helpers/request-transformer.ts (1 hunks)
- indexer/services/comlink/src/types.ts (1 hunks)
Files skipped from review as they are similar to previous changes (6)
- indexer/packages/postgres/tests/helpers/constants.ts
- indexer/packages/postgres/src/types/db-model-types.ts
- indexer/packages/postgres/src/types/websocket-message-types.ts
- indexer/services/comlink/tests/lib/request-helpers/request-transformer.test.ts
- indexer/services/comlink/src/request-helpers/request-transformer.ts
- indexer/services/comlink/src/types.ts
Additional Context Used
Path-based Instructions (1)
indexer/services/comlink/public/api-documentation.md (1)
**/**
:
Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.
Additional comments not posted (1)
indexer/services/comlink/public/api-documentation.md (1)
1733-1735
: The addition ofopenInterestLowerCap
andopenInterestUpperCap
fields to thePerpetualMarketResponse
object is consistent with the PR's objective to incorporate Open Interest caps information across the system. This change enhances the API's ability to provide detailed market data, including the newly introduced Open Interest limits.
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (2)
- indexer/services/ender/tests/handlers/liquidity-tier-handler.test.ts (3 hunks)
- indexer/services/ender/src/scripts/handlers/dydx_liquidity_tier_handler.sql (2 hunks)
Files skipped from review as they are similar to previous changes (2)
- indexer/services/ender/tests/handlers/liquidity-tier-handler.test.ts
- indexer/services/ender/src/scripts/handlers/dydx_liquidity_tier_handler.sql
indexer/services/ender/__tests__/handlers/liquidity-tier-handler.test.ts
Outdated
Show resolved
Hide resolved
indexer/services/ender/src/scripts/handlers/dydx_liquidity_tier_handler.sql
Outdated
Show resolved
Hide resolved
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (5)
- indexer/packages/postgres/src/db/migrations/migration_files/20240329154240_liquidity_tier_update.ts (1 hunks)
- indexer/packages/postgres/src/models/liquidity-tiers-model.ts (4 hunks)
- indexer/services/ender/tests/handlers/liquidity-tier-handler.test.ts (3 hunks)
- indexer/services/ender/src/handlers/liquidity-tier-handler.ts (1 hunks)
- indexer/services/ender/src/scripts/handlers/dydx_liquidity_tier_handler.sql (2 hunks)
Files skipped from review as they are similar to previous changes (5)
- indexer/packages/postgres/src/db/migrations/migration_files/20240329154240_liquidity_tier_update.ts
- indexer/packages/postgres/src/models/liquidity-tiers-model.ts
- indexer/services/ender/tests/handlers/liquidity-tier-handler.test.ts
- indexer/services/ender/src/handlers/liquidity-tier-handler.ts
- indexer/services/ender/src/scripts/handlers/dydx_liquidity_tier_handler.sql
indexer/services/ender/src/scripts/handlers/dydx_liquidity_tier_handler.sql
Show resolved
Hide resolved
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.
Actionable comments posted: 1
Review Status
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
protocol/indexer/events/events.pb.go
is excluded by!**/*.pb.go
,!**/*.pb.go
Files selected for processing (13)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts (8 hunks)
- indexer/services/ender/tests/handlers/liquidity-tier-handler.test.ts (9 hunks)
- indexer/services/ender/tests/helpers/constants.ts (2 hunks)
- indexer/services/ender/tests/validators/liquidity-tier-validator.test.ts (6 hunks)
- indexer/services/ender/src/handlers/liquidity-tier-handler.ts (2 hunks)
- indexer/services/ender/src/lib/block-processor.ts (2 hunks)
- indexer/services/ender/src/lib/helper.ts (2 hunks)
- indexer/services/ender/src/lib/types.ts (2 hunks)
- indexer/services/ender/src/validators/liquidity-tier-validator.ts (2 hunks)
- proto/dydxprotocol/indexer/events/events.proto (2 hunks)
- protocol/indexer/events/constants.go (1 hunks)
- protocol/indexer/events/liquidity_tier.go (1 hunks)
- protocol/indexer/events/liquidity_tier_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (4)
- indexer/services/ender/tests/handlers/liquidity-tier-handler.test.ts
- indexer/services/ender/tests/helpers/constants.ts
- indexer/services/ender/src/handlers/liquidity-tier-handler.ts
- indexer/services/ender/src/lib/block-processor.ts
Additional Context Used
Path-based Instructions (9)
protocol/indexer/events/liquidity_tier_test.go (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.protocol/indexer/events/liquidity_tier.go (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.protocol/indexer/events/constants.go (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/ender/src/validators/liquidity-tier-validator.ts (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/ender/__tests__/validators/liquidity-tier-validator.test.ts (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/ender/src/lib/types.ts (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/services/ender/src/lib/helper.ts (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.proto/dydxprotocol/indexer/events/events.proto (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts (1)
Pattern
**/**
: Do not include a walkthrough. For all comments on line changes that are longer than 15 lines, add a prefix to the comment of what lines you are commenting on (for example: "The changes from lines 100 to 200...". Add your comment to be on the last 15 lines of the chunk rather than adding your comment to the entire chunk.
Additional comments not posted (8)
protocol/indexer/events/liquidity_tier_test.go (1)
18-18
: Ensure the testTestNewLiquidityTierUpsertEvent_Success
adequately covers the new fieldsOpenInterestLowerCap
andOpenInterestUpperCap
introduced inLiquidityTierUpsertEventV2
.protocol/indexer/events/constants.go (1)
33-33
: Confirm the update ofLiquidityTierEventVersion
to2
aligns with the intended versioning strategy and that all references to this constant have been appropriately updated throughout the codebase.indexer/services/ender/src/validators/liquidity-tier-validator.ts (1)
51-91
: Ensure theLiquidityTierValidatorV2
class correctly validates the new fieldsopenInterestLowerCap
andopenInterestUpperCap
inLiquidityTierUpsertEventV2
. Consider adding validation logic for these fields if necessary.indexer/services/ender/__tests__/validators/liquidity-tier-validator.test.ts (1)
45-63
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [17-102]
Ensure the test suite for
LiquidityTierValidatorV2
includes tests for the new fieldsopenInterestLowerCap
andopenInterestUpperCap
inLiquidityTierUpsertEventV2
. Adding tests for these fields will help ensure their validation logic is correctly implemented.indexer/services/ender/src/lib/types.ts (1)
119-130
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [31-127]
Confirm the addition of
LiquidityTierUpsertEventV2
toEventProtoWithTypeAndVersion
correctly integrates with the rest of the system and that all necessary handling for this new event version has been implemented.indexer/services/ender/src/lib/helper.ts (1)
177-192
: Verify theindexerTendermintEventToEventProtoWithType
function correctly decodes and handles bothLiquidityTierUpsertEventV1
andLiquidityTierUpsertEventV2
based on theversion
parameter. Ensure this logic aligns with the intended handling of different event versions throughout the system.proto/dydxprotocol/indexer/events/events.proto (1)
462-489
: Confirm the definition ofLiquidityTierUpsertEventV2
inevents.proto
correctly includes all necessary fields and aligns with the intended functionality for handling Open Interest caps. Ensure the use of field options, such as markingopen_interest_lower_cap
as optional, aligns with the system's requirements.indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts (1)
1196-1267
: The introduction ofLiquidityTierUpsertEventV2
withopenInterestLowerCap
andopenInterestUpperCap
fields aligns with the PR's objectives to add OI caps info. The deprecatedbasePositionNotional
field is correctly marked.
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (3)
- indexer/services/ender/tests/handlers/liquidity-tier-handler.test.ts (9 hunks)
- indexer/services/ender/src/handlers/liquidity-tier-handler.ts (2 hunks)
- indexer/services/ender/src/lib/helper.ts (2 hunks)
Files skipped from review as they are similar to previous changes (3)
- indexer/services/ender/tests/handlers/liquidity-tier-handler.test.ts
- indexer/services/ender/src/handlers/liquidity-tier-handler.ts
- indexer/services/ender/src/lib/helper.ts
9dc26e0
to
ce70536
Compare
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.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
protocol/indexer/events/events.pb.go
is excluded by!**/*.pb.go
,!**/*.pb.go
Files selected for processing (3)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts (8 hunks)
- proto/dydxprotocol/indexer/events/events.proto (2 hunks)
- protocol/indexer/events/liquidity_tier.go (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts
- proto/dydxprotocol/indexer/events/events.proto
- protocol/indexer/events/liquidity_tier.go
indexer/services/ender/__tests__/handlers/liquidity-tier-handler.test.ts
Outdated
Show resolved
Hide resolved
indexer/services/ender/src/scripts/handlers/dydx_liquidity_tier_handler.sql
Show resolved
Hide resolved
https://github.com/Mergifyio backport release/protocol/v5.x |
https://github.com/Mergifyio backport release/indexer/v5.x |
✅ Backports have been created
|
✅ Backports have been created
|
(cherry picked from commit 3eb18f0)
(cherry picked from commit 3eb18f0)
(cherry picked from commit 3eb18f0) Co-authored-by: Mohammed Affan <[email protected]>
(cherry picked from commit 3eb18f0) Co-authored-by: Mohammed Affan <[email protected]>
Changelist
Test Plan
[Describe how this PR was tested (if applicable)]
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
New Features
LiquidityTierUpsertEventV2
with enhanced data fields for margin fractions, position sizes, and open interest caps.Improvements
Bug Fixes
LiquidityTierHandler
to correctly interpret liquidity tier data.Tests
Deprecations
LiquidityTierUpsertEventV1
in favor of the new version to reflect updated data fields.