### Install Project Dependencies (Bash)
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
Installs all project dependencies, including those from the main requirements.txt file and any found within the 'lib' directory. It sorts and uniquely lists dependencies before installation.
```bash
pip3 install $(cat requirements.txt $(find lib -name requirements.txt | sort) | sort | uniq | sed 's/ *== */==/g')
```
--------------------------------
### Install Dai.js and MCD Plugin
Source: https://docs.makerdao.com/build/dai.js/getting-started
Installs the core Dai.js library and the Multi-Collateral Dai (MCD) plugin using npm. These are essential for interacting with the MakerDAO protocol.
```bash
npm install @makerdao/dai
npm install @makerdao/dai-plugin-mcd
```
--------------------------------
### Set Up and Activate Virtual Environment (Bash)
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
Creates a Python virtual environment named '_virtualenv' and activates it. This isolates project dependencies and ensures the correct Python version is used.
```bash
python3 -m venv _virtualenv
source _virtualenv/bin/activate
```
--------------------------------
### Create a Vault and Draw Dai with Dai.js
Source: https://docs.makerdao.com/build/dai.js/getting-started
Demonstrates creating a MakerDAO vault, locking ETH as collateral, and drawing Dai. This example requires a private key for signing transactions. It ensures a proxy contract exists and then uses `openLockAndDraw` to perform the actions.
```javascript
import Maker from '@makerdao/dai';
import { McdPlugin, ETH, DAI } from '@makerdao/dai-plugin-mcd';
// you provide these values
const infuraKey = 'your-infura-api-key';
const myPrivateKey = 'your-private-key';
const maker = await Maker.create('http', {
plugins: [McdPlugin],
url: `https://mainnet.infura.io/v3/${infuraKey}`,
privateKey: myPrivateKey
});
// verify that the private key was read correctly
console.log(maker.currentAddress());
// make sure the current account owns a proxy contract;
// create it if needed. the proxy contract is used to
// perform multiple operations in a single transaction
await maker.service('proxy').ensureProxy();
// use the "vault manager" service to work with vaults
const manager = maker.service('mcd:cdpManager');
// ETH-A is the name of the collateral type; in the future,
// there could be multiple collateral types for a token with
// different risk parameters
const vault = await manager.openLockAndDraw(
'ETH-A',
ETH(50),
DAI(1000)
);
console.log(vault.id);
console.log(vault.debtValue); // '1000.00 DAI'
```
--------------------------------
### Starting Auction Keeper with a Bidding Model (Shell)
Source: https://docs.makerdao.com/keepers/auction-keepers/auction-keeper-bot-setup-guide
Demonstrates how to launch the auction-keeper process, specifying an external shell script as the bidding model using the '--model' command-line argument. This setup allows for custom bidding strategies implemented in shell.
```shell
bin/auction-keeper --model '../my-bidding-model.sh' [...]
```
--------------------------------
### Jsonnet Data Templating Example
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
This snippet demonstrates how to use Jsonnet for data templating in configuration files. It shows how to define a base price and then calculate amounts based on that price, allowing for dynamic configuration adjustments.
```jsonnet
{
"_price": 10,
"_buyToken": "DAI",
"buyBands": [
{
"minMargin": 0.020,
"avgMargin": 0.050,
"maxMargin": 0.075,
"minAmount": 0.05 * $._price,
"avgAmount": 0.25 * $._price,
"maxAmount": 0.35 * $._price,
"dustCutoff": 0.1
}
],
"_sellToken": "ETH",
"sellBands": []
}
```
--------------------------------
### Install Seth using Dapp Tools Installer Script
Source: https://docs.makerdao.com/clis/seth
This command installs Seth and other Dapp Tools by downloading and executing an installer script. It sets up the Nix package manager and configures binary caches. This method is recommended for GNU/Linux and macOS systems.
```bash
$ curl https://dapp.tools/install | sh
```
--------------------------------
### Manual Installation of Seth and Dapp Tools
Source: https://docs.makerdao.com/clis/seth
This sequence of commands manually installs Nix, Cachix (for binary caching), and then clones the Dapp Tools repository. Finally, it installs Seth, Solc, HEVM, and Ethsign using Nix. This is an alternative if the one-line installer fails.
```bash
$ curl https://nixos.org/nix/install | sh
$ . "$HOME/.nix-profile/etc/profile.d/nix.sh"
$ nix-env -if https://github.com/cachix/cachix/tarball/master --substituters https://cachix.cachix.org --trusted-public-keys cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM=
$ cachix use dapp
$ git clone --recursive [https://github.com/dapphub/dapptools](https://github.com/dapphub/dapptools) $HOME/.dapp/dapptools
$ nix-env -f $HOME/.dapp/dapptools -iA dapp seth solc hevm ethsign
```
--------------------------------
### Clone Market Maker Keeper Repository (Bash)
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
Clones the market-maker-keeper repository from GitHub and navigates into the created directory. This is the first step in setting up the bot.
```bash
git clone git@github.com:makerdao/market-maker-keeper.git
cd market-maker-keeper
```
--------------------------------
### Look Up Vault Information with Dai.js
Source: https://docs.makerdao.com/build/dai.js/getting-started
Example of how to initialize Dai.js with the McdPlugin and Infura, then use the `getCdpIds` and `getCdp` methods to retrieve and display details about a specific vault. This operation only reads data and does not require a private key.
```javascript
// you provide these values
const infuraKey = 'your-infura-api-key';
const ownerAddress = '0xf00...';
const maker = await Maker.create('http', {
plugins: [McdPlugin],
url: `https://mainnet.infura.io/v3/${infuraKey}`
});
const manager = maker.service('mcd:cdpManager');
const proxyAddress = maker.service('proxy').getProxyAddress(ownerAddress);
const data = await manager.getCdpIds(proxyAddress); // returns list of { id, ilk } objects
const vault = await manager.getCdp(data[0].id);
console.log([
vault.collateralAmount, // amount of collateral tokens
vault.collateralValue, // value in USD, using current price feed values
vault.debtValue, // amount of Dai debt
vault.collateralizationRatio, // collateralValue / debt
vault.liquidationPrice // vault becomes unsafe at this price
].map(x => x.toString());
```
--------------------------------
### Install Jsonnet for macOS Mojave (Bash)
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
A sequence of commands to install the 'jsonnet' library, specifically for users on macOS Mojave experiencing installation issues. This includes installing Xcode command line tools and SDK headers before installing jsonnet.
```bash
xcode-select --install
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
pip3 install jsonnet==0.9.5
```
--------------------------------
### Sample bands.json Configuration for Market Maker Keeper
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
A sample bands.json file demonstrating the configuration for two trading bands for the ETH-DAI pair. This file defines buy and sell margins, amounts, and dust cutoffs, serving as a starting point for Market Maker Keeper setup.
```json
{
"_buyToken": "DAI",
"buyBands": [
{
"minMargin": 0.005,
"avgMargin": 0.01,
"maxMargin": 0.02,
"minAmount": 20.0,
"avgAmount": 30.0,
"maxAmount": 40.0,
"dustCutoff": 0.0
},
{
"minMargin": 0.02,
"avgMargin": 0.025,
"maxMargin": 0.03,
"minAmount": 40.0,
"avgAmount": 60.0,
"maxAmount": 80.0,
"dustCutoff": 0.0
}
],
"buyLimits": [],
"_sellToken": "ETH",
"sellBands": [
{
"minMargin": 0.005,
"avgMargin": 0.01,
"maxMargin": 0.02,
"minAmount": 2.5,
"avgAmount": 5.0,
"maxAmount": 7.5,
"dustCutoff": 0.0
},
{
"minMargin": 0.02,
"avgMargin": 0.025,
"maxMargin": 0.05,
"minAmount": 4.0,
"avgAmount": 6.0,
"maxAmount": 8.0,
"dustCutoff": 0.0
}
],
"sellLimits": []
}
```
--------------------------------
### Clone and Install Cage Keeper Project (Shell)
Source: https://docs.makerdao.com/keepers/cage-keeper
This snippet shows the commands to clone the Cage Keeper repository from GitHub, navigate into the directory, initialize submodules, and run the installation script. It assumes Python 3.6.2 is installed.
```shell
git clone https://github.com/makerdao/cage-keeper.git
cd cage-keeper
git submodule update --init --recursive
./install.sh
```
--------------------------------
### Install Development Dependencies for Market Maker Keeper
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
Installs the Python libraries required for running unit tests and development tasks. This command reads dependencies from the 'requirements-dev.txt' file.
```shell
pip3 install -r requirements-dev.txt
```
--------------------------------
### Install dapp tools and mcd CLI
Source: https://docs.makerdao.com/clis/mcd-cli
Installs the necessary dapp tools and the mcd package for interacting with Multi-collateral Dai. Requires curl for downloading and dapp pkg for package management.
```bash
$ curl https://dapp.tools/install | sh
$ dapp pkg install mcd
```
--------------------------------
### Initialize Git Submodules (Bash)
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
Initializes and updates git submodules, which are necessary for including the pymaker and pyexchange libraries. This command ensures all required external code is downloaded.
```bash
git submodule update --init --recursive
```
--------------------------------
### Forwarding Proxy Example (Solidity)
Source: https://docs.makerdao.com/build/dai.js/advanced-configuration/using-ds-proxy
A simple example of a forwarding proxy contract in Solidity, demonstrating how to aggregate multiple function calls into a single method for atomic execution.
```solidity
// Forwarding proxy
function lockAndDraw(address tub_, bytes32 cup, uint wad) public payable {
lock(tub_, cup);
draw(tub_, cup, wad);
}
```
--------------------------------
### Installing Python Requirements (Bash)
Source: https://docs.makerdao.com/keepers/auction-keepers/auction-keeper-bot-setup-guide
Command to install all Python dependencies listed in the 'requirements.txt' file using pip. This is essential for the auction-keeper bot to function correctly.
```bash
pip3 install -r requirements.txt
```
--------------------------------
### Run Oasis Market Maker Keeper (Bash)
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
This bash script executes the oasis-market-maker-keeper with specified RPC host, timeout, Ethereum account details, contract addresses for Oasis and Tub, price feed, token addresses, configuration file path, and gas price settings. Ensure correct contract addresses and account key/password files are provided.
```bash
#!/bin/bash
bin/oasis-market-maker-keeper \
--rpc-host 127.0.0.1 \
--rpc-port \
--rpc-timeout 10 \
--eth-from [address of your generated Ethereum account] \
--eth-key ${ACCOUNT_KEY} \
--tub-address 0x448a5065aebb8e423f0896e6c5d525c040f59af3 \
--oasis-address 0x14fbca95be7e99c15cc2996c6c9d841e54b79425 \
--price-feed fixed:200 \
--buy-token-address [address of the quote token, could be DAI] \
--sell-token-address [address of the base token, could be WETH] \
--config [path to the json bands configuration file, e.g bands.json] \
--smart-gas-price \
--min-eth-balance 0.001
```
--------------------------------
### Verify Seth Installation
Source: https://docs.makerdao.com/clis/seth
This command checks the installed version of Seth. Successful execution confirms that Seth has been installed correctly as part of the Dapp Tools suite.
```bash
$ seth --version
```
--------------------------------
### Install Pymaker and Dependencies
Source: https://docs.makerdao.com/build/pymaker
Installs the Pymaker project and its required Python packages. Includes commands for cloning the repository and installing dependencies using pip. Also provides specific package installations for Ubuntu and macOS to resolve known issues with secp256k1 compilation and OpenSSL linking.
```bash
git clone https://github.com/makerdao/pymaker.git
cd pymaker
pip3 install -r requirements.txt
```
```bash
sudo apt-get install build-essential automake libtool pkg-config libffi-dev python-dev python-pip libsecp256k1-dev
```
```bash
brew install openssl libtool pkg-config automake
export LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include"
```
--------------------------------
### Test New Service Integration with Maker Object
Source: https://docs.makerdao.com/build/dai.js/advanced-configuration/adding-a-new-service
These examples illustrate how to test a newly added service. The first test shows how to create a Maker object with a new service role ('example') and access its methods. The second test demonstrates replacing a default service (like 'web3') with a custom implementation.
```javascript
import Maker from '../../src/index';
//step 8: a new service role ('example') is used
test('test 1', async () => {
const maker = await Maker.create('http', {example: "ExampleService"});
const exampleService = customMaker.service('example');
exampleService.test(); //logs "test"
});
//step 8: a custom service replaces a default service (Web3)
test('test 2', async () => {
const maker = await Maker.create('http', {web3: "MyCustomWeb3Service"});
const mycustomWeb3Service = maker.service('web3');
});
```
--------------------------------
### Start Local Ethereum Testnet
Source: https://docs.makerdao.com/clis/seth
This command starts a local private Ethereum network using the Dapp tool. It automatically creates accounts and keystore files, which is useful for developing and testing decentralized applications without using real Ether.
```bash
$ dapp testnet
```
--------------------------------
### DS-Proxy Execute Function Example
Source: https://docs.makerdao.com/smart-contract-modules/proxy-module/proxy-actions-detailed-documentation
An example demonstrating how to use the DS-Proxy's execute function to call a function within the dss-proxy-actions library. This involves specifying the target library address and the encoded function call data.
```Solidity
proxy.execute(dssProxyActions, abi.encodeWithSignature("open(address,bytes32,address)", address(manager), bytes32("ETH-A"), address(0x123)))
```
--------------------------------
### Sample Cage Keeper Startup Script (Bash)
Source: https://docs.makerdao.com/keepers/cage-keeper
This bash script provides a template for starting the Cage Keeper application. It includes essential parameters such as RPC host, network, Ethereum address, key file, and the VAT deployment block. Users need to replace placeholder values with their specific configurations.
```bash
#!/bin/bash
/full/path/to/cage-keeper/bin/cage-keeper \
--rpc-host 'sample.ParityNode.com' \
--network 'kovan' \
--eth-from '0xABCAddress' \
--eth-key 'key_file=/full/path/to/keystoreFile.json,pass_file=/full/path/to/passphrase/file.txt' \
--vat-deployment-block 14374534
```
--------------------------------
### Define and Implement a New Service Class
Source: https://docs.makerdao.com/build/dai.js/advanced-configuration/adding-a-new-service
This snippet demonstrates how to create a new service class, `ExampleService`, that extends `PublicService`. It shows the constructor setup, including calling the parent constructor with the service name and dependencies (like 'log'), and implementing a basic public method `test()` that utilizes a dependency.
```javascript
import PublicService from '../core/PublicService';
export default class ExampleService extends PublicService {
constructor (name='example') {
super(name, ['log']);
}
test(){
this.get('log').info('test');
}
}
```
--------------------------------
### Import Dai.js and MCD Plugin in JavaScript
Source: https://docs.makerdao.com/build/dai.js/getting-started
Demonstrates how to import the Dai.js library and the McdPlugin into a JavaScript project using both ES Modules (`import`) and CommonJS (`require`) syntax.
```javascript
import Maker from '@makerdao/dai';
// or
const Maker = require('@makerdao/dai');
```
```javascript
import { McdPlugin } from '@makerdao/dai-plugin-mcd';
// or
const { McdPlugin } = require('@makerdao/dai-plugin-mcd');
```
--------------------------------
### Use Dai.js as a UMD Module
Source: https://docs.makerdao.com/build/dai.js/getting-started
Shows how to include Dai.js as a UMD module in an HTML file using a script tag. After the script loads, the Maker object will be available globally on the `window` object.
```html
```
--------------------------------
### Create Maker Instances with Presets (JavaScript)
Source: https://docs.makerdao.com/build/dai.js/maker
Demonstrates creating Maker instances using the 'browser', 'http', and 'test' presets. The 'browser' preset automatically detects Ethereum providers, 'http' requires a node URL, and 'test' connects to a local node.
```javascript
const makerBrowser = await Maker.create('browser');
const makerHttp = await Maker.create('http', {
url: 'https://kovan.infura.io/v3/YOUR_INFURA_PROJECT_ID'
});
const makerTest = await Maker.create('test');
```
--------------------------------
### Creating a Simple Fixed-Price Bidding Model (Bash)
Source: https://docs.makerdao.com/keepers/auction-keepers/auction-keeper-bot-setup-guide
An example of a bash script that acts as a simple bidding model. It outputs a fixed 'price' in JSON format to stdout and then sleeps for 60 seconds before repeating. This demonstrates a basic strategy for the auction keeper.
```bash
#!/usr/bin/env bash
echo "{"price": \"150.0\"}" # put your desired fixed price amount here
sleep 60 # locking the price for a 60 seconds period
```
--------------------------------
### Get Kovan MCD MKR using Seth
Source: https://docs.makerdao.com/keepers/auction-keepers/auction-keeper-bot-setup-guide
This command uses the Seth tool to interact with the MCD K-MKR token contract on the Kovan network. It calls the 'gulp' function on the specified token address to receive 1 MKR. Ensure Seth is installed and configured.
```bash
seth send 0xcbd3e165ce589657fefd2d38ad6b6596a1f734f6 'gulp(address)' 0xaaf64bfcc32d0f15873a02163e7e500671a4ffcd
```
--------------------------------
### Make Keeper Executable and Run
Source: https://docs.makerdao.com/keepers/simple-arbitrage-keeper
These commands demonstrate how to make the shell script executable and then run it. First, `chmod +x` grants execute permissions to the script. Second, `./` executes the script from the current directory.
```bash
chmod +x run-simple-keeper-kovan.sh
./run-simple-keeper-kovan.sh
```
--------------------------------
### Execute Market Maker Keeper Unit Tests
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
Runs the comprehensive unit test suite for the market-maker keeper project. This script typically utilizes a test runner like pytest to execute all defined tests.
```shell
./test.sh
```
--------------------------------
### Sample Chief Keeper Startup Script
Source: https://docs.makerdao.com/keepers/chief-keeper
This bash script provides a sample configuration for starting the chief-keeper. It includes essential parameters such as the RPC host, network, Ethereum address, key file, passphrase file, and the chief deployment block number.
```bash
#!/bin/bash
/full/path/to/chief-keeper/bin/chief-keeper \
--rpc-host 'sample.ParityNode.com' \
--network 'kovan' \
--eth-from '0xABCAddress' \
--eth-key 'key_file=/full/path/to/keystoreFile.json,pass_file=/full/path/to/passphrase/file.txt' \
--chief-deployment-block 14374534
```
--------------------------------
### Kovan Addresses for Oasis Market Maker Keeper
Source: https://docs.makerdao.com/keepers/market-maker-keepers/market-maker-keeper-bot-setup-guide
This list provides essential contract addresses for the Oasis Market Maker Keeper on the Kovan testnet. These include addresses for the Oasis server, Tub, SAI (buy token), WETH (sell token), and a new Oasis address. These are crucial for the keeper to interact with the correct smart contracts.
```shell
V2_OASIS_SERVER1_ADDRESS=
V2_OASIS_SERVER1_KEY="key_file=/home/ed/Projects/member-account.json,pass_file=/home/ed/Projects/member-account.pass"
TUB_ADDRESS=0xa71937147b55deb8a530c7229c442fd3f31b7db2 # tub-address
SAI_ADDRESS=0xc4375b7de8af5a38a93548eb8453a498222c4ff2 # buy-token-address
WETH_ADDRESS=0xd0a1e359811322d97991e03f863a0c30c2cf029c # sell-token-address
OASIS_ADDRESS_NEW=0x4a6bc4e803c62081ffebcc8d227b5a87a58f1f8f # oasis-address
```
--------------------------------
### Simple Arbitrage Keeper Initial Startup Log
Source: https://docs.makerdao.com/keepers/simple-arbitrage-keeper
This log output shows the initial startup sequence of the simple arbitrage keeper. It includes connection messages, operating address, startup logic execution, and the 'Watching for new blocks' status, followed by a 'Best Trade' message indicating the keeper's activity.
```log
2019-10-19 17:21:57,463 INFO Keeper connected to RPC connection https://...
2019-10-19 17:21:57,463 INFO Keeper operating as 0xABCD
2019-10-19 17:21:58,523 INFO Executing keeper startup logic
2019-10-19 17:22:04,820 INFO Watching for new blocks
2019-10-19 17:22:13,983 INFO Best trade regardless of profit/min-profit: -1.243077085275947008 DAI from Uniswap to Oasis
```
--------------------------------
### Waiting for Service Lifecycle States in JavaScript
Source: https://docs.makerdao.com/build/dai.js/advanced-configuration/adding-a-new-service
Demonstrates how to wait for a service and its dependencies to reach specific lifecycle states (initialize, connect, authenticate) using async/await. It also shows how to use callback syntax for connection events and how to authenticate all services managed by a Maker object.
```javascript
const maker = await Maker.create('http', {example: "ExampleService"});
const exampleService = customMaker.service('example');
//wait for example service and its dependencies to initialize
await exampleService.manager().initialize();
//wait for example service and its dependencies to connect
await exampleService.manager().connect();
//wait for example service and its dependencies to authenticate
await exampleService.manager().authenticate();
//can also use callback syntax
exampleService.manager().onConnected(()=>{
/*executed after connected*/
});
//wait for all services used by the maker object to authenticate
maker.authenticate();
```
--------------------------------
### Dog Interface: Liquidation Initiation
Source: https://docs.makerdao.com/smart-contract-modules/dog-and-clipper-detailed-documentation
Initiates the liquidation process for a given `urn` and `ilk`. This function starts an auction, and the `kpr` parameter specifies the address where liquidation rewards should be sent.
```Solidity
function bark(bytes32 ilk, address urn, address kpr)
external returns (uint256 id);
```
--------------------------------
### Install Chief Keeper Development Dependencies
Source: https://docs.makerdao.com/keepers/chief-keeper
This command installs the necessary development dependencies for the chief-keeper project, typically required for running tests. It uses pip3 to install packages listed in the 'requirements-dev.txt' file.
```bash
pip3 install -r requirements-dev.txt
```
--------------------------------
### Ilk Initialization
Source: https://docs.makerdao.com/smart-contract-modules/rates-module/jug-detailed-documentation
Ensures proper initialization of new collateral types by calling the `init` function. Failure to do so can lead to incorrect fee accumulation.
```APIDOC
## Ilk Initialization
### Description
Initializes a new collateral type (`ilk`). This function must be called when a new collateral type is added to ensure that the `rho` (last update time) is properly set. If `init` is not called, fees will accumulate based on an incorrect start date (January 1st, 1970), leading to inaccurate calculations.
### Method
`init`
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
* **ilk** (bytes32) - Required - The identifier of the collateral type to initialize.
### Request Example
```json
{
"ilk": "0x74657374696c6b00000000000000000000000000000000000000000000000000"
}
```
### Response
#### Success Response (200)
No specific return value, but state is updated.
#### Response Example
```json
{
"status": "success"
}
```
```
--------------------------------
### Get Yearly Rate (getYearlyRate)
Source: https://docs.makerdao.com/build/dai.js/savingsservice
Get the current annual savings rate.
```APIDOC
## GET /getYearlyRate
### Description
Get the current annual savings rate.
### Method
GET
### Endpoint
`/getYearlyRate`
### Parameters
#### Path Parameters
None
#### Query Parameters
None
### Response
#### Success Response (200)
- **yearlyRate** (number) - The current annual savings rate (e.g., 0.05 for 5%).
#### Response Example
```json
{
"yearlyRate": 0.05
}
```
```
--------------------------------
### GET /price/eth
Source: https://docs.makerdao.com/build/dai.js/single-collateral-dai/price-service
Get the current USD price of ETH, as a `USD_ETH` price unit.
```APIDOC
## GET /price/eth
### Description
Get the current USD price of ETH, as a `USD_ETH` price unit.
### Method
GET
### Endpoint
`/price/eth`
### Parameters
#### Query Parameters
None
### Request Example
```javascript
const price = maker.service('price');
const ethPrice = await price.getEthPrice();
```
### Response
#### Success Response (200)
- **ethPrice** (number) - The current USD price of ETH.
#### Response Example
```json
{
"ethPrice": 1850.50
}
```
```
--------------------------------
### Get Total Dai (getTotalDai)
Source: https://docs.makerdao.com/build/dai.js/savingsservice
Get the total amount of Dai in the DSR contract for all users.
```APIDOC
## GET /getTotalDai
### Description
Get the total amount of Dai in the DSR contract for all users.
### Method
GET
### Endpoint
`/getTotalDai`
### Parameters
#### Path Parameters
None
#### Query Parameters
None
### Response
#### Success Response (200)
- **totalDai** (Dai) - The total amount of Dai in the DSR contract.
#### Response Example
```json
{
"totalDai": "DAI(1000000)"
}
```
```