Settle a default
For lenders and the keeper. At maturity, an unpaid repo's pledged units move to the lender.
When a repo reaches maturity unpaid, its pledged units can move to the lender. Any wallet can settle it, the units always go to the lender, and the keeper settles each one at its own maturity. Nothing is needed from the borrower, because the units were pledged on the register when the repo opened.
Before you start
- The repo is active and its maturity has passed. From the maturity second on, it can no longer be repaid.
- The calling wallet pays only the network fee. It doesn't need to be the lender, or a member.
In the app
Find the repo
On /app/repo, My repos lists each repo you lent in. Once an active repo is past its maturity, its row shows Settle default.
Settle default
Press it: Review settle shows the pledged units moving from the borrower to your free lane, then Sign and send.
Settled
The repo reads Defaulted and the units are free in your position. The keeper settles each default at its maturity, so the repo may already read Defaulted when you open it.
Through the API
const repos = await api.repos({ wallet })
const due = repos.filter((r) => r.status === 'active' && Date.parse(r.maturity) <= Date.now())
for (const repo of due) await send(await api.buildSettleDefault({ wallet, repoId: repo.id }), sign)curl -X POST "$AGORA_API/v1/build/settle-default" -H 'content-type: application/json' \
-d '{"wallet":"<wallet>","repoId":"<repo id>"}'send is the helper from A first settlement.
What it ends in
| Settle default | |
|---|---|
| Borrower's units | pledged: − the repo's units |
| Lender's units | free: + the repo's units |
| The repo | Defaulted |
The advance the borrower received stays with the borrower; the lender keeps the units instead of the repurchase amount. Both unit positions settle their income first, so income paid while the units were pledged stays the borrower's. The settlement is the kind default, with the caller named.
If it fails
RepoNotMatured: maturity is still ahead.RepoNotActive: the repo was repaid, or the default is already settled.