Event signature · Lending

Liquidate (Morpho Blue) event signature and topic0

The topic0 of the Liquidate (Morpho Blue) event is 0xa4946ede45d0c6f06a0f5ce92c9ad3b4751452d2fe0e25010783bcab57a67e41, the keccak-256 hash of Liquidate(bytes32,address,address,uint256,uint256,uint256,uint256,uint256); 3 of its 8 arguments are indexed. Position liquidated on a Morpho Blue market.

Anatomy of a Liquidate (Morpho Blue) log

Topics

  • topic00xa4946ede45d0c6f06a0f5ce92c9ad3b4751452d2fe0e25010783bcab57a67e41keccak256("Liquidate(bytes32,address,address,uint256,uint256,uint256,uint256,uint256)")
  • topic1id (bytes32)indexed: filterable
  • topic2caller (address)indexed: filterable
  • topic3borrower (address)indexed: filterable

Data

  • datarepaidAssets (uint256), repaidShares (uint256), seizedAssets (uint256), badDebtAssets (uint256), badDebtShares (uint256)ABI-encoded, decoded with the ABI
Parameters

Arguments and where they sit in the log

Indexed arguments travel as topics and can be filtered cheaply; the others are ABI-encoded together in the data.

NameTypeIn the log
idbytes32topic1
calleraddresstopic2
borroweraddresstopic3
repaidAssetsuint256data
repaidSharesuint256data
seizedAssetsuint256data
badDebtAssetsuint256data
badDebtSharesuint256data

Solidity declaration

event Liquidate(bytes32 indexed id, address indexed caller, address indexed borrower, uint256 repaidAssets, uint256 repaidShares, uint256 seizedAssets, uint256 badDebtAssets, uint256 badDebtShares);

Canonical signature

Liquidate(bytes32,address,address,uint256,uint256,uint256,uint256,uint256)

topic0

0xa4946ede45d0c6f06a0f5ce92c9ad3b4751452d2fe0e25010783bcab57a67e41

Ready-made alerts

Get an alert on Liquidate

Each rule opens with the contract and the conditions filled in. Sign in, pick your chat and click Create.

Who emits it

Contracts we list that emit Liquidate

Any other contract with the same signature emits a log with the same topic0.

Code

Read Liquidate logs in code

The same filter in viem, ethers and plain JSON-RPC, and the Solidity that emits it. The address is Morpho Blue, a contract we list that emits it.

viem
import { createPublicClient, http, parseAbiItem } from "viem"
import { mainnet } from "viem/chains"

const client = createPublicClient({ chain: mainnet, transport: http() })

const logs = await client.getLogs({
  address: "0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb",
  event: parseAbiItem("event Liquidate(bytes32 indexed id, address indexed caller, address indexed borrower, uint256 repaidAssets, uint256 repaidShares, uint256 seizedAssets, uint256 badDebtAssets, uint256 badDebtShares)"),
  fromBlock: "latest",
})

for (const log of logs) console.log(log.args) // { id, caller, borrower, repaidAssets, repaidShares, seizedAssets, badDebtAssets, badDebtShares }
ethers v6
import { Interface, JsonRpcProvider } from "ethers"

const provider = new JsonRpcProvider(process.env.RPC_URL)
const iface = new Interface(["event Liquidate(bytes32 indexed id, address indexed caller, address indexed borrower, uint256 repaidAssets, uint256 repaidShares, uint256 seizedAssets, uint256 badDebtAssets, uint256 badDebtShares)"])

const logs = await provider.getLogs({
  address: "0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb",
  topics: [iface.getEvent("Liquidate")!.topicHash],
})

for (const log of logs) console.log(iface.parseLog(log)?.args)
JSON-RPC (eth_getLogs)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getLogs",
  "params": [
    {
      "address": "0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb",
      "topics": [
        "0xa4946ede45d0c6f06a0f5ce92c9ad3b4751452d2fe0e25010783bcab57a67e41"
      ],
      "fromBlock": "latest"
    }
  ]
}
Solidity
event Liquidate(bytes32 indexed id, address indexed caller, address indexed borrower, uint256 repaidAssets, uint256 repaidShares, uint256 seizedAssets, uint256 badDebtAssets, uint256 badDebtShares);

// inside a function:
emit Liquidate(id, caller, borrower, repaidAssets, repaidShares, seizedAssets, badDebtAssets, badDebtShares);
Example

An example Liquidate log, encoded and decoded

Placeholder values, not a real transaction: how each argument is stored in the topics and the data, and what decoding gives back.

Encoded (as the node returns it)
  • topic0keccak256("Liquidate(bytes32,address,address,uint256,uint256,uint256,uint256,uint256)")0xa4946ede45d0c6f06a0f5ce92c9ad3b4751452d2fe0e25010783bcab57a67e41
  • topic1id0xabababababababababababababababababababababababababababababababab
  • topic2caller0x0000000000000000000000002222222222222222222222222222222222222222
  • topic3borrower0x0000000000000000000000003333333333333333333333333333333333333333
  • data0x0000000000000000000000000000000000000000000000000000000000000fa0000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000017700000000000000000000000000000000000000000000000000000000000001b580000000000000000000000000000000000000000000000000000000000001f40
Decoded with the ABI
  • idbytes32 · indexed0xabababababababababababababababababababababababababababababababab
  • calleraddress · indexed0x2222222222222222222222222222222222222222
  • borroweraddress · indexed0x3333333333333333333333333333333333333333
  • repaidAssetsuint2564000
  • repaidSharesuint2565000
  • seizedAssetsuint2566000
  • badDebtAssetsuint2567000
  • badDebtSharesuint2568000
FAQ

Frequently asked questions

What is the topic0 of the Liquidate (Morpho Blue) event?

0xa4946ede45d0c6f06a0f5ce92c9ad3b4751452d2fe0e25010783bcab57a67e41: the keccak-256 hash of Liquidate(bytes32,address,address,uint256,uint256,uint256,uint256,uint256).

Which Liquidate (Morpho Blue) arguments are indexed?

id, caller, borrower are indexed and sit in the log's topics; repaidAssets, repaidShares, seizedAssets, badDebtAssets, badDebtShares are in the data.

How do I get an alert when a contract emits Liquidate (Morpho Blue)?

Open one of the ready-made rules on this page, or add any contract and pick Liquidate (Morpho Blue) from the event list. Conditions can be set on indexed and non-indexed arguments, and each alert names the contract and links to the transaction.

Keep exploring

More event signatures and tools

Know the moment a contract emits it

The Beta plan is free: one wallet and one contract, no credit card.