Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Latest commit

 

History

History
139 lines (109 loc) · 5.46 KB

Reference_Trigger.md

File metadata and controls

139 lines (109 loc) · 5.46 KB

Module DA.Trigger.Finance.Asset.Lifecycle

Functions

trigger

: (LifecycleEffects -> Bool) -> Trigger ()

A trigger to lifecycle AssetDeposit contracts. It listens to LifecycleEffects contracts that do not consume any assets and eagerly applies them.

Inputs:

pred (LifecycleEffects -> Bool): A predicate to filter LifecycleEffects contracts that are processed. The trigger cannot handle cases where the asset effects end up in different accounts.

Module DA.Trigger.Finance.Instrument.Entitlement

Functions

trigger

: RelTime -> RelTime -> Trigger ()

A trigger that eagerly processes Entitlement contracts once they settle.

Inputs:

settlementOffset (RelTime): Offset to the settlement date when the settlement happens.

heartbeat (RelTime): The heartbeat of the trigger.

Module DA.Trigger.Finance.Instrument.Equity.Option

Functions

trigger

: RelTime -> RelTime -> Trigger ()

A trigger that eagerly processes equity lifecycle event contracts (EquityStockSplit) once they are due.

Inputs:

settlementOffset (RelTime): Offset to the ex date when the lifecycle event is processed.

heartbeat (RelTime): The heartbeat of the trigger.

Module DA.Trigger.Finance.Instrument.Equity.Stock

Functions

trigger

: RelTime -> RelTime -> (Id -> Text) -> Trigger ()

A trigger that eagerly processes equity lifecycle event contracts (EquityCashDividend, EquityStockSplit) once they are due.

Inputs:

settlementOffset (RelTime): Offset to the ex date when the lifecycle event is processed.

heartbeat (RelTime): The heartbeat of the trigger.

toEntitlementIdLabel (Id -> Text): A function to derive the entitlement label from the id of the lifecycle event (e.g. for EquityCashDividend).

Module DA.Trigger.Finance.Trade.Dvp.Lifecycle

Functions

trigger

: Trigger ()

A trigger to lifecycle Dvp contracts. It listens to LifecycleEffects contracts and eagerly applies them. If multiple LifecycleEffects contracts are affecting a single dvp, they are applied sequentially.

Module DA.Trigger.Finance.Trade.Dvp.Settlement

Functions

trigger

: RelTime -> RelTime -> Trigger ()

A trigger to settle Dvp contracts once all allocated SettlementInstruction contracts are available and the current time is after the settlement date.

Inputs:

settlementOffset (RelTime): Offset to the settlement date when the settlement happens.

heartbeat (RelTime): The heartbeat of the trigger.

Module DA.Trigger.Finance.Trade.SettlementInstruction

Templates

template AllocationRule

Rule that helps to allocate AssetDeposit to SettlementInstruction contracts by atomically merging and splitting the deposits.

Field Type Description
sig Party The signatory.
  • Choice Allocate

    Allows the sig to allocate deposits to settlement instructions. Expects deposits of the same asset in the same account.

    Field Type Description
    instructionCids [ContractId SettlementInstruction] The settlement instructions that are allocated.
    depositCids [ContractId AssetDeposit] The deposits that are used for allocation. Need to be mergeable.
  • Choice Archive

    (no fields)

Functions

trigger

: Trigger ()

A trigger that eagerly allocates AssetDeposit contracts to SettlementInstruction contracts.