> For the complete documentation index, see [llms.txt](https://docs.ethgas.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ethgas.com/get-started/traders/propamm/makers.md).

# Makers

pAMM Quote WebSocket

> This endpoint is reserved for trading firms operating a propAMM on Ethereum who want to land quote updates in ETHGAS realtime blocks. Access is API-key gated, please go to: <https://hoodi.propamm.ethgas.com/> to get the access

### Behavioral properties <a href="#behavioural-properties" id="behavioural-properties"></a>

**Maker priority**

The builder provides two defences against being picked off on latency.

**Taker ordering.** When a taker trade against the pool is included in a block, the latest applicable quote update is guaranteed to be placed before it in the same block.

**Maker freshness protection.** A per-session freshness buffer `b`, set at onboarding, can be applied to takers routing against your pool. A taker is only eligible to trade against a quote update if the taker was received by the builder at least `b` before that quote update was received:

```
taker_recv + b < quote_update_recv
```

For example, with `b = 50ms`, a quote update received at time `T` can only be sequenced against takers received before `T - 50ms`.

This reduces exposure to toxic takers attempting to snipe stale quotes, while also protecting makers in case of quote streaming failures mid-slot.

Makers should therefore target a requote cadence of 50ms even if the price they're quoting did not move. We will evict any quotes from the quote state override stream as well as the price level stream that did not receive an update for longer than 400ms.

**Fast replacements and cancellations**

Quotes sent through this endpoint take the fastest path to the builders. We have cores dedicated to simulating and applying these bundles efficiently. Cancellations are more consistent due to stricter block overwrite rules.

**Conditional inclusion**

Quote transactions can either land every block, or only when a taker in the block trades against the pool. The builder evaluates each candidate tx against every live quote and, in conditional mode, includes the latest quote update immediately before any taker - quotes that have no takers never go onchain.

#### Authentication <a href="#authentication" id="authentication"></a>

Authentication uses an API key shared directly when access is granted. Specify it in the `Authorization` header when establishing the WebSocket connection.

#### Endpoints <a href="#endpoints" id="endpoints"></a>

Use the following regional endpoints to get the lowest latency between your quote publisher and our clusters. Higher-performance URLs (direct access) are available on request.

| Region                       | Mainnet                                                                                                          |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `us-east-1`                  | [wss://us.propamm.rpc.ethgas.com/ws/sendquoteupdate](wss://hoodi-test.propamm.rpc.ethgas.com/ws/sendquoteupdate) |
| `eu-central-1`               | [wss://eu.propamm.rpc.ethgas.com/ws/sendquoteupdate](wss://hoodi-test.propamm.rpc.ethgas.com/ws/sendquoteupdate) |
| `ap-northeast-1 (Tokyo, 1a)` | <wss://ap.propamm.rpc.ethgas.com/ws/sendquoteupdate>                                                             |
| `ap-northeast-1 (Tokyo, 1d)` | [wss://ap-2.propamm.rpc.ethgas.com/ws/sendquoteupdate](wss://ap.propamm.rpc.ethgas.com/ws/sendquoteupdate)       |

Hoodi staging (stable version):

Hoodi dev (active development version)

|              | Hoodi Dev                                                                                                                 | Hoodi staging                                                                                                         |
| ------------ | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `ap-east-1c` | <wss://hoodi-test.propamm.rpc.ethgas.com/ws/sendquoteupdate>                                                              | [wss://hoodi.propamm.rpc.ethgas.com/ws/sendquoteupdate](wss://hoodi-test.propamm.rpc.ethgas.com/ws/sendquoteupdate)   |
| `ap-east-1c` | [wss://hoodi-test2.propamm.rpc.ethgas.com/ws/sendquoteupdate](wss://hoodi-test.propamm.rpc.ethgas.com/ws/sendquoteupdate) | [wss://hoodi-2.propamm.rpc.ethgas.com/ws/sendquoteupdate](wss://hoodi-test.propamm.rpc.ethgas.com/ws/sendquoteupdate) |

#### Submit quote (`ws/sendquoteupdate`) <a href="#submit-quote-ws-sendquoteupdate" id="submit-quote-ws-sendquoteupdate"></a>

```proto
message PWebsocketQuoteUpdateV1Args {
  // RLP-encoded quote-update tx bytes. Empty = cancel the replacement_uuid.
  bytes tx = 1;
  // single block this quote is valid for
  uint64 block_number = 2;
  // 16-byte quote identifier (raw UUID bytes).
  bytes replacement_uuid = 3;
  // monotonic per uuid (>0)
  uint64 replacement_seq_number = 4;
  // quotes will not be shared between builder regions
  bool disable_cross_region_sharing = 5;
  // Asset pairs for quoting: each element is 40 bytes (two 20-byte ERC20 token
  // addresses concatenated). Designates which pair prices are influenced by the update.
  repeated bytes asset_pairs = 6;
  // Quote address taker has to touch (20-byte address) in order to receive a quote. 
  bytes quote_address = 7; 
  // Pool addresses (20-byte address) for which this quote is needed if takers want to swap
  repeated bytes pool_addresses = 8;
}
```

`replacement_uuid` must be set and exactly 16 bytes. `replacement_seq_number` must be set and strictly greater than the previous value seen under the same `replacement_uuid` and cannot be 0. Messages violating either constraint are dropped.

We recommend setting `disable_cross_region_sharing` to `true`. Otherwise we broadcast your quotes internally across regions, which adds latency you do not control. For best results, run edge nodes next to each of our regional clusters and send directly to the closest.

#### Cancel quotes <a href="#cancel-quotes" id="cancel-quotes"></a>

Send a `PWebsocketQuoteUpdateV1Args` with `tx` empty, `replacement_uuid` set to the quote you want to pull, and a strictly greater `replacement_seq_number` than the last update under that uuid.

#### Response <a href="#response" id="response"></a>

```proto
message PWebsocketQuoteUpdateV1Response {
  // Quote identifier being acknowledged.
  bytes replacement_uuid = 1;
  uint64 replacement_seq_number = 2;
  // RPC receive UNIX nanos.
  uint64 timestamp = 3;
  // Empty on success. Populated with error detail on failure.
  string error = 4;
}
```

Match responses to submits on `(replacement_uuid, replacement_seq_number)`. Use `timestamp` minus your local send-time to measure end-to-end latency.

#### Example (Rust) <a href="#example-rust" id="example-rust"></a>

```rust
// Generate the `pb` module from the .proto above using prost-build.

use std::io::ErrorKind;
use tungstenite::{client::IntoClientRequest, stream::MaybeTlsStream, Message as WsMessage};
use prost::Message;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut req = "wss://ap.propamm.rpc.ethgas.com/ws/sendquoteupdate".into_client_request()?;
    req.headers_mut().insert("Authorization", "YOUR_API_KEY".parse()?);

    let (mut ws, _) = tungstenite::connect(req)?;

    if let MaybeTlsStream::Plain(s) = ws.get_mut() {
        s.set_nodelay(true)?;
        s.set_nonblocking(true)?;
    }

    let mut buf = Vec::with_capacity(4096);
    let mut seq: u64 = 0;

    loop {
        seq += 1;
        let quote = pb::PWebsocketQuoteUpdateV1Args {
            tx: vec![/* RLP-encoded signed quote-update tx */],
            block_number: 1234,
            replacement_uuid: vec![/* 16 bytes */],
            replacement_seq_number: seq,
            disable_cross_region_sharing: true,
            asset_pairs: vec![/* 40-byte token0||token1 concatenations */],
            quote_address: /*20 byte address*/,
            pool_addresses: vec![/*optionally filled: 20 byte address,20 byte address*/,]
        };

        buf.clear();
        quote.encode(&mut buf)?;

        match ws.send(WsMessage::Binary(buf.into())) {
            Ok(()) => {}
            Err(tungstenite::Error::Io(e)) if e.kind() == ErrorKind::WouldBlock => {}
            Err(e) => return Err(e.into()),
        }

        match ws.read() {
            Ok(WsMessage::Binary(bytes)) => {
                let _resp = pb::PWebsocketQuoteUpdateV1Response::decode(&*bytes)?;
                // latency = match on (replacement_uuid, replacement_seq_number)
            }
            Ok(_) => {}
            Err(tungstenite::Error::Io(e)) if e.kind() == ErrorKind::WouldBlock => {}
            Err(e) => return Err(e.into()),
        }
    }
}
```

#### Pricing <a href="#pricing" id="pricing"></a>

Quote updates submitted through this endpoint do not pay priority fees.

Instead, makers are charged a volume-based fee on filled trades. Fees are configured on a per-pair basis. Pricing may differ across assets depending on market structure and quoting behaviour, though fees across makers are the same.

During the initial testing phase, fee discounts are active while we collect data on spreads, fill quality, and realised markouts across different markets. We expect to move to a more stable and publicly documented fee schedule once the system has been sufficiently tested and pricing can be calibrated from production data. Please reach out directly for more information on current pricing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ethgas.com/get-started/traders/propamm/makers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
