Skip to main content
Schema: canton.core Table: ez_amulet_lock_lifecycle Type: View

Description

Comprehensive EZ view showing the complete lifecycle of locked amulets from initial lock through unlock or expiration. Joins lock and unlock events to provide a full picture of staking activity including durations, status, and outcomes.

Key Use Cases

  • Analyzing complete amulet locking/staking patterns
  • Calculating average lock durations
  • Identifying locks that expired vs were actively unlocked
  • Tracking which locks were unlocked after expiry
  • Understanding staking behavior and timing
  • Monitoring currently active locks

Important Relationships

  • Combines core__fact_amulet_locks and core__fact_amulet_unlocks via locked_amulet_contract_id
  • Links to validators and staking through amulet_owner and lock_holders

Commonly-used Fields

  • locked_amulet_contract_id: Unique identifier for the locked amulet
  • amulet_owner: Party who owns the locked amulet
  • lock_status: Current status (locked, unlocked, or expired)
  • locked_at: When the lock was created
  • unlocked_at: When it was unlocked (NULL if still locked)
  • locked_amount: Amount locked
  • days_locked_before_unlock: Duration for completed locks
  • days_locked_current: Duration for active locks
  • was_unlocked_after_expiry: Whether unlock happened after expiration time

Columns

Column NameData TypeDescription
LOCKED_AMULET_CONTRACT_IDTEXTContract ID for a LockedAmulet contract.
AMULET_OWNERTEXTParty identifier for the owner of an amulet (locked or unlocked).
LOCK_HOLDERSTEXTArray of party identifiers who hold rights to a locked amulet.
LOCKED_ATTEXTTimestamp when the amulet was locked
LOCK_EXPIRES_ATTEXTTimestamp when a lock expires and the amulet can be unlocked.
UNLOCKED_ATTEXTTimestamp when the amulet was unlocked (NULL if still locked)
LOCKED_AMOUNTTEXTInitial amount of amulet being locked/staked.
UNLOCKED_AMOUNTTEXTAmount of amulet being unlocked from a locked state.
AMOUNT_CREATED_AT_ROUNDTEXTRound number when an amulet amount was originally created.
RATE_PER_ROUNDTEXTRate at which fees or rewards accrue per mining round.
UNLOCK_ACTIONTEXTType of unlock action: ‘unlock’ for normal unlock or ‘expire_lock’ for lock expiration.
UNLOCK_REASONTEXTMetadata describing the reason for an unlock operation.
TX_KINDTEXTTransaction kind metadata describing the type of transaction.
UNLOCK_AMULET_PRICETEXTUSD price of amulet at time of unlock
UNLOCK_ROUND_NUMBERTEXTRound number when unlock occurred
CREATED_AMULET_CONTRACT_IDTEXTContract ID for a newly created Amulet contract (typically after unlock).
LOCK_EVENT_IDTEXTEvent ID of the lock creation event
UNLOCK_EVENT_IDTEXTEvent ID of the unlock event (NULL if still locked)
LOCK_STATUSTEXTCurrent status: locked, unlocked, or expired
DAYS_LOCKED_BEFORE_UNLOCKTEXTNumber of days amulet was locked before being unlocked
DAYS_LOCKED_CURRENTTEXTNumber of days amulet has been locked (for currently locked amulets)
WAS_UNLOCKED_AFTER_EXPIRYTEXTBoolean indicating if unlock occurred after the lock expiration time
MOST_RECENT_ACTIVITYTEXTMost recent timestamp of activity (unlock if unlocked, otherwise lock time)
CREATED_ATTEXTTimestamp when the contract was created.
SIGNATORIESTEXTArray of party identifiers who are signatories to the contract.
OBSERVERSTEXTArray of party identifiers who can observe the contract but are not signatories.