Skip to main content

Tranches

Definition

Analogous to the segments in Lockup Dynamic, a Lockup Tranched stream is composed of multiple tranches with different amounts and durations. The protocol uses these tranches to enable traditional vesting curves with regular unlocks.

Technically, a tranche is a struct with two fields:

FieldTypeDescription
Amountuint128The amount of assets to be unlocked in a tranche, denoted in units of the asset's decimals.
Timestampuint40The Unix timestamp indicating the tranche's end.

The distribution function of a Lockup tranched stream:

f(x)=Σ(eta)f(x) = \Sigma(eta)

Where:

  • Σ(eta)\Sigma(eta) is the sum of all vested tranches' amounts.

Requirements

  • The sum of all tranche amounts must equal the deposit amount.
  • The block gas limit enforces a limit to how many tranches there can be in a stream.
    • If someone creates a stream with an excessively large number of tranches, the transaction would revert as it wouldn't fit within a block. You can fetch the limit using MAX_TRANCHE_COUNT. Alternatively, you can find the limit for each chain here.
  • The timestamps must be sorted in ascending order. It's not possible for the (i1)th(i-1)^{th} timestamp to be greater than ithi^{th} timestamp (given that we're dealing with an increasing monotonic function).