ReferenceOverview

Reference Overview

Complete technical reference for RevvFi deployments.

Core Protocol Constants

ConstantValueLocationPurpose
MAX_APR_BPS5000 (50%)RevvFiMarketProtocol-wide APR ceiling, regardless of borrower’s own maxApr
BASIS_POINTS10000RevvFiMarketBasis-point denominator used throughout
MAX_ACTIVE_POSITIONS100RevvFiMarketCap on simultaneous active positions per market
DEFAULT_STALE_PRICE_THRESHOLD24 hoursRevvFiCollateralEscrowDefault oracle staleness window (per-market tunable)
auctionDuration3 daysRevvFiLiquidatorTotal liquidation auction window (tunable)
dutchAuctionStepDuration1 hourRevvFiLiquidatorTime between each price step (tunable)
dutchAuctionPriceDecrementBps500 (5%)RevvFiLiquidatorPrice drop per step, as % of debt (tunable)
minBidIncrementBps100 (1%)RevvFiLiquidatorMinimum bid increase over the previous highest (tunable)
auctionExtensionWindow15 minutesRevvFiLiquidatorAnti-sniping extension on late bids (tunable)
Reserve price80% of debtRevvFiLiquidatorLiquidation auction price floor

Function Quick Reference

RevvFiArchController

  • registerBorrower(address) / removeBorrower(address) — owner-only borrower whitelist
  • isRegisteredBorrower(address) / isBlacklistedAsset(address) — views used by the Factory

RevvFiFactory

  • deployMarket(address borrower, address borrowAsset, address collateralAsset, address collateralOracle, uint8 collateralDecimals, uint8 borrowDecimals, uint256 minCollateralRatio, uint256 liquidationThreshold) — payable, clones a new market
  • setDeploymentFee(uint256) / setFeeRecipient(address) — owner-only

RevvFiMarket

  • depositCollateral(uint256) / withdrawCollateral(uint256)
  • borrow(uint256 amount, bool useSeniorOnly, uint256 maxApr)
  • repay(uint256 amount) / repayFull()
  • claimFunds(uint256 positionId)
  • getTotalOwed() / getCurrentPrincipal() / getPositionValue(uint256) / getPositionClaimable(uint256)

RevvFiOfferBook

  • submitOffer(uint256 amount, uint256 apr, uint8 seniority, uint256 duration)
  • cancelOffer(uint256 offerId) / modifyOffer(uint256, uint256, uint256, uint256)
  • getBestOffers(uint256 amount, bool useSeniorOnly) (view)

RevvFiCollateralEscrow

  • setMinCollateralRatio(uint256) / setLiquidationThreshold(uint256) / setStalePriceThreshold(uint256) — factory-only
  • getCollateralRatio(address, uint256 debt) / isHealthy(address, uint256) / isLiquidatable(address, uint256)

RevvFiLiquidator

  • createAuction(...) — market-only
  • placeBid(uint256 auctionId, uint256 bidAmount)
  • settleAuction(uint256 auctionId)

ReputationRegistry

  • getReputationScore(address) / getRiskLabel(address) / getBorrowerProfile(address) (views)

Common Errors

ErrorCause
BorrowerNotRegisteredBorrower isn’t approved in RevvFiArchController
AssetBlacklistedBorrow asset, collateral asset, or oracle is blacklisted
InsufficientFeemsg.value doesn’t match the Factory’s deploymentFee
BorrowAmountTooHighRequested amount exceeds getMaxBorrowable()
MaxAprExceededThe fill’s weighted-average APR exceeds the borrower’s maxApr (or the protocol’s MAX_APR_BPS cap)
NoOffersAvailableNo active offers match the request
TooManyActivePositionsWould exceed MAX_ACTIVE_POSITIONS
OraclePriceStaleChainlink latestRoundData() is older than stalePriceThreshold, or otherwise invalid
InsufficientCollateralWithdrawal or health check would breach minCollateralRatio
AuctionNotFound / AuctionNotActive / AuctionAlreadySettledLiquidation auction lifecycle guards
BidTooLowBid doesn’t meet the current price / minimum increment over the highest bid

Next Steps