Skip to content

feat(pricing): implement 4-tier pricing engine and migration (#1) - #112

Open
angelTomo9 wants to merge 1 commit into
Nexussyn:mainfrom
angelTomo9:agent/angelTomo9/issue-1-1787630455531
Open

feat(pricing): implement 4-tier pricing engine and migration (#1)#112
angelTomo9 wants to merge 1 commit into
Nexussyn:mainfrom
angelTomo9:agent/angelTomo9/issue-1-1787630455531

Conversation

@angelTomo9

Copy link
Copy Markdown

Closes #1

Summary of Deliverables

Implements the 4-tier pricing system for x402 API calls to increase monetization efficiency by +30%.

Features & Deliverables

  • Tier Structure:
    • Tier 1 (Free): Calls 1–50 ($0.00)
    • Tier 2 (Standard): Calls 51–500 ($0.01/call)
    • Tier 3 (Premium): Calls 501+ ($0.03/call)
    • Tier 4 (Priority): Flagged priority calls ($0.10/call)
  • Batch Calculation: calculateBatchCost computing multi-call costs rounded to 6 decimals (USDC precision).
  • SQL Migration: migrations/add_tiered_pricing.sql creating pricing_tiers table and adding tier, price_per_call, and priority_flag columns with idempotency.
  • Unit Tests: tests/pricing.test.ts verifying all tier thresholds, priority overrides, and batch calculations.

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.

[AGENT-TASK] Implement tiered pricing engine — +30% revenue expected

1 participant