On-Chain Methods
Trading, quoting, token approvals, and direct Gateway contract interaction via RPC.
Overview
Market Deployments & Routing
const gateway = await client.resolveGateway(marketAddress);Contract Addresses
Trading
Pricing Mechanism (DPM)
Quoting Trades
quoteBuy
quoteSell
quoteRedeem and quoteLiquidate
Buying Shares
BuyShares (params)
Field
Type
Description
Selling Shares
SellShares (params)
Field
Type
Description
Liquidating Positions
liquidate(params)
Field
Type
Description
getMarketStatus(marketAddress)
Slippage Guidelines
Scenario
Recommended slippage
Common Contract Errors
Error
Cause
Fix
Token Approvals
getTokenAllowance(params)
approveToken(params)
ensureTokenApproval(params)
Network
Collateral token
Gateway Contract Reference
viem Client Setup
Gateway Functions
1. Read Functions
Function
Args
Returns
Notes
2. Write Functions
Function
Args
Notes
Direct Read Examples
Implied Probability for All Outcomes
Spot Prices
Full Market State
Share Balance for a Wallet
Price Impact Estimation
Last updated