Event Documentation
On-chain print event structures emitted by FlowVault contracts for real-time tracking, indexing, and transactional audits.
Overview
FlowVault uses Clarity's native print command to emit structured events for state-changing operations. External indexers (such as Hiro API indexer, Subquery, or custom chain monitors) parse these print events to track user deposit history and routing logs.
Deposit Event
Emitted when a user submits a deposit transaction. It includes the complete routing breakdown detailing splits, locked amounts, and held balances as configured in their active strategy.
Event Payload Schema
| Key | Clarity Type | Description |
|---|---|---|
event | (string-ascii 7) | Always set to "deposit". |
depositor | principal | Address of the depositor principal. |
amount | uint | Total deposit amount in micro-units. |
split-amount | uint | The portion routed to the split address. |
split-to | (optional principal) | Optional recipient address of the split amount. |
lock-amount | uint | The portion locked until lock-until block. |
lock-until | uint | Absolute block height at which lock expires. |
hold-amount | uint | Remaining portion kept in user's liquid vault balance. |
Example Payload
{
event: "deposit",
depositor: 'ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5,
amount: u1000000,
split-amount: u200000,
split-to: (some 'ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG),
lock-amount: u300000,
lock-until: u103,
hold-amount: u800000
}Withdraw Event
Emitted when a user withdraws unlocked funds from their vault.
Event Payload Schema
| Key | Clarity Type | Description |
|---|---|---|
event | (string-ascii 8) | Always set to "withdraw". |
withdrawer | principal | Address of the withdrawer principal. |
amount | uint | Withdrawn amount in micro-units. |
remaining-balance | uint | User's new total vault balance (liquid + locked). |
Example Payload
{
event: "withdraw",
withdrawer: 'ST2CY5V39NHDPWSXMW9QDT3HC3GD6Q6XX4CFRK9AG,
amount: u300000,
remaining-balance: u700000
}Strategy Configurations
Note that setting or clearing routing rules (via set-routing-rules and clear-routing-rules) updates the internal contract data maps directly without printing events to minimize network execution gas costs.
The updated strategy rules are implicitly reflected in the next deposit print event.