📄️ 1. Set up
Clone from GitHub the DeFi Adapters Library, install its dependencies, and run the library:
📄️ 2. Run the CLI
You'll be asked a series of questions to describe your DeFi product, such as:
📄️ 3. Inspect your new adapter
After completing all the prompts, the CLI will generate the code files for your new adapter in /packages/adapters-library/src/adapters//products//xxxxAdapter.ts.
📄️ 4. Build classes from ABIs
If your adapter requires implementations that rely on on-chain queries to your protocol's smart contracts, you'll need to import ABIs to create factories for type-safe interaction with those contracts.
📄️ 5. Build metadata files
Upon inspecting the adapter start by filling details for the following methods
📄️ 6. Fill code gaps
Check if the following methods need to be implemented or code has already been added based on the CLI questions:
📄️ 7. Validate with dev UI
The command npm run dev that you've launched at 1. Set up also runs a dev UI at http5173/. This allows you to visually check user positions and view the raw JSON data for debugging. Simply enter an Ethereum address and filter by the protocol you're working on to see the relevant data.
📄️ 8. Create snapshot tests
Overview
📄️ 9. Pull Request
Once you're satisfied with the work and its results, run the following command to automatically fix any linting errors and receive a report of those requiring manual attention: