axis-synome 0.1.0.dev35__tar.gz → 0.1.0.dev41__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/PKG-INFO +1 -1
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/_version.py +2 -2
- axis_synome-0.1.0.dev41/src/axis_synome/spec/entities/__init__.py +5 -0
- axis_synome-0.1.0.dev41/src/axis_synome/spec/entities/protocol_risk.py +29 -0
- axis_synome-0.1.0.dev41/src/axis_synome/spec/risk_capital/administrative_rrc/__init__.py +1 -0
- axis_synome-0.1.0.dev41/src/axis_synome/spec/risk_capital/administrative_rrc/administrative_risk.py +238 -0
- axis_synome-0.1.0.dev41/src/axis_synome/spec/risk_capital/lindy_factor.py +51 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome.egg-info/PKG-INFO +1 -1
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome.egg-info/SOURCES.txt +5 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/.flake8 +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/README.md +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/WRITING_SPECS.md +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/pyproject.toml +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/setup.cfg +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/README.md +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/alm_proxies.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/assets.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/assets_by_prime.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/networks.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/primes.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/protocol_sets.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/tokens.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/types.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/asc.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/asc_collateral_ratio.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/asc_incentive.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/dab.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/latent_asc.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/ratio_latent_asc.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/resting_asc.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/codegen_test/entities/agents.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/crypto_lending/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/crypto_lending/formulas/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/crypto_lending/formulas/lif.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/risk_capital/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/risk_capital/financial_rrc/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/risk_capital/financial_rrc/entities.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/risk_capital/financial_rrc/perpetual_positions.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/risk_capital/formulas/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/risk_capital/formulas/required_risk_capital.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/suraf/README.md +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/suraf/entities/assessor_score.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/suraf/entities/assets.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/suraf/entities/mappings.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/suraf/formulas/crr.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/suraf/formulas/scoring.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/evm_address.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/pendle_validation.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/runtime/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/runtime/base.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/runtime/math.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/runtime/reference.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/validated_dataclass.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/validated_str.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_validator/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_validator/check_source_uuids.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_validator/checker.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_validator/flake8_plugin.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_validator/python_subset.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome.egg-info/dependency_links.txt +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome.egg-info/entry_points.txt +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome.egg-info/requires.txt +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome.egg-info/top_level.txt +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/conftest.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/mocks.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_alm_proxies.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_asc.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_asc_collateral_ratio.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_asc_incentive.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_dab.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_evm_address.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_latent_asc.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_prime_agent_data_validation.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_ratio_latent_asc.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_resting_asc.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/risk_capital/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/risk_capital/financial_rrc/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/risk_capital/financial_rrc/test_perpetual_positions.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/risk_capital/formulas/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/risk_capital/formulas/test_loss_given_default.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/spec_support/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/spec_support/runtime/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/spec_support/runtime/test_base.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/spec_support/runtime/test_math.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/spec_validator/test_check_source_uuids.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/spec_validator/test_checker.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/spec_validator/test_flake8_plugin.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/entities/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/entities/test_assessor_score.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/formulas/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/formulas/test_crr.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/formulas/test_scoring.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/static/aave_ausdc/v1/crr_mapping.csv +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/static/aave_ausdc/v1/penalty.csv +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/static/aave_ausdc/v1/scorecards/Assessor_1_scores.csv +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/static/aave_ausdc/v1/scorecards/Assessor_2_scores.csv +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/static/aave_ausdc/v1/scorecards/Assessor_3_scores.csv +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/static/aave_ausdc/v1/weights.csv +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/suraf_client/__init__.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/suraf_client/suraf_client.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/suraf_client/test_suraf_client.py +0 -0
- {axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/uv.lock +0 -0
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.1.0.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 1, 0, '
|
|
21
|
+
__version__ = version = '0.1.0.dev41'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 0, 'dev41')
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Backdoor types and protocol risk profiles.
|
|
2
|
+
|
|
3
|
+
Defines the protocol-level risk profile used by Smart Contract and
|
|
4
|
+
Administrative RRC models, including backdoor classification types
|
|
5
|
+
and their associated risk weights.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from enum import Enum
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class BackdoorType(Enum):
|
|
12
|
+
"""Protocol backdoor classification (A.3.2.2.1.3.1.2).
|
|
13
|
+
|
|
14
|
+
Captures the privileged-access profile of a protocol, which drives
|
|
15
|
+
the Starting Rate used in the Administrative Risk Rating (ARR):
|
|
16
|
+
|
|
17
|
+
NO_BACKDOOR — no privileged access to the relevant contracts
|
|
18
|
+
by any whitelisted set of users. SR = 0.
|
|
19
|
+
LIMITED_BACKDOOR — privileged users can materially modify the
|
|
20
|
+
terms of the smart contracts (e.g. freeze
|
|
21
|
+
transfers) but cannot make arbitrary changes
|
|
22
|
+
or transfer user funds. SR = 50.
|
|
23
|
+
ROOT_BACKDOOR — privileged users can make arbitrary changes,
|
|
24
|
+
including transferring user funds. SR = 100.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
NO_BACKDOOR = "NoBackdoor"
|
|
28
|
+
LIMITED_BACKDOOR = "LimitedBackdoor"
|
|
29
|
+
ROOT_BACKDOOR = "RootBackdoor"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Instance Administrative Required Risk Capital."""
|
axis_synome-0.1.0.dev41/src/axis_synome/spec/risk_capital/administrative_rrc/administrative_risk.py
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"""ARR formulas and related parameters.
|
|
2
|
+
|
|
3
|
+
Administrative Risk is the risk of loss due to abuse of privileged
|
|
4
|
+
access to the smart contracts that a Prime Agent invests in — e.g. a
|
|
5
|
+
multisig or other actor that can modify protocol terms or move funds
|
|
6
|
+
outside of a governance process.
|
|
7
|
+
|
|
8
|
+
The Instance Administrative RRC is computed in two steps:
|
|
9
|
+
|
|
10
|
+
1. Administrative Risk Rating (ARR) — A.3.2.2.1.3.1
|
|
11
|
+
A protocol-level rating on [0, 100], composed from:
|
|
12
|
+
- Starting Rate (SR): backdoor-type driven base (0, 50, 100)
|
|
13
|
+
- Delay Factor (DF): mitigation from a security delay, [0, 1]
|
|
14
|
+
- Lindy Adjustment Factor (LAF): shared helper (A.3.2.2.1.2.2.4)
|
|
15
|
+
ARR = min(CAP, SR * DF * LAF), with CAP a temporary cap.
|
|
16
|
+
|
|
17
|
+
2. Instance Administrative RRC — A.3.2.2.1.3.2
|
|
18
|
+
The ARR is converted into a Capital Requirement Ratio using the
|
|
19
|
+
same piecewise methodology as Smart Contract RRC
|
|
20
|
+
(A.3.2.2.1.2.3), then multiplied by the Prime's exposure. The
|
|
21
|
+
rating-to-CRR mapping is intentionally shared with Smart
|
|
22
|
+
Contract RRC and therefore delegated to that module; this file
|
|
23
|
+
defines only the Administrative-specific rating inputs and the
|
|
24
|
+
per-protocol exceptions (A.3.2.2.1.3.3) that override the rating
|
|
25
|
+
computation.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from typing import Final
|
|
29
|
+
|
|
30
|
+
from axis_synome.spec.entities.protocol_risk import BackdoorType
|
|
31
|
+
from axis_synome.spec.risk_capital.lindy_factor import lindy_adjustment_factor
|
|
32
|
+
|
|
33
|
+
# ── Administrative Risk Rating Cap (A.3.2.2.1.3.1.1) ──────────────
|
|
34
|
+
|
|
35
|
+
ADMINISTRATIVE_RISK_RATING_CAP: Final[float] = 30.0
|
|
36
|
+
"""Temporary cap on the Administrative Risk Rating.
|
|
37
|
+
|
|
38
|
+
:source_uuid: 7e359ea6-e846-4977-b3db-87fc1db64c0f
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
# ── Starting Rates by backdoor type (A.3.2.2.1.3.1.2.*) ───────────
|
|
42
|
+
|
|
43
|
+
STARTING_RATE_NO_BACKDOOR: Final[float] = 0.0
|
|
44
|
+
"""Starting Rate for a protocol with no backdoor access.
|
|
45
|
+
|
|
46
|
+
:source_uuid: 0d40ea83-8eef-4bea-b1ca-5700fb4536bc
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
STARTING_RATE_LIMITED_BACKDOOR: Final[float] = 50.0
|
|
50
|
+
"""Starting Rate for a protocol with limited backdoor access.
|
|
51
|
+
|
|
52
|
+
:source_uuid: ef31a379-c7ea-43c6-9a68-0f6083fcfeaf
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
STARTING_RATE_ROOT_BACKDOOR: Final[float] = 100.0
|
|
56
|
+
"""Starting Rate for a protocol with root backdoor access.
|
|
57
|
+
|
|
58
|
+
:source_uuid: 7d203683-a16c-479c-8425-2fed3b4c2375
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
# ── Delay Factor parameter (A.3.2.2.1.3.1.3) ─────────────────────
|
|
62
|
+
|
|
63
|
+
MAX_SECURITY_DELAY_HOURS: Final[float] = 48.0
|
|
64
|
+
"""Security delay (in hours) at or above which the Delay Factor is zero; it decays linearly from 1.0 at 0h.
|
|
65
|
+
|
|
66
|
+
:source_uuid: 52511026-55f4-4848-95a2-53db048d906c
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
# ── Per-protocol exceptions (A.3.2.2.1.3.3) ───────────────────────
|
|
70
|
+
#
|
|
71
|
+
# Exceptions land at two different layers:
|
|
72
|
+
# - Rating-layer (A.3.2.2.1.3.3.5 Fluid): overrides the ARR itself,
|
|
73
|
+
# which then flows through the standard rating-to-CRR mapping.
|
|
74
|
+
# - CRR-layer (A.3.2.2.1.3.3.{1,3,4}): zero out the Administrative
|
|
75
|
+
# CRR directly, short-circuiting the rating computation. Per the
|
|
76
|
+
# linked Smart Contract sub-docs (A.3.2.2.1.2.4.{1,3,4}) the same
|
|
77
|
+
# rule also zeroes the Smart Contract CRR; SC-side anchors will be
|
|
78
|
+
# declared alongside that module when it lands.
|
|
79
|
+
# - Exposure-layer (A.3.2.2.1.3.3.2 Legal Recourse Assets): not
|
|
80
|
+
# declared here; it is a multi-parameter exposure formula that
|
|
81
|
+
# belongs with the exposure / Smart Contract RRC work.
|
|
82
|
+
|
|
83
|
+
FLUID_ADMINISTRATIVE_RISK_RATING: Final[float] = 25.0
|
|
84
|
+
"""Administrative Risk Rating for Fluid (exception).
|
|
85
|
+
|
|
86
|
+
:source_uuid: 6bbbfa59-7988-4d34-bd75-05402d8ac6f8
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
BUIDL_GROUP_ADMINISTRATIVE_CRR: Final[float] = 0.0
|
|
90
|
+
"""Administrative CRR for BUIDL, JTRSY, USTB, and JAAA (exception).
|
|
91
|
+
|
|
92
|
+
:source_uuid: 095464ba-2301-4bb6-b342-e840bdd3c018
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
ETHENA_ADMINISTRATIVE_CRR: Final[float] = 0.0
|
|
96
|
+
"""Administrative CRR for Ethena (exception).
|
|
97
|
+
|
|
98
|
+
:source_uuid: 2397551e-9704-435e-b815-0384429be224
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
SUPERSTATE_ADMINISTRATIVE_CRR: Final[float] = 0.0
|
|
102
|
+
"""Administrative CRR for Superstate (exception).
|
|
103
|
+
|
|
104
|
+
:source_uuid: 92c06f19-21a3-4aea-9503-db685b3fd7f9
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# ── Starting Rate selection (A.3.2.2.1.3.1.2) ────────────────────
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def starting_rate(
|
|
112
|
+
backdoor_type: BackdoorType,
|
|
113
|
+
) -> float:
|
|
114
|
+
"""Select the Starting Rate for the Administrative Risk Rating (A.3.2.2.1.3.1.2).
|
|
115
|
+
|
|
116
|
+
The Starting Rate is the initial risk rating for Administrative
|
|
117
|
+
Risk before the Delay Factor and Lindy Adjustment Factor are
|
|
118
|
+
applied. It is a piecewise function of the protocol's backdoor
|
|
119
|
+
classification:
|
|
120
|
+
|
|
121
|
+
NO_BACKDOOR → 0
|
|
122
|
+
LIMITED_BACKDOOR → 50
|
|
123
|
+
ROOT_BACKDOOR → 100
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
backdoor_type: The protocol's backdoor classification (see
|
|
127
|
+
``BackdoorType``). A protocol's backdoor type
|
|
128
|
+
is a governance input determined as part of
|
|
129
|
+
onboarding the Instance.
|
|
130
|
+
|
|
131
|
+
:source_uuid: 368786cb-da80-4d48-a2e8-52d14fb6320c
|
|
132
|
+
"""
|
|
133
|
+
return (
|
|
134
|
+
STARTING_RATE_NO_BACKDOOR
|
|
135
|
+
if backdoor_type == BackdoorType.NO_BACKDOOR
|
|
136
|
+
else (
|
|
137
|
+
STARTING_RATE_LIMITED_BACKDOOR
|
|
138
|
+
if backdoor_type == BackdoorType.LIMITED_BACKDOOR
|
|
139
|
+
else STARTING_RATE_ROOT_BACKDOOR
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# ── Delay Factor (A.3.2.2.1.3.1.3) ───────────────────────────────
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def delay_factor(
|
|
148
|
+
security_delay_hours: float,
|
|
149
|
+
) -> float:
|
|
150
|
+
"""Compute the Delay Adjustment Factor for a given security delay (A.3.2.2.1.3.1.3).
|
|
151
|
+
|
|
152
|
+
A security delay between the approval of a backdoor change and its
|
|
153
|
+
activation gives users time to raise issues or withdraw funds,
|
|
154
|
+
mitigating the risk associated with backdoor access. The Delay
|
|
155
|
+
Factor scales the ARR accordingly:
|
|
156
|
+
|
|
157
|
+
DF = max(0, 1 - security_delay_hours / MAX_SECURITY_DELAY_HOURS)
|
|
158
|
+
|
|
159
|
+
So DF is 1 when there is no security delay, 0 at a delay of 48
|
|
160
|
+
hours or greater, and for example 0.5 at 24 hours (per the Atlas
|
|
161
|
+
illustrative example).
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
security_delay_hours: Time between approval of a backdoor
|
|
165
|
+
change and it becoming effective, in
|
|
166
|
+
hours (>= 0).
|
|
167
|
+
|
|
168
|
+
:source_uuid: 52511026-55f4-4848-95a2-53db048d906c
|
|
169
|
+
"""
|
|
170
|
+
return max(0.0, 1.0 - security_delay_hours / MAX_SECURITY_DELAY_HOURS)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
# ── Administrative Risk Rating (A.3.2.2.1.3.1) ───────────────────
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def administrative_risk_rating(
|
|
177
|
+
starting_rate_value: float,
|
|
178
|
+
delay_factor_value: float,
|
|
179
|
+
lindy_adjustment_factor_value: float,
|
|
180
|
+
) -> float:
|
|
181
|
+
"""Compute the Administrative Risk Rating for a protocol (A.3.2.2.1.3.1).
|
|
182
|
+
|
|
183
|
+
ARR = min(CAP, SR * DF * LAF)
|
|
184
|
+
|
|
185
|
+
where:
|
|
186
|
+
- SR is the Starting Rate from the backdoor type
|
|
187
|
+
(A.3.2.2.1.3.1.2), obtained via ``starting_rate``.
|
|
188
|
+
- DF is the Delay Factor from any security delay
|
|
189
|
+
(A.3.2.2.1.3.1.3), obtained via ``delay_factor``.
|
|
190
|
+
- LAF is the Lindy Adjustment Factor (A.3.2.2.1.3.1.4), which
|
|
191
|
+
uses the same methodology as Smart Contract RRC
|
|
192
|
+
(A.3.2.2.1.2.2.4) and is supplied by the shared Lindy
|
|
193
|
+
helper.
|
|
194
|
+
- CAP is the Administrative Risk Rating cap (A.3.2.2.1.3.1.1),
|
|
195
|
+
a temporary governance-set ceiling on the rating.
|
|
196
|
+
|
|
197
|
+
Args:
|
|
198
|
+
starting_rate_value: SR in [0, 100] (see ``starting_rate``).
|
|
199
|
+
delay_factor_value: DF in [0, 1] (see ``delay_factor``).
|
|
200
|
+
lindy_adjustment_factor_value: LAF in [0, 1] from the shared
|
|
201
|
+
Lindy helper
|
|
202
|
+
(``lindy_adjustment_factor``,
|
|
203
|
+
A.3.2.2.1.2.2.4).
|
|
204
|
+
|
|
205
|
+
:source_uuid: a9dfd122-2862-4759-aba7-482f86428ca7
|
|
206
|
+
"""
|
|
207
|
+
raw_rating: float = starting_rate_value * delay_factor_value * lindy_adjustment_factor_value
|
|
208
|
+
return min(ADMINISTRATIVE_RISK_RATING_CAP, raw_rating)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def administrative_risk_rating_from_inputs(
|
|
212
|
+
backdoor_type: BackdoorType,
|
|
213
|
+
security_delay_hours: float,
|
|
214
|
+
age_days: float,
|
|
215
|
+
gm_tvl: float,
|
|
216
|
+
) -> float:
|
|
217
|
+
"""Compose the ARR directly from raw protocol-level inputs (A.3.2.2.1.3.1).
|
|
218
|
+
|
|
219
|
+
A convenience top-level formula that chains ``starting_rate``,
|
|
220
|
+
``delay_factor``, and the shared ``lindy_adjustment_factor`` helper
|
|
221
|
+
(A.3.2.2.1.2.2.4) into ``administrative_risk_rating``.
|
|
222
|
+
|
|
223
|
+
Args:
|
|
224
|
+
backdoor_type: Protocol backdoor classification.
|
|
225
|
+
security_delay_hours: Security delay applied to backdoor
|
|
226
|
+
changes, in hours (>= 0).
|
|
227
|
+
age_days: Average age of the relevant contracts,
|
|
228
|
+
in days, used by the Lindy helper.
|
|
229
|
+
gm_tvl: Geometric-mean daily TVL over the
|
|
230
|
+
contract age, in USD, used by the Lindy
|
|
231
|
+
helper.
|
|
232
|
+
|
|
233
|
+
:source_uuid: a9dfd122-2862-4759-aba7-482f86428ca7
|
|
234
|
+
"""
|
|
235
|
+
sr: float = starting_rate(backdoor_type)
|
|
236
|
+
df: float = delay_factor(security_delay_hours)
|
|
237
|
+
laf: float = lindy_adjustment_factor(age_days, gm_tvl)
|
|
238
|
+
return administrative_risk_rating(sr, df, laf)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import math
|
|
2
|
+
from typing import Final
|
|
3
|
+
|
|
4
|
+
DAYS_PER_MONTH = 365.0 / 12.0
|
|
5
|
+
|
|
6
|
+
TVL_THRESHOLD_LINDY: Final[float] = 100_000_000.0
|
|
7
|
+
"""TVL threshold (USD) used to scale the effective Lindy age.
|
|
8
|
+
|
|
9
|
+
:source_uuid: c7939b23-39e1-4299-9beb-700857b8f90e
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
LAF_DECAY_FACTOR_LAMBDA: Final[float] = 0.1
|
|
13
|
+
"""Decay factor lambda controlling the curvature of the Lindy Adjustment Factor.
|
|
14
|
+
|
|
15
|
+
:source_uuid: 7f109cc0-ee8d-48b6-8fbf-6e363004edfb
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
LAF_MAXIMUM_AGE_MONTHS: Final[float] = 60.0
|
|
19
|
+
"""Maximum effective age (in months) at which the Lindy Adjustment Factor saturates to 1.
|
|
20
|
+
|
|
21
|
+
:source_uuid: 891eab12-0c47-4b87-b867-3cba6ca7db4e
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def age_effective_lindy(age_days: float, gm_tvl: float) -> float:
|
|
26
|
+
"""Compute Atlas effective age from contract age and geometric-mean TVL.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
age_days: Average age of the relevant contracts, measured in days.
|
|
30
|
+
gm_tvl: Geometric mean of daily TVL over the contract age, in USD.
|
|
31
|
+
|
|
32
|
+
:source_uuid: a8db99b2-f072-4132-9ee2-c8ebcc2b3609
|
|
33
|
+
"""
|
|
34
|
+
contract_age_months = age_days / DAYS_PER_MONTH
|
|
35
|
+
scale = math.log(1.0 + gm_tvl / TVL_THRESHOLD_LINDY)
|
|
36
|
+
return contract_age_months * scale
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def lindy_adjustment_factor(age_days: float, gm_tvl: float) -> float:
|
|
40
|
+
"""Compute the Atlas Lindy Adjustment Factor for smart contract risk.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
age_days: Average age of the relevant contracts, measured in days.
|
|
44
|
+
gm_tvl: Geometric mean of daily TVL over the contract age, in USD.
|
|
45
|
+
|
|
46
|
+
:source_uuid: 227eff62-f2aa-4e49-91ad-1321261ed299
|
|
47
|
+
"""
|
|
48
|
+
age_eff = age_effective_lindy(age_days, gm_tvl)
|
|
49
|
+
numerator = math.log(1.0 + LAF_DECAY_FACTOR_LAMBDA * age_eff)
|
|
50
|
+
denominator = math.log(1.0 + LAF_DECAY_FACTOR_LAMBDA * LAF_MAXIMUM_AGE_MONTHS)
|
|
51
|
+
return max(0.0, 1.0 - numerator / denominator)
|
|
@@ -33,7 +33,12 @@ src/axis_synome/spec/codegen_test/entities/agents.py
|
|
|
33
33
|
src/axis_synome/spec/crypto_lending/__init__.py
|
|
34
34
|
src/axis_synome/spec/crypto_lending/formulas/__init__.py
|
|
35
35
|
src/axis_synome/spec/crypto_lending/formulas/lif.py
|
|
36
|
+
src/axis_synome/spec/entities/__init__.py
|
|
37
|
+
src/axis_synome/spec/entities/protocol_risk.py
|
|
36
38
|
src/axis_synome/spec/risk_capital/__init__.py
|
|
39
|
+
src/axis_synome/spec/risk_capital/lindy_factor.py
|
|
40
|
+
src/axis_synome/spec/risk_capital/administrative_rrc/__init__.py
|
|
41
|
+
src/axis_synome/spec/risk_capital/administrative_rrc/administrative_risk.py
|
|
37
42
|
src/axis_synome/spec/risk_capital/financial_rrc/__init__.py
|
|
38
43
|
src/axis_synome/spec/risk_capital/financial_rrc/entities.py
|
|
39
44
|
src/axis_synome/spec/risk_capital/financial_rrc/perpetual_positions.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/__init__.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/alm_proxies.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/assets.py
RENAMED
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/networks.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/primes.py
RENAMED
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/tokens.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/entities/types.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/asc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/dab.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/latent_asc.py
RENAMED
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/asc/formulas/resting_asc.py
RENAMED
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/crypto_lending/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/risk_capital/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/suraf/entities/assets.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/suraf/entities/mappings.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/suraf/formulas/crr.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec/suraf/formulas/scoring.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/__init__.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/evm_address.py
RENAMED
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/runtime/__init__.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/runtime/base.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/runtime/math.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_support/validated_str.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_validator/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_validator/checker.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_validator/flake8_plugin.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome/spec_validator/python_subset.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/src/axis_synome.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_alm_proxies.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_asc_incentive.py
RENAMED
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_evm_address.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_latent_asc.py
RENAMED
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_ratio_latent_asc.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/asc/test_resting_asc.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/risk_capital/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/spec_support/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/spec_validator/test_checker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/entities/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/formulas/__init__.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/formulas/test_crr.py
RENAMED
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/formulas/test_scoring.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{axis_synome-0.1.0.dev35 → axis_synome-0.1.0.dev41}/tests/axis_synome/suraf/suraf_client/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|