Liquidity Marketplace
How the Magma marketplace works - HODL invoices, non-custodial settlement, matching, and the order lifecycle at a glance.
Magma is a peer-to-peer marketplace for Lightning Network channel liquidity. Sellers post offers; buyers fill them; channels open. Everything is settled with HODL invoices, so Magma never takes custody of either side's funds.
This page is the conceptual overview. For the developer-facing details see Orders and Offers, Buy Liquidity, and Sell Liquidity.
What's on the marketplace
Two artefacts:
- Offers - listings by sellers: "I'll provide up to N sats of inbound capacity, at this price, locked for at least M blocks, to buyers who meet these criteria."
- Orders - agreements when a buyer fills part of an offer: "I (buyer) am paying X for Y sats of inbound to my node from this seller, for this duration."
Both have rich filtering and metadata. See Orders and Offers for the data model.
How HODL invoices make it non-custodial
A regular Lightning invoice settles the moment payment lands. A HODL invoice holds the payment in escrow and only settles when the recipient releases a secret preimage. Magma uses this primitive to bind payment to channel opening.
The guarantees this gives you:
| Scenario | Outcome |
|---|---|
| Seller never opens the channel | HODL invoice expires; buyer's payment auto-refunds. |
| Seller opens the wrong channel (different peer, wrong size) | Magma marks the order INVALID_CHANNEL_OPENING; buyer's payment auto-refunds. |
| Channel opens correctly and confirms | HODL settles; seller is paid, buyer has inbound capacity. |
| Buyer doesn't pay before invoice expiry | Order fails (BUYER_FAILED_TO_PAY); no money moves. |
Because HODL invoices use real channels, Magma never holds buyer or seller keys. Amboss only operates the matching, monitoring, and dispute layer.
Lock period and routing guarantees
Every offer commits to two things the buyer cares about beyond just opening a channel:
min_block_length- the minimum number of blocks the channel will remain open before the seller is allowed to close it. Common values:4320(~30 days),8640(~60 days),12960(~90 days).base_fee_cap/fee_rate_cap- the maximum routing fees the seller will charge formin_block_lengthblocks. This is what makes the inbound capacity actually usable: without a cap, a seller could open the channel and immediately raise routing fees to make it unrouteable.
These commitments are locked into each order at acceptance time, regardless of subsequent offer updates.
Marketplace matching
When a buyer calls liquidity.buy, Magma matches them against the marketplace using a few signals:
- Price -
liquidity_per_usdreflects the current depth across all enabled offers. - Seller reliability - historical performance, uptime, on-time channel openings.
- Buyer conditions - offers can require minimum buyer capacity, peer rank, socket type, etc.
- Options -
rails_cluster_onlyrestricts matching to the Amboss Rails reliability tier;private: truefilters offers willing to open unannounced channels.
You can also call market.offer.offers to browse the listing book directly and place a manual order against a specific offer via market.order.create.
Order lifecycle at a glance
This is the happy path collapsed. The full state machine has 17 statuses and explicit terminal failure states - see Order Lifecycle.
Where Magma fits
| Magma is | Magma is not |
|---|---|
| A matching and monitoring layer for channel sales between independent nodes. | A custodian. We never hold buyer or seller funds. |
| Open to anyone, including anonymous buyers (no signup required). | A wallet or a Lightning node. You bring your own node. |
| Non-discriminatory between LN implementations (LND, CLN, Eclair, …). | A pricing oracle. Sellers set prices; the marketplace surfaces them. |
| A reliability layer (Amboss Rails cluster for higher-grade sellers). | A guarantor - failed orders trigger the HODL refund, not a payout. |
Notifications
Order-status updates are delivered two ways today:
- API polling - call
user.market.orders.get_orderon a cadence. See Tracking Orders. - Telegram - @theambossbot sends push notifications for orders linked to your Amboss account.
Order-status webhooks aren't available yet. For Lightning payment webhooks (separate product), see the Amboss Payments docs.
Next steps
- Orders and Offers - the data model
- Order Lifecycle - every status explained
- Buy Liquidity - the buyer's mutation
- Sell Liquidity - the seller's mutations
- Visit the marketplace - browse live offers