Types
Shared types across the Python SDK. The value types (SwapParams, Quote, SwapResult, …) are dataclasses re-exported from the package root (from propamm import SwapParams); override types come from propamm.overrides.
SwapParams
Common parameters shared by every swap entrypoint.
@dataclass
class SwapParams:
token_in: str
token_out: str
amount_in: int
amount_out_min: int
recipient: str
deadline: inttoken_in— address of the token being sold, orETH_SENTINELfor native ETH (attachesmsg.valueautomatically).token_out— address of the token being bought;ETH_SENTINELdelivers native ETH.amount_in— exact input amount, in atomic units.amount_out_min— minimum acceptable output (net of the frontend fee, when one is passed); derive from a quote withapply_slippage.recipient— receiver oftoken_out.deadline— unix timestamp after which the swap is invalid; build withdeadline_in.
Quote
Result of every quote method.
@dataclass
class Quote:
amount_out: int
venue: stramount_out— the quoted output amount, in atomic units.venue— the venue that produced the quote (or the Uniswap fallback router); pin it in a follow-upswapviaSwapOptions.venuesto execute against it.
SwapResult
Decoded outcome of a mined swap, from wait_for_swap or swap_and_wait.
@dataclass
class SwapResult:
hash: str
receipt: Any
amount_in: int
amount_out: int
executed_venue: str
recipient: str
fee: FeeCharged | None = Nonehash/receipt— the transaction hash and its receipt.amount_in— input pulled from the sender (from theSwappedevent).amount_out— output delivered to the recipient, net of any fee.executed_venue— the venue that actually filled, or the Uniswap fallback router.recipient— who receivedtoken_out.fee— aFeeCharged, present when the swap charged a frontend fee (fromFrontendFeeCharged).
FeeCharged
The frontend fee actually charged by a swap, on SwapResult.fee.
@dataclass
class FeeCharged:
recipient: str
amount: intSwapOptions
Per-swap options, accepted by swap and swap_and_wait.
@dataclass
class SwapOptions:
venues: list[str] | None = None
frontend_fee: FrontendFee | None = None
gas_limit: int | None = Nonevenues— restrict the swap to these venues: a single entry executes through that venue directly, several re-quote on-chain and fill via the best of them. Must be non-empty when present; omit to swap through the best-quoting venue overall.frontend_fee— skim a frontend fee from the output; routes the call through the contract'sWithFeeselector.gas_limit— explicit transaction gas limit, in gas units. Overrides the hardcoded per-function default (see swap).
FrontendFee
Frontend fee skimmed from a swap's output; pass via SwapOptions.frontend_fee. Validated before the swap is sent.
@dataclass
class FrontendFee:
bps: int
recipient: strbps— fee in basis points of the output token, an integer in[1, MAX_FEE_BPS](MAX_FEE_BPS = 100, i.e. 1%).recipient— receives the fee intoken_out; must be a valid, non-zero address.
QuoteOptions
Per-call options accepted by quote.
@dataclass
class QuoteOptions:
overrides: ... = <attached source>
bebop_default: bool = True
venues: list[str] | None = Noneoverrides— by default uses the router's attached overrides source. Replace it for this call with anotherOverridesSource, a fixedOverridesSnapshot, orNoneto quote raw on-chain state.bebop_default— setFalseto keep Bebop's raw on-chain slot instead of zeroing it when the snapshot has no Bebop entry (defaultTrue).venues— restrict the quote to these venues: a single entry quotes that venue directly, several pick the best among them. Must be non-empty when present.
OverridesSnapshot
A parsed pAMM state-override payload, returned by every source's get_overrides().
@dataclass
class OverridesSnapshot:
block_number: int | None = None
timestamp_ns: int | None = None
per_pamm: dict[str, dict[str, dict[int, int]]] = ...block_number— block the overrides were generated against; quotes pin the simulation to it.timestamp_ns— generation time in nanoseconds since epoch; quotes pin the simulatedblock.timestampto it.per_pamm— pAMM address → overridden contract → storage slot → value.
OverridesSource
The abstract base both override sources implement — subclass it to plug in a custom source.
class OverridesSource(abc.ABC):
async def get_overrides(self) -> OverridesSnapshot | None: ...
async def close(self) -> None: ... # optional teardown; default no-opPriceLevelsSnapshot
A parsed price-levels payload, returned by every source's get_price_levels().
@dataclass
class PriceLevelsSnapshot:
block_number: int | None = None
slot: int | None = None
timestamp_ns: int | None = None
pamms: list[PammPriceLevels] = ...block_number— block the levels were generated against.slot— beacon slot the levels were generated against.timestamp_ns— generation time in nanoseconds since epoch.pamms— per-pAMM order books.
PammPriceLevels
One pAMM's price levels across all pairs it quotes.
@dataclass
class PammPriceLevels:
pamm: ChecksumAddress
pairs: list[PairPriceLevels] = ...PairPriceLevels
The order book a pAMM quotes for one token_in/token_out pair.
@dataclass
class PairPriceLevels:
token_in: ChecksumAddress
token_out: ChecksumAddress
order_book: list[PriceLevel] = ...PriceLevel
One rung of a pair's order book.
@dataclass
class PriceLevel:
amount_in: int
amount_out: int
variant: Literal["Simulated", "Interpolated"]amount_in/amount_out— amounts in atomic units.variant—"Simulated"means the rung came from an EVM simulation;"Interpolated"from a linear spline between simulated rungs.
TitanQuote
Result of get_quote / get_quote_venue (titan_getPammQuote / titan_getPammQuoteVenue).
@dataclass
class TitanQuote:
token_in: ChecksumAddress
token_out: ChecksumAddress
amount_in: int
amount_out: int
pamm: ChecksumAddress
router: ChecksumAddress
block_number: int | None = None
slot: int | None = None
timestamp_ns: int | None = Nonepamm— pAMM that produced the quote.router— router associated with the quote.
PriceLevelsSource
The abstract base both price-level sources implement — subclass it to plug in a custom source.
class PriceLevelsSource(abc.ABC):
async def get_price_levels(self) -> PriceLevelsSnapshot: ...
async def close(self) -> None: ... # default no-op