Skip to main content

Points Tokenization

The points tokenization system transforms your offchain loyalty points into real, tradeable onchain assets.

The Deposit Process

Dual-Token Model

When you deposit points, you receive a Soulbound NFT that represents your points. Later, when your offer is filled on the market, ERC20 tokens are minted. This two-stage design creates security and efficiency:

1. Soulbound NFT (chXXX-R tokens)

Minted immediately at deposit. A non-transferable receipt that proves you deposited X amount of points and tracks changes to your points amount over time. This NFT is your proof of deposit and is required to create offers on the market. Referenced as the DepositReceipt.sol contract. onchain points data: Point balance changes are tracked onchain via the Oracle, which internally uses OpenZeppelin’s Checkpoints library to maintain an immutable record of all balance updates. This data is queryable onchain via the Soulbound NFT (DepositReceipt.sol)
function getUserData(address user)
    external
    view
    returns (
        uint256 depositedAmount,
        uint256 heldAmount,
        uint256 latestPointsAmount,
        uint256 latestClaimTime
    );

2. Escrow Token (chXXX tokens)

Minted when someone fills your offer on Market.sol. An ERC20 token backed 1:1 by your points. Once minted, it’s tradeable just like any other token and can be traded, lent, etc. This is essentially an escrow token for the real token until TGE. Referenced as the EscrowToken.sol contract. On Protocol Token Generation Event (TGE):
  • The escrow tokens are redeemable for the real tokens at a given ratio determined by Settlement.sol
The redemption ratio is calculated as: tokenRatio=totalTokenAmount×RATIO_PRECISIONtotalEscrowSupply\text{tokenRatio} = \left\lfloor \frac{\text{totalTokenAmount} \times \text{RATIO\_PRECISION}}{\text{totalEscrowSupply}} \right\rfloor Where:
  • totalTokenAmount => ERC20(TGEToken).balanceOf(address(settlement))
  • RATIO_PRECISION => 10**18
  • totalEscrowSupply => ERC20(escrowToken).totalSupply()

Hold System

When you create an offer to sell points in the Market, your points are “held” temporarily and are freed when the offer is cancelled.
  • Held points: Reserved for your pending trade
  • Available points: Free to use or trade elsewhere
  • Total points: Held + Available = Your complete balance