For Borrowers
What you're entering
Borrowing on Rayyan is a murabaha: the pool provides you USDC at a disclosed contract price, principal plus a fixed markup, against your pledged collateral (rahn). You know the most you can ever owe before you sign, and there is no floating rate anywhere in your contract.
Opening a position
- Deposit collateral: WETH or WBTC (standard Compound V3 collateral mechanics).
- Choose your borrow amount. The app shows, before you confirm:
- Your rate: read from the utilization curve at this moment and locked for your position permanently
- Contract price: principal + full 360-day markup, your absolute maximum cost
- Daily cost: markup ÷ 360, constant
- Settlement date: 360 days out
- Health factor: computed against your contract price (conservative), constant over time, moving only with collateral price
- Confirm. You receive the full principal. Your rate can never change.
One position per address at MVP. Borrow limits: your collateral × collateral factor must cover the full contract price; a pool-wide 80% utilization cap protects LP liquidity.
While the position is open
Your owed amount grows linearly toward the cap, by the same dollar amount every day:
owed(t) = principal + full_markup × min(t, 360d) / 360d ≤ contract price, alwaysThere is no compounding and no rate resets, and nothing to monitor except your collateral's price (health factor), exactly as on any collateralized venue.
Closing a position
1. Repay with USDC (ibra' applies automatically)
Pay getAmountOwed(), principal plus accrued markup only. The unearned remainder of the contract price is forgiven by the contract, not by anyone's discretion. Close at day 90 on a 4.2% contract and you keep 75% of the markup in your pocket.
2. Unified close with any mix of USDC and collateral
Don't have the full USDC? Use the slider: contribute anything from 0% to 100% in USDC and the RayyanCloser contract covers the remainder by atomically selling exactly enough of your WETH collateral on Uniswap V3 (via flash swap: the pool fronts the USDC, your released collateral repays it, all in one transaction). All remaining collateral returns to your wallet. If anything fails, the entire transaction reverts and your position is untouched. No pre-authorization step is required.
3. Let it mature
When you open a position you appoint Rayyan as your agent to settle it if it is still open at day 360. The keeper then sells enough of your collateral at market price to pay what you owe, charges an agency fee of 0.25% of the amount settled (minimum 1 USDC), and returns everything else to your wallet. On a 10,420 USDC settlement the fee is 26.05 USDC. The fee goes to the operator that performs the sale, never to depositors. Closing yourself before maturity costs nothing beyond gas, and the app counts down and nudges you, but maturity is a settlement rather than a punishment.
(The live Sepolia deployment still charges the earlier fee, 1.5% of collateral value, until the next deployment.)
The embedded collar (why sophisticated borrowers care)
If rates spike after you borrow, nothing changes, because your rate is contractual. If rates drop, you can close by paying only the accrued amount and re-borrow at the new one. Ibra' makes the exit free, and the round trip costs only gas.
That pair, a cap above and a free exit below, is a zero-cost collar. Banks price that protection in the hundreds of thousands on institutional loans, while here it is a property of the contract type.
Liquidation
If your health factor falls below 1.0 (collateral price decline), your position can be absorbed, using Compound V3's machinery. Because your debt is recorded at the contract price, your health factor is constant over time, so borrowing does not slowly erode your position and only market moves matter. Add collateral anytime to raise it.
What you get back: the protocol credits your collateral at its oracle value less the discount paid to whoever buys it (4.2% for WETH and WBTC), against what you owe after ibra'. The protocol keeps none of the discount, and everything above what you owe stays yours as a USDC balance. Example: 10,000 USDC at 4.2% (contract price 10,420), liquidated on day 90 with collateral worth 11,500. You owe 10,105 after ibra'; the credit is 95.8% of 11,500, or 11,017; you keep 912 USDC.
(The live Sepolia deployment still credits 93% of collateral value against the full contract price until the next deployment. In the same example you would keep 275 USDC.)
Worked example
10,000 USDC at a locked 4.2% (rates at the launch utilization band run ~7.4–8.0%; the mechanics are identical at any rate):
| Event | You pay | You save vs cap |
|---|---|---|
| Close day 30 | 10,035 | 385 |
| Close day 90 | 10,105 | 315 |
| Close day 180 | 10,210 | 210 |
| Settle day 360 | 10,420 (the cap) | — |
| Rates triple at day 10 | changes nothing | your rate is locked |