Skip to content

lnbits/bitmarket

Repository files navigation

LNbits

License: MIT Built for LNbits tip-hero

BitMarket — LNbits extension

A prediction market extension for LNbits that allows users to create and participate in Bitcoin Lightning prediction markets. Bet on outcomes of events using Lightning Network payments with automated payouts when markets resolve.

For video content about the BitMarket extension, watch the official demo.


Quick Links

Features

  • Create prediction markets — set event titles, descriptions, outcomes, and resolution dates
  • Place bets with Lightning — secure payments using Lightning Network invoices
  • Automated payouts — winning bets automatically receive payouts when markets resolve
  • Public market grid — browse all active prediction markets at /events
  • Shareable market pages — individual market pages at /events/{id} for easy sharing
  • Real-time updates — websocket notifications for payment confirmations
  • Market liquidity tracking — see total funds locked in each market

Overview

BitMarket enables prediction markets where users can bet on binary outcomes of events using Bitcoin Lightning payments. Each market has two possible outcomes (Yes/No), and when the market resolves, winning participants receive automatic payouts based on the total liquidity in the market.

Similar to Polymarket, users can view a grid of active prediction markets and participate by placing bets with their Lightning Addresses. The platform ensures trustless operation through Lightning Network payments and automated payout mechanisms.

Creating Markets

  1. Enable the extension in LNbits.

  2. Navigate to the BitMarket extension.

  3. Click "New Markets" to create a prediction market.

    Create Market
  4. Fill in market details:

    • Title: Question you're predicting (e.g., "Will BTC > $100k by Dec 31?")
    • Description: Additional context
    • Wallet: Wallet to manage market funds
    • Resolution Date: When the market will be resolved
    • Oracle: Identifier of the resolution authority (optional)
  5. Save the market to make it available for betting.

Placing Bets

  1. Navigate to the market grid at /events to see all available markets.

  2. Select a market to view details and place a bet.

  3. Enter your Lightning Address for receiving winnings and bet amount.

  4. Choose outcome (Yes or No) and submit your bet.

  5. Pay the Lightning invoice that's generated to confirm your bet.

    Place Bet

Market Resolution

Market owners can resolve markets when the event outcome is known:

  1. Go to your market in the admin interface.

  2. Click "Resolve Market" button.

  3. Select the winning outcome (Yes/No) from the dropdown.

  4. Click "Resolve" to finalize the market.

When a market resolves:

  • All bets on the winning outcome share the total market liquidity proportionally
  • Automated payouts are sent to winners' Lightning Addresses
  • The market status changes to "resolved"

Public Access

BitMarket provides two public interfaces:

  • Market Grid at /events: Browse all active prediction markets in a Polymarket-like grid
  • Individual Markets at /events/{id}: View and participate in specific markets

Both public pages are accessible without authentication, allowing anyone to browse and participate in prediction markets.


Powered by LNbits

LNbits empowers developers and merchants with modular, open-source tools for building Bitcoin-based systems — fast, free, and extendable.

Visit LNbits Shop Try myLNbits SaaS Read LNbits News Explore LNbits Extensions tip-hero

About

A prediction market extension for LNbits

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors