Smart Contract Architecture
The Paydax protocol is built on a modular smart contract system to ensure security, transparency, and efficiency. The core contracts include:
contract PDPToken {
function stake(uint256 amount) external;
function unstake(uint256 amount) external;
function claimRewards() external;
}
contract LendingPool {
mapping(address => mapping(address => uint256)) deposits; // user => token => amount
mapping(address => mapping(address => uint256)) borrows; // user => token => amount
function deposit(address token, uint256 amount) external;
function withdraw(address token, uint256 amount) external;
function borrow(address collateralToken, address borrowToken, uint256 amount)
external; function repay(address token, uint256 amount) external;
}
contract CollateralManager {
function getHealthFactor(address user) external view returns (uint256);
function liquidate(address user, address collateralToken) external;
function isLiquidatable(address user) external view returns (bool);
}
These contracts handle token staking, lending/borrowing operations, and collateral management, ensuring seamless user interactions and robust risk controls.

Last updated