Developer Contributions
This documentation explains how to create your own protocol adapter to integrate additional yield sources into the Polystream ecosystem.
Protocol Adapter Interface
interface IProtocolAdapter {
function supply(address asset, uint256 amount) external returns (uint256);
function withdraw(address asset, uint256 amount) external returns (uint256);
function withdrawToUser(address asset, uint256 amount, address user) external returns (uint256);
function harvest(address asset) external returns (uint256);
function convertFeeToReward(address asset, uint256 fee) external;
function getAPY(address asset) external view returns (uint256);
function getBalance(address asset) external view returns (uint256);
function getTotalPrincipal(address asset) external view returns (uint256);
function isAssetSupported(address asset) external view returns (bool);
function getProtocolName() external view returns (string memory);
}Implementing a Protocol Adapter
Step 1: Create a new adapter contract
Step 2: Implement key functions
Step 3: Implement additional helper functions
Example Adapter Implementation: AaveAdapter
Testing Your Protocol Adapter
Examples
Last updated