DOCS

How a deal works

A borrower locks tokens and names a buyback price and a term. A lender pays the asking price in ETH. At the deadline the borrower pays the buyback price and takes the collateral back, or does nothing and the lender takes it. Everything below is generated from DealVault.sol at 70f9806.

THE FIVE STATUSES

LISTED
Collateral is in the vault. Terms are set, nobody has funded it, the borrower can cancel.
FUNDED
A lender has paid the asking price. The deadline is now fixed and cannot move.
RECLAIMED
The borrower paid the buyback price in time and took the collateral back.
CLAIMED
The grace window closed with nobody coming back, and the lender took the collateral.
CANCELLED
A listing was withdrawn before it was funded. The collateral went straight back.

EVERY PARAMETER, AND ITS RANGE

TERMDealVault.sol:122
1H .. 90D
PROTOCOL FEEDealVault.sol:111
0.10% .. 2.00% OF THE ASK
GRACE SURCHARGEDealVault.sol:117
0 .. 10.00% OF THE BUYBACK
GRACE WINDOWDealVault.sol:120
1D
ONE ADDRESS, AT MOSTDealVault.sol:114
10.00% OF TOTAL OUTSTANDING
BUYBACK PRICEDealVault.sol:91
MUST EXCEED THE ASK
FEE AT LAUNCHDeployTestnet.s.sol:25
0.50%
SURCHARGE AT LAUNCHDeployTestnet.s.sol:26
5.00%

THE ONLY TWO FORMULAS

WHAT THE BORROWER RECEIVES
askPrice - (askPrice * feeBps) / 10000
DealVault.sol:389
WHAT THE BORROWER PAYS, ON TIME
buybackPrice
DealVault.sol:644
WHAT THE BORROWER PAYS, IN GRACE
buybackPrice + (buybackPrice * graceSurchargeBps) / 10000
DealVault.sol:644

Integer division floors, always in the borrower's favour on the fee. Both feeBps and graceSurchargeBps are frozen into a deal when it is funded and cannot move afterwards.

WHAT THE OWNER CAN DO

9 functions: the fee, the grace surcharge, the house-token discount, the two caps, the token allowlist, the listings pause, and sweeping the protocol's own accrued fees. None of them can move locked collateral or a funded deal's ETH, and there is no proxy, no upgrade path and no rescue function.

THE EXHAUSTIVE LIST, WITH LINE NUMBERS →

Put your own numbers through the same arithmetic in the simulator, see the settlement rule against real price history in the backtest, read what can still go wrong, the adversarial review in full, and every deal as it happens.