Stellar-tradehub / stellar-trade
git clone https://github.com/Stellar-tradehub/stellar-trade.git
Stellar prediction-market prototype: buy a YES/NO position, sell by reducing it, and inspect pooled XLM settlement onchain.
—
stars, 24h
—
stars, 7 days
+129
stars, 30 days · #1,825
129
★ total
128
forks · 0 open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageShell
LicenseMIT
Created2026-10-07 (13d ago)
Last push5d ago
Watchers0
OwnerOrganization
GitHub topics
Links
README excerpt
# Stellar Trade **A Soroban prediction-market prototype for taking a position on a question and inspecting how it settles.** Built on Stellar, the project combines XLM pools, wallet-signed transactions, and contract-enforced payout accounting. ## Why Stellar Trade A poll records what people think. A prediction market records a position against a defined outcome and settles it under published rules. Stellar Trade explores how to make that lifecycle understandable and inspectable: what question is being asked, how much value entered the pool, who can resolve the market, and how the final payout was calculated. The project is aimed at communities and builders who want a transparent way to aggregate forecasts around ecosystem milestones, public data, or other questions with verifiable resolution criteria. The prototype uses Soroban contracts for the value-bearing rules and Stellar wallets for user authorization. Its goal is to make market mechanics reviewable in code and on the public ledger, while keeping the product honest about what is live and what is still a concept. ## Market flow [code] The contract enforces pool accounting and settlement, while the wallet authorizes each transaction. Market questions, criteria, and resolver authority remain essential parts of the trust model. ## How a market works 1. **Create a clear question.** A market needs an outcome that can be checked against stated criteria and a close time. Resolution sources and criteria must be published before a market opens. 2. **Buy a position.** A participant chooses YES or NO and stakes XLM. The contract records the position and accounts for the market's fee shares. 3. **Sell or reduce a position.** Before close, a participant can reduce their existing stake. The `reduce_position` contract operation returns the amount computed by its accounting rules. This is not an order-book sale to another user and does not open a short position. 4. **Resolve and settle.** An authorized resolver submits the outcome. Winning positions share the distributable pool proportionally; a cancelled market follows its refund path. Contract calls and resulting transactions can be inspected on Stellar. Market resolution is currently permissioned. Public price and network feeds shown by the website provide context; they do not act as automated oracles or trigger settlement. Resolver accountability, objective criteria, and public evidence are open product and governance problems, not solved features. ## What is implemented - **Prediction market contract:** market creation, YES/NO positions, partial position reduction, proportional claims, cancellation refunds, per-market fee accounting, dispute timing, and administrative controls. - **Reward asset contract:** a Soroban token used by the reward system. Fresh deployments initialize it as **Stellar Trade (STRD)**. The STRD contract has not yet been deployed. - **Referral registry:** referral registration and bounded referral-fee distribution. - **Leaderboa