Skip to content

Commit ab99204

Browse files
author
Edward (OpenClaw)
committed
docs(asset-leasing): add the holder's full lifecycle
The README walked through the short seller's lifecycle in detail (open / sell / wait / close) but never gave the holder the same treatment. Now both parties have explicit lifecycle steps: - list tokens via create_lease (Listed status) - wait for a taker (Active) or cancel - earn fees passively while Active - get paid out at close via any of return_lease / liquidate / close_expired Plus a paragraph clarifying the two close_expired situations (cancel a Listed lease, or seize collateral on an Active default) since these are the holder's most surprising calls.
1 parent 7c0f710 commit ab99204

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

defi/asset-leasing/anchor/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,31 @@ bounty from the collateral. If the lease term ends without the short
7373
seller calling `return_lease`, the holder calls `close_expired` to
7474
seize the collateral and recover.
7575

76+
The holder's full lifecycle is shorter:
77+
78+
1. **List the tokens** by calling `create_lease`. This locks the A
79+
tokens in a program-owned vault and publishes the terms (collateral
80+
required, lease fee, duration, maintenance margin, liquidation
81+
bounty, oracle feed). The lease starts in `Listed` status.
82+
2. **Wait for a taker.** If a short seller takes the offer (calling
83+
`take_lease`), the lease moves to `Active` status and the holder
84+
starts earning the per-second lending fee. If no-one takes it, the
85+
holder can cancel at any time.
86+
3. **Earn fees while the lease is `Active`.** The holder doesn't have
87+
to call anything; the fee accrues against the short seller's
88+
collateral and settles whenever any handler runs against the lease.
89+
4. **Get paid out at close.** Whichever path the lease takes (clean
90+
return, liquidation, or expiry), the holder ends up with their A
91+
tokens back (or, on liquidation/expiry default, the equivalent
92+
value in B as compensation) plus all the lease fees that accrued.
93+
94+
The holder can call `close_expired` to terminate the lease in two
95+
situations: (a) the lease is `Listed` and they want to cancel it
96+
before any short seller takes it, or (b) the lease is `Active`, the
97+
deadline has passed, and the short seller hasn't returned the tokens -
98+
in which case the holder seizes the entire collateral as compensation
99+
for the missing tokens.
100+
76101
The program acts as a non-custodial escrow. It:
77102

78103
1. Takes the holder's A tokens and locks them in a program-owned

0 commit comments

Comments
 (0)