Protocol Constants
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.
Values shown here are the current settings. Anything served by /lending/constants — rates, LTV, buffers, and fees — is read live on-chain and may be tuned by admin via timelock, so treat the live endpoint as authoritative.
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.10e18 | WAD (10%) | 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.42e18 | WAD (42%) | The annual borrow rate exactly at the kink point (80% utilization). |
| Maximum Rate | MAX_RATE |
3.17e18 | WAD (317%) | The theoretical maximum annual borrow rate at 100% utilization. |
| Slope 1 (Below Kink) | SLOPE1 |
0.40e18 | WAD (40%) | 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.10e18 | WAD (10%) | 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% | 10.00% | 0.00% |
| 10% | 14.00% | 1.26% |
| 20% | 18.00% | 3.24% |
| 30% | 22.00% | 5.94% |
| 40% | 26.00% | 9.36% |
| 50% | 30.00% | 13.50% |
| 60% | 34.00% | 18.36% |
| 70% | 38.00% | 23.94% |
| 80% | 42.00% | 30.24% |
| 85% | 110.75% | 84.72% |
| 90% | 179.50% | 145.40% |
| 95% | 248.25% | 212.25% |
| 100% | 317.00% | 285.30% |
*Supply APY = Borrow APR × Utilization × (1 - Reserve Factor). Lenders also receive a share of profit fees from leveraged position closes (see Profit Fee Parameters).
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.05e18 | WAD (5%) | Added to the LTV ratio to determine the liquidation threshold. Creates a safety gap between the maximum borrowing limit and the liquidation trigger. |
| Liquidator Fee | LIQUIDATOR_FEE |
0.05e18 | WAD (5%) | The fee paid to the liquidator as a percentage of the debt amount. |
| 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 Price Points | NUM_ANCHORS |
7 | count | The number of price/LTV points in the LTV definition (all set to flat 80%). |
Profit Fee Parameters
When a leveraged position is closed with profit (surplus exceeds initial equity), a profit fee is charged.
| Constant | Backend Name | Value | Description |
|---|---|---|---|
| Profit Fee | profit_fee |
10% | The percentage of profit taken as a fee when closing a leveraged position with gains. |
| Pool Share | profit_fee_pool |
7% | The portion of the profit fee that goes to the lending pool (lenders). |
| Protocol Share | profit_fee_protocol |
3% | The portion of the profit fee that goes to the protocol fee pool. |
All three are read live from /lending/constants.
The profit fee only applies to leveraged positions that close with a profit above their initial equity. It does not apply to regular borrow positions or positions that close at a loss.
Entry Fee
A one-time, risk-based fee deducted from your deposit when you open a borrow or leverage position (the borrowed amount itself arrives whole). It accrues to lenders.
| Constant | Backend Name | Value | Description |
|---|---|---|---|
| Entry Fee Cap | entry_fee_cap |
live (≈7%) | Maximum entry-fee rate, applied to the lowest-priced (riskiest) shares. |
| Entry Fee Steepness | entry_fee_m |
live | How quickly the rate rises as share price falls. |
The rate scales with risk — higher for lower-priced shares, approaching the cap — following cap × tanh(m × (1 − price)). Both parameters are read live from /lending/constants.
Operation Fee
A small flat fee charged on each relayed transaction (borrow, collateral withdrawal, leverage open) for spam protection and to fund the relayer's gas costs.
| Constant | On-Chain Name | Value | Unit | Description |
|---|---|---|---|---|
| Operation Fee | operationFee() |
live (admin-set) | USDC (6 decimals) | The current flat fee per relayed operation. Read live from the pool proxy. |
For relayed deposits/withdrawals, the same fee is converted to collateral shares at the oracle price and collected in shares instead of USDC. The accumulated fees go to a dedicated pool (operationFeePool) that is used exclusively to top up the relayer wallet's gas balance.
LTV Parameters
PredMart uses a flat 80% LTV at all share prices, giving uniform 5x max leverage. The liquidation threshold is 85% (LTV + 5% buffer).
| Parameter | Value | Description |
|---|---|---|
| Max LTV | 80% (0.80e18) | Maximum borrowing power at any share price |
| Liquidation Threshold | 85% | Point at which positions become liquidatable |
| Max Leverage | 5.00x | Maximum theoretical leverage (1 / (1 - 0.80)) |
Oracle and Timing Parameters
These constants control the oracle system — how price and resolution data is validated.
The smart contract enforces strict freshness requirements on all oracle-signed data. Price data must be very recent (seconds-level) and resolution data must be within a reasonable window. Stale data is rejected on-chain.
Pool Configuration
| Constant | On-Chain Name | Value | Unit | Description |
|---|---|---|---|---|
| Pool Cap | poolCapBps |
500 | basis points (5%) | On-chain per-token concentration ceiling — the maximum total borrowing against any single token, as a percentage of the pool's total assets. Adjustable by admin via timelock. Acts as the contract-level backstop; the backend constants below typically bind tighter. |
| Effective Per-Token Cap | EFFECTIVE_CAP_USD |
500 | USD | Backend hardcoded per-token max borrow. Admin-tunable. Binds tighter than poolCapBps whenever it's smaller than 5% × totalAssets. |
| Timelock Delay | timelockDelay |
21600 | seconds (6 hours) | Mandatory waiting period before timelocked admin operations can be executed. Uses a one-way ratchet — can only be increased, never decreased. This file is the single source of truth for the current timelock value; live value also readable on-chain via timelockDelay(). |
CLOB Order Slippage
These tolerances are applied off-chain when PredMart's backend builds Fill-or-Kill orders against Polymarket's CLOB. They are not enforced by the smart contract.
| Action | Slippage Tolerance | Notes |
|---|---|---|
| Automated leverage open (BUY) | 5% (500 bps) | Order signs at price × 1.05; if the book moves more than 5% between sign and fill, FOK rejects — no partial fill. |
| Manual flash close (SELL) | 5% (500 bps) | Order signs at price × 0.95; same protection. |
| Spot buy/sell via PredMart UI | 5% (500 bps) | Same as above. |
| Liquidation auto-sell | No cap | Order signs at the minimum valid price; FOK fills at the best available bid. Execution certainty is prioritized over price. |
| Take-Profit / Stop-Loss close | No cap | Same as liquidation — TP/SL guarantees execution, not price. |
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. |
Additional Parameters
Precision Constants
| Constant | Value | Description |
|---|---|---|
| WAD | 10^18 | Standard 18-decimal precision for fixed-point arithmetic. Used for prices, rates, ratios. |
| USDC Decimals | 6 | USDC has 6 decimal places. |
| pUSDC Decimals | 12 | pUSDC has 12 decimal places (6 from USDC + 6 offset). |
Nonce Separation
PredMart uses separate nonces for each operation type to prevent cross-operation replay attacks:
| Nonce Type | Contract Function | Description |
|---|---|---|
| Borrow Nonce | borrowNonce(address) |
Incremented on each borrow operation |
| Withdraw Nonce | withdrawNonce(address) |
Incremented on each collateral withdrawal |
| Leverage Nonce | leverageNonce(address) |
Incremented on each leverage operation |
This separation ensures that a signed borrow intent cannot be replayed as a withdraw or leverage intent, even if the nonce values happen to match.
Per-Market Borrow Cap
PredMart's per-market borrow cap dynamically limits borrowing per token based on the market's liquidity and recent price stability. See Oracle Pricing & Borrow Caps for details.
Oracle Price
The oracle price (the Mark) is the average price to sell $1,000 of shares into the order book — a manipulation-resistant measure, signed by the oracle and verified on-chain. See Oracle Pricing & Borrow Caps for the full explanation.
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
- Smart Contract — Developer reference with ABI and events
- Interest Rates — Detailed explanation of the interest rate model
- Risk Parameters — How the LTV curve and health factor work
- Oracle Pricing & Borrow Caps — How borrow caps are calculated