Skip to main content

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 /eventsBatch endpoint of the ACTUS engine
  • Converts contract terms and optional risk factors into a backend-compatible format
  • Returns a CashFlowStream for downstream analysis

๐Ÿ” Methodsโ€‹

MethodDescription
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โ€‹

ParameterDescription
serverURLBase URL of the ACTUS backend
externalRiskServiceToggle 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

๐Ÿ”— See Alsoโ€‹