This repository was archived by the owner on Jun 23, 2026. It is now read-only.
pyth lazer cranker#471
Merged
Merged
Conversation
allow for high performance pyth ranker
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the Pyth Lazer cranker by making the subscription channel configurable, adding control over simulation behavior, and refining interval and compute unit logic.
- Introduces
subscribeChannelparameter toPythLazerSubscriberand exposes it via config - Adds
skipSimulationandpythLazerIdsto bot config and implements branching for simulation vs. direct send - Refactors default interval handling and adjusts compute unit limits
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/pythLazerSubscriber.ts | Added Channel import, subscribeChannel parameter, updated constructor usage |
| src/config.ts | Added new optional config fields: skipSimulation, pythLazerChannel, pythLazerIds |
| src/bots/pythLazerCranker.ts | Updated imports, default interval logic, skipSimulation branch, compute unit limits, and debug logs |
Comments suppressed due to low confidence (6)
src/bots/pythLazerCranker.ts:37
- Typo in constant name:
DEFAULT_INTEVAL_MSshould beDEFAULT_INTERVAL_MSfor consistency and clarity.
const DEFAULT_INTEVAL_MS = 30000;
src/bots/pythLazerCranker.ts:91
- [nitpick] Consider replacing
console.logcalls with a structured logger (e.g.,logger.debug) to maintain consistency with other log statements.
console.log(feedIdChunks);
src/config.ts:123
- [nitpick] Add JSDoc or inline comments explaining the purpose and effect of
skipSimulationto improve configuration clarity.
skipSimulation?: boolean;
src/pythLazerSubscriber.ts:30
- [nitpick] Consider documenting the new
subscribeChannelparameter in the constructor (e.g., via JSDoc) to clarify its expected values.
private subscribeChannel = 'fixed_rate@200ms'
src/bots/pythLazerCranker.ts:199
- Introduce unit or integration tests covering both branches of
skipSimulationto ensure reliability across simulation and direct send modes.
if (!this.crankConfigs.skipSimulation) {
src/bots/pythLazerCranker.ts:176
- Reducing the compute unit limit from 1_400_000 to 30_000 may cause transactions to exceed the allowed compute units and fail. Verify this change aligns with expected on-chain requirements.
units: 30_000,
| throw new Error('Missing lazerEndpoint or lazerToken in global config'); | ||
| } | ||
|
|
||
| console.log(this.crankConfigs.pythLazerChannel); |
There was a problem hiding this comment.
[nitpick] This debug log may not be needed in production; consider removing it or using an appropriate logging level.
Suggested change
| console.log(this.crankConfigs.pythLazerChannel); | |
| logger.debug(`PythLazerChannel: ${this.crankConfigs.pythLazerChannel}`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.