Skip to main content

Fixed fee strategy

In a fixed fee strategy, users pay a set fee for specific actions such as creating an account or making a transaction.

Key details:

  • Users pay a fixed amount (similar to a one-time purchase) using a specific token to access the dapp's features.
  • This approach provides a clear and easy-to-understand system, suitable for users who prefer straightforward access.
  • Simplifies the dapp's financial management and encourages brand loyalty among satisfied users.

Benefits of fixed fees:

  • Clarity: Users know exactly what they’re paying for, fostering trust and transparency.
  • Convenience: Eliminates the need for recurring payments, making it user-friendly.
  • Brand Loyalty: Encourages users to explore all features, potentially increasing engagement.

Getting started

A code example with tests is available here.

To begin, here is an example configuration:

lib.ft4.core.accounts.strategies.transfer:
rules:
- sender_blockchain: x"0000000000000000000000000000000000000000000000000000000000000000"
sender: "*"
recipient: "*"
asset:
- name: "MyTestAsset"
min_amount: 100L
timeout_days: 60
strategy:
- "fee"
lib.core.accounts.strategies.transfer.fee:
asset:
- name: "MyTestAsset" # issued by current blockchain
amount: 40L

This configuration includes two main settings: strategies.transfer and strategies.transfer.fee. In the example above:

  1. Transfer Strategy: For any user to any recipient from any blockchain using the MyTestAsset asset with a minimum amount of 100 coins, a fixed fee can be requested. The timeout is 60 days.
  2. Fee Strategy: The fee is set at 40 MyTestAsset coins.
tip

A clear and straightforward fee structure is essential. Transparency ensures users know exactly what they’re paying for.

To test the configuration above, refer to the available tests.