Definition
wagmi
A React hooks library for Ethereum used to manage wallet connections and on-chain state.
wagmi
wagmi is a React hooks library for Ethereum that provides composable utilities for wallet connections, account and chain state, transaction lifecycle management, and on-chain data fetching. PolyArb uses wagmi in the front end to keep wallet state synchronized, react to connection changes, and surface transaction status to users.
Key takeaways
- wagmi exposes lightweight React hooks for wallet connectivity, account data, and transactions.
- In PolyArb's stack wagmi is used alongside tools like viem and RainbowKit to manage signing, RPC calls, and UI flows.
- wagmi manages ephemeral UI state; long-running operations (e.g., CTF splits/merges) still rely on Polymarket's Relayer and backend confirmations.
- wagmi itself is a client-side library and does not replace on-chain verification or Polymarket's smart contracts.
In context
On PolyArb wagmi appears wherever the UI needs live wallet information: whether a user is connected, which address is active, which Polygon chain (chain ID 137) is selected, or whether a pending transaction has been confirmed. wagmi hooks are typically paired with viem (RPC and signer utilities) and RainbowKit (connection UI) so the app can create signed orders or trigger CTF operations that the Polymarket Relayer will submit gaslessly.
Because Polymarket sponsors gas via its Relayer and supports multiple wallet connectors (MetaMask, Rabby, Coinbase, etc.), wagmi's role is to surface the user's chosen connector and address to the app, and to expose wallet-signed payloads when required.
See also
- /glossary/viem
- /glossary/rainbowkit