OverridesWsSource
Streaming source for pAMM state overrides — the router default. Caches per-pAMM entries across frames (a frame only carries the pAMMs it updates), reconnects with backoff, and auto-closes when idle.
OverridesWsSource(
url: str = "wss://rpc.titanbuilder.xyz/ws/pamm_quote_stream",
*,
first_frame_timeout: float = 5.0,
idle_timeout: float = 30.0
)Usage
from propamm import PropAmmRouter
from propamm.overrides import OverridesWsSource
# the default: a router without an overrides argument creates one internally
router = PropAmmRouter(client, "0x...")
# or configure explicitly
source = OverridesWsSource(idle_timeout=0)
router2 = PropAmmRouter(client, "0x...", overrides=source)Methods
get_overrides()
async def get_overrides(self) -> OverridesSnapshotReturns OverridesSnapshot — the accumulated snapshot. Connects lazily on first use and waits for the first frame; after an idle close it reconnects and waits for a fresh frame instead of serving stale data. Raises on first-frame timeout or after close().
close()
async def close(self) -> NoneImmediate, permanent teardown. Not needed for process exit — the idle timeout handles that.
Parameters
url (optional)
- Type:
str - Default:
wss://rpc.titanbuilder.xyz/ws/pamm_quote_stream
Stream endpoint.
first_frame_timeout (optional)
- Type:
float(seconds) - Default:
5.0
How long get_overrides waits for the first frame before raising.
idle_timeout (optional)
- Type:
float(seconds) - Default:
30.0
Close the socket after this long without a get_overrides call; the next call reconnects transparently. 0 closes right after each call.