Centrifuge Chain Codebase
The Centrifuge Chain functionality is grouped in 4 key groups of modules (also known as pallets). pool-system
is at the core of everything, tieing together the investment side with the asset side.
Pools (pool-system
, pool-registry
, investments
, pool-fees
): The core logic for managing investment pools such as bundling loans, slicing pools into tranches and controlling investment epochs, as well as charging and accruing fees incurred by pool issuers.
Assets (loans
, interest-accrual
, anchors
, oracle-
): Managing the assets that make up the value of a pool, computing the NAV (Net Asset Value) of a pool, managing data feeds (oracles) that brings in pricing from external sources, and any other asset related features.
Liquidity Pools (liquidity-pools-
, foreign-investment
, swaps
, order-book
, token-mux
): Enables investment activities on EVM chains using Solidity contracts, bridging the liquidity of EVM ecosystems with the efficiency and security of the Polkadot ecosystem through the flexibly configurable LP Gateway.
Permissioning (restricted-(x)tokens
, transfer-allowlist
): Extension of the token logic that enables strict permissioning, to ensure regulatory compliance for tranche tokens of pools, as well as increased operational security for stablecoins and other pool currencies.
Centrifuge Chain Pallets
On top of the Substrate FRAME framework, Centrifuge Chain is composed of custom pallets which can be found inside the pallets directory. The following list gives a brief overview, and links to the corresponding documentation:
-
anchors (docs): Storing hashes of documents on-chain. The documents are stored in the Private Off-chain Data (POD) node network.
-
block-rewards (docs): Provides means of configuring and distributing block rewards to collators as well as the annual treasury inflation.
-
bridge (docs): Connecting ChainBridge to transfer tokens to and from Ethereum.
-
collator-allowlist (docs): Tracking active collators, and allows the root account to manage this list.
-
ethereum-transaction (docs): Wrapper around the Ethereum pallet which allows other pallets to execute EVM calls.
-
fees (docs): Taking fees from accounts and sending this to the treasury, to the author, or burning them.
-
foreign-investments (docs): Enables investing, redeeming and collecting in foreign and non-foreign currencies. Can be regarded as an extension of
pallet-investments
which provides the same toolset for pool (non-foreign) currencies. -
interest-accrual (docs): Keeping account of the outstanding debt through interest accrual calculations.
-
investments (docs): Provides orders for assets and allows user to collect these orders.
-
keystore (docs): Linking public keys to accounts. Supporting the operations of the offchain document consensus layer through the Centrifuge POD (Private Offchain Data) Node.
-
liquidity-pools (docs): Provides the toolset to enable foreign investments on foreign domains.
-
liquidity-pools-gateway (docs): The main handler of incoming and outgoing Liquidity Pools messages.
-
liquidity-rewards (docs): Epoch based reward system.
-
loans (docs): Locking a collateral NFT into a pool allowing to borrow from the pool. The loans pallet is also used for bookkeeping loan values and outstanding debt.
-
oracle-collection (docs): Pallet used to collect and aggregate oracle values.
-
oracle-feed (docs): Pallet used to feed oracle values.
-
order-book (docs): Allows orders for currency swaps to be placed and fulfilled.
-
permissions (docs): Linking roles to accounts. It is adding and removing relationships between roles and accounts on chain.
-
pool-fees (docs): Stores all the fees related to a pool and allows for these fees to be charged.
-
pool-registry (docs): Used for creating, updating, and setting the metadata of pools.
-
pool-system (docs): Creating and managing investment pools. It is bundling loans, slicing pools into tranches, and controlling investment epochs.
-
restricted-tokens (docs): Transferring tokens and setting balances. It is wrapping
orml-tokens
with the addition of checking for permissions. -
restricted-xtokens (docs): Wrapper pallet over
orml-xtokens
which allows the runtime to create arbitrary filters for transfers of x-chain-transfers. -
rewards (docs): Implement a scalable reward distribution mechanism that can be used for other pallets to create different rewards systems.
-
swaps (docs): Enables applying swaps independently of previous swaps in the same or opposite directions.
-
token-mux (docs): Enables proxying variants of the same foreign assets to a local asset representation.
-
transfer-allowlist (docs): This pallet checks whether an account should be allowed to make a transfer to a receiving location with a specific currency.