Buy Trades

Purpose

The Buy function allows users to purchase shares of a specific outcome in a prediction market. The price of shares is dynamically adjusted based on the current state of the market, reflecting demand and supply.

Workflow

  1. Input Parameters:

    • Market ID.

    • Outcome to buy (e.g., YES or NO).

    • Amount of collateral the user is willing to spend.

  2. Price Calculation

    • The AMM calculates the cost of the desired shares using the constant.

  3. Pool Update:

    • Collateral is added to the pool for the selected outcome.

    • The share pool is adjusted to maintain the constant product.

  4. Share Allocation:

  • The user receives the purchased shares in their wallet.

  1. Fee Deduction:

  • A small fee is deducted and distributed to liquidity providers or the platform treasury.

Last updated