Looking to charge fees for offramps? Visit Developer Fees for more details.
How Settlement Rules Work
Create settlement rule
Define fee calculation methods and destination wallets. Settlement rules support fixed and tiered pricing models with percentage or flat fee amounts.
Apply to virtual account
Associate the rule with a user’s virtual account. Rules must be created on the same blockchain network as the virtual account’s destination chain.
Rule Configuration
Settlement rules support two calculation models that can be combined:- Fixed: Apply a single rate or value to all transactions
- Tiered: Apply different rates or values based on transaction amount ranges
Creating Settlement Rules
Create a settlement rule using the Create Settlement Rule endpoint.Request
Unique identifier for the request (recommend using UUID v4).
Blockchain network for the settlement rule (e.g., , , , ).
Whether to include HIFI platform fee in the calculation. Defaults to .
Array of fee rule objects to apply (minimum 1 rule required). Each rule object contains:
Multiple rules can be applied to a single settlement rule configuration. The rules are processed in the order they are defined.
Response
Unique settlement rule ID. Use this when applying the rule to virtual accounts.
Blockchain network the rule is configured for. Must match the virtual account’s destination chain.
Whether HIFI platform fees are included in fee calculations.
Array of fee rules with their configuration, including type, calculation model, values, and beneficiary wallets.
For detailed field documentation, see the Create Settlement Rule API reference.
Rule Types
Settlement rules support two calculation models that can be combined to create flexible fee structures:Fixed Calculation with Fixed Value
Fixed Calculation with Fixed Value
Charge a flat fee amount per transaction regardless of transaction size.
Fixed Calculation with Percentage
Fixed Calculation with Percentage
Charge a percentage of the transaction amount using a single rate.
Tiered Calculation with Percentage
Tiered Calculation with Percentage
Charge a percentage using different rates based on transaction amount ranges. Useful for volume-based pricing.
For tiered rules, leave
min empty for the first tier and max empty for the last tier to create open-ended ranges.Applying Rules to Virtual Accounts
After creating a settlement rule, associate it with a specific user’s virtual account using the Apply Settlement Rule endpoint.Request
- userId (required): User ID who owns the virtual account
- accountId (required): Virtual account ID to apply the rule to
- ruleId (required): Settlement rule ID from the create response
How Fee Distribution Works
When a transaction is processed through a virtual account with settlement rules:Monitoring Fees
Track settlement transactions and fee distributions by monitoring the specified wallet addresses. Each fee distribution includes an on-chain transaction hash for verification.Key Concepts
Getting Help
- 📧 Email: support@hifi.com
- 💬 Slack: Message us in our shared Slack channel
Related Resources
- Virtual Accounts - Set up reusable bank accounts for deposits
- Developer Fees - Fee calculation for offramp transactions
- API Reference - Complete endpoint documentation