Varla
OverviewWhat it is and why it matters.How It WorksLending against prediction markets, step by step.FeaturesLending, borrowing, leverage, and risk management.Supported MarketsPolymarket, Opinion, Kalshi, and more.
DocumentationProtocol docs, guides, and architecture.Smart ContractsPool, Collateral Manager, Oracle, Liquidation Engine.SDK ReferenceTypeScript SDK for protocol interactions.API ReferenceREST and GraphQL endpoints for market data.
BlogLatest news and announcements from Varla.FAQsFrequently asked questions about the protocol.Security & AuditsProtocol security, audits, and trust assumptions.Brand AssetsLogos, colors, and typography guidelines.
Sign up
Varla
Protocol
Overview What it is and why it matters.
How It Works Lending against prediction markets, step by step.
Features Lending, borrowing, leverage, and risk management.
Supported Markets Polymarket, Opinion, Kalshi, and more.
Developers
Documentation Protocol docs, guides, and architecture.
Smart Contracts Pool, Collateral Manager, Oracle, Liquidation Engine.
SDK Reference TypeScript SDK for protocol interactions.
API Reference REST and GraphQL endpoints for market data.
Resources
Blog Latest news and announcements from Varla.
FAQs Frequently asked questions about the protocol.
Security & Audits Protocol security, audits, and trust assumptions.
Brand Assets Logos, colors, and typography guidelines.
Sign up

Introduction

Overview
Varla 101

Protocol

Overview
Lending Model
Supply & Borrow Interest Rates Reserves
User Positions
Open Positions Supply Assets Borrow Assets Withdraw Assets Repay Loans
Risk Engine
Health Factor LTV & Thresholds Liquidations Market Resolution Oracle System

Markets

Overview
Polymarket
Opinion
Kalshi
Adapters

Token

Overview
Distribution
Utility & Governance
Varla Gems

Security

Overview
Trust Assumptions
Risk Disclosure
Risk Parameters

Resources

FAQ
Glossary
Links
Brand Assets

Getting Started

Overview
TypeScript SDK
GraphQL API
Smart Contracts

Smart Contracts

Overview
Core Protocol
VarlaPool VarlaOracle Interest Rate Liquidators Market Adapters
Governance & Access
Governance

References

SDK Reference
API Reference

Operations

Testing & Debugging
Contract Addresses

Security

Overview
Trust Assumptions
Risk Disclosure
Risk Parameters

Repay Loans

How to repay borrowed stablecoins — partial repayment, full repayment, and the mechanics of debt reduction.

How Repayment Works

Call repay(amount) on VarlaCore. Stablecoins are transferred from your wallet back to the VarlaPool, reducing your scaled debt. Your health factor improves immediately.

Repayment flow
1. Approve USDC/USDT to VarlaCore (one-time)
2. Call repay(amount) — or repay(type(uint256).max) for full repayment
3. Stablecoins transfer: your wallet → VarlaPool
4. Scaled debt reduced: scaledDebt -= amount / currentBorrowIndex
5. Health factor improves immediately

Partial vs Full Repayment

  • Partial repayment — pay back any amount. Reduces debt and improves health factor. Remaining debt continues accruing interest.
  • Full repayment — pass type(uint256).max as the amount. The contract calculates your exact debt (including accrued interest to the current second) and charges exactly that amount. After full repayment, you can withdraw all collateral.
💡 Full repayment tip
Always use type(uint256).max for full repayment rather than trying to calculate the exact amount yourself. Interest accrues per-second, so your calculation will be slightly off by the time the transaction is mined.

After Repayment

Post-repayment options
After partial repayment:
├── Health factor improved
├── Can withdraw some collateral (if HF allows)
└── Remaining debt continues accruing interest

After full repayment:
├── Debt = 0
├── Health factor = ∞
├── Can withdraw ALL collateral
└── Account remains open for future use
ℹ Account persistence
Repaying all debt doesn't close your account. Your collateral remains deposited and you can borrow again anytime. To fully exit, repay all debt then withdraw all collateral.

Menu

  • Overview
  • How it works
  • Features
  • Documentations
  • FAQs

Ecosystem

  • Prediction markets
  • Builders
  • Integrations
  • Governance

Company

  • About
  • Terms
  • Privacy
  • Support

©2026 Varla Labs Inc. All rights reserved