Skip to content

Comments

feat(lazer-pusher): add bulk trade pusher service#3468

Open
Dewyer wants to merge 1 commit intomainfrom
lazer-pusher/3-bulk-trade-pusher
Open

feat(lazer-pusher): add bulk trade pusher service#3468
Dewyer wants to merge 1 commit intomainfrom
lazer-pusher/3-bulk-trade-pusher

Conversation

@Dewyer
Copy link
Contributor

@Dewyer Dewyer commented Feb 13, 2026

Adds the Bulk Trade price pusher that delivers Pyth Lazer prices to Bulk Trade validators via WebSocket.

Components:

  • bulk-trade-pusher: Main service binary

    • Subscribes to Pyth Lazer price feeds
    • Signs price updates with Ed25519 (bulk-keychain)
    • Pushes to multiple validators via websocket-delivery
    • Health endpoints (liveness + readiness)
    • Prometheus metrics
  • bulk-trade-mock-validator: Mock validator for testing

    • Simulates Bulk Trade validator WebSocket API
    • Configurable acceptance rate for HA testing
    • Exposes metrics for monitoring

HA strategy: Multiple pushers share the same oracle account but use different signing keys. Validators deduplicate by (account, nonce).

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

@vercel
Copy link

vercel bot commented Feb 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-reference Ready Ready Preview, Comment Feb 20, 2026 2:17pm
component-library Ready Ready Preview, Comment Feb 20, 2026 2:17pm
developer-hub Ready Ready Preview, Comment Feb 20, 2026 2:17pm
entropy-explorer Ready Ready Preview, Comment Feb 20, 2026 2:17pm
insights Ready Ready Preview, Comment Feb 20, 2026 2:17pm
proposals Ready Ready Preview, Comment Feb 20, 2026 2:17pm
staking Ready Ready Preview, Comment Feb 20, 2026 2:17pm

Request Review

@Dewyer Dewyer marked this pull request as draft February 16, 2026 10:02
@Dewyer Dewyer force-pushed the lazer-pusher/2-websocket-delivery branch 2 times, most recently from 9707511 to 64a4705 Compare February 18, 2026 09:58
Base automatically changed from lazer-pusher/2-websocket-delivery to main February 20, 2026 11:21
@Dewyer Dewyer force-pushed the lazer-pusher/3-bulk-trade-pusher branch from 5c9f1f3 to 6d1515d Compare February 20, 2026 11:21
@Dewyer Dewyer marked this pull request as ready for review February 20, 2026 11:37
@Dewyer Dewyer force-pushed the lazer-pusher/3-bulk-trade-pusher branch from 6d1515d to c41f9bc Compare February 20, 2026 11:42
Adds the Bulk Trade price pusher that delivers Pyth Lazer prices
to Bulk Trade validators via WebSocket.

Components:
- bulk-trade-pusher: Main service binary
  - Subscribes to Pyth Lazer price feeds
  - Signs price updates with Ed25519 (bulk-keychain)
  - Pushes to multiple validators via websocket-delivery
  - Health endpoints (liveness + readiness)
  - Prometheus metrics

- bulk-trade-mock-validator: Mock validator for testing
  - Simulates Bulk Trade validator WebSocket API
  - Configurable acceptance rate for HA testing
  - Exposes metrics for monitoring

HA strategy: Multiple pushers share the same oracle account but use
different signing keys. Validators deduplicate by (account, nonce).

RUN --mount=type=cache,target=/root/.cargo/registry \
printf '[workspace]\nresolver = "2"\nmembers = ["apps/pyth-lazer-pusher/pusher-utils","apps/pyth-lazer-pusher/pusher-base","apps/pyth-lazer-pusher/websocket-delivery","apps/pyth-lazer-pusher/bulk-trade-pusher"]\n\n[workspace.lints.rust]\nunsafe_code = "deny"\n\n[workspace.lints.clippy]\nexpect_used = "warn"\nunwrap_used = "warn"\n' > Cargo.toml && \
cargo build --release -p bulk-pusher
Copy link
Contributor

Choose a reason for hiding this comment

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

So this creates an ad-hoc Cargo workspace and uses it to compile the project? Can't we just make a normal workspace at the apps/pyth-lazer-pusher level?

Comment on lines +7 to +10
//! Note: This module uses our own message types (OracleAction, OracleUpdate) with
//! integer prices + exponent format. The bulk-keychain crate's OraclePrice uses f64,
//! which doesn't match. Once bulk-keychain supports our format, we can migrate to
//! using their types directly.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ty for the great comments throughout!

/// A single oracle price update.
/// Prices are sent as integers with exponent, matching Lazer's native format.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OracleUpdate {
Copy link
Contributor

Choose a reason for hiding this comment

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

This might belong in a different module than signing.rs?

Comment on lines +3 to +8
//! Accepts WebSocket connections and responds to oracle push messages.
//! Exposes Prometheus metrics on a separate port.
//!
//! Usage:
//! cargo run --bin mock-bulk-validator -- --port 8080 --metrics-port 9090
//! cargo run --bin mock-bulk-validator -- --port 8080 --fail-rate 0.1 --dedup-rate 0.2
Copy link
Contributor

Choose a reason for hiding this comment

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

Very cool. Do you just spin it up for manual testing or is it hooked into integration tests somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants