Skip to main content

Basic ANN Example

Contract Definition

import pandas as pd
from awesome_actus_lib import ANN, PublicActusService

contract = ANN(
contractID="ann01",
contractRole="RPA",
contractDealDate="2012-12-28T00:00:00",
initialExchangeDate="2013-01-01T00:00:00",
statusDate="2012-12-30T00:00:00",
notionalPrincipal=5000,
cycleAnchorDateOfPrincipalRedemption="2013-02-01T00:00:00",
nextPrincipalRedemptionPayment=434.866594118346,
dayCountConvention="A365",
nominalInterestRate=0.08,
currency="USD",
cycleOfPrincipalRedemption="P1ML0",
maturityDate="2014-01-01T00:00:00",
rateMultiplier=1.0,
rateSpread=0.0,
fixingDays="P0D",
cycleAnchorDateOfInterestPayment="2013-02-01T00:00:00",
cycleOfInterestPayment="P1ML0",
creatorID="Creator-01",
counterpartyID="Counterparty-01"
)

service = PublicActusService()
event_stream = service.generateEvents(portfolio=contract, riskFactors=[])
print(event_stream.events_df)

Generated Events

typetimepayoffcurrencynominalValuenominalRatenominalAccruedcontractId
IED2013-01-01T00:00-5000USD50000.080ann01
PR2013-02-01T00:00400.894USD4599.110.0833.9726ann01
IP2013-02-01T00:0033.9726USD4599.110.080ann01
PR2013-03-01T00:00406.642USD4192.460.0828.2247ann01
IP2013-03-01T00:0028.2247USD4192.460.080ann01
PR2013-04-01T00:00406.381USD3786.080.0828.4858ann01
IP2013-04-01T00:0028.4858USD3786.080.080ann01
PR2013-05-01T00:00409.972USD3376.110.0824.8948ann01
IP2013-05-01T00:0024.8948USD3376.110.080ann01
PR2013-06-01T00:00411.928USD2964.180.0822.9391ann01
IP2013-06-01T00:0022.9391USD2964.180.080ann01
PR2013-07-01T00:00415.376USD2548.810.0819.4905ann01
IP2013-07-01T00:0019.4905USD2548.810.080ann01
PR2013-08-01T00:00417.549USD2131.260.0817.3179ann01
IP2013-08-01T00:0017.3179USD2131.260.080ann01
PR2013-09-01T00:00420.386USD1710.870.0814.4809ann01
IP2013-09-01T00:0014.4809USD1710.870.080ann01
PR2013-10-01T00:00423.617USD1287.260.0811.2496ann01
IP2013-10-01T00:0011.2496USD1287.260.080ann01
PR2013-11-01T00:00426.12USD861.1360.088.74629ann01
IP2013-11-01T00:008.74629USD861.1360.080ann01
PR2013-12-01T00:00429.204USD431.9320.085.66227ann01
IP2013-12-01T00:005.66227USD431.9320.080ann01
IP2014-01-01T00:002.93477USD431.9320.080ann01
MD2014-01-01T00:00431.932USD00.080ann01