SaFi Bank Space : Scheduled activities

List of scheduled job/tasks/activities that are to be executed based on a configured time trigger, dependency on other job or event.

In general there are following types of scheduled jobs

  • Jobs scheduled and executed within TM Vault [further referred to as Vault]
    (mainly jobs directly related to product’s core financial business logic such as interests accrual etc)

  • Jobs scheduled by a central scheduler outside of TM Vault and executed by micro-services [further referred to as MS]
    (mainly jobs without direct impact to financial logic of products such as notifications, statements, etc)

  • Report generation jobs scheduled by a central scheduler outside of TM Vault and executed on top of DataLake [further referred to as Reporting]

  • Activities implemented and executed within a workflow engine [Workflow]

  • Jobs managed by an external service [further referred to as External]

Domain

Use case

Trigger / When to execute

Job Type (responsible service)

Dependencies / Pre-conditions / Post-conditions / Follow-up actions

Onboarding

Deletion of Prospects from DB (Period will be agreed with BO e.g. 1 year or 6 months)

Daily

MS (Customer Manager)

Subscriptions

Charge subscription fee

Start of a subscription period = rolling month (Start of day)

MS (Product Manager)

Subscriptions

Main account blocking if fees are not paid in 30 days

30 days after subscription period

MS (Product Manager)

Subscriptions

Periodic notifications about product usage

TBD, probably in middle of the month

MS (Product Manager)

Accounts

Interest accrual moved from its specific address on a deposit account

End of calendar month

Vault (main account smart contract)

Daily interest accrual already finished.

Accounts

Daily interest accrual into its specific account address.

Daily

Vault (main account smart contract)

Valid interest rate for the past day is set as a parameter in smart-contract

All transactions with value dat in current day were posted

Accounts

Actions when reaching target date in locked pocket (Send notification, auto-renewal)

Date specified in locked pocket

MS (Account Manager)

Accounts

Tax payments from earned interest

End of calendar month

Vault (main account smart contract)

Valid tax rate for past month is set as a parameter in smart-contract

Non-zero interests was moved from interest accrual address to given account.

Backoffice

Reject all unapproved BO changes

End of business day

MS (Backoffice Manager)

Backoffice

AR / AP (accounts receivable/ accounts payable) daily reconciliation reports generation

  • Fees report

  • Report to reconcile with the billing statements being sent by partners

  • AR from clients on cases that transaction was credited multiple times

  • pending payments for payment aggregators and partners

End of day

Reporting

Onboarding

Invalidate not used prospect customers after 7 days

End of day

MS (Customer Manager)

Transactions

Execute scheduled payment at given date

Specified date

MS (Transaction Manager)

Transactions

Execute recurring payments according to plan. Can be multiple payments, finite or infinite.

Specified dates, usually once a month.

MS (Transaction Manager)

Statement

Generate monthly statements

End of calendar month

MS (Statement Manager)

After EOD

Loans

Automatic instalment deduction

Specified date

MS (Loan Manager)

Loans

Automatic instalment deduction when loan is in default

When main account is credited with enough money

Vault (supervisor smart contract)

Loans

Automatic fee deduction

When main account is credited with enough money

Vault (supervisor smart contract)

Loans

Pre-collection warning notifications to customer

Specified date by various collection strategies

MS (Loan Manager or External)

Managed by Collections system

Loans

Warning messages during loan in default

Specified date by various collection strategies

MS (Loan Manager or External)

Managed by Collections system

Loans

Overdraft and loan workflow

Specified date

Workflow (Loan Manager)

We are going to use Temporal for this internally.

Loans

Penalty Interest accrual

End of day

Vault (loan account smart contract)

Onboarding

OSP reconciliation to fetch lost events

Every minute

MS (Customer Manager)

Scheduling solution approach

  • This approach is based on an analysis of requirements for the scheduled job execution from different domains and consultation with TM Vault’s experts.

  • There is a need for a capability to schedule recurring tasks running in TM Vault’s smart-contracts and also in micro-services.

  • Some of these activities have dependencies on other activities in terms on the order of execution.

  • Some of these activities are to be executed on EOD, EOM or EOY.

Job type: Vault

Jobs executed within TM Vault, implemented in smart contracts and orchestrated by Vault’s Scheduler. Repeating periods supporting concepts such as EOD, EOM and EOY taking into account banking and non-banking days are defined using is a build-in concept of a calendar with a notion of a BookkeepingDate in TM Vault. Core banking use cases directly related to product’s core financial business logic such as interests accrual etc are in this category.

Job type: MS

Jobs scheduled by a central scheduler outside of TM Vault and implemented in micro-services. The scheduler will be subscribed to TM Vault’s Core streaming API to receive EOD events with with account schedule tags so that the jobs can be triggered at a proper time and respecting dependencies on processing inside of TM Vault. Mainly jobs without direct impact to financial logic of products such as notifications, statements, etc are in this category.

Job type: Report

Report generation jobs scheduled by a central scheduler outside of TM Vault and executed on top of DataLake.

Job type: Workflow

Activities implemented and executed within a workflow engine (temporal.io).

Job type: External

Jobs managed by an external service.

Central scheduler candidate solution

Obvious candidate solution for the central scheduler is Apache Airflow which is also available as a managed service Cloud Composer provided by the GCP. It is recommended by Google if there is a need to orchestrate jobs outside of Compute Engine. Airflow meets the requirements for the scheduler as it is able to manage and execute workflows of tasks with dependencies and the workflows are defined as code with the obvious benefits of such approach. Airflow workflows can be triggered by Kafka topics for cases where jobs managed by Airflow are dependent on EOD events published by TM Vault’s Scheduler.

High level design

Backup

Jobs affecting account balance

  • [Accounts] Monthly subscription fee charging (Viliam Dillinger)

  • [Accounts] Daily interest accrual (Viliam Dillinger)

  • [Accounts] Monthly interest posting to customers (Viliam Dillinger)

  • [Accounts] Interest tax deduction (Viliam Dillinger)

  • [Loans] Loan fee and instalment deduction (Jan Gorig)

  • [Loans] Penalty Interest accrual (Jan Gorig)

  • [Transactions] Scheduled payments (Slavomir Kocka)

  • [Transactions] Recurring payments (Slavomir Kocka)

  • [Transactions] Monthly statements (Slavomir Kocka)

  • [Backoffice] Daily reconciliation reports of AR/AP (Martin Ondercin)

Attachments:

~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~drawio~620d181df97d180071744bea~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
scheduling.drawio (application/vnd.jgraph.mxfile)
scheduling.drawio.png (image/png)
~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
~scheduling.drawio.tmp (application/vnd.jgraph.mxfile)
scheduling.drawio (application/vnd.jgraph.mxfile)
scheduling.drawio.png (image/png)