ActusService
The ActusService class is the core controller interface for generating ACTUS-compliant event schedules.
It connects your Python-based contracts to the ACTUS simulation backend via HTTP.
โ Usage Exampleโ
from awesome_actus_lib import PAM, ActusService
contract = PAM(...)
service = ActusService(serverURL="http://localhost:8083")
eventStream = service.generateEvents(portfolio=contract)
๐ Featuresโ
- Sends contracts to
/eventsBatchendpoint of the ACTUS engine - Converts contract terms and optional risk factors into a backend-compatible format
- Returns a
CashFlowStreamfor downstream analysis
๐ Methodsโ
| Method | Description |
|---|---|
generateEvents() | Simulates contracts using inline risk factors (or none) |
generateEventsWithExternalRisk() | Simulates contracts using pre-uploaded risk scenarios |
extract_required_risk_factors() | Finds all referenced risk factors in a portfolio |
_validate_rate_reset_risk_factor_coverage() | Ensures risk coverage dates are valid |
๐ Configurationโ
| Parameter | Description |
|---|---|
serverURL | Base URL of the ACTUS backend |
externalRiskService | Toggle for using external RiskService |
๐งช Validationโ
When generateEvents() is called, the controller:
- Checks contract formatting
- Validates risk factor compatibility
- Raises detailed exceptions for missing or malformed inputs