-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCovenantDefaults.sol
More file actions
38 lines (33 loc) · 1.92 KB
/
Copy pathCovenantDefaults.sol
File metadata and controls
38 lines (33 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {ReceivableNote} from "./ReceivableNote.sol";
/// @notice The desk's default risk policy, in one place.
///
/// Deploy scripts, the demo narrative and the test suite all read the curve
/// from here rather than each restating it. When those three disagree the
/// failure is silent and specific: tests assert a rate the deployed desk does
/// not actually charge.
///
/// The bands are eligibility bands, not credit ratings. `subTier` is the axis
/// an integrator sets when issuing a Cleanverse A-Pass, so it measures how
/// thoroughly a counterparty has been verified — deeper verification narrows
/// the discount, and that is the whole claim. It is not a probability of
/// default and is never presented as one.
library CovenantDefaults {
uint8 internal constant SUBTIER_INSTITUTIONAL = 80;
uint8 internal constant SUBTIER_ESTABLISHED = 50;
uint8 internal constant SUBTIER_BASIC = 20;
uint16 internal constant RATE_INSTITUTIONAL = 9_700; // 97%
uint16 internal constant RATE_ESTABLISHED = 9_300; // 93%
uint16 internal constant RATE_BASIC = 8_800; // 88%
/// @notice A supplier below this has not been verified deeply enough to originate
/// at all — it is the floor that keeps anonymous originators out, not a
/// pricing input.
uint8 internal constant MIN_ORIGINATOR_SUBTIER = 20;
function rateBands() internal pure returns (ReceivableNote.RateBand[] memory bands) {
bands = new ReceivableNote.RateBand[](3);
bands[0] = ReceivableNote.RateBand({minSubTier: SUBTIER_INSTITUTIONAL, advanceRateBps: RATE_INSTITUTIONAL});
bands[1] = ReceivableNote.RateBand({minSubTier: SUBTIER_ESTABLISHED, advanceRateBps: RATE_ESTABLISHED});
bands[2] = ReceivableNote.RateBand({minSubTier: SUBTIER_BASIC, advanceRateBps: RATE_BASIC});
}
}