This page is a comprehensive reference of all constants, parameters, and configuration values used across PredMart's smart contract and backend systems. These values define the protocol's risk model, interest rate behavior, liquidation mechanics, oracle constraints, and operational parameters.
All on-chain constants are defined in the PredmartLendingPool.sol smart contract. Backend constants are defined in lending/constants.py and config.py.
Interest Rate Model Parameters
These constants define PredMart's kinked (two-slope) interest rate model. They determine how borrowing costs and lending yields respond to pool utilization.
| Constant | On-Chain Name | Value | Unit | Description |
|---|
| Base Rate | BASE_RATE | 0.05e18 | WAD (5%) | The minimum annual borrow rate at 0% utilization. This is the floor rate — even when nobody is borrowing, this rate applies. |
| Kink Utilization | KINK | 0.80e18 | WAD (80%) | The target utilization point where the rate curve changes slope. Below this level, rates increase gently. Above this level, rates increase steeply. |
| Rate at Kink | RATE_AT_KINK | 0.25e18 | WAD (25%) | The annual borrow rate exactly at the kink point (80% utilization). |
| Maximum Rate | MAX_RATE | 3.00e18 | WAD (300%) | The theoretical maximum annual borrow rate at 100% utilization. |
| Slope 1 (Below Kink) | SLOPE1 | 0.25e18 | WAD (25%) | The rate of interest increase per unit of utilization below the kink. Formula: (RATE_AT_KINK - BASE_RATE) / KINK. |
| Slope 2 (Above Kink) | SLOPE2 | 13.75e18 | WAD (1375%) | The rate of interest increase per unit of utilization above the kink. Formula: (MAX_RATE - RATE_AT_KINK) / (1 - KINK). Deliberately very steep. |
| Reserve Factor | RESERVE_FACTOR | 0.05e18 | WAD (5%) | The percentage of interest income that goes to protocol reserves rather than lenders. |
| Seconds Per Year | SECONDS_PER_YEAR | 31,557,600 | seconds | 365.25 days × 86,400 seconds. Used for converting annual rates to per-second rates. |
Interest Rate at Various Utilizations
| Utilization | Borrow APR | Supply APY* |
|---|
| 0% | 5.00% | 0.00% |
| 10% | 7.50% | 0.71% |
| 20% | 10.00% | 1.90% |
| 30% | 12.50% | 3.56% |
| 40% | 15.00% | 5.70% |
| 50% | 17.50% | 8.31% |
| 60% | 20.00% | 11.40% |
| 70% | 22.50% | 14.96% |
| 80% | 25.00% | 19.00% |
| 85% | 93.75% | 75.70% |
| 90% | 162.50% | 138.94% |
| 95% | 231.25% | 208.69% |
| 100% | 300.00% | 285.00% |
*Supply APY = Borrow APR × Utilization × (1 - Reserve Factor)
Risk Parameters
These constants govern the protocol's risk management — how much users can borrow, when liquidation triggers, and how liquidation is executed.
| Constant | On-Chain Name | Value | Unit | Description |
|---|
| Liquidation Buffer | LIQUIDATION_BUFFER | 0.10e18 | WAD (10%) | Added to the LTV ratio to determine the liquidation threshold. Creates a safety gap between the maximum borrowing limit and the liquidation trigger. |
| Close Factor | CLOSE_FACTOR | 0.50e18 | WAD (50%) | The maximum fraction of a borrower's debt that can be repaid in a single liquidation, when the health factor is between 0.95 and 1.0. |
| Full Close Health Factor | FULL_CLOSE_HF | 0.95e18 | WAD (0.95) | When a position's health factor drops below this threshold, the close factor increases to 100%, allowing the entire debt to be repaid in a single liquidation. |
| Liquidation Bonus | LIQUIDATION_BONUS | 0.05e18 | WAD (5%) | The bonus collateral awarded to the liquidator in above-water liquidations. Liquidators receive collateral worth repayAmount × (1 + 5%). |
| Liquidation Discount | LIQUIDATION_DISCOUNT | 0.10e18 | WAD (10%) | For underwater liquidations, the discount applied to the collateral value. The liquidator pays 90% of the collateral's value and receives all collateral. |
| Minimum Borrow | MIN_BORROW | 1,000,000 | USDC units ($1.00) | The minimum loan size in USDC's 6-decimal representation. Prevents dust positions. |
| Number of Anchors | NUM_ANCHORS | 7 | count | The number of price/LTV anchor points in the LTV curve. |
LTV Curve Anchors
The LTV (Loan-to-Value) curve is defined by 7 anchor points. Between anchors, the LTV is linearly interpolated. The liquidation threshold at each price point is LTV + 10% (the liquidation buffer).
| Anchor Index | Price Anchor | LTV Anchor | Liquidation Threshold | Max Theoretical Leverage |
|---|
| 0 | $0.00 (0) | 2% (0.02e18) | 12% | 1.02x |
| 1 | $0.10 (0.10e18) | 8% (0.08e18) | 18% | 1.09x |
| 2 | $0.20 (0.20e18) | 30% (0.30e18) | 40% | 1.43x |
| 3 | $0.40 (0.40e18) | 45% (0.45e18) | 55% | 1.82x |
| 4 | $0.60 (0.60e18) | 60% (0.60e18) | 70% | 2.50x |
| 5 | $0.80 (0.80e18) | 70% (0.70e18) | 80% | 3.33x |
| 6 | $1.00 (1.00e18) | 75% (0.75e18) | 85% | 4.00x |
Interpolated LTV at Common Prices
| Price | LTV | Liquidation Threshold |
|---|
| $0.05 | 5.0% | 15.0% |
| $0.15 | 19.0% | 29.0% |
| $0.25 | 37.5% | 47.5% |
| $0.30 | 37.5% | 47.5% |
| $0.35 | 41.25% | 51.25% |
| $0.45 | 48.75% | 58.75% |
| $0.50 | 52.50% | 62.50% |
| $0.55 | 56.25% | 66.25% |
| $0.65 | 62.50% | 72.50% |
| $0.70 | 65.00% | 75.00% |
| $0.75 | 67.50% | 77.50% |
| $0.85 | 71.25% | 81.25% |
| $0.90 | 72.50% | 82.50% |
| $0.95 | 73.75% | 83.75% |
Oracle and Timing Parameters
These constants control the oracle system — how price and resolution data is validated.
| Constant | On-Chain Name | Value | Unit | Description |
|---|
| Max Price Age | MAX_RELAY_PRICE_AGE | 10 | seconds | Maximum age of oracle-signed price data. Transactions with older price data are rejected. |
| Max Resolution Age | MAX_RESOLUTION_AGE | 3,600 | seconds (1 hour) | Maximum age of oracle-signed resolution data. Market resolution calls with older data are rejected. |
Pool Configuration
| Constant | On-Chain Name | Value | Unit | Description |
|---|
| Pool Cap | poolCapBps | 500 | basis points (5%) | Maximum total borrowing against any single token as a percentage of the pool's total assets. Prevents concentration risk. Adjustable by admin. |
ERC-4626 Vault Parameters
| Parameter | Value | Description |
|---|
| Underlying Asset | USDC.e | The token lenders deposit and borrowers receive |
| Vault Share Name | pUSDC | The ERC-20 token lenders receive |
| Decimal Offset | 6 | pUSDC has 12 decimals (USDC's 6 + offset of 6). Prevents inflation attacks. |
Backend Constants
These constants are defined in PredMart's backend code and govern operational behavior. They are not on-chain but affect the oracle, liquidation bot, and borrow limits.
Depth Gate Parameters
| Constant | Variable Name | Value | Description |
|---|
| Lookback Period | DEPTH_GATE_LOOKBACK_DAYS | 7 days | How far back depth snapshots are considered for cap calculation. |
| Sample Interval | DEPTH_GATE_SAMPLE_INTERVAL_MIN | 60 minutes | How often orderbook depth is sampled. |
| Percentile | DEPTH_GATE_PERCENTILE | 25 | The percentile used from the depth snapshot distribution (conservative). |
| Ask Band | DEPTH_GATE_ASK_BAND | $0.10 | Only count asks within this range of the best ask price. |
| Minimum Uptime | DEPTH_GATE_MIN_UPTIME | 0.8 (80%) | Require at least 80% of expected samples to exist; otherwise borrowing is blocked. |
| Pretrack Volume | DEPTH_GATE_PRETRACK_VOLUME_MIN | $1,000 | Pre-sample depth for markets with at least this cumulative trading volume. |
| Pretrack Cache TTL | DEPTH_GATE_PRETRACK_CACHE_TTL | 1,800 seconds (30 min) | How often the high-volume market list is refreshed from Gamma API. |
Depth Gate Graduated Scaling
| History Age | Divisor | Effective Cap vs. Pool Cap |
|---|
| 7+ days | 1.0 | 100% (full pool cap) |
| 6 days | 1.5 | 67% |
| 5 days | 2.0 | 50% |
| 4 days | 2.5 | 40% |
| 3 days | 3.0 | 33% |
| 2 days | 5.0 | 20% |
| 1 day | 7.0 | 14% |
| 12 hours | 10.0 | 10% |
| 6 hours | 15.0 | 7% |
| 2+ hours | 20.0 | 5% |
| Less than 2 hours | — | Borrowing blocked |
Price Drop Guard Parameters
| Constant | Variable Name | Value | Description |
|---|
| Window | PRICE_DROP_WINDOW | 180 seconds (3 minutes) | Rolling time window for crash detection. |
| Relative Threshold | PRICE_DROP_THRESHOLD_PCT | 0.35 (35%) | Minimum relative price drop to trigger the guard. |
| Absolute Threshold | PRICE_DROP_THRESHOLD_ABS | 0.08 ($0.08) | Minimum absolute price drop to trigger the guard. Both thresholds must be met. |
Borrow Haircut
| Constant | Variable Name | Value | Description |
|---|
| Borrow Haircut | BORROW_HAIRCUT | 995 (99.5%) | Backend reduces the theoretical max borrow by 0.5% to account for rounding and timing differences between the API call and on-chain execution. |
Precision Constants
| Constant | Variable Name | Value | Description |
|---|
| WAD | WAD | 10^18 | Standard 18-decimal precision for fixed-point arithmetic. Used for prices, rates, ratios. |
| USDC Decimals | USDC_DECIMALS | 6 | USDC has 6 decimal places. |
| USDC Unit | USDC_UNIT | 10^6 (1,000,000) | One USDC in its smallest unit. |
| pUSDC Decimals | PUSDC_DECIMALS | 12 | pUSDC has 12 decimal places (6 from USDC + 6 offset). |
Worker Task Intervals
These intervals define how frequently PredMart's background tasks run.
| Task | Interval | Queue | Description |
|---|
| Event Indexer | 2 seconds | indexer | Indexes new blockchain events from the lending pool contract. |
| Position Scanner | 5 seconds | indexer | Refreshes the Redis cache of all active positions. |
| Liquidation Fallback | 5 seconds | indexer | REST-based health factor check for all positions (backup for WebSocket). |
| Unsold Shares Sweep | 10 seconds | indexer | Retries selling seized collateral that failed to sell previously. |
| Resolution Fallback | 60 seconds | indexer | Polls Polymarket's API for newly resolved markets. |
| Pool Stats Snapshot | 30 seconds | default | Records utilization, rates, and TVL for historical charts. |
| Depth Sampling | 60 minutes | default | Samples orderbook depth for each active collateral token. |
Contract Addresses
| Contract | Network | Address |
|---|
| PredMart Lending Pool (Proxy) | Polygon Mainnet | 0xD90D012990F0245cAD29823bdf0B4C9AF207d9ee |
| USDC.e | Polygon Mainnet | 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 |
| CTF (Conditional Token Framework) | Polygon Mainnet | 0x4D97DCd97eC945f40cF65F87097ACe5EA0476045 |
Next Steps