Sell Trades
Purpose
The Sell function allows users to sell their shares of a specific outcome in exchange for a selected coin. The AMM dynamically adjusts the price based on the remaining pool liquidity.
Workflow
Input Parameters:
Market ID.
Outcome to sell.
Number of shares the user wants to sell.
Price Calculation:
The AMM calculates the amount of collateral the user will receive for the shares sold
pool Update:
Shares are added back to the pool.
Collateral is removed to maintain the constant product.
Collateral Transfer:
The calculated collateral is transferred to the user.
Fee Deduction:
A small fee is deducted and distributed to liquidity providers or the platform treasury.
Last updated