# Abacus - Issuing points for multiple sources

[Grab](https://yomu.fyi/company/grab) · Chandrakanth · Mar 1, 2022

**Type:** Problem & solution

## Summary

Grab needed a centralised points management architecture to issue loyalty points across a growing catalog of products, membership tiers, and external partner exchanges. To address this, the engineering team built Abacus, an issuance platform designed to process millions of daily transactions with high availability. The system ingests completed transaction streams or API calls, dynamically computes points via configured multipliers, and passes calculations through Amazon Simple Queue Service queues. Once the Point Awarding module updates a persistent ledger, Abacus notifies consumers, emits events to Kafka for downstream consumers, and recalculates rolling point expiration dates.

## Context

Grab required a robust, centralised points management platform to handle diverse product issuance rules, partner exchange programs, and millions of daily transactions across different country configurations.

## Approach / What changed

Grab developed Abacus, a points issuance platform utilizing Amazon SQS queues with idempotency keys, dynamic multiplier calculations, ledger tracking, Kafka event streaming, and an Expiry Extension module for activity-based point expiration.

## Takeaways

- Internal point calculation multiplies the transaction amount by vertical, effective price per fare (EPPF), cashless, and tier multipliers.
- Abacus uses an idempotency key across its Point Awarding and Retry SQS queues to prevent duplicate rewards during calculation retries and dependency outages.
- Points use activity-based expiration set to the last day of the third or sixth month, which extends by a month whenever a consumer completes a new transaction.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [AWS](https://yomu.fyi/topic/aws), [Data Pipelines](https://yomu.fyi/topic/data-pipelines), [Kafka](https://yomu.fyi/topic/kafka), [Scalability](https://yomu.fyi/topic/scalability)

[Read original post](https://engineering.grab.com/abacus-issuing-points-for-multiple-sources)
