Skip to content

Commit 116c45d

Browse files
committed
chore(lazer) How lazer works requested changes
1 parent 85a5286 commit 116c45d

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

pages/lazer/how-lazer-works.mdx

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { Callout } from "nextra/components";
2-
31
# How Pyth Lazer works
42

53
Pyth Lazer is a permissioned service that provides ultra-low-latency market data to consumers.
64
It aggregates data from multiple publishers and distributes it to consumers through a multi-tier architecture.
75

86
## System Services
97

10-
The architecture consists of five main services that work together to provide ultra-low-latency data to consumers.
8+
The architecture consists of five main types of services that work together to provide ultra-low-latency data to consumers.
9+
Each service has multiple instances running to ensure high availability and low latency.
1110

1211
### INSERT DIAGRAM HERE
1312

@@ -23,33 +22,30 @@ The Relayer service is the ingestion layer that receives and validates all incom
2322
**Key responsibilities:**
2423

2524
- **Authentication**: Validates publisher access tokens and optional Ed25519 signatures.
25+
- **Validation**: Performs sanity checks on incoming updates by examining feed IDs, timestamps, and values to ensure data integrity and proper formatting.
2626
- **Rate limiting**: Enforces configurable limits on publisher updates.
27-
- **Message forwarding**: Publishes validated updates to an internal message queue (a NATS cluster).
27+
- **Message forwarding**: Publishes validated updates to an internal message queue.
2828

29-
**Douro Labs** operates the relayer service for the Pyth Lazer network.
29+
Douro Labs operates the relayer service for the Pyth Lazer network. It follows a strict, deterministic processing model:
3030

31-
<Callout type="info">
32-
The Douro Labs-operated relayer follows a strict, deterministic processing model:
33-
- **No price dropping**: All validated updates are forwarded to the message queue without dropping any prices.
34-
- **FCFS processing**: Updates are processed on a first-come-first-served basis without prioritization.
35-
- **Deterministic operation**: The relayer operates according to its configured logic and does not deviate from it.
31+
- **No price dropping outside of circuit breakers**: All validated updates are forwarded to the message queue without dropping any prices.
32+
- **FCFS processing**: Updates are processed on a first-come-first-served basis without prioritization.
33+
- **Deterministic operation**: The relayer operates according to its configured logic and does not deviate from it.
3634

3735
This ensures reliable, predictable data flow from publishers to consumers.
3836

39-
</Callout>
40-
4137
### Message Queue
4238

43-
The system uses NATS JetStream as the primary message queue for pub/sub messaging with stream persistence.
39+
The system uses a distributed message queue for pub/sub messaging with stream persistence.
4440
This allows the system to be deployed in a multi-datacenter environment and ensures reliable message delivery between services.
4541

46-
**Message ordering**: NATS JetStream guarantees message ordering within a single stream, ensuring that updates from publishers are processed in the order they were received by the Relayer.
42+
**Message ordering**: The message queue guarantees message ordering within a single stream, ensuring that updates from publishers are processed in the order they were received by the Relayer.
4743
This ordering guarantee is critical for maintaining consistent feed state across all aggregators.
4844

4945
### Routers
5046

5147
The Router is the real-time distribution layer that serves data to consumers.
52-
It embeds aggregation logic to compute median prices, confidence intervals (using interquartile range), and best bid/ask prices from multiple publisher inputs.
48+
It embeds aggregation logic to compute median prices, confidence intervals (using interquartile range), and best bid/ask prices, funding rates, and more from multiple publisher inputs.
5349

5450
**Key features:**
5551

@@ -60,7 +56,7 @@ It embeds aggregation logic to compute median prices, confidence intervals (usin
6056

6157
#### Aggregation logic
6258

63-
Each Router embeds an aggregator component that consumes publisher updates from NATS and computes aggregated data feeds. The aggregator:
59+
Each Router embeds an aggregator component that consumes publisher updates from the Message Queue and computes aggregated data feeds. The aggregator:
6460

6561
- Computes median values resistant to outlier data from individual publishers.
6662
- Calculates confidence intervals using interquartile range to measure data spread.
@@ -73,5 +69,5 @@ The History Service provides persistence and historical data queries.
7369

7470
**Key responsibilities:**
7571

76-
- Data persistence: Stores all publisher updates, aggregated data, and transactions in ClickHouse.
72+
- Data persistence: Stores all publisher updates, aggregated data, and transactions.
7773
- Historical queries: Provides REST API for querying historical data.

0 commit comments

Comments
 (0)