build_buy_shares_tx
Build an unsigned transaction to buy YES or NO shares on a prediction market using CPMM pricing, given a market address, outcome, stablecoin amount, and chain ID. Requires prior stablecoin approval.
Instructions
Build an unsigned transaction to buy YES or NO shares on a prediction market. Requires prior stablecoin approval. Returns shares based on CPMM pricing.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"market_address": "<market_address>",
"outcome": "<outcome>",
"amount": "<amount>",
"chain_id": "<chain_id>"
},
"name": "build_buy_shares_tx"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Stablecoin amount to spend (e.g. "10.5") | |
| outcome | Yes | Market outcome: YES or NO | |
| chain_id | Yes | EVM chain ID (e.g. 8453 for Base, 369 for PulseChain) | |
| min_shares | No | Minimum shares to accept (slippage protection). Default "0" for no minimum. | 0 |
| market_address | Yes | PredictionMarket contract address |