Skip to main content

sra-riskgate

Deterministic pre-filter for stablecoin transactions. It runs fast rule checks (peg-deviation bounds in both directions, a single-transfer ceiling, and payload validation) before you send a transaction to the SRA-RiskGate-4B model.

This package does not run the model and does not perform sanctions screening.

pip install sra-riskgate
from sra_riskgate import RulePreFilter, TransactionPayload

gate = RulePreFilter(max_amount=50_000, depeg_hold_pct=1.0, depeg_reject_pct=5.0)
verdict = gate.inspect(TransactionPayload(
    chain_id=1, token="USDC",
    sender="0x" + "a" * 40, recipient="0x" + "b" * 40,
    amount=5000.0, peg_deviation_pct=-1.5,
))
print(verdict.decision.value, verdict.flags, verdict.required_actions)
# hold ['MODERATE_DEPEG'] ['manual_review']
Rule Decision
Peg deviation NaN / infinite reject
abs(peg deviation) >= depeg_reject_pct reject
abs(peg deviation) >= depeg_hold_pct hold
amount > max_amount hold
otherwise approve

Changelog

0.3.1: Unknown constructor arguments now raise TypeError instead of being silently ignored. Legacy max_allowed_deviation_pct maps to the hold threshold again (as in 0.1.x). Non-finite thresholds are rejected. License and author metadata restored.

0.3.0: Depeg checks use abs() (catches upward depegs). Thresholds validated.

License: Apache-2.0

Metadata

Release files for sra-riskgate 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sra-riskgate 0.3.2
File Size Uploaded
sra_riskgate-0.3.2.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sra-riskgate 0.3.2
File Interpreter ABI Platform
sra_riskgate-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / sra_riskgate-0.3.2.tar.gz

Download URL sra_riskgate-0.3.2.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bf575e412583a40be58f633cc96ae8a54f233b07e855624ad7125578a2ac88eb
BLAKE2b-256 checksum
How to use checksums
c5fc09be6acb8a600ae09650e76c9a3ec736b6730faf9c9747448269530e3980
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / sra_riskgate-0.3.2-py3-none-any.whl

Download URL sra_riskgate-0.3.2-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d15a75b418ddabca77292385b748b2b19c141db567f3d4a979260fe10181a673
BLAKE2b-256 checksum
How to use checksums
00f5ff0fe6b68853c450b4211b9c640606dca9ccb5d9ddd6dc158e18dff2cdbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page