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

[CT-808] Add subaccount limit per pnl run #1527

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions indexer/services/roundtable/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export const configSchema = {
// PNL ticks
PNL_TICK_UPDATE_INTERVAL_MS: parseInteger({ default: ONE_HOUR_IN_MILLISECONDS }),
PNL_TICK_MAX_ROWS_PER_UPSERT: parseInteger({ default: 1000 }),
PNL_TICK_MAX_ACCOUNTS_PER_RUN: parseInteger({ default: 65000 }),

// Remove expired orders
BLOCKS_TO_DELAY_EXPIRY_BEFORE_SENDING_REMOVES: parseInteger({ default: 20 }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export async function getPnlTicksCreateObjects(
const accountsToUpdate: string[] = [
...getAccountsToUpdate(accountToLastUpdatedBlockTime, blockTime),
...newSubaccountIds,
];
].slice(0, config.PNL_TICK_MAX_ACCOUNTS_PER_RUN);
stats.gauge(
`${config.SERVICE_NAME}_get_ticks_accounts_to_update`,
accountsToUpdate.length,
Expand Down
3 changes: 3 additions & 0 deletions indexer/services/roundtable/src/tasks/create-pnl-ticks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export default async function runTask(): Promise<void> {
at: 'create-pnl-ticks#runTask',
message: 'Error when getting pnl ticks',
error,
latestBlockHeight,
latestBlockTime,
txId,
});
return;
} finally {
Expand Down
Loading