Coming Soon: The Developers section is under active development. Documentation will be available soon.
Contract Structure
Centuari consists of several core contracts working together:
┌─────────────────────────────────────────────────────────────┐
│ Core Protocol │
├─────────────────────────────────────────────────────────────┤
│ │
│ OrderBook.sol - Order matching engine │
│ CBTFactory.sol - Bond token creation │
│ CollateralManager.sol - Collateral handling │
│ VaultFactory.sol - Vault creation │
│ YieldRouter.sol - Idle capital deployment │
│ │
├─────────────────────────────────────────────────────────────┤
│ Periphery │
├─────────────────────────────────────────────────────────────┤
│ │
│ OracleAdapter.sol - Price feed aggregation │
│ BridgeAdapter.sol - Cross-chain integration │
│ RelayerHub.sol - Meta-transaction handling │
│ │
└─────────────────────────────────────────────────────────────┘
Core Contracts
OrderBook.sol
The central matching engine for all fixed-rate orders.
| Function | Description |
|---|
placeLendOrder | Create new lend order |
placeBorrowOrder | Create new borrow order |
cancelOrder | Cancel unfilled order |
matchOrders | Execute order matching |
CBTFactory.sol
Manages CBT (Centuari Bond Token) creation and lifecycle.
| Function | Description |
|---|
createCBT | Deploy new CBT for asset/maturity |
mint | Mint CBT to lender |
redeem | Redeem CBT at maturity |
getCBT | Get CBT address for parameters |
CollateralManager.sol
Handles all collateral operations.
| Function | Description |
|---|
deposit | Deposit collateral |
withdraw | Withdraw collateral |
getBorrowingPower | Calculate max borrow |
liquidate | Execute liquidation |
VaultFactory.sol
Creates and manages curator vaults.
| Function | Description |
|---|
createVault | Deploy new vault |
deposit | Deposit to vault |
withdraw | Withdraw from vault |
rebalance | Curator rebalance |
YieldRouter.sol
Manages idle capital deployment.
| Function | Description |
|---|
deploy | Deploy capital to yield source |
recall | Recall capital for matching |
harvest | Collect accrued yield |
Contract Interfaces
IOrderBook
interface IOrderBook {
struct Order {
address maker;
address asset;
uint256 amount;
uint256 rate; // basis points
uint256 maturity;
bool isLend;
OrderStatus status;
}
function placeLendOrder(
address asset,
uint256 amount,
uint256 rate,
uint256 maturity
) external returns (bytes32 orderId);
function placeBorrowOrder(
address asset,
uint256 amount,
uint256 maxRate,
uint256 maturity
) external returns (bytes32 orderId);
function cancelOrder(bytes32 orderId) external;
function getOrder(bytes32 orderId) external view returns (Order memory);
}
ICBT
interface ICBT is IERC20 {
function underlying() external view returns (address);
function maturity() external view returns (uint256);
function redeem(uint256 amount) external returns (uint256);
function redeemTo(address to, uint256 amount) external returns (uint256);
}
ICollateralManager
interface ICollateralManager {
function deposit(address asset, uint256 amount) external;
function withdraw(address asset, uint256 amount) external;
function getCollateralValue(address user) external view returns (uint256);
function getBorrowingPower(address user) external view returns (uint256);
function getHealthFactor(address user) external view returns (uint256);
function liquidate(
address user,
address debtAsset,
uint256 debtAmount,
address collateralAsset
) external returns (uint256 collateralSeized);
}
Events
OrderBook Events
event OrderPlaced(
bytes32 indexed orderId,
address indexed maker,
address asset,
uint256 amount,
uint256 rate,
uint256 maturity,
bool isLend
);
event OrderMatched(
bytes32 indexed lendOrderId,
bytes32 indexed borrowOrderId,
uint256 matchedAmount,
uint256 rate
);
event OrderCancelled(bytes32 indexed orderId);
CollateralManager Events
event CollateralDeposited(
address indexed user,
address indexed asset,
uint256 amount
);
event CollateralWithdrawn(
address indexed user,
address indexed asset,
uint256 amount
);
event Liquidation(
address indexed user,
address indexed liquidator,
address debtAsset,
uint256 debtCovered,
address collateralAsset,
uint256 collateralSeized
);
Security Features
Access Control
| Role | Permissions |
|---|
| Admin | Pause, emergency functions |
| Keeper | Liquidations, yield harvesting |
| Governance | Parameter changes |
Pause Mechanism
// Emergency pause
function pause() external onlyAdmin;
// Granular pause
function pauseFunction(bytes4 selector) external onlyAdmin;
Reentrancy Protection
All state-changing functions use reentrancy guards:
modifier nonReentrant() {
require(!_locked, "Reentrant call");
_locked = true;
_;
_locked = false;
}
Upgradeability
Contracts use transparent proxy pattern:
- Implementation contracts are immutable
- Proxy delegates to implementation
- Upgrades require timelock (48h)
- Admin multi-sig required