Problem
Stories on the discover/home page can only be sorted by default order. Users who want to find trending or high-value stories have no way to sort by market cap.
Solution
Add a "Market Cap" option to the sort dropdown on the story discovery page. Stories are sorted by their token's market cap (total supply × price per token × PLOT USD price) in descending order.
Implementation
- The
trade_history table already has price_per_token and total_supply for each storyline token
- PLOT USD price is available via
getPlotUsdPrice()
- MCap =
total_supply × price_per_token × PLOT_USD
- Add sort option to existing dropdown (alongside "Newest", "Most Plots", etc.)
Files
- Discover/home page component — add sort option
- API route for discovery — add
sort=mcap query param support
Acceptance Criteria
Problem
Stories on the discover/home page can only be sorted by default order. Users who want to find trending or high-value stories have no way to sort by market cap.
Solution
Add a "Market Cap" option to the sort dropdown on the story discovery page. Stories are sorted by their token's market cap (total supply × price per token × PLOT USD price) in descending order.
Implementation
trade_historytable already hasprice_per_tokenandtotal_supplyfor each storyline tokengetPlotUsdPrice()total_supply × price_per_token × PLOT_USDFiles
sort=mcapquery param supportAcceptance Criteria