Find something... ⌘K

Maxy for your app / Use cases

For lending apps

Offer loans against Bitcoin that never leaves the Bitcoin network, with MaxyLock. The borrower locks BTC in Bitcoin scripts and receives the loan on the host chain. Nothing is wrapped, bridged or held by a custodian. For lending markets, wallets and treasury apps whose users hold BTC and want to borrow against it.

How a MaxyLock loan fits

Each loan is between one borrower and one lender, on terms both signed. In the loans Maxy offers, Maxy is the lender, and Maxy's service does the lender's part.

MaxyLock
CollateralBTC in Bitcoin scripts, 1 to 7 tranches, each repaid on its own
LoanUSDC or USDG, in the SDK's markets base-mainnet and robinhood-mainnet
ProofThe contract pays the principal only after a Bitcoin proof, with no oracle or committee
Price feedNone. A fall in the Bitcoin price does not, by itself, cost the borrower the collateral
AdministratorCannot touch funds. The one privileged power is to pause new loans
If the lender withholds the secretIts collateral buys the borrower Bitcoin at a premium: 105% in live vaults

The live vault values, such as a 1-day term and a 7 USDC smallest loan, are on How MaxyLock works.

Two ways to build

You wantDo thisRead
Maxy's loans in your appUse the SDK's borrow calls: Maxy lends, your app runs the borrower's sideBorrow with the SDK
To run the loan yourself, as a wallet or a lenderCall the loan contract directly, and run a watcherWallets and lenders

What to build

  1. 01 Sign the wallet in. Loans act for one wallet: maxy.auth.signIn. A wallet's first sign-in needs a username.
  2. 02 Quote and show it. borrow.listVaults, then borrow.quote for an amount. If canBorrow is false, show the quote anyway, keep the button live, and show blockedReason on click.
  3. 03 Agree and sign the terms. borrow.createRequest, then borrow.signTerms. The SDK rebuilds and checks every term before the wallet signs; a plan that fails is verification_failed, with nothing signed.
  4. 04 Fund. The borrower sends one Bitcoin transaction with one output per tranche, each for the exact amount: borrow.fund. If its outcome is ambiguous, do not fund again: look the txid up first.
  5. 05 Pay out. Follow the loan with borrow.trackLoan until it is active, then borrow.claimPayout.
  6. 06 Repay. borrow.repay before lastSafeRepayTime. Maxy's service reveals the secret and the BTC comes back: Repaying.
  7. 07 Watch for a missed reveal. getLoan(...).status.revealMissed lists the tranche, and startLiquidation starts it: If someone defaults.

The whole flow in code, with every refusal and what to do: Borrow with the SDK.

Keys and testing

Loans run with your live secret key and the signed-in wallet's session. They have no sandbox: a test key answers sandbox_refused for a loan call, so the first loan runs on mainnet with real BTC and real gas. Start small, and keep the EVM and Bitcoin private keys in your own key store, never in code. With no gas to repay, borrow.requestGas sends a small amount.

Running it yourself

A wallet that runs the loan itself needs a host-chain RPC and a Bitcoin node or indexer that returns raw transactions, headers and Merkle branches. Many contract calls are open to anyone, and a party that is offline at the wrong moment loses by it, so run a watcher. A lender holds three credentials on separate systems and must reveal at once on every repayment: Lender operations.

Every field, signature, event and revert reason: the MaxyLock documentation (PDF).