Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

pyth lazer cranker#471

Merged
moosecat2 merged 2 commits into
mainnet-betafrom
master
Jun 4, 2025
Merged

pyth lazer cranker#471
moosecat2 merged 2 commits into
mainnet-betafrom
master

Conversation

@moosecat2

Copy link
Copy Markdown
Contributor

No description provided.

@moosecat2
moosecat2 requested a review from Copilot June 3, 2025 23:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 subscribeChannel parameter to PythLazerSubscriber and exposes it via config
  • Adds skipSimulation and pythLazerIds to 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_MS should be DEFAULT_INTERVAL_MS for consistency and clarity.
const DEFAULT_INTEVAL_MS = 30000;

src/bots/pythLazerCranker.ts:91

  • [nitpick] Consider replacing console.log calls 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 skipSimulation to improve configuration clarity.
skipSimulation?: boolean;

src/pythLazerSubscriber.ts:30

  • [nitpick] Consider documenting the new subscribeChannel parameter 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 skipSimulation to 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);

Copilot AI Jun 3, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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}`);

Copilot uses AI. Check for mistakes.
@moosecat2
moosecat2 merged commit 6e4b70e into mainnet-beta Jun 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants