Skip to content

feat(pyth-lazer-agent) Allow conditionally disabling success responses #2896

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

Merged
merged 12 commits into from
Jul 29, 2025
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
60 changes: 21 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions apps/pyth-lazer-agent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "pyth-lazer-agent"
version = "0.3.3"
version = "0.4.0"
edition = "2024"
description = "Pyth Lazer Agent"
license = "Apache-2.0"
repository = "https://github.com/pyth-network/pyth-crosschain"

[dependencies]
pyth-lazer-publisher-sdk = "0.1.7"
pyth-lazer-protocol = "0.8.1"
pyth-lazer-publisher-sdk = "0.3.0"
pyth-lazer-protocol = "0.10.1"

anyhow = "1.0.98"
backoff = "0.4.0"
Expand Down
21 changes: 14 additions & 7 deletions apps/pyth-lazer-agent/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pyth-lazer-agent

pyth-lazer-agent is intended to be run by Lazer publishers analogous to [pyth-agent](https://github.com/pyth-network/pyth-agent)
for pythnet publishers. Currently it retains [the existing Lazer publishing interface](https://github.com/pyth-network/pyth-examples/tree/main/lazer/publisher),
for pythnet publishers. Currently, it retains [the existing Lazer publishing interface](https://github.com/pyth-network/pyth-examples/tree/main/lazer/publisher),
but will batch and sign transactions before publishing them to Lazer.

## Keypair
Expand All @@ -16,6 +16,18 @@ pyth-lazer-agent will need to configure access to this keypair file to sign tran

## Build and run

### From cargo
```
# Download the cargo package
cargo install pyth-lazer-agent

# Add .cargo/bin to PATH
export PATH="$PATH:~/.cargo/bin"

# Run the agent
pyth-lazer-agent --help
```

Comment on lines +19 to +30
Copy link
Contributor

Choose a reason for hiding this comment

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

Would also show the actual run usage which is just pyth-lazer-agent --config /path/to/config.toml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

imho pyth-lazer-agent --help already explains how to use it in a lot more detail than we need to here

### From source
Please check [rust-toolchain](rust-toolchain.toml) to see the version of Rust needed to build (currently 1.88).
You will also need SSL and CA certificates. `cargo build` should then work as usual.
Expand All @@ -32,7 +44,7 @@ The agent takes a single `--config` CLI option, pointing at
`config/config.toml` by default. Configuration is currently minimal:

```toml
relayer_urls = ["ws://relayer-0.pyth-lazer.dourolabs.app/v1/transaction", "ws://relayer-0.pyth-lazer.dourolabs.app/v1/transaction"]
relayer_urls = ["wss://relayer.pyth-lazer-staging.dourolabs.app/v1/transaction", "wss://relayer-1.pyth-lazer-staging.dourolabs.app/v1/transaction"]
publish_keypair_path = "/path/to/keypair.json"
authorization_token = "your_token"
listen_address = "0.0.0.0:8910"
Expand All @@ -44,8 +56,3 @@ publish_interval_duration = "25ms"
- `authorization_token`: The Lazer team will provide this or instruct that it can be omitted.
- `listen_address`: The local port the agent will be listening on; can be anything you want.
- `publisher_interval`: The agent will batch and send transaction bundles at this interval. The Lazer team will provide guidance here.

## Publish

Please use the `/v1/publisher` or `/v2/publisher` endpoints and the corresponding `PriceFeedDataV1` and `PriceFeedDataV2`
schemas as defined in [the sdk](https://github.com/pyth-network/pyth-crosschain/blob/main/lazer/sdk/rust/protocol/src/publisher.rs).
2 changes: 1 addition & 1 deletion apps/pyth-lazer-agent/config/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
relayer_urls = ["wss://relayer-0.pyth-lazer.dourolabs.app/v1/transaction", "wss://relayer-0.pyth-lazer.dourolabs.app/v1/transaction"]
relayer_urls = ["wss://relayer.pyth-lazer-staging.dourolabs.app/v1/transaction", "wss://relayer-1.pyth-lazer-staging.dourolabs.app/v1/transaction"]
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably worth breaking these out as consts so that we can clearly understand they're "STAGING_RELAYER_1_WS_URL" or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in config? does toml have support for some consts i'm missing?

publish_keypair_path = "/path/to/solana/id.json"
listen_address = "0.0.0.0:8910"
publish_interval_duration = "25ms"
Expand Down
Loading