Skip to main content

Reading state

The view functions and helpers to read before you build a transaction. Nothing here changes state.

Quotas​

Aggregator.redemptionQuotaAvailable()
returns (uint256 available, uint256 redemptionCapacityNow)
Aggregator.issuanceQuotaAvailable(address troveManager)
returns (uint256 available, ...)

A redemption above available reverts (no partial fill); an open/borrow above the branch issuance quota reverts with "Agg:issuanceQuota". Check these before sending.

Hints​

Compute sorted-list hints off-chain with the singleton GlobalHintHelper:

// Multi-branch redemption hints (no branch index, no price arg):
GlobalHintHelper.getRedemptionHints(uint _RDamount, uint _maxIterations)
returns (address[] firstRedemptionHints, uint[] partialRedemptionHintNICRs, uint[] truncatedRDamounts)

// Approximate insert hint for one branch's TroveManager:
GlobalHintHelper.getApproxHint(address troveManager, uint _NICR, uint _numTrials, uint _inputRandomSeed)
returns (address hintAddress, uint diff, uint latestRandomSeed)

Standard pattern: read branch state → getApproxHint with numTrials ≈ sqrt(numTroves) × 10 → refine with SortedTroves.findInsertPosition(NICR, hint, hint) for the exact upper/lower. Always use the trove's post-operation NICR.

Prices and ratios​

  • RateParControl.par() — the internal redemption price (normally 1e18).
  • MarketOracle.getResultWithValidity() — RD/USD market price + validity, the controller's input.
  • PriceFeed.fetchPrice(...) / lastGoodPrice() — the branch collateral USD price.
  • TroveManager.getCurrentICR(address, price) / getCurrentICRPar(address, price, par) — a trove's live ICR.
  • Aggregator.unshieldedDebtEma(i).ema — the redemption basket weight for branch i.

Front-ends should surface the realized RD-in vs collateral-out for redemptions (the fee depends on which branch is hit), not a headline fee percentage. See Front-end operators.