SINAI STANDARD

Pattern: Hold Period (Lock-Up)

Create a token with a mandatory holding period before transfers are allowed

Overview

The hold period hook enforces a lock-up duration after token acquisition. Investors cannot transfer tokens until the lock-up expires. Common for private placements and vesting schedules.

Implementation

import { AksumKit, HoldPeriodManager } from "@sinai-standard/sdk";
 
const NINETY_DAYS = 90 * 24 * 60 * 60;
 
const token = await kit.createToken({
  name: "Lock-Up Fund Token",
  symbol: "LFT",
  decimals: 6,
  supply: 50_000_000,
  hooks: {
    holdPeriod: { seconds: NINETY_DAYS },
  },
});
 
const hold = new HoldPeriodManager(holdProgram, token.mint);
await hold.initialize(issuer.publicKey, NINETY_DAYS);
await hold.initializeExtraAccountMetas(issuer.publicKey);
 
// When an investor receives tokens, record the acquisition
await hold.recordAcquisition(
  issuer.publicKey,
  issuer.publicKey,
  investorA.publicKey
);
 
// Before 90 days: transfer BLOCKED
// After 90 days: transfer ALLOWED
 
// Check lock status
const canTransfer = await hold.isUnlocked(investorA.publicKey);

Key Points

  • recordAcquisition() must be called when tokens are distributed to set the lock timer
  • unlockAt = now + holdPeriodSeconds — computed at acquisition time
  • updateHoldPeriod() changes the duration for future acquisitions only, existing locks are unaffected
  • isUnlocked() returns true if no lock exists (e.g., wallet never acquired)
  • Use toggleActive(false) to temporarily bypass all hold period checks

On this page