/defi-sdk

DeFi SDK Makes Money Lego Work

Primary LanguageJavaScriptGNU Lesser General Public License v3.0LGPL-3.0

Build status Test status Coverage status Lint status License Discord Twitter Follow

DeFi SDK is an open-source system of smart contracts designed for precise DeFi portfolio accounting. To put it simply, DeFi SDK is the on-chain balanceOf for DeFi protocols.

If you have any questions about DeFi SDK, feel free to reach out to us on our Discord server.

Features

💥Query user assets and debt deposited in DeFi protocols like Maker, Aave, dYdX, etc.

How much debt does 0xdead..beef have on Compound?

📊Get the underlying components of complex derivative ERC20 tokens

How much cUSDC vs ETH does ETHMACOAPY have?

✨Interact with multiple DeFi protocols in a unified way

See How to interact with DeFi SDK contracts

Addresses

AdapterRegistry contract is deployed to the mainnet and its source code is verified on etherscan.

All the deployed contracts' addresses are available here.

How to Add Your Adapter

The full instructions on how to add a custom adapter to the AdapterRegistry contract may be found in our docs.

If you have questions and/or want to add your adapter to Zerion reach out to us on our Discord server.

Security Vulnerabilities 🛡

If you discover a security vulnerability within DeFi SDK, please send us an e-mail at inbox@zerion.io. All security vulnerabilities will be promptly addressed.

Dev Notes

This project uses Truffle and web3js for all Ethereum interactions and testing.

Set environment

Rename .env.sample file to .env, and fill in the env variables.

MNEMONIC and INFURA_API_KEY are required for core and adapters tests. PRIVATE_KEY is required for interactiveAdapters tests.

Compile contracts

npm run compile

Run tests

npm run test:core for core tests. npm run test:adapters for adapters tests. npm run test:interactiveAdapters for interactiveAdapters tests.

Run Solidity code coverage

npm run coverage

Currently, unsupported files are ignored.

Run Solidity and JS linters

npm run lint

Currently, unsupported files are ignored.

Run all the migrations scripts

npm run deploy:network, network is either development or mainnet.

Serve docs

npm run docs:serve

License

All smart contracts are released under GNU LGPLv3.