Technical Deep DiveThis section explores the underlying infrastructure that makes Bayex possible.
System Components
Smart Accounts (Safe)
User wallets on Bayex are not EOAs (Externally Owned Accounts). Instead, we deploy a Safe (formerly Gnosis Safe) for every user.Compatibility: We utilize the exact same proxy architecture as Polymarket. This means if you have an existing Polymarket account, it is 100% compatible and usable on Bayex immediately.This Smart Account acts as a proxy, allowing for:
- Gasless Transactions (Sponsored)
- Batched Operations (Wrap + Swap)
- Session Keys (Future Scope)
The Relayer
Bayex utilizes a centralized (but strictly non-custodial) relayer service to submit transactions on behalf of users.
User Signature (EIP-712) -> Relayer API -> Blockchain -> ExecutionThis ensures users never need MATIC (Polygon gas token) to interact with the protocol.CT Wrapper Contract
The core innovation. Polymarket uses the Conditional Tokens Framework (ERC-1155). To make these compatible with Uniswap V4 (which works best with ERC-20s), we use a Wrapper.
Wrap
User sends ERC-1155 -> Wrapper locks it -> Mints ERC-20 (CTERC20)
Unwrap
User burns ERC-20 -> Wrapper unlocks ERC-1155 -> Sends to User
Uniswap V4 Pool Manager
We use the singleton
PoolManager contract to host all our prediction market pools.- Hooks: (Currently minimal) Future capability to add dynamic fees or KYC logic.
- Flash Accounting: Efficient multi-hop swaps or complex portfolio rebalancing in a single transaction.

