Automates revenue sharing for Lilith creators by orchestrating royalty schedules, sale-based distributions, scheduled payouts, and compliance logging.
Pipeline#
- Compliance auditor – validates schedule definitions and payout distributions.
- Schedule registry – persists royalty schedules and version revisions.
- Share calculator – computes dynamic payout allocations per sale.
- Scheduled payout calculator – aggregates outstanding royalties for periodic runs.
- Payment executor – dispatches on-chain transactions for recipients.
- Royalty ledger – records distributions and emits audit events.
- Payout scheduler – determines next payout execution window.
- Notification + analytics – informs stakeholders and publishes telemetry.
Usage#
ts
import { createCreatorRoyaltyService } from './service';
const service = createCreatorRoyaltyService({
scheduleRegistry,
shareCalculator,
scheduledPayoutCalculator,
paymentExecutor,
complianceAuditor,
royaltyLedger,
payoutScheduler,
notificationService,
analyticsReporter,
});
const { schedule } = await service.createSchedule({
metadata: {
assetId: 'sacred-art-108',
assetType: 'sacred_art',
title: 'Lilith Moon Bloom',
createdBy: '0xLilith',
},
recipients: [
{ address: '0xCreator', percentage: 70, role: 'creator' },
{ address: '0xCollaborator', percentage: 20, role: 'collaborator' },
{ address: '0xPlatform', percentage: 10, role: 'platform' },
],
allocationStrategy: 'fixed_split',
minPayoutThreshold: '100000000000000000',
chainId: 137,
payoutFrequency: 'weekly',
});
Tests#
bash
npx jest --config apps/lilith/svc-creator-royalty/jest.config.cjs --runInBand