Lens - Protocol - MakerDAO

This API retrieves information about all of the actions that occurred on the protocol within a certain timespan.

🚧

Time Range Limit

The maximum time range (difference between endDate and startDate) is 60 days.

📘

Not specifying startDate and endDate

If the startDate and endDate query parameters are not provided, the API will return the data from the previous 24 hours.

Understanding Actions in MakerDAO

There are many different types of actions in MakerDAO, as you'll see in the action property for each item of the payload.data array. The guide below will help you understand the possible actions.

All actions in the API response share the following data structure

propertytype
actionstring
timestampstring | number
blockNumbernumber
transactionHashstring
logIndexnumber
marketIdstring
marketstring
assetstring
assetIdstring
assetSymbolstring
amountNativenumber
amountUSDnumber
userstring

Deposit

The address at user deposited amountNative of assetSymbol into the Maker protocol. This deposit serves as collateral for any borrowing activity the user desires to engage in.

In other words, user deposited 2072.630 USDC as collateral into the protocol.

{
  "action": "Deposit",
  "timestamp": "2022-09-01 11:39:32 000",
  "blockNumber": 15452673,
  "transactionHash": "0xaf55ae25ac30d0fbe5eb75a455e860de1ad64611f8ef8c67c6e42ecb6c82d393",
  "logIndex": 410,
  "marketId": "0x0a59649758aa4d66e25f08dd01271e891fe52199",
  "market": "PSM-USDC-A",
  "assetId": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "assetSymbol": "USDC",
  "amountNative": 2072.630944,
  "amountUSD": 2072.630944,
  "user": "89b78cfa322f6c5de0abceecab66aee45393cc5a"
}

Borrow

The address user borrowed amountNative of assetSymbol.

Reminder that in the Maker protocol, all borrowing must be done with DAI regardless of the collateral asset provided.

In other words, user borrowed 7,888.805 DAI from the protocol.

{
  "action": "Borrow",
  "timestamp": "2022-09-01 12:28:07 000",
  "blockNumber": 15452878,
  "transactionHash": "0xd53cfc48ae23474f9482b466765fb3c37a2585737864b00b90d08d561a5e6a85",
  "logIndex": 738,
  "marketId": "0x2f0b23f53734252bda2277357e97e1517d6b042a",
  "market": "ETH-A",
  "assetId": "0x6b175474e89094c44da98b954eedeac495271d0f",
  "assetSymbol": "DAI",
  "amountNative": 7888.805038288017,
  "amountUSD": 7888.805038288017,
  "borrowRate": 0.014999447884814958,
  "borrowRateMode": "Stable",
  "user": "4bbf448852dc7d2c22395810df319b0fd3de6373"
}
propertytype
borrowRatenumber
borrowRateModeStable

Repay

The address user repaid their loan with amountNative of assetSymbol.

Reminder that in the Maker protocol, all repayments must be done with DAI.

In other words, user repaid their loan with 20,000 DAI.

{
  "action": "Repay",
  "timestamp": "2022-09-01 12:29:23 000",
  "blockNumber": 15452884,
  "transactionHash": "0xda3c64cbb0e91a9c9f8a02642da87a31b135b01490bdefc752eef3881e22449e",
  "logIndex": 179,
  "marketId": "0x0a59649758aa4d66e25f08dd01271e891fe52199",
  "market": "PSM-USDC-A",
  "assetId": "0x6b175474e89094c44da98b954eedeac495271d0f",
  "assetSymbol": "DAI",
  "amountNative": 20000,
  "amountUSD": 20000,
  "user": "89b78cfa322f6c5de0abceecab66aee45393cc5a"
}

Withdraw

The address user is removing amountNative of assetSymbol from the protocol and therefore that amount will no longer be available as collateral for any borrowing activity the user desires to engage in.

In other words, user withdrew 0.132 UNI-V2 from the protocol.

{
  "action": "Withdraw",
  "timestamp": "2022-09-01 11:00:11 000",
  "blockNumber": 15452492,
  "transactionHash": "0xd938e150d7a188d3f9707f0fabbf6ec180e106da8eb3a5b6eac13290e72c440b",
  "logIndex": 196,
  "marketId": "0xa81598667ac561986b70ae11bbe2dd5348ed4327",
  "market": "UNIV2DAIUSDC-A",
  "assetId": "0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5",
  "assetSymbol": "UNI-V2",
  "amountNative": 0.13248175838023699,
  "amountUSD": 298426.1700000008,
  "user": "1bc9df10a0ebf0104e4b58ac3c65c3859474d3aa"
}

LiquidationCall

When liquidatee is under-collateralized for their borrowed debt, liquidator will sell amountNative of assetSymbol to cover the liquidatee's debt. Liquidators receive profit as measured by profitUSD for liquidating users' collateral.

In other words, liquidator sold 8 WBTC to cover the debt of liquidatee and received a profit of 8,248 USD.

Note, the sold asset, assetSymbol belongs to the user being liquidated i.e. liquidatee.

{
  "action": "LiquidationCall",
  "timestamp": "2022-01-22 00:00:11 000",
  "blockNumber": 14051986,
  "transactionHash": "0xbc3d79fa0dcc542e26f1fc1446bfb8711db103e9f980f29098c90f54d1e34959",
  "logIndex": 33,
  "market": "WBTC-A",
  "assetSymbol": "WBTC",
  "amountNative": 8,
  "amountUSD": 291196.8,
  "profitUSD": "8248.603083777377664592408215072",
  "liquidator": "0x008ca3a9c52e0f0d9ee94d310d20d67399d44f6c",
  "liquidatee": "0x8107f84011f42758ee4ba22ed55fe62df0caae64"
}
propertytype
liquidatorstring
liquidateestring

MakerDAO Stability Fee

You can see the Stability Fee for each asset supported by MakerDAO in Information - Assets in Lending Protocols. Use the query parameter protocol=makerdao and get the value of the property, borrowingRateStable.

Within each Borrow you'll see the Stability Fee described with the properties borrowRate and borrowRateMode.

Language
Credentials
Header
Click Try It! to start a request and see the response here!