Skip to content

Commit 602823f

Browse files
author
Edward (OpenClaw)
committed
docs(asset-leasing): note that swap composition is the frontend's job, not the program's
Clarify that take_lease does not perform the A->B swap. The program deliberately stays narrow (a token-leasing primitive); the DEX swap belongs in the frontend, bundled with take_lease in a single tx so the short seller signs once and the atomicity is preserved by Solana's transaction semantics. Avoids scope creep, removes a Jupiter dependency from the program, and keeps the tutorial value of the example tight.
1 parent 0c64894 commit 602823f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

defi/asset-leasing/anchor/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ The short seller's full lifecycle is:
5151
each second - the fee is just a number that grows until someone
5252
pokes the lease.
5353
2. **Sell A immediately** on a market like Jupiter, receiving more B
54-
in return. The short seller now has more B and owes A.
54+
in return. The short seller now has more B and owes A. The
55+
asset-leasing program does not perform this swap itself; that is
56+
the DEX's job, and keeping the two concerns separate keeps each
57+
program narrow and composable. In practice a frontend bundles
58+
`take_lease` and the Jupiter swap into a single transaction so
59+
the short seller signs once and the open-short flow is atomic
60+
(Solana's transaction atomicity guarantees both succeed or both
61+
revert).
5562
3. **Wait.** They are betting A's price (denominated in B) will fall.
5663
The short seller doesn't have to call anything while they wait -
5764
accrued fees auto-settle at close. They can optionally call

0 commit comments

Comments
 (0)