How It Works
A loan on Amish forms in three steps: create an intent, get matched, and execute. Same-chain loans complete faster than cross-chain loans, which depend on finality and proof generation.

Step 1: Create an intent
An intent is a signed message expressing your willingness to borrow or lend under specific conditions. It is a commitment, but it does not lock your capital.
If you want to borrow, you specify:
What collateral you offer (asset, amount, chain)
What principal you want (asset, chain)
Your maximum interest rate (e.g., 7% APR)
Your minimum LTV (e.g., 75%)
Loan duration
Where to receive funds (payout address)
If you want to lend, you specify:
What principal you offer (asset, amount, chain)
What collateral you accept (asset, chain)
Your minimum interest rate (e.g., 5% APR)
Your maximum LTV (e.g., 80%)
Loan duration
You sign this intent with your wallet (EIP-712 typed data). The signature cryptographically binds you to these terms. But your capital stays in your wallet - nothing moves until a match forms.
Step 2: Get matched
The matching engine continuously scans for compatible intents. Two intents match when their terms overlap:
Asset compatibility: The borrower's collateral is something the lender accepts. The lender's principal is something the borrower wants.
Rate overlap: The borrower's maximum rate meets or exceeds the lender's minimum rate.
LTV overlap: The borrower's minimum LTV does not exceed the lender's maximum.
Duration compatibility: Both parties specify acceptable loan terms.
When a match forms, the matching engine computes effective terms within the overlap accepted by both parties. Both parties get notified.
Matching happens automatically. Users create intents and the matching engine handles the rest.
Step 3: Execute the loan
Once matched, both parties execute their on-chain transfers:
The borrower deposits collateral to the protocol's CollateralManager contract. For cross-chain loans, this deposit is verified via storage proof on the principal chain.
The lender transfers principal through the DebtIssuer contract. The principal goes to the borrower's specified payout address.
The protocol issues a debt token to the lender - an ERC-20 representing their claim on repayment.
After both transfers confirm, the loan is active. The borrower has their principal. The lender has their debt token. Interest accrues at the fixed rate locked at match time.
After the loan
For borrowers: Monitor your position health, repay before expiration, and claim your collateral back.
For lenders: Watch for repayment, then redeem your debt tokens for principal plus interest. Or sell your debt tokens on secondary markets for immediate liquidity.
If something goes wrong: If the borrower's collateral value drops below safe levels, the position becomes eligible for liquidation. Liquidators can seize collateral to repay the debt. If the borrower fails to repay by expiration, lenders can claim collateral.
Cross-chain in action
When collateral is on one chain and principal on another, the process adds a verification step:

Borrower deposits collateral on Chain A
Protocol generates a storage proof of the deposit
Proof is verified on Chain B via the Facts Registry
Lender transfers principal on Chain B
Borrower receives principal on Chain B
No bridges. No trusted messengers. The storage proof cryptographically proves the collateral exists. The security model derives from the source chain's security rather than bridge operator security.
Time to completion
Same-chain loans: Generally faster. Create intent, get matched, execute transfers.
Cross-chain loans: Longer due to finality requirements. The protocol waits for the source chain transaction to finalize before generating proofs. Duration depends on source chain finality and proof verification.
Last updated