Dev Docs

Quick Start Guide

Lending allows users to deposit native collateral, and then create a debt at a collateralization ratio CR (collateralization ratio). The debt is always denominated in USD (aka TOR) regardless of what L1 asset the user receives
Stagenet examples used, lending will be released on Mainnet soon!

Open a Loan Quote

Lending Quote endpoints have been created to simplify the implementation process.
Request: Loan quote using 1 BTC as collateral, target debt asset is USDT at 0XDAC17F958D2EE523A2206206994597C13D831EC7
"dust_threshold": "10000",
"expected_amount_out": "91883238100",
"expected_collateral_deposited": "9996658",
"expected_collateralization_ratio": "29442",
"expected_debt_issued": "92183950000",
"expiry": 1695278399,
"fees": {
"asset": "ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC7",
"liquidity": "128623000",
"outbound": "194207800",
"slippage_bps": 8,
"total": "322830800",
"total_bps": 35
"inbound_address": "bc1q2hldv0pmy9mcpddj2qrvdgcx6pw6h6h7gqytwy",
"inbound_confirmation_blocks": 1,
"inbound_confirmation_seconds": 600,
"memo": "$+:ETH.USDT:0xe7062003a7be4df3a86127293a0d6b1f54c04220",
"notes": "First output should be to inbound_address, second output should be change back to self, third output should be OP_RETURN, limited to 80 bytes. Do not send below the dust threshold. Do not use exotic spend scripts, locks or address formats (P2WSH with Bech32 address format preferred).",
"outbound_delay_blocks": 5,
"outbound_delay_seconds": 30,
"recommended_min_amount_in": "162000",
"warning": "Do not cache this response. Do not send funds after the expiry."
If you send 1 BTC to bc1q2hldv0pmy9mcpddj2qrvdgcx6pw6h6h7gqytwy withh the memo $+:ETH.USDT:0xe7062003a7be4df3a86127293a0d6b1f54c04220 you will receive approx. 1079.4077 USDT debt sent to 0xe7062003a7be4df3a86127293a0d6b1f54c04220 with a CR of 294%.
The Inbound_Address changes regularly, do not cache!
Loans cannot be repaid until a minimum time has passed, as determined by LOANREPAYMENTMATURITY, which is currently set as the current block height plus LOANREPAYMENTMATURITY. Currently, LOANREPAYMENTMATURITY is set to 432,000 blocks, equivalent to 30 days. Increasing the collateral on an existing loan to obtain additional debit resets the period.

Close a Loan

Request: Repay a loan using USDT where BTC.BTC was used as colloteral. note any asset can be used to repay a loan.