Skip to content

Canton CIP-56 indexer sample#21

Open
IvanNik wants to merge 12 commits into
mainfrom
canton-samples
Open

Canton CIP-56 indexer sample#21
IvanNik wants to merge 12 commits into
mainfrom
canton-samples

Conversation

@IvanNik

@IvanNik IvanNik commented May 13, 2026

Copy link
Copy Markdown

Canton CIP-56 Indexer Template

New Workflow Engine SDK template that indexes Canton CIP-56 token holding and transfer events into the Kaleido Asset Manager.

See readme and Flow details

What it does

Processes Canton ledger events for CIP-56 compliant tokens (Holdings and TransferInstructions) and maps them to Asset Manager entities (fragments, transfers, addresses, assets, pools).

Key features

  • Holding indexing: Fragments and balance-tracking transfers for CIP-56 Holding creates/archives, with locked holding detection (locked: true label)
  • Transfer enrichment: Correlates TransferInstruction exercises with Holding events via transactionId to produce enriched send/receive transfers, even across WFE batch boundaries (cross-batch txTransferContext + AM fallback on restart)
  • Decimal scaling: Converts Daml Decimal (Numeric 10) to integer base units via 10^10 multiplier, matching BTC satoshis (10^8) / ERC20 wei
  • Batched AM queries: bulkQuery with 100-item chunking for cache-miss lookups (adopted from btc-indexer)
  • Transfer direction labels: direction: send|receive and transferInstructionId on enriched transfers
  • Multi-stage batch pipeline: Two scan passes (index creates, resolve TI context, collect misses) -> batched AM query -> dispatch to handlers -> single bulkUpsert flush

@IvanNik IvanNik marked this pull request as ready for review May 14, 2026 15:59
@IvanNik IvanNik requested a review from a team as a code owner May 14, 2026 15:59
@IvanNik IvanNik changed the title Canton CIP-56 indexing sample Canton CIP-56 indexer sample May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant