convex.lab.secured-loan.cvx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of convex-core Show documentation
Show all versions of convex-core Show documentation
Convex core libraries and common utilities
The newest version!
;; Smart contract implementing a secured loan
;;
;; Concept:
;; 1. Issuer creates secured-loan contract in :initial state
;; 2. Issuer places collateral assets (tokens, etc.) in account under control of secured-loan contract
;; 3. Issuer switches state to :offered
;; 4. Lender may provide the loan, in which case state changes to :accepted
;; 5. Once accepted, issuer may withdraw borrowed funds but cannot touch collateral
;; 6. Issuer must ensure principal plus interest is repaid before the maturity date
;; 7. At maturity, either:
;; a) Loan is repaid, and issuer regains control of collateral assets
;; b) Loan defaults, and lender gains control of collateral assets
(do
)