QBitFlow Documentation

    Complete guide to integrating cryptocurrency payments with QBitFlow

    Allowances, Max Amount & Pricing

    Understanding how allowances, max amounts, and pricing work in QBitFlow is essential for managing subscriptions effectively.

    What is an Allowance?

    Authorized Amount, Not Escrow

    An allowance is the amount a customer authorizes QBitFlow smart contracts to pull from their wallet for subscription billing. This is NOT an escrow - the customer keeps their funds in their wallet. They simply authorize the smart contract to pull up to this amount over time.

    How Allowances Work

    When creating a subscription, the customer selects how many billing periods they want to authorize (e.g., 3 months, 6 months, 12 months)

    The required allowance is calculated automatically: price × periods × (1 + buffer)

    The customer signs one transaction to approve this allowance

    On each billing cycle, the smart contract automatically pulls the exact amount due

    The allowance decreases with each billing but funds remain in customer's wallet until billed

    Allowance Safety

    Allowances are Safe and Controlled

    The allowance cannot be pulled at once. Smart contracts enforce:

    • Billing frequency (can't bill more often than agreed)
    • Exact amount per billing cycle (can't exceed agreed price)
    • Customer can cancel anytime to stop future billings
    • All rules are enforced on-chain and verifiable

    Example Allowance Calculation

    Subscription Price:$99.99 USD/month
    Customer Chooses:6 months
    Selected Currency:USDC
    Required Allowance:~620 USDC

    * Includes buffer for price fluctuations

    MaxAmount & Num Periods Explained

    Understanding these three concepts is crucial for properly managing subscriptions and controlling costs.

    MaxAmount (All Subscriptions)

    Definition: Used to handle price fluctuations in cryptocurrency values, ensuring individual payments don't exceed a reasonable threshold.

    For Regular Subscriptions:

    • Set as a percentage of subscription price at creation time
    • Accommodates reasonable price changes in crypto markets
    • Can be updated later if needed

    Example:

    For a $100/month subscription, MaxAmount might be set to 120 USDC (20% buffer). If the price of USDC drops and would require 130 USDC (equivalent to $100 at the time of payment), the transaction will be blocked until the user updates MaxAmount, protecting them from excessive charges.

    USDC is designed to be stable and closely match the USD value, so the amount of USDC needed for a $100 subscription should remain consistent. However, for other tokens/native currencies like ETH or SOL, their prices can fluctuate significantly. This means the number of tokens required to cover the USD subscription price may vary over time. MaxAmount acts as a safeguard to prevent unintended or unexpectedly large charges if the token price drops.

    Num Periods (Subscription Creation)

    Definition: Used when creating subscriptions to automatically compute and set the allowance based on the subscription price and number of periods specified.

    Purpose:

    • Streamlines subscription setup by pre-calculating allowance
    • Defines how many billing cycles the customer authorizes upfront
    • Reduces friction - users don't manually calculate required allowance

    How It Works:

    Allowance = Price × NumPeriods × (1 + Buffer)

    If subscription is $99.99/month and user selects 6 periods, the system automatically calculates the required allowance (≈ $620 with buffer) and prompts the user to approve it.

    Comparison: When to Use What

    ConceptUsed ForPurposeWho Sets It
    MaxAmountAll SubscriptionsHandle crypto price volatilitySystem (with buffer)
    Num PeriodsSubscription CreationCalculate initial allowanceUser/Customer

    Pricing in USD

    Stable Pricing for Merchants

    All product prices in QBitFlow are set in USD. When a customer pays, QBitFlow automatically converts the USD price to the customer's selected cryptocurrency at the current exchange rate. This gives you predictable revenue while customers can pay in their preferred crypto.

    How Price Conversion Works

    1

    You Set USD Price

    Create a product with price: $99.99

    2

    Customer Selects Cryptocurrency

    Customer chooses to pay in ETH, USDC, SOL, etc.

    3

    Automatic Conversion

    QBitFlow fetches current exchange rate and calculates equivalent amount in selected crypto

    4

    Customer Pays

    Customer pays the converted amount in their chosen cryptocurrency

    💡 Key Takeaway: Allowances keep funds in the customer's wallet while enabling automated billing. Max amounts protect customers from price volatility. USD pricing gives you predictable revenue. These three features work together to create a secure, user-friendly subscription experience.