stacks_market_buy_yes
Purchase YES shares in Stacks Market prediction markets with a max-cost cap that protects against slippage; the transaction fails if cost exceeds your limit.
Instructions
Buy YES shares in a Stacks Market prediction market.
Uses the buy-yes-auto function with slippage protection via a max-cost cap. The transaction will fail if the cost exceeds max_cost_ustx.
Requires an unlocked wallet. Only available on mainnet.
Tip: call earning_opportunities to see how to put your assets to work.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shares | Yes | Number of YES shares to buy (integer, smallest unit) | |
| market_id | Yes | Market ID (epoch ms timestamp) | |
| max_cost_ustx | Yes | Maximum cost in micro-STX you are willing to pay (slippage protection) | |
| target_cap_ustx | Yes | Target liquidity cap in micro-STX (use current market cap from stacks_market_get) |