Once a protocol is added to ProtocolAdapterRegistry contract, it will immediately appear in all the interfaces that use DeFi SDK (including Zerion). In order to add protocol to to DeFi SDK one has to implement the following contracts.
The function has two arguments of address type: the first one is token address and the second one is account address. The function MUST return balance of given asset held on the protocol for the given account.
To create new protocol adapter, one has to implement TokenAdapter interface.
The function has the only argument – token address. The function MUST return all the underlying tokens info:
token : address of the underlying token contract;
rate : uint256 with price per base token share (1e18).
After the adapters are deployed and tested, one can contact Zerion team in order to add the adapters to AdapterRegistry contract.
To get a PR merged, one should write tests for all the functions implemented. Examples may be found in the repo.
In case ProtocolAdapter should work with the short list of tokens, these tokens should be added to the list of supported tokens in ProtocolAdapterRegistry contract. In order to do that, one should add tokens in PR's comments.