Pay it down. Close it out. Asynchronously, by construction.
Repay closes a borrow fully, pays down principal, or services accrued interest only. The stablecoin pull and on-chain order_id are atomic in one tx; pro rata collateral release lands in a separate tx via settle(order_id) once the pool-side leg confirms. Open-term, no prepayment penalty.
The full Repay spec lives in the docs
The repay-type enum, partial vs full close, the pro-rata collateral release math, the webhook payload, and the cross-chain bridging path. Python and Node.js tabs, copy-ready.
How repayment works
One call. Live debt balance. Collateral release in the same transaction. Open-term means you can repay any time.
Submit the repay
One POST call with the borrow id, the repay type (interest, principal, or full), and the amount. Flo computes the live debt balance including interest accrued since the last repay.
Atomic create-order tx
One on-chain tx atomically pulls the stablecoin from the borrower's wallet and creates an on-chain order_id binding the pull to the repay/close intent. Status is "active" once this tx confirms.
Settle on chain
Flo's keeper calls settle(order_id) on chain. The contract reduces the borrow balance, realizes accrued interest to the supplier pool, releases collateral pro rata to the borrower's destination wallet, and recomputes health factor — all in the same settle tx. A full repay returns 100% of collateral and closes the position. cancel(order_id) refunds the stablecoin if the pool-side leg fails; user_cancel(order_id) is the recovery escape hatch after the window.
What you get with every repay
Three modes, pro rata collateral, no prepayment penalty, and a clean receipt. Symmetric to Borrow on the same SDK.
Three repay modes
Repay just the accrued interest, paydown principal by any amount, or close the position fully in one call. Mode is selected per call; positions stay open until you fully close them.
Pro rata collateral release
When you paydown principal, the call submits one on-chain tx that atomically pulls the stablecoin and creates an on-chain order_id. The collateral release lands in a separate tx via settle(order_id) once the pool-side leg confirms; health factor recomputes against the new debt balance at that point.
No prepayment penalty
Borrows are open-term. Close in five minutes or hold for a year, the rate accrues per second and stops the moment you repay. No origination amortization to recover.
Receipt + webhook per repay
Every repay call returns a structured receipt: principal portion, interest portion, collateral released, new health factor. Same payload fires as a webhook for downstream reconciliation.
Same chain or cross-chain
Repay from the chain holding the borrow position, or repay from another chain and let Flo bridge the stablecoin via the same Bridge primitive used elsewhere in the SDK.
Built for repayment agents
ERC-20 debt receipts make it easy to wire up a recurring repayment agent, a streaming-payment integration, or an account-abstraction policy that pays interest automatically.
Three modes, one endpoint
Pick the mode at call time. The same endpoint handles all three so your client code stays simple.
Interest
Pay only the accrued interest. Principal balance and collateral lockup are unchanged. Useful for keeping a position open indefinitely while servicing it on a schedule.
Principal
Pay any portion of the principal balance. Collateral releases pro rata; the position remains open with the reduced principal. Combine with an interest paydown in the same call if you want.
Full
Close the position. All accrued interest plus the full principal balance settle in one call. 100% of the collateral returns to the destination wallet, the debt token burns, and the position id is closed.
Close the loop on every borrow
One call, client.repay(), and the position closes with the collateral back in the borrower's wallet.