-
Notifications
You must be signed in to change notification settings - Fork 131
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-568] Initial vault PnL endpoints. #2121
Conversation
WalkthroughThe changes introduce new API endpoints for retrieving historical profit and loss (PnL) data for megavaults and vaults. Testing functions for these APIs are enhanced, a new helper function for aggregating PnL ticks is added, and relevant documentation and type definitions are updated to reflect these changes, thus improving the overall structure of the codebase. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant VaultController
participant Database
participant Helper
Client->>VaultController: GET /v1/megavault/historicalPnl
VaultController->>Database: Fetch PnL ticks
Database-->>VaultController: Return PnL ticks
VaultController->>Helper: aggregatePnlTicks(pnlTicks)
Helper-->>VaultController: Return aggregated PnL data
VaultController-->>Client: Return historical PnL response
sequenceDiagram
participant Client
participant VaultController
participant Database
participant Helper
Client->>VaultController: GET /v1/vaults/historicalPnl
VaultController->>Database: Fetch vault subaccount PnL ticks
Database-->>VaultController: Return PnL ticks
VaultController->>Helper: aggregatePnlTicks(pnlTicks)
Helper-->>VaultController: Return aggregated PnL data
VaultController-->>Client: Return historical PnL response
Poem
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: 2
Outside diff range, codebase verification and nitpick comments (4)
indexer/services/comlink/src/controllers/api/index-v4.ts (1)
23-23
: Maintain alphabetical order in imports.The import statement for
VaultController
should be placed in alphabetical order to maintain consistency.+ import VaultController from './v4/vault-controller';
indexer/services/comlink/public/api-documentation.md (3)
3079-3156
: Ensure correct endpoint path formatting.The endpoint path in the code samples is correct, but ensure consistency in formatting across all documentation.
Tools
Markdownlint
3128-3128: null
Blank line inside blockquote(MD028, no-blanks-blockquote)
5364-5365
: Correct grammatical errors in schema documentation.Use "an" instead of "a" before words starting with a vowel sound.
Use this diff to fix the grammatical errors:
- <a id="schemamegavaulthistoricalpnlresponse"></a> + <an id="schemamegavaulthistoricalpnlresponse"></an>- <a id="schema_MegavaultHistoricalPnlResponse"></a> + <an id="schema_MegavaultHistoricalPnlResponse"></an>Tools
LanguageTool
[misspelling] ~5364-~5364: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...emamegavaulthistoricalpnlresponse"> <a id="schema_MegavaultHistoricalPnlRespon...(EN_A_VS_AN)
[misspelling] ~5365-~5365: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...ma_MegavaultHistoricalPnlResponse"> <a id="tocSmegavaulthistoricalpnlresponse"...(EN_A_VS_AN)
5428-5429
: Correct grammatical errors in schema documentation.Use "an" instead of "a" before words starting with a vowel sound.
Use this diff to fix the grammatical errors:
- <a id="schemavaultshistoricalpnlresponse"></a> + <an id="schemavaultshistoricalpnlresponse"></an>- <a id="schema_VaultsHistoricalPnlResponse"></a> + <an id="schema_VaultsHistoricalPnlResponse"></an>Tools
LanguageTool
[misspelling] ~5428-~5428: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...schemavaultshistoricalpnlresponse"> <a id="schema_VaultsHistoricalPnlResponse"...(EN_A_VS_AN)
[misspelling] ~5429-~5429: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...chema_VaultsHistoricalPnlResponse"> </...(EN_A_VS_AN)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (11)
- indexer/packages/postgres/tests/helpers/mock-generators.ts (2 hunks)
- indexer/services/comlink/tests/controllers/api/v4/vault-controller.test.ts (1 hunks)
- indexer/services/comlink/tests/lib/helpers.test.ts (4 hunks)
- indexer/services/comlink/public/api-documentation.md (2 hunks)
- indexer/services/comlink/public/swagger.json (2 hunks)
- indexer/services/comlink/src/config.ts (1 hunks)
- indexer/services/comlink/src/controllers/api/index-v4.ts (2 hunks)
- indexer/services/comlink/src/controllers/api/v4/historical-pnl-controller.ts (2 hunks)
- indexer/services/comlink/src/controllers/api/v4/vault-controller.ts (1 hunks)
- indexer/services/comlink/src/lib/helpers.ts (3 hunks)
- indexer/services/comlink/src/types.ts (1 hunks)
Additional context used
Markdownlint
indexer/services/comlink/public/api-documentation.md
3128-3128: null
Blank line inside blockquote(MD028, no-blanks-blockquote)
3207-3207: null
Blank line inside blockquote(MD028, no-blanks-blockquote)
LanguageTool
indexer/services/comlink/public/api-documentation.md
[misspelling] ~5364-~5364: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...emamegavaulthistoricalpnlresponse"> <a id="schema_MegavaultHistoricalPnlRespon...(EN_A_VS_AN)
[misspelling] ~5365-~5365: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...ma_MegavaultHistoricalPnlResponse"> <a id="tocSmegavaulthistoricalpnlresponse"...(EN_A_VS_AN)
[misspelling] ~5395-~5395: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ... <a ...(EN_A_VS_AN)
[misspelling] ~5396-~5396: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ... <a id=...(EN_A_VS_AN)
[misspelling] ~5428-~5428: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...schemavaultshistoricalpnlresponse"> <a id="schema_VaultsHistoricalPnlResponse"...(EN_A_VS_AN)
[misspelling] ~5429-~5429: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...chema_VaultsHistoricalPnlResponse"> </...(EN_A_VS_AN)
Additional comments not posted (27)
indexer/services/comlink/src/controllers/api/index-v4.ts (1)
48-48
: LGTM!The addition of the
/vault
route is consistent with the existing routing structure.indexer/packages/postgres/__tests__/helpers/mock-generators.ts (1)
45-45
: LGTM!The addition of
vaultSubaccount
to theseedData
function enhances testing capabilities for vault-related scenarios.indexer/services/comlink/src/config.ts (1)
61-62
: LGTM!The addition of
EXPERIMENT_VAULTS
andEXPERIMENT_VAULT_MARKETS
provides a foundation for future vault-related configurations.indexer/services/comlink/src/controllers/api/v4/vault-controller.ts (4)
28-32
: Clarify placeholder logic.The
VaultMapping
interface and related TODO comments indicate placeholder logic. Ensure these are updated once the vault table is implemented.
81-133
: LGTM!The router setup for the new endpoints is consistent with existing patterns and includes rate limiting and error handling.
135-153
: Consider pagination or limits.The
getVaultSubaccountPnlTicks
function retrieves PnL ticks without explicit pagination or limits. Ensure this aligns with performance and data retrieval requirements.
155-166
: Clarify placeholder logic.The
getVaultSubaccountsFromConfig
function includes placeholder logic. Ensure these are updated once the vault table is implemented.indexer/services/comlink/src/controllers/api/v4/historical-pnl-controller.ts (1)
22-22
: LGTM!The use of
aggregatePnlTicks
improves code modularity and readability, aligning with best practices.indexer/services/comlink/__tests__/controllers/api/v4/vault-controller.test.ts (6)
21-23
: Ensure database migration is necessary.The
beforeAll
hook migrates the database. Confirm that this is necessary for the tests to run correctly, as it might slow down the test suite.
25-27
: Ensure proper teardown of database resources.The
afterAll
hook tears down the database. Verify that this is necessary and that it doesn't affect other tests running in parallel.
48-93
: Test coverage for single vault subaccount is comprehensive.The test for
/megavault/historicalPnl
with a single vault subaccount is well-structured and covers expected responses.
95-139
: Test coverage for multiple vault subaccounts is comprehensive.The test for
/megavault/historicalPnl
with two vault subaccounts is well-structured and covers expected responses.
141-189
: Test coverage for single vault subaccount in/vaults/historicalPnl
is comprehensive.The test is well-structured and covers expected responses.
191-251
: Test coverage for multiple vault subaccounts in/vaults/historicalPnl
is comprehensive.The test is well-structured and covers expected responses.
indexer/services/comlink/src/types.ts (5)
646-649
: EnsurePnlTicksResponseObject
is defined correctly.The
VaultHistoricalPnl
interface relies onPnlTicksResponseObject
. Verify that this type is defined correctly and used consistently.
651-653
: Ensure consistency inMegavaultHistoricalPnlResponse
.The
megavaultsPnl
field should consistently use thePnlTicksResponseObject
type. Verify its correct usage across the codebase.
655-657
: Ensure consistency inVaultsHistoricalPnlResponse
.The
vaultsPnl
field should consistently use theVaultHistoricalPnl
type. Verify its correct usage across the codebase.
659-664
: Ensure optional fields inVaultPosition
are handled correctly.The
perpetualPosition
field is optional. Ensure that the code handles cases where this field might be undefined.
666-668
: EnsureMegavaultPositionResponse
aligns with expected data structures.The
positions
field should use theVaultPosition
type. Verify its correct usage across the codebase.indexer/services/comlink/src/lib/helpers.ts (1)
547-569
: Ensure efficiency ofaggregatePnlTicks
function.The function aggregates PnL ticks by block height. Ensure that the logic is correct and that it handles large datasets efficiently.
indexer/services/comlink/__tests__/lib/helpers.test.ts (2)
728-742
: Test coverage for single PnL tick aggregation is comprehensive.The test accurately reflects the expected behavior of the
aggregatePnlTicks
function with a single PnL tick.
744-792
: Test coverage for multiple PnL ticks with the same height is comprehensive.The test accurately reflects the expected behavior of the
aggregatePnlTicks
function with multiple PnL ticks sharing the same block height.indexer/services/comlink/public/swagger.json (5)
1363-1377
: EnsureMegavaultHistoricalPnlResponse
schema is comprehensive.The schema should accurately represent the expected response structure for megavault historical PnL data.
1378-1396
: EnsureVaultHistoricalPnl
schema is comprehensive.The schema should accurately represent the expected structure for vault historical PnL data.
1397-1410
: EnsureVaultsHistoricalPnlResponse
schema is comprehensive.The schema should accurately represent the expected response structure for vaults historical PnL data.
3058-3075
: EnsureGET /vault/v1/megavault/historicalPnl
endpoint is documented correctly.The endpoint should accurately reflect the expected request and response structure.
3077-3094
: EnsureGET /vault/v1/v1/vaults/historicalPnl
endpoint is documented correctly.The endpoint should accurately reflect the expected request and response structure.
@Route('vault/v1') | ||
class VaultController extends Controller { | ||
@Get('/megavault/historicalPnl') | ||
async getMegavaultHistoricalPnl(): Promise<MegavaultHistoricalPnlResponse> { | ||
const vaultPnlTicks: PnlTicksFromDatabase[] = await getVaultSubaccountPnlTicks(); | ||
|
||
// aggregate pnlTicks for all vault subaccounts grouped by blockHeight | ||
const aggregatedPnlTicks: Map<number, PnlTicksFromDatabase> = aggregatePnlTicks(vaultPnlTicks); | ||
|
||
return { | ||
megavaultsPnl: Array.from(aggregatedPnlTicks.values()).map( | ||
(pnlTick: PnlTicksFromDatabase) => { | ||
return pnlTicksToResponseObject(pnlTick); | ||
}), | ||
}; | ||
} | ||
|
||
@Get('/v1/vaults/historicalPnl') | ||
async getVaultsHistoricalPnl(): Promise<VaultsHistoricalPnlResponse> { | ||
const vaultSubaccounts: VaultMapping = getVaultSubaccountsFromConfig(); | ||
const vaultPnlTicks: PnlTicksFromDatabase[] = await getVaultSubaccountPnlTicks(); | ||
|
||
const groupedVaultPnlTicks: VaultHistoricalPnl[] = _(vaultPnlTicks) | ||
.groupBy('subaccountId') | ||
.mapValues((pnlTicks: PnlTicksFromDatabase[], subaccountId: string): VaultHistoricalPnl => { | ||
const market: PerpetualMarketFromDatabase | undefined = perpetualMarketRefresher | ||
.getPerpetualMarketFromClobPairId( | ||
vaultSubaccounts[subaccountId], | ||
); | ||
|
||
if (market === undefined) { | ||
throw new Error(`Vault clob pair id ${vaultSubaccounts[subaccountId]} does not correspond to a perpetual market.`) | ||
} | ||
|
||
return { | ||
ticker: market.ticker, | ||
historicalPnl: pnlTicks, | ||
}}) | ||
.values() | ||
.value(); | ||
|
||
return { | ||
vaultsPnl: groupedVaultPnlTicks, | ||
}; | ||
} | ||
} |
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.
Ensure proper error handling and logging.
The getVaultsHistoricalPnl
method throws an error if a market is undefined. Consider logging this error for better traceability.
+ console.error(`Error: Vault clob pair id ${vaultSubaccounts[subaccountId]} does not correspond to a perpetual market.`);
Committable suggestion was skipped due to low confidence.
## GetVaultsHistoricalPnl | ||
|
||
<a id="opIdGetVaultsHistoricalPnl"></a> | ||
|
||
> Code samples | ||
|
||
```python | ||
import requests | ||
headers = { | ||
'Accept': 'application/json' | ||
} | ||
|
||
# For the deployment by DYDX token holders, use | ||
# baseURL = 'https://indexer.dydx.trade/v4' | ||
baseURL = 'https://dydx-testnet.imperator.co/v4' | ||
|
||
r = requests.get(f'{baseURL}/vault/v1/v1/vaults/historicalPnl', headers = headers) | ||
|
||
print(r.json()) | ||
|
||
``` | ||
|
||
```javascript | ||
|
||
const headers = { | ||
'Accept':'application/json' | ||
}; | ||
|
||
// For the deployment by DYDX token holders, use | ||
// const baseURL = 'https://indexer.dydx.trade/v4'; | ||
const baseURL = 'https://dydx-testnet.imperator.co/v4'; | ||
|
||
fetch(`${baseURL}/vault/v1/v1/vaults/historicalPnl`, | ||
{ | ||
method: 'GET', | ||
|
||
headers: headers | ||
}) | ||
.then(function(res) { | ||
return res.json(); | ||
}).then(function(body) { | ||
console.log(body); | ||
}); | ||
|
||
``` | ||
|
||
`GET /vault/v1/v1/vaults/historicalPnl` | ||
|
||
> Example responses | ||
|
||
> 200 Response | ||
|
||
```json | ||
{ | ||
"vaultsPnl": [ | ||
{ | ||
"ticker": "string", | ||
"historicalPnl": [ | ||
{ | ||
"id": "string", | ||
"subaccountId": "string", | ||
"equity": "string", | ||
"totalPnl": "string", | ||
"netTransfers": "string", | ||
"createdAt": "string", | ||
"blockHeight": "string", | ||
"blockTime": "string" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Responses | ||
|
||
|Status|Meaning|Description|Schema| | ||
|---|---|---|---| | ||
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Ok|[VaultsHistoricalPnlResponse](#schemavaultshistoricalpnlresponse)| | ||
|
||
<aside class="success"> | ||
This operation does not require authentication | ||
</aside> |
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.
Fix duplicate path segment in endpoint URL.
The endpoint URL contains a duplicate "v1" segment. Correct the URL in the documentation and code samples.
Use this diff to fix the endpoint URL:
- r = requests.get(f'{baseURL}/vault/v1/v1/vaults/historicalPnl', headers = headers)
+ r = requests.get(f'{baseURL}/vault/v1/vaults/historicalPnl', headers = headers)
- fetch(`${baseURL}/vault/v1/v1/vaults/historicalPnl`,
+ fetch(`${baseURL}/vault/v1/vaults/historicalPnl`,
Tools
Markdownlint
3207-3207: null
Blank line inside blockquote(MD028, no-blanks-blockquote)
return res.send(response); | ||
} catch (error) { | ||
return handleControllerError( | ||
'VaulController GET /megavault/historicalPnl', |
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.
nit
'VaulController GET /megavault/historicalPnl', | |
'VaultController GET /megavault/historicalPnl', |
try { | ||
const controllers: VaultController = new VaultController(); | ||
const response: MegavaultHistoricalPnlResponse = await controllers.getMegavaultHistoricalPnl(); | ||
return res.send(response); |
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.
nit: extra indentation here and below?
} | ||
} | ||
return aggregatedPnlTicks; | ||
} |
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.
nit: new line needed
totalPnl: (parseFloat(currentPnlTick.totalPnl) + parseFloat(pnlTick.totalPnl)).toString(), | ||
netTransfers: (parseFloat(currentPnlTick.netTransfers) + | ||
parseFloat(pnlTick.netTransfers)).toString(), | ||
}); |
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.
in extreme scenarios, these summations might overflow?
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.
The largest float possible is in the order of 1e308, so it's impossible given that these are human read-able dollar amounts.
The largest float possible without loss of precision (with 2 decimal places) I think is ~1e16, which is still near impossible with human-readable dollar amounts.
} | ||
|
||
export interface MegavaultHistoricalPnlResponse { | ||
megavaultsPnl: PnlTicksResponseObject[]; |
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.
nit
megavaultsPnl: PnlTicksResponseObject[]; | |
megavaultPnl: PnlTicksResponseObject[]; |
}; | ||
} | ||
|
||
@Get('/v1/vaults/historicalPnl') |
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.
The full url would be
vault/v1/vaults/historicalPnl
Seems a bit redundant?
Also, are we now trying to add versioning to our indexer APIs?
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.
Actually do you even need to put the "v1" here since its already on the route above?
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.
Will add a comment, I put a v1 since this is an MVP and there's corners being cut that we may want to rectify in the future and seemed better to have versioning already added rather than add it in later.
As for vault
vs vaults
, agree it looks redundant, but vault
is the top-level while vaults
indicates these are not the megavault
specific data.
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.
Also, are we now trying to add versioning to our indexer APIs?
Experimenting here since there might need to be a new version of this API for other vault data, and there's more strict type checking on FE/mobile on both protocol and indexer responses and a need for backwards compatability.
[subaccountId: string]: string; | ||
} | ||
|
||
@Route('vault/v1') |
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.
You have 'v1' both here (route) and on the specific API. Could you remove one or the other?
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.
I can't, this is an annotation for the swagger / doc generation, the other is the actual path being registered with express.
EDIT: Nevermind, misread this, I did add an additional v1
to the path.
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 (8)
- indexer/packages/postgres/tests/stores/pnl-ticks-table.test.ts (2 hunks)
- indexer/services/comlink/tests/controllers/api/v4/vault-controller.test.ts (1 hunks)
- indexer/services/comlink/tests/lib/helpers.test.ts (3 hunks)
- indexer/services/comlink/public/api-documentation.md (2 hunks)
- indexer/services/comlink/public/swagger.json (2 hunks)
- indexer/services/comlink/src/controllers/api/v4/vault-controller.ts (1 hunks)
- indexer/services/comlink/src/lib/helpers.ts (3 hunks)
- indexer/services/comlink/src/types.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- indexer/packages/postgres/tests/stores/pnl-ticks-table.test.ts
Files skipped from review as they are similar to previous changes (6)
- indexer/services/comlink/tests/controllers/api/v4/vault-controller.test.ts
- indexer/services/comlink/tests/lib/helpers.test.ts
- indexer/services/comlink/public/swagger.json
- indexer/services/comlink/src/controllers/api/v4/vault-controller.ts
- indexer/services/comlink/src/lib/helpers.ts
- indexer/services/comlink/src/types.ts
Additional context used
Markdownlint
indexer/services/comlink/public/api-documentation.md
3128-3128: null
Blank line inside blockquote(MD028, no-blanks-blockquote)
3207-3207: null
Blank line inside blockquote(MD028, no-blanks-blockquote)
LanguageTool
indexer/services/comlink/public/api-documentation.md
[misspelling] ~5364-~5364: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...emamegavaulthistoricalpnlresponse"> <a id="schema_MegavaultHistoricalPnlRespon...(EN_A_VS_AN)
[misspelling] ~5365-~5365: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...ma_MegavaultHistoricalPnlResponse"> <a id="tocSmegavaulthistoricalpnlresponse"...(EN_A_VS_AN)
[misspelling] ~5395-~5395: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ... <a ...(EN_A_VS_AN)
[misspelling] ~5396-~5396: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ... <a id=...(EN_A_VS_AN)
[misspelling] ~5428-~5428: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...schemavaultshistoricalpnlresponse"> <a id="schema_VaultsHistoricalPnlResponse"...(EN_A_VS_AN)
[misspelling] ~5429-~5429: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...chema_VaultsHistoricalPnlResponse"> </...(EN_A_VS_AN)
Additional comments not posted (4)
indexer/services/comlink/public/api-documentation.md (4)
3095-3111
: Fix duplicate path segment in endpoint URL.The endpoint URL contains a duplicate "v1" segment. Correct the URL in the documentation and code samples.
Use this diff to fix the endpoint URL:
- r = requests.get(f'{baseURL}/vault/v1/v1/vaults/historicalPnl', headers = headers) + r = requests.get(f'{baseURL}/vault/v1/vaults/historicalPnl', headers = headers)- fetch(`${baseURL}/vault/v1/v1/vaults/historicalPnl`, + fetch(`${baseURL}/vault/v1/vaults/historicalPnl`,Also applies to: 3174-3190
3158-3240
: LGTM! Endpoint documentation is complete.The documentation for the
GetVaultsHistoricalPnl
endpoint is well-structured and provides clear examples.Tools
Markdownlint
3207-3207: null
Blank line inside blockquote(MD028, no-blanks-blockquote)
5364-5365
: Correct grammatical errors in schema documentation.Use "an" instead of "a" before words starting with a vowel sound.
[misspelling]
Apply this diff to correct the grammar:- <a id="schemamegavaulthistoricalpnlresponse"></a> + <an id="schemamegavaulthistoricalpnlresponse"></an>- <a id="schema_MegavaultHistoricalPnlResponse"></a> + <an id="schema_MegavaultHistoricalPnlResponse"></an>Tools
LanguageTool
[misspelling] ~5364-~5364: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...emamegavaulthistoricalpnlresponse"> <a id="schema_MegavaultHistoricalPnlRespon...(EN_A_VS_AN)
[misspelling] ~5365-~5365: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...ma_MegavaultHistoricalPnlResponse"> <a id="tocSmegavaulthistoricalpnlresponse"...(EN_A_VS_AN)
5428-5429
: Correct grammatical errors in schema documentation.Use "an" instead of "a" before words starting with a vowel sound.
[misspelling]
Apply this diff to correct the grammar:- <a id="schemavaultshistoricalpnlresponse"></a> + <an id="schemavaultshistoricalpnlresponse"></an>- <a id="schema_VaultsHistoricalPnlResponse"></a> + <an id="schema_VaultsHistoricalPnlResponse"></an>Tools
LanguageTool
[misspelling] ~5428-~5428: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...schemavaultshistoricalpnlresponse"> <a id="schema_VaultsHistoricalPnlResponse"...(EN_A_VS_AN)
[misspelling] ~5429-~5429: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...chema_VaultsHistoricalPnlResponse"> </...(EN_A_VS_AN)
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 (1)
- indexer/services/comlink/tests/controllers/api/v4/vault-controller.test.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- indexer/services/comlink/tests/controllers/api/v4/vault-controller.test.ts
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 (1)
- indexer/packages/postgres/tests/stores/pnl-ticks-table.test.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- indexer/packages/postgres/tests/stores/pnl-ticks-table.test.ts
Changelist
MVP of vault PnL endpoints to un-block FE testing with data.
Notes:
Test Plan
Unit tests.
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
Bug Fixes
Documentation
Tests
Chores