-
Notifications
You must be signed in to change notification settings - Fork 115
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
Adam/remove candles main #2045
Adam/remove candles main #2045
Conversation
This reverts commit 5a6eed7.
WalkthroughThe recent changes reflect a significant simplification of the data model concerning candle and order book mid-price structures. Key properties related to Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API
participant Database
Client->>API: Request Candle Data
API->>Database: Fetch Candle Data (without Mid Prices)
Database-->>API: Return Candle Data
API-->>Client: Respond with Candle Data
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 Configuration 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 details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (13)
- indexer/packages/postgres/tests/helpers/constants.ts (1 hunks)
- indexer/packages/postgres/tests/stores/candle-table.test.ts (1 hunks)
- indexer/packages/postgres/src/models/candle-model.ts (2 hunks)
- indexer/packages/postgres/src/types/candle-types.ts (2 hunks)
- indexer/packages/postgres/src/types/db-model-types.ts (1 hunks)
- indexer/packages/redis/tests/caches/orderbook-levels-cache.test.ts (2 hunks)
- indexer/packages/redis/src/caches/orderbook-levels-cache.ts (1 hunks)
- indexer/services/comlink/public/api-documentation.md (4 hunks)
- indexer/services/comlink/public/swagger.json (1 hunks)
- indexer/services/ender/tests/helpers/redis-helpers.ts (2 hunks)
- indexer/services/ender/tests/lib/candles-generator.test.ts (22 hunks)
- indexer/services/ender/src/lib/candles-generator.ts (14 hunks)
- indexer/services/roundtable/src/lib/athena-ddl-tables/candles.ts (2 hunks)
Files skipped from review due to trivial changes (1)
- indexer/services/comlink/public/api-documentation.md
Additional comments not posted (18)
indexer/services/ender/__tests__/helpers/redis-helpers.ts (2)
Line range hint
8-15
: LGTM!The function
expectNextFundingRate
is correctly implemented.
Line range hint
17-24
: LGTM!The function
expectStateFilledQuantums
is correctly implemented.indexer/packages/postgres/src/types/candle-types.ts (2)
Line range hint
3-13
: LGTM!The removal of
orderbookMidPriceOpen
andorderbookMidPriceClose
fromCandleCreateObject
simplifies the data model.
Line range hint
15-24
: LGTM!The removal of
orderbookMidPriceOpen
andorderbookMidPriceClose
fromCandleUpdateObject
simplifies the data model.indexer/services/roundtable/src/lib/athena-ddl-tables/candles.ts (4)
Line range hint
8-18
: LGTM!The removal of
orderbookMidPriceOpen
andorderbookMidPriceClose
fromRAW_TABLE_COLUMNS
simplifies the table schema.
Line range hint
19-30
: LGTM!The removal of
orderbookMidPriceOpen
andorderbookMidPriceClose
fromTABLE_COLUMNS
simplifies the table schema.
Line range hint
32-39
: LGTM!The function
generateRawTable
is correctly implemented.
Line range hint
41-47
: LGTM!The function
generateTable
is correctly implemented.indexer/packages/postgres/__tests__/stores/candle-table.test.ts (1)
70-73
: LGTM! But verify the consistency of changes.The removal of
orderbookMidPriceOpen
andorderbookMidPriceClose
from theupdatedCandle
object is consistent with the updated model. Ensure that these properties are not referenced elsewhere in the test cases.To verify consistency, search for references to these properties in the test cases.
Verification successful
LGTM!
The removal of
orderbookMidPriceOpen
andorderbookMidPriceClose
from theupdatedCandle
object is consistent with the updated model. These properties are not referenced elsewhere in the test cases.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the properties `orderbookMidPriceOpen` and `orderbookMidPriceClose` are not referenced elsewhere in the test cases. # Test: Search for references to the properties. Expect: No occurrences. rg --type python 'orderbookMidPriceOpen' rg --type python 'orderbookMidPriceClose'Length of output: 144
Script:
#!/bin/bash # Description: Verify that the properties `orderbookMidPriceOpen` and `orderbookMidPriceClose` are not referenced elsewhere in the test cases. # Test: Search for references to the properties. Expect: No occurrences. rg 'orderbookMidPriceOpen' rg 'orderbookMidPriceClose'Length of output: 54
indexer/services/ender/src/lib/candles-generator.ts (2)
179-181
: Verify correctness of function calls after parameter removal.The removal of the
orderbookMidPrice
parameter simplifies the function call. Ensure that all calls tocreateUpdateOrPassPostgresCandle
are correct and that the removed parameter does not affect the functionality.Verification successful
Verified: Function calls are correct after parameter removal.
The removal of the
orderbookMidPrice
parameter from thecreateUpdateOrPassPostgresCandle
function is consistent across its definition and all calls. There are no issues with the functionality.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `createUpdateOrPassPostgresCandle` are correct. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type ts -A 5 $'createUpdateOrPassPostgresCandle'Length of output: 1131
Line range hint
203-268
:
Verify correctness of method after parameter removal.The removal of the
orderbookMidPrice
parameter and its related logic simplifies the method. Ensure that the method functions correctly without the removed parameter and logic.Verification successful
Verify correctness of method after parameter removal.
The removal of the
orderbookMidPrice
parameter and its related logic simplifies thecreateUpdateOrPassPostgresCandle
method. The search results confirm that there are no remaining references toorderbookMidPrice
in the codebase, indicating that the method functions correctly without the removed parameter and logic.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the `createUpdateOrPassPostgresCandle` method after parameter removal. # Test: Search for the method implementation. Expect: No references to `orderbookMidPrice`. rg --type ts -A 20 $'createUpdateOrPassPostgresCandle'Length of output: 3496
Script:
#!/bin/bash # Description: Verify the complete removal of `orderbookMidPrice` from the codebase. # Search for any references to `orderbookMidPrice` in the entire codebase. rg --type ts 'orderbookMidPrice'Length of output: 32
indexer/packages/redis/src/caches/orderbook-levels-cache.ts (1)
Line range hint
1-100
:
Verify correctness of codebase after function removal.The removal of the
getOrderBookMidPrice
function indicates a significant change in functionality. Ensure that no other parts of the codebase rely on this function.Verification successful
No issues found with the removal of the
getOrderBookMidPrice
function.The
getOrderBookMidPrice
function is not used anywhere else in the codebase, so its removal does not impact other parts of the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the codebase after removing the `getOrderBookMidPrice` function. # Test: Search for the function usage. Expect: No occurrences of `getOrderBookMidPrice`. rg --type ts -A 5 $'getOrderBookMidPrice'Length of output: 40
Script:
#!/bin/bash # Description: Verify the correctness of the codebase after removing the `getOrderBookMidPrice` function. # Test: Search for the function definition. Expect: No occurrences of `getOrderBookMidPrice`. rg 'function getOrderBookMidPrice' --type ts # Test: Search for the function usage. Expect: No occurrences of `getOrderBookMidPrice`. rg 'getOrderBookMidPrice' --type tsLength of output: 82
indexer/services/ender/__tests__/lib/candles-generator.test.ts (3)
Line range hint
1-30
:
Verify correctness of file after import removal.The removal of the
updatePriceLevel
import simplifies the file. Ensure that no other parts of the file rely on this import.Verification successful
Removal of
updatePriceLevel
import is correct.The
updatePriceLevel
import has been removed from theindexer/services/ender/__tests__/lib/candles-generator.test.ts
file, and it is not used within this file. Therefore, the removal is correct and does not impact the file.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the file after removing the `updatePriceLevel` import. # Test: Search for the import usage. Expect: No occurrences of `updatePriceLevel`. rg --type ts -A 5 $'updatePriceLevel'Length of output: 60025
Line range hint
1-30
:
Verify correctness of file after import removal.The removal of the
OrderSide
import simplifies the file. Ensure that no other parts of the file rely on this import.Verification successful
Removal of
OrderSide
import is correct.The removal of the
OrderSide
import fromindexer/services/ender/__tests__/lib/candles-generator.test.ts
does not affect the file as there are no references toOrderSide
within it.
- No occurrences of
OrderSide
were found in the specific file under review.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the file after removing the `OrderSide` import. # Test: Search for the import usage. Expect: No occurrences of `OrderSide`. rg --type ts -A 5 $'OrderSide'Length of output: 184739
Line range hint
251-337
:
Verify correctness of test cases after reference removal.The removal of references to
orderbookMidPriceClose
andorderbookMidPriceOpen
simplifies the test cases. Ensure that the tests still cover the necessary functionality.Verification successful
Verify correctness of test cases after reference removal.
The removal of references to
orderbookMidPriceClose
andorderbookMidPriceOpen
simplifies the test cases. The remaining test cases cover various scenarios such as creating candles with no open positions, creating first candles with open interest, and updating existing candles, ensuring comprehensive test coverage.
it('successfully creates candles with no open positions', async () => { ...
it('successfully creates first candles with open interest', async () => { ...
it('successfully updates existing candles', async () => { ...
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the test cases after removing references to `orderbookMidPriceClose` and `orderbookMidPriceOpen`. # Test: Search for the references in the test file. Expect: No occurrences of `orderbookMidPriceClose` and `orderbookMidPriceOpen`. rg --type ts -A 5 $'orderbookMidPriceClose' rg --type ts -A 5 $'orderbookMidPriceOpen'Length of output: 84
Script:
#!/bin/bash # Description: List all the test cases in the file to verify their coverage and correctness. # List all test descriptions in the file to ensure comprehensive test coverage. rg --type ts 'it\(' --context 3 indexer/services/ender/__tests__/lib/candles-generator.test.tsLength of output: 1362
indexer/packages/redis/__tests__/caches/orderbook-levels-cache.test.ts (1)
Line range hint
1-1
:
Verify the removal of thegetOrderBookMidPrice
tests.The removal of the
describe('getMidPrice', ...)
block significantly reduces the test coverage. Ensure that this functionality is no longer required or has been moved to another location.Verification successful
Verification complete: The
getOrderBookMidPrice
function is no longer present in the codebase.The removal of the
describe('getMidPrice', ...)
block is justified as the corresponding functionality has been removed from the codebase.
- No occurrences of the
getOrderBookMidPrice
function were found in the JavaScript/TypeScript files.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if the `getOrderBookMidPrice` function is still present in the codebase. # Test: Search for the function definition. Expect: No occurrences of the function definition. rg --type python 'def getOrderBookMidPrice'Length of output: 76
Script:
#!/bin/bash # Description: Verify if the `getOrderBookMidPrice` function is still present in the codebase. # Test: Search for the function definition in TypeScript files. Expect: No occurrences of the function definition. rg --type typescript 'function getOrderBookMidPrice'Length of output: 89
Script:
#!/bin/bash # Description: Verify if the `getOrderBookMidPrice` function is still present in the codebase. # Test: Search for the function definition in JavaScript/TypeScript files. Expect: No occurrences of the function definition. rg 'function getOrderBookMidPrice' --type js --type tsLength of output: 56
indexer/packages/postgres/__tests__/helpers/constants.ts (1)
Line range hint
1-1
:
Verify the removal oforderbookMidPriceOpen
andorderbookMidPriceClose
properties.The removal of these properties simplifies the data model. Ensure that these properties are no longer required or have been moved to another location.
Verification successful
The removal of
orderbookMidPriceOpen
andorderbookMidPriceClose
properties has been verified.The properties are no longer referenced in the codebase, confirming that their removal simplifies the data model without affecting other parts of the code.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if the `orderbookMidPriceOpen` and `orderbookMidPriceClose` properties are still referenced in the codebase. # Test: Search for references to the removed properties. Expect: No occurrences of the properties. rg --type python 'orderbookMidPriceOpen|orderbookMidPriceClose'Length of output: 96
Script:
#!/bin/bash # Description: Verify if the `orderbookMidPriceOpen` and `orderbookMidPriceClose` properties are still referenced in the codebase. # Test: Search for references to the removed properties. Expect: No occurrences of the properties. rg 'orderbookMidPriceOpen|orderbookMidPriceClose'Length of output: 51
indexer/services/comlink/public/swagger.json (1)
Line range hint
1-1
:
Verify the removal oforderbookMidPriceOpen
andorderbookMidPriceClose
properties.Ensure that all references to these properties are removed from the schema and that their removal does not affect the required properties list.
Verification successful
The properties
orderbookMidPriceOpen
andorderbookMidPriceClose
have been successfully removed from the codebase.No occurrences of these properties were found in any file types, confirming their complete removal.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the removal of `orderbookMidPriceOpen` and `orderbookMidPriceClose` properties. # Test: Search for the removed properties. Expect: No occurrences of the removed properties. rg --type json 'orderbookMidPriceOpen|orderbookMidPriceClose'Length of output: 63
Script:
#!/bin/bash # Description: Verify the removal of `orderbookMidPriceOpen` and `orderbookMidPriceClose` properties. # Test: Search for the removed properties in all JSON files. Expect: No occurrences of the removed properties. rg 'orderbookMidPriceOpen|orderbookMidPriceClose' --type jsonLength of output: 63
Script:
#!/bin/bash # Description: Verify the removal of `orderbookMidPriceOpen` and `orderbookMidPriceClose` properties. # Test: Search for the removed properties in all file types. Expect: No occurrences of the removed properties. rg 'orderbookMidPriceOpen|orderbookMidPriceClose'Length of output: 51
Changelist
Remove all candles changes from Main
Summary by CodeRabbit
New Features
orderbookMidPriceOpen
andorderbookMidPriceClose
from various components, including candle creation and updates.Bug Fixes
Documentation
Chores