Architecture

All Cryptex indexes have the same architecture as show below.

TCAP Components

Vaults

Vault Handler

The Vault handler is the primary interface for Cryptex users to manage their Vaults. The Vault handler allows users to create a vault, deposit collateral, mint index token, burn the index tokens or liquidate vaults. Vaults are unique for a each address and only one vault is created for an address. The vault parameters can be changed through the Orchestrator. Read more details on the Vault Handler Contract.

Index Token

The index token is an ERC20 compliant contract which can only be minted and burned by a Vault Handler. The index token tracks the price of the index price that is obtained from a chainlink oracle.
It behaves like a normal ERC20 Token with a cap on its supply that can be changed by the Orchestrator. The Cryptex protocol currently has two index token i.e TCAP and JPEGZ.

Orchestrator

The Orchestrator is a smart contract that is used to manage the parameters of the protocol. The vault handler, the treasury and the index token are owned by this contract.
The Orchestrator functions can only be called by it's owner. The Timelock Contract is the owner of the Orchestrator and the timelock is owned by CTX Governance. Read more details on the Orchestrator Contract.

Oracles

Chainlink Oracle

The Chainlink Oracle is a custom contract that connects to a Chainlink Oracles through an Aggregator. The protocol uses chainlink oracles for price feeds of the Index and Collateral Price. This allow the VaultHandler to read information from Chainlink in real time. Read more details on the Chainlink Oracle Contract.

Chainlink Aggregator

Chainlink Aggregators are contracts created by Chainlink that allow TCAP contracts to connect with decentralized oracles in real time. Read more details on Chainlink Aggregators.

Governance

CTX

CTX is an ERC-20 that is used for governance of the protocol. Owners of the CTX Token are able to make proposals and vote to make protocol changes. Read more details on the CTX Reference.

Governor Alpha

This contract is used for creating proposals, voting on proposals and then queuing them up for execution if the proposal passes. Only CTX holders can create new proposals and vote on them. Passed votes are queued in the timelock smart contract for further execution. Read more details on the Governor Alpha Reference

Timelock

The Timelock contract makes sure that the proposals as executed after a delay. This gives time to people who are against the proposal sufficient time to take action accordingly.
Read more details on the Timelock Reference

Treasury

The treasury stores all the revenue generated by the protocol through fees. It also stores the CTX owned by the DAO. The treasury is owned and controlled by the DAO through governance.

Rewards

Uniswap Liquidity Reward

Uniswap V3 staker contract is used for incentivising users to provide liquidity for the index minted on uniswap. The incentive programs are created by the DAO.