{"id":13744915,"url":"https://github.com/zeriontech/defi-sdk","last_synced_at":"2025-05-14T23:00:20.442Z","repository":{"id":37374202,"uuid":"229208072","full_name":"zeriontech/defi-sdk","owner":"zeriontech","description":"DeFi SDK Makes Money Lego Work","archived":false,"fork":false,"pushed_at":"2025-05-14T14:56:31.000Z","size":10287,"stargazers_count":813,"open_issues_count":50,"forks_count":266,"subscribers_count":43,"default_branch":"router","last_synced_at":"2025-05-14T15:53:09.772Z","etag":null,"topics":["0x","aave-protocol","balancer","compound","ctokens","curve","dai","defi","defi-protocols","defi-sdk","ethereum","maker","solidity","truffle","uniswap"],"latest_commit_sha":null,"homepage":"https://docs.zerion.io/defi-sdk/","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeriontech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/supported-protocols/interactive-adapters.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-20T06:55:26.000Z","updated_at":"2025-05-14T14:56:35.000Z","dependencies_parsed_at":"2024-03-31T06:32:15.624Z","dependency_job_id":"315da2e3-1b23-428d-a707-c2646c553082","html_url":"https://github.com/zeriontech/defi-sdk","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeriontech","download_url":"https://codeload.github.com/zeriontech/defi-sdk/tar.gz/refs/heads/router","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243353,"owners_count":22038044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["0x","aave-protocol","balancer","compound","ctokens","curve","dai","defi","defi-protocols","defi-sdk","ethereum","maker","solidity","truffle","uniswap"],"created_at":"2024-08-03T05:01:18.398Z","updated_at":"2025-05-14T23:00:20.374Z","avatar_url":"https://github.com/zeriontech.png","language":"Solidity","readme":"![](https://i.ibb.co/7QCQKPD/MEDIUM-FINAL.png)\n[![Build status](https://github.com/zeriontech/defi-sdk/workflows/build/badge.svg)](https://github.com/zeriontech/defi-sdk/actions?query=workflow:build)\n[![Test status](https://github.com/zeriontech/defi-sdk/workflows/test/badge.svg)](https://github.com/zeriontech/defi-sdk/actions?query=workflow:test)\n[![Coverage status](https://github.com/zeriontech/defi-sdk/workflows/coverage/badge.svg)](https://github.com/zeriontech/defi-sdk/actions?query=workflow:coverage)\n[![Lint status](https://github.com/zeriontech/defi-sdk/workflows/lint/badge.svg)](https://github.com/zeriontech/defi-sdk/actions?query=workflow:lint)\n[![License](https://badgen.net/github/license/zeriontech/defi-sdk)](https://www.gnu.org/licenses/lgpl-3.0.en.html)\n[![Discord](https://badgen.net/badge/zerion/Zerion?icon=discord\u0026label=discord)](https://zerion.io/discord)\n[![Twitter Follow](https://img.shields.io/twitter/follow/zerion?style=social)](https://x.com/intent/follow?screen_name=zerion)\n\n**DeFi SDK** is an open-source system of smart contracts that allows you to execute trades with ERC20 tokens and track balances on different protocols.\n\nIf you have any questions about DeFi SDK, feel free to reach out to us on our [Discord server](https://zerion.io/discord).\n\n![](https://i.ibb.co/RC54SjL/defisdk.png)\n\n## Features\n\n**💸Trade any ERC20 tokens on L2 chains using single Router contract**\n\u003e See [How to swap ERC20 tokens using DeFi SDK Router](docs/router.md)\n\n**💥Query user assets and debt deposited in DeFi protocols like *Maker, Aave, dYdX*, etc.**\n\u003e How much debt does `0xdead..beef` have on Compound?\n\n**📊Get the underlying components of complex derivative ERC20 tokens**\n\u003e How much `cUSDC` vs `ETH` does `ETHMACOAPY` have?\n\n**✨Interact with multiple DeFi protocols in a unified way**\n\u003e See [How to interact with DeFi SDK contracts](docs/interacting.md)\n\n## Trading Features\n\n* Trade any ERC20 token\n* Two types of amounts: absolute (usual amount) and relative (percentage of balance)\n* Three types of `permit()` functions for approving tokens in the same transaction (EIP2612, DAI-like, Yearn-like)\n* Two types of swaps: with fixed input amount or fixed output amount\n* Two types of fees:\n  * **protocol fee** managed by the **Router** contract owner with possibility of one-time discounts requiring signature of an address with the special role\n  * **marketplace fee** managed by the transaction creator\n* Relayed transactions requiring just an EIP712 signature of the user\n\n## How to Add Your Adapter\n\n\u003e Read-only and interactive adapters are maintained in [`master`](https://github.com/zeriontech/defi-sdk/tree/master) and [`interactive-updates`](https://github.com/zeriontech/defi-sdk/tree/interactive-updates) branches of **defi-sdk** repo respectively.\n\nThe full instructions on how to add a custom adapters may be found in our [docs](docs/creating-your-adapters/index.md).\n\nIf you have questions and/or want to add your adapter to Zerion reach out to us on our [Discord server](https://zerion.io/discord).\n\n## Addresses\n\nAll the deployed contracts' addresses are available [here](docs/addresses.md).\n\n## Security Vulnerabilities 🛡\n\nIf you discover a security vulnerability within DeFi SDK, please send us an e-mail at inbox@zerion.io.\nAll security vulnerabilities will be promptly addressed.\n\nThe project uses [Slither](https://github.com/crytic/slither) for security analysis.\nIt should be previously installed (e.g. via [pip](https://pypi.org/project/pip/)).\n\nRun `npm run slither` to run security checks.\n\n## Dev Notes\n\nWe use [Hardhat](https://github.com/NomicFoundation/hardhat), which runs tests extremely fast!\n\nAlso, we use [Truffle Dashboard](https://trufflesuite.com/docs/truffle/getting-started/using-the-truffle-dashboard/) for secure deployment.\n\n### Installation\n\nRun `npm install` to install all the dependencies.\n\n### Deployment\n\nRun `npm run truffle-dashboard` to start the Truffle Dashboard.\n\nRun `npm run deploy:router:truffle-dashboard` to deploy the **Router** contract.\nSign deployment transaction in your browser at `http://localhost:24012/`.\n\nFill in address of newly deployed contract to `scripts/deployment.js`.\n\nThe same instruction applies to the **SimpleCaller** contract with `deploy:sc:truffle-dashboard` command.\n\nAfter filling in fee beneficiary for the chosen network in `scripts/deployment.js`, `initialize:router:truffle-dashboard` command may be run.\n\nRun `npm run verify` to verify contract on any block explorer.\nThe respective `\u003cBLOCK_EXPLORER\u003e_API_KEY` filled in `.env` file is required for this step.\nSee the `hardhat.config.ts` file for the details (`etherscan` field of `config` variable uses these API keys).\n\n### Testing \u0026 Coverage\n\nThe **Router** contract and its dependencies is fully covered with tests.\n\nRun `npm run test` and `npm run coverage` to run tests or coverage respectively.\n`INFURA_API_KEY` filled in `.env` file is required for this step.\n`REPORT_GAS` filled in `.env` file enables/disables gas reports during tests.\n\n### Linting\n\nRun `npm run lint` for both JS and Solidity linters.\n\nRun `npm run lint:eslint` and `npm run lint:solhint` to run linter for JS and Solidity separately.\n\n### Serve docs\n\n`npm run docs:serve`\n\n## License\n\nAll smart contracts are released under GNU LGPLv3 license.\n","funding_links":[],"categories":["Solidity","TypeScript","Others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeriontech%2Fdefi-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeriontech%2Fdefi-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeriontech%2Fdefi-sdk/lists"}