đź“–
Dev Documents
  • README
  • Basic Concepts
    • TEA Developer Prerequisites
    • The TEA Economic Revolution for Developers
    • The Future of Layer-2s
    • What Makes a Web3 App?
    • Magic of the State Machine
  • Step by Step Tutorial
    • Install Dev Environment
    • Hello World
      • Step 1: Build sample-actor and Run Unit Test
      • Step 2: Start the Local Dev Environment
      • Sample Actor Code Walkthrough
      • Sample Front-end Code Walkthrough
      • 025_understand_request_and_response
    • Deploy Hello World on Testnet
    • Add Login Feature
      • Sample-actor Code Walkthrough - Login Branch
        • tea_sdk_utils
      • Sample Front-end Walkthrough - Login Branch
    • SQL
      • Sample Txn Executor
      • Sample Actor
      • Sample Front-end
    • Reward Fund Transfer
      • Sample Txn Executor
    • Retweet Task
      • Retweet Frontend
      • Retweet Sample Actor
      • Retweet Txn Executor
      • Retweet FAQ
    • Gas Fees
      • Query logs
      • A deep dive into gas measurement and settlement
    • Summary
  • Billing
    • Billing FAQ
    • Gas Fee Billing
    • Gas & Fuse Limits
    • Local Debugging Environment
    • State Maintainer Billing
    • TApp Billing
  • Example TApps
  • Advanced TApps
    • TEA Party TApp Intro
    • TEA Party Code Walkthrough
  • Functions
    • Actors vs Functions
    • Function Calls Between Native & Wasm
    • Native vs Wasm Functions
  • Glossary
    • Actor
    • Adapter
    • App AES Key
    • AuthKey
    • back_end_actor
    • Birth Control
    • Blockchain Listener
    • Capability
    • CML Auctions
    • Commands
    • Consensus
    • Context
    • Conveyor
    • Conveyor: Mutable vs Immutable
    • enclave
    • Followup
    • Front-end
    • GlueSQL
    • GPS
    • Hosting Actor Handlers
    • Hosting CML
    • hosting_profitability
    • Magic of WASM
    • mini-runtime
    • OrbitDb
    • Order of Txns
    • party-actor
    • party-fe
    • Party-state-actor
    • Providers
    • Public Service
    • queries
    • Remote Attestation
    • Staking to Hosting CML
    • Staking to TApp
    • State
    • State Machine
    • State Machine Actor
    • State Machine Replica
    • TEA ID
    • TPM
    • Transactions
    • VMH - Virtual Messaging Hub
    • Where Messages are Stored
Powered by GitBook
On this page
  1. Billing

TApp Billing

PreviousState Maintainer BillingNextExample TApps

Last updated 2 years ago

The calculus for a TApp that must pay for the txn fee and memory tax is a bit different depending on what rate it charges for TApp usage.

  • If the TApp usage fee charged covers the txn fee and memory tax, then the excess is paid as a dividend profit to the TApp’s bonding curve token holders.

  • If conversely the usage fee charged isn’t enough to cover the state machine related costs, then the TApp will be losing money every time an end-user uses the app. This could especially be the case with not-for-profit TApps that don’t charge a usage fee.

Visually the revenue and expenses for the TApp portion of the end-user’s payment looks like this:

TApp Billing
  1. The TApp charges a usage fee taken from the end-user’s payment that goes into the accrued balance account.

  2. The txn fee and memory tax owed by the TApp draws from the accrued balance into the collection pool.

  3. The collection pool is settled at regular intervals (5–20 minutes) into the wallets of the state maintainers who receive the txn fees and memory tax as revenue.

  4. Settlement from the accrued balance goes into the TApp’s bonding curve at regular intervals of between 5–20 minutes. Because this happens post-expenses, this accrued pool could either be positive (resulting in a dividend distribution as shown in the graphic) or negative. If the accrued balance is negative net of the txn fees and memory tax, then that shortfall is levied as an expense to the TApp’s bonding curve token holders.

This latter scenario is exactly the reverse of what happens when TApp usage generates a profit. Instead of new TApp tokens being generated and sent to existing TApp token holders as a dividend, TApp tokens are taken from the existing token holders and liquidated for their TEA value to pay the necessary state machine expense. This would eventually lead to the bonding curve token being liquidated.

These actions — dividend payouts for profits and token dissolution for expenses — occur at regular settlement intervals. Because the bonding curve can remove tokens from among its holders, TApp token investors should perform due diligence on the TApp to ensure expenses are covered by the TApp usage fee. A TApp token is just like any other investment that has risks, and dividend payouts along with token subtractions are part of the nature of the bonding curve.

More information is available in our .

billing-faq