{"id":13807077,"url":"https://github.com/makerdao/integration-examples","last_synced_at":"2025-05-14T00:30:43.130Z","repository":{"id":34028013,"uuid":"135474875","full_name":"makerdao/integration-examples","owner":"makerdao","description":"A set of examples of how to use the DAI.js library with various purposes and configs","archived":true,"fork":false,"pushed_at":"2022-07-21T18:53:46.000Z","size":3168,"stargazers_count":56,"open_issues_count":73,"forks_count":35,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-11-18T23:51:35.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/makerdao.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}},"created_at":"2018-05-30T17:14:40.000Z","updated_at":"2023-04-25T15:42:05.000Z","dependencies_parsed_at":"2022-08-07T23:31:33.701Z","dependency_job_id":null,"html_url":"https://github.com/makerdao/integration-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fintegration-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fintegration-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fintegration-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fintegration-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makerdao","download_url":"https://codeload.github.com/makerdao/integration-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254046199,"owners_count":22005551,"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":[],"created_at":"2024-08-04T01:01:20.519Z","updated_at":"2025-05-14T00:30:42.150Z","avatar_url":"https://github.com/makerdao.png","language":"JavaScript","funding_links":[],"categories":["Developer Resources","JavaScript"],"sub_categories":["Single-Collateral Dai"],"readme":"\u003ch1 align=\"center\"\u003e\n  Dai.js Examples\n\u003c/h1\u003e\n\n### other examples\n\nSee the [Maker governance dashboard repo](https://github.com/makerdao/governance-dashboard) for an example of a production application that uses dai.js.\nThe WIP [MCD CDP Portal](https://github.com/makerdao/mcd-cdp-portal) also uses dai.js.\nThe examples in this repo are simple examples that use dai.js, but note that these examples are not updated very often.\n\n### accounts\n\nDemo of multiple account support. See [README](https://github.com/makerdao/integration-examples/blob/master/accounts/README.md).\n\n### leverage\n\nLock ETH -\u003e Draw DAI -\u003e Exchange Dai for ETH -\u003e repeat\n\n__Example usage__\n```shell\nexport PRIVATE_KEY=0xabc... # your key goes here\nexport NETWORK='kovan' # choose your network here\nexport DEBUG=leverage.* #turn on console logging\ncd leverage\nbabel-node . 1 400 0.1\n```\n* The first argument is the number of iterations\n* The second argument is the ETH price floor\n* The third argument is the initial amount of ETH\n\n### react-example\n\nInteract with Dai.js in the browser.\n\nTo set your private key:\n* `cd react-example`\n* `cp .env.example .env`\n* Add your key (as a string) where prompted in `.env`\n\n\n### TopUp\n\nPrevent your Vault from getting liquidated (automated risk management) -- \"top it up\" with collateral to stay above a target collateralization ratio.\n\n__Example usage__\n\nRun `yarn install` or `npm install`\n\nNB: One way to get your pivate key is to do it trough Metamask. Click on `Details` button and then on the `Export Private Key` button in your wallet account. \n\n```shell\nexport PRIVATE_KEY=0xabc... # your key goes here\nexport NETWORK='kovan' # choose your network here\ncd topup\nnode . 1234 -t 2.5 -v\n```\n* The first argument is a CDP ID.\n* The value for the `-t` argument is the target ratio.\n* `-v` enables verbose mode (shows stack traces for errors).\n\n### wyre\n\nUse Dai.js along with the Wyre SDK for an easy fiat on or off ramp in your application.\nUses version 1.0.5 of the Wyre API, which may need an upgrade soon.\n\n### mcd-dai\nUse the `dai-mcd-plugin` to interact with the Multi Collateral Dai smart contracts\n\n\n__Example Usage__\nSee the project's README for detailed instructions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fintegration-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakerdao%2Fintegration-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fintegration-examples/lists"}