# SigmaFi bonds

> How a SigmaFi zero-coupon bond is offered, filled, repaid, liquidated and claimed, and how to borrow or lend from the web panel.

Source: https://lithosprotocol.org/docs/extensions/sigmafi-bonds

**Level:** Advanced

*Assumes you know Ergo's UTXO model and what a token is. Start with [Mining on Lithos](https://lithosprotocol.org/docs/tutorial-basics/mining-on-lithos) if not.*

SigmaFi bonds are peer-to-peer loans on Ergo, backed by collateral. A borrower locks collateral, a lender
lends ERG or a token against it, and the borrower repays a fixed amount by a fixed block. If they do not,
the collateral goes to the lender. This page explains how a bond runs, how to borrow and lend from the
web panel, and what your client does with bonds on its own.

It does not cover the API endpoints behind the panel, which are in the [API reference](https://lithosprotocol.org/docs/api) under
**SigmaFi Bonds**, or the settings for liquidating bonds, which are in
[Batching and orders](https://lithosprotocol.org/docs/configuration/batching#sigmafi-bond-liquidations).

## What a bond is

Every SigmaFi bond today is a zero-coupon bond. It pays no interest along the way: the borrower repays
one amount, larger than the loan, at the end. A bond has these terms:

| Term | Meaning |
|---|---|
| Loan | ERG, or an amount of one token |
| Repayment | What the borrower pays back, in the same asset as the loan |
| Maturity | The block by which the borrower must repay. Repayment closes at this block |
| Collateral | ERG and any tokens the bond holds until it is repaid or liquidated |
| Batching reserve | ERG the lender adds above the collateral on fill; refunded to the bond holder on repayment or available to a liquidator |
| Liquidation | The rule for when the bond can be liquidated. Today, anyone from maturity on |

The difference between the repayment and the loan is the lender's return.

## How a bond is made

Borrowers create an **order**, locking their collateral with the requested loan amount, repayment,
and maturity. A lender fills the order: the principal goes to the borrower and the collateral moves
into the bond. The lender chooses and funds a separate batching reserve at this point. The borrower’s
entire collateral remains protected from this fee. SigmaFi V2 does not support lender-created offers.

An order can fix its maturity to a block, or ask for a term counted from the block a lender fills it.
A term counted from the fill does not shrink while the order waits. It must be at least 30 blocks.

Before an order is filled, its borrower can cancel it to recover the collateral.

## The bond asset

Filling an order mints two units of the **bond asset**: one locked in the bond, and one sent to the lender.
Whoever holds the circulating unit is owed the bond. You can send or sell it like any token. Settlement
burns the bond’s locked unit; claiming the vault burns the holder’s circulating unit.

A verified bond asset uses the circular SigmaFi mark with a small status-colored **ZC** badge.
All lifecycle states use the dark mark. Compact collateral tooltips place the **ZC** badge beside the mark for readability.
Hover or focus it to inspect repayment, maturity, collateral and any vault proceeds. LithosDex Provisions
use the same detail cards as the Wallet. The **Documentation** link opens this page.

Its EIP-4 name is `SigmaFi-ZC-Bond-<first six token ID characters>`. A name and description are set by whoever minted a token, so they prove nothing.
The panel uses **SigmaFi Bond** and **LithosDex Provision** as display labels for these assets.
Anyone can mint a token with the same name. The web panel and **Wallet** check each bond asset against
the chain and mark it ZC-Bond only when it is the asset its bond was created with. A token named like a
bond asset that fails the check is marked Not a ZC-Bond.

## How a bond ends

A bond ends in one of two ways, and either way the lender's side goes to a vault for the bond asset's
holder:

1. **Repaid.** Any block before maturity, the borrower pays the repayment into the vault, and the
   collateral returns to them. The lender-funded reserve moves into the vault with the repayment,
   so the bond holder recovers it on claim.
2. **Liquidated.** From maturity on, anyone can liquidate the bond. The collateral goes to the vault,
   while the liquidator may keep the separate lender-funded reserve. With the standard maturity
   liquidation rule, the vault receives at least all the borrower’s collateral and all collateral tokens.

The agreed liquidation expression determines both eligibility and payout contents. The client currently
creates orders with `MaturityLiquidation`, which enforces the behavior above. The bond contract itself
pins the vault, settlement tags and locked-unit burn; inspect any different liquidation expression before
relying on its collateral payout. Principal amounts are carried in the live bond’s registers, so the client
can read the agreed loan directly while separately checking the bond’s origin against its minting order.

The holder of the bond asset then **claims** what the vault holds for it. One claim takes the bond's own
settlement output and at most 8 other vault boxes naming the asset, largest first, and burns the bond
asset. A vault box the claim leaves out can never be claimed after, so the claim's check lists any such
box before you send.

You do not need to liquidate bonds yourself. Lithos miners liquidate every matured bond that pays a
batching fee of at least 0.05 ERG, in their own blocks first and by broadcast one block later.

## Borrow or lend from the web panel

Open **Extensions > SigmaFi** in the navbar. It has four views:

| View | What it does | Needs your API key |
|---|---|---|
| Market | Loan requests and active bonds, with collateral, repayment, term, total interest and secondary APR | Only to send |
| Borrow | Creates a loan request; collateral tokens come from the client wallet dropdown | For wallet tokens and publishing |
| Portfolio | Lending, borrowing and open requests, with cancel, repay, liquidate and claim | Yes |
| Search | Looks up any bond asset by token ID, including collateral and confirmed settlement evidence | No |

The Borrow form adds a 0.001 ERG box minimum to your entered ERG collateral. Entering 10 ERG locks
10.001 ERG, plus a separate creation network fee. There is no borrower fee-reserve input. On fill,
a lender choosing a 0.05 ERG reserve funds that reserve in addition to the principal; the bond then
holds 10.051 ERG. On repayment, 10.001 ERG returns to the borrower and the 0.05 ERG reserve goes to
the bond holder’s vault with the repayment. NFT collateral is fixed at one unit, and NFT assets are
excluded from the principal selector.

In **Market**, select **Lend**, enter the **Batching reserve (ERG)**, and review the updated wallet impact.
The form starts at 0.05 ERG. Any nonnegative amount is allowed, including zero, but clients on shipped
settings skip automatic liquidation below 0.05 ERG. Changing the reserve requires a fresh preview.

The **Search** tab accepts a bond asset’s token ID and looks it up through your client. Wallet bond
links open this page with that asset already selected. Click a SigmaFi Bond or LithosDex Provision in the collateral list, or its detail card, to
open its own lookup. Each bond can lead to another bond, so you can follow any collateral chain without
needing to own those assets. LithosDex provisions open **LithosDex > NFT search** with their token ID.
Classification comes from the client’s chain checks; a matching name alone never establishes origin.

Hovering a bond asset shows **Active**, **Matured**, **Repaid**, or **Liquidated**, with matching icon-tray and badge
colors. The client establishes settlement status from confirmed spend evidence. Its settlement transaction,
block, payout, and returned collateral remain available after the vault output is claimed. Incomplete evidence
is shown as **Unknown**, with the reason supplied by the client.

The loan term can be entered in days or whole blocks. Switching units preserves the block duration;
days use an estimate of 720 blocks per day. Block input does not accept decimals.

## Collateral Ratio and USD estimates

The Collateral Ratio is the estimated USD value of the collateral divided by the loan principal. This is
an informational health rating, with **no price-based liquidation threshold**. The agreed maturity and
liquidation script determine when a bond can be liquidated.

ERG uses the client's confirmed `erg-usd` oracle. SigUSD and USE use an assumed $1 peg. Other prioritized,
verified tokens use the deepest eligible LithosDex route to one of those assets, with up to three pools.
Routes are ranked by their weakest quote-side USD reserve. Unsafe and unchecked pools are excluded;
Spectrum pools are not used. The question-mark helper identifies the oracle and pool route used.

Estimates exclude batching fees, the box minimum, and slippage. Unpriced tokens and NFTs remain visible
but are not valued. A **≥** percentage or dollar amount is a lower bound covering only priced collateral.
Missing principal prices show an unavailable rating; stale oracle data is excluded from ERG pricing.
The market can sort by Collateral Ratio or filter by minimum estimates and unpriced or partial collateral.
The display is red at 80% or below, orange at 90%, yellow at 100%, and greener at 125%, 150%, 175%,
and 200% or above. These colors do not change any liquidation rule.

Every action is checked by your client first and shows what you pay, what you receive and any warning
before anything is signed. A check never signs or sends anything. The send uses your client's wallet and
pays the quoted network fee (currently 0.001 ERG).

**Choose the reserve before you lend.** It is your money in addition to the principal, and is refunded
on repayment. Under the standard maturity liquidation rule, it can pay the liquidator while the
borrower’s collateral goes to the vault. The displayed collateral amount excludes the reserve and
box minimum. A reserve below 0.05 ERG is left to manual liquidation by clients on shipped settings.
The client’s single-bond liquidation action also needs enough reserve to pay its network fee and
minimum reward output; a very small reserve may require a separately constructed transaction.

## What can go wrong

| Situation | What happens | What to do |
|---|---|---|
| The borrower misses maturity | The bond can be liquidated. The collateral goes to the vault | Claim it from **Portfolio** once it is liquidated |
| You repay with two blocks or fewer left | The repayment counts only if it is mined before the maturity block. If it is not, it fails and the bond can be liquidated. The check and the send both warn | Repay earlier than the last few blocks |
| The collateral is worth less than the loan at maturity | The borrower may let the bond be liquidated | Choose collateral and terms that cover your loan |
| You chose a reserve under 0.05 ERG | Clients on shipped settings skip automatic liquidation | Use **Portfolio** if the reserve covers a manual liquidation, or construct a transaction separately |
| You send the bond asset away | Whoever holds it is paid instead of you | Keep the bond asset until you claim |
| You claim while a liquidation is still pending | Your client refuses the claim | Claim after the liquidation confirms |

## Next steps

- [Batching and orders](https://lithosprotocol.org/docs/configuration/batching#sigmafi-bond-liquidations): how your client liquidates bonds.
- [Block packages](https://lithosprotocol.org/docs/configuration/candidate): the `sigmafi` source that puts liquidations in your blocks.
- [Difficulty forwards](https://lithosprotocol.org/docs/extensions/difficulty-forwards): the other extension.
