Repay
Repay pays down your USDC loan. Any amount up to what you owe, any time, no penalty.
What the method does
Section titled “What the method does”On-chain, repay transfers USDC from your wallet to the position’s lender and
reduces your debt:
- The position’s stored lender (Jupiter Lend or Kamino Lend) decides which repay flow runs.
- Repaying lowers your LTV and frees collateral for withdrawal.
- There is no minimum, no schedule, and no early-repayment fee.
Note you may not need to repay as much as you think: Sonnar
harvests vault profit into your debt continuously, and when the effective APY
is negative the balance is already shrinking on its own - the
selfRepayDate in getQuote projects when it would reach
zero unaided.
How to call it
Section titled “How to call it”import { executeAction, parseUsdc, CBBTC_MINT } from "@hobba-io/core";
const { signature } = await executeAction({ connection, signer, collateralMint: CBBTC_MINT, action: "repay", amount: parseUsdc("75"), // micro-USDC (1e6) apiBaseUrl: "https://app.hobba.io", onStep: (s) => setStatus(s),});Bounds - use getLimits for “repay max”
Section titled “Bounds - use getLimits for “repay max””const limits = await getLimits({ connection, owner, collateralMint, apiBaseUrl });// limits.maxRepayUsdc - the correct "Max" amount, micro-USDCDon’t compute “max repay” as min(wallet balance, debt) yourself - there’s a
lender nuance: Jupiter Lend rejects a repay that leaves a tiny non-zero
debt below its minimum-debt floor. maxRepayUsdc already shaves the
required dust (about 0.02 USDC) so a full repay clears cleanly, and accounts
for interest accruing between quote and execution. On Kamino it’s the plain
min(wallet USDC, debt).
After it lands
Section titled “After it lands”- Your debt and LTV drop immediately.
- If your LTV falls below Sonnar’s band, the engine may deploy more working
capital - that’s expected and doesn’t touch your loan figure, which only
counts your debt (
userDebtUsdc). - Once the debt is fully cleared, the position keeps earning: the collateral stays productive and harvest leftovers are sent straight to your wallet. You can then withdraw everything whenever you like.