events namespace —
independent of DlmmProgram/Pool/Position/BinArray.
address defaults to programAddress — every pool the program touches. Pass a specific pool
address to scope the subscription to just that pool.
Event types
The SDK decodes all seven events the program emits:
Every amount field on these events is gross — before any Token-2022 transfer fee, which is
reported separately via the matching
transferFee*/*TransferFee field rather than netted
out. This matches the convention used everywhere else in the protocol: reporting a net amount
here would silently disagree with what actually moved for a leg that paid a transfer fee, and
would make the same field mean different things depending on whether the mint happened to carry
the extension.
event.name is a discriminated union tag — narrow on it to get the correctly-typed data:
Scoping to one pool, and handling stream errors
Passaddress to watch a single pool instead of every pool the program touches, and onError
to observe stream-level failures (e.g. a dropped WebSocket) without an unhandled rejection — a
handler throw only drops that one event and doesn’t stop the subscription, so onError is
specifically for the transport, not for errors your own handler raises: