{"id":19149561,"url":"https://github.com/zeriontech/defi-sdk-js-archived","last_synced_at":"2026-06-17T04:32:00.909Z","repository":{"id":72895561,"uuid":"360545593","full_name":"zeriontech/defi-sdk-js-archived","owner":"zeriontech","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-12T16:03:46.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-22T20:32:25.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-22T14:20:39.000Z","updated_at":"2021-05-12T16:03:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a704d05-215e-436c-a130-8842ee05ef09","html_url":"https://github.com/zeriontech/defi-sdk-js-archived","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zeriontech/defi-sdk-js-archived","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk-js-archived","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk-js-archived/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk-js-archived/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk-js-archived/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeriontech","download_url":"https://codeload.github.com/zeriontech/defi-sdk-js-archived/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk-js-archived/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34434492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-09T08:08:42.835Z","updated_at":"2026-06-17T04:32:00.900Z","avatar_url":"https://github.com/zeriontech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# defi-sdk\n\nA TypeScript/Javascript library for interacting with the [DeFi SDK](https://github.com/zeriontech/defi-sdk).\n\nVisit **[docs.zerion.io](https://docs.zerion.io)** for full documentation.\n\n## Installation\n\n```\nnpm install defi-sdk@0.0.1\n```\n\n## Usage\n\ndefi-sdk is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).\n\n### Initialize DeFiSDK\nDeFi SDK directly connects to the Ethereum blockchain. You are welcome to use an Ethereum node of your choice to start using DeFi SDK.\nIf you don't have a node, in the example below you can use a node provided by Cloudflare and served through our domain.\n\n```javascript\nimport { DeFiSDK } from 'defi-sdk';\n\nconst nodeUrl = 'https://eth-mainnet.zerion.io/';\nconst defiSdk = new DeFiSDK(nodeUrl);\n```\n\n### Examples\n\n#### Get supported protocols\n```javascript\ndefiSdk.getProtocolNames().then(protocols =\u003e console.log(protocols));\n\n// output:\n// [\n//   'Uniswap V2',           'PieDAO',\n//   'Multi-Collateral Dai', 'Bancor',\n//   'DeFi Money Market',    'TokenSets',\n//   '0x Staking',           'Uniswap V1',\n//   'Synthetix',            'PoolTogether',\n//   'Dai Savings Rate',     'Chai',\n//   'iearn.finance (v3)',   'iearn.finance (v2)',\n//   'Idle',                 'dYdX',\n//   'Curve',                'Compound',\n//   'Balancer',             'Aave'\n// ]\n```\n\n#### Get supported token adapters\n```javascript\ndefiSdk.getTokenAdapterNames().then(adapters =\u003e console.log(adapters));\n\n// output:\n// [\n//   'Uniswap V2 pool token',\n//   'PieDAO Pie Token',\n//   'SmartToken',\n//   'MToken',\n//   'SetToken',\n//   'Uniswap V1 pool token',\n//   'PoolTogether pool',\n//   'Chai token',\n//   'YToken',\n//   'IdleToken',\n//   'Curve pool token',\n//   'CToken',\n//   'Balancer pool token',\n//   'AToken',\n//   'ERC20'\n// ]\n```\n\n### Get account balance locked in a protocol\n```javascript\nconst account  = \"0x42b9dF65B219B3dD36FF330A4dD8f327A6Ada990\";\nconst protocol = \"Compound\";\ndefiSdk.getProtocolBalance(\n  account,\n  protocol\n).then(balance =\u003e console.log(balance));\n\n// output:\n// ProtocolBalance {\n//   metadata: ProtocolMetadata {\n//     name: 'Compound',\n//     description: 'Decentralized lending \u0026 borrowing protocol',\n//     website: URL {\n//       href: 'https://compound.finance/',\n//       origin: 'https://compound.finance',\n//       protocol: 'https:',\n//       username: '',\n//       password: '',\n//       host: 'compound.finance',\n//       hostname: 'compound.finance',\n//       port: '',\n//       pathname: '/',\n//       search: '',\n//       searchParams: URLSearchParams {},\n//       hash: ''\n//     },\n//     logo: URL {\n//       href: 'https://protocol-icons.s3.amazonaws.com/compound.png',\n//       origin: 'https://protocol-icons.s3.amazonaws.com',\n//       protocol: 'https:',\n//       username: '',\n//       password: '',\n//       host: 'protocol-icons.s3.amazonaws.com',\n//       hostname: 'protocol-icons.s3.amazonaws.com',\n//       port: '',\n//       pathname: '/compound.png',\n//       search: '',\n//       searchParams: URLSearchParams {},\n//       hash: ''\n//     },\n//     version: 2n\n//   },\n//   balances: [\n//     AdapterBalance { metadata: [AdapterMetadata], balances: [Array] },\n//     AdapterBalance { metadata: [AdapterMetadata], balances: [Array] }\n//   ]\n// }\n```\n### Get derivative token underlying components\n```javascript\nconst tokenType = 'Uniswap V2 pool token';\nconst tokenAddress = '0xa478c2975ab1ea89e8196811f51a7b7ade33eb11';\ndefiSdk.getTokenComponents(tokenType, tokenAddress).then(components =\u003e {\n  console.log(\"Base\", components.base);\n  console.log(\"Underlying\", components.underlying);\n});\n\n// output:\n// Base TokenBalance {\n//   balance: '1000000000000000000',\n//   metadata: TokenMetadata {\n//     address: '0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11',\n//     decimals: 18,\n//     name: 'DAI/WETH Pool',\n//     symbol: 'UNI-V2'\n//   }\n// }\n// Underlying [\n//   TokenBalance {\n//     balance: '14400197657513580020',\n//     metadata: TokenMetadata {\n//       address: '0x6B175474E89094C44Da98b954EedeAC495271d0F',\n//       decimals: 18,\n//       name: 'Dai Stablecoin',\n//       symbol: 'DAI'\n//     }\n//   },\n//   TokenBalance {\n//     balance: '70472588741190622',\n//     metadata: TokenMetadata {\n//       address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n//       decimals: 18,\n//       name: 'Wrapped Ether',\n//       symbol: 'WETH'\n//     }\n//   }\n// ]\n```\n\nCheck out the complete API reference [here](src/protocols/interfaces.ts).\n\n## License\n\ndefi-sdk is available under the MIT. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeriontech%2Fdefi-sdk-js-archived","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeriontech%2Fdefi-sdk-js-archived","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeriontech%2Fdefi-sdk-js-archived/lists"}