Message Formats

Webhook message properties and data models.

Receiving Webhooks

Webhooks are sent via HTTP, and a 2xx response is expected with 3 seconds, otherwise we will retry sending the message later. If you are successfully receiving the message but not responding within 3 seconds, this can result in repeated messages.

We will also retry sending messages up to 5 times before giving up. Periods between retries will gradually increase. If your service is down for too long though you may miss some messages.


Message Properties

NameTypeDescription
typeWebhookPublisherMessageTypeThe type of message
deduplicationIdStringA unique id for the message so that you can avoid reprocessing the same message if for some horrible reason we send it more than once
webhookIdStringThe unique id of the webhook
groupIdStringEither the groupId of the webhook (if one was supplied), or the webhookId
hashStringA SHA256 hash of the webhook's securityToken and the message's deduplicationId.
dataWebhookPublisherDataModels

Webhook Publisher Message Type

enum {
  PRICE_EVENT,
  DECODED_LOG,
  DECODED_CALL,
}

Webhook Publisher Data Models

Price Event

NameTypeDescription
idStringThe id of the token (address:networkId)
priceUsdStringThe price of the token in USD
weightedMeanPriceUSDStringI don't know
addressStringThe contract address of the token
networkIdIntThe id of the network the token is on
timestampIntThe timestamp of when the price was calculated
blockNumberIntThe blocknumber of when the price was calculated
absoluteDeviationFloatI don't know
deviationsFromMeanFloatI don't know
derivedSwapPriceStringI don't know
targetTokenAddressStringI don't know

Example

{
   "type":"PRICE_EVENT",
   "deduplicationId":"43b7b2a6-10b4-4a96-86ff-3c8f12854187-0xf4d2888d29d722226fafa5d9b24f9164c092421e:1-0000000016636917#00000008#00000042",
   "webhookId":"43b7b2a6-10b4-4a96-86ff-3c8f12854187",
   "groupId":"43b7b2a6-10b4-4a96-86ff-3c8f12854187",
   "hash":"1b7753a1220e3a73cb9ad80fe2995417391bbbdf5afdc2c20e8d09e1525b5a77",
   "data":{
      "id":"0xf4d2888d29d722226fafa5d9b24f9164c092421e:1",
      "priceUsd":"0.2947524293192561",
      "weightedMeanPriceUSD":"0.29591661415754684237638544437518137913573321397384173430977975687571741224486479663626573953609440257289752764081859",
      "address":"0xf4d2888d29d722226fafa5d9b24f9164c092421e",
      "networkId":1,
      "timestamp":1676497655,
      "blockNumber":16636917,
      "absoluteDeviation":0.0011641848382907423,
      "deviationsFromMean":3.1257552985434662,
      "derivedSwapPrice":"0.2943200371838018",
      "targetTokenAddress":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
   }
}

Decoded Log

NameTypeDescription
hashKeyString
decodingIdStringThe id of the ContractDecoding
projectNameStringThe name of the project
contractNameStringThe name of the contract
contractAddressStringOptional address of the contract
eventNameStringThe name of the event emitted
logIndexInt
transactionIndexInt
blockNumberInt
networkIdIntThe id of the network
expiryInt
addressStringThe address of the contract that emitted the log
blockTimestampInt
transactionHashString
eventString

Example

{
   "type":"DECODED_LOG",
   "deduplicationId":"469923e6-feb5-43c6-a6b9-519f55502700-uniswapv3_1_pool_Swap-0000000016650398#00000401#00000627",
   "webhookId":"469923e6-feb5-43c6-a6b9-519f55502700",
   "groupId":"uniswap",
   "hash":"1b7753a1220e3a73cb9ad80fe2995417391bbbdf5afdc2c20e8d09e1525b5a77",
   "data":{
      "hashKey":"uniswapv3_1_pool_Swap",
      "decodingId":"uniswapv3:pool:1",
      "projectName":"uniswapv3",
      "contractName":"pool",
      "eventName":"Swap",
      "logIndex":627,
      "transactionIndex":401,
      "blockNumber":16650398,
      "networkId":1,
      "expiry":1681844879,
      "address":"0x824a30f2984f9013f2c8d0a29c0a3cc5fd5c0673",
      "blockTimestamp":1676660879,
      "transactionHash":"0x884bcdbfe9f91889bb55fdf34f66be0e5659b03567a3791ee527b962c8ea45d7",
      "event":{
         "sender":"0xEf1c6E67703c7BD7107eed8303Fbe6EC2554BF6B",
         "recipient":"0xEf1c6E67703c7BD7107eed8303Fbe6EC2554BF6B",
         "amount0":"957113775275568559787",
         "amount1":"-552812869680136073",
         "sqrtPriceX96":"1906926222104804491428102571",
         "liquidity":"923094255107221455066689",
         "tick":"-74541"
      }
   }
}

Decoded Call

NameTypeDescription
hashKeyString
decodingIdStringThe id of the ContractDecoding
projectNameStringThe name of the project
contractNameStringThe name of the contract
contractAddressStringOptional address of the contract
methodNameStringThe name of the method that was called
transactionIndexInt
blockNumberInt
networkIdIntThe id of the network
expiryInt
blockTimestampInt
transactionHashString
inputString
outputString
traceAddressString
traceTypeInt
traceIndexInt
fromString
toString
methodIdString
successBoolean

Example

{
   "type":"DECODED_CALL",
   "deduplicationId":"309e11ee-0707-4072-b3a2-b62983109d77-uniswapv3_1_pool_mint-0000#0000000016644137#00000233#000000000000000000000000000000000674",
   "webhookId":"309e11ee-0707-4072-b3a2-b62983109d77",
   "groupId":"uniswap",
   "hash":"1b7753a1220e3a73cb9ad80fe2995417391bbbdf5afdc2c20e8d09e1525b5a77",
   "data":{
      "hashKey":"uniswapv3_1_pool_mint",
      "decodingId":"uniswapv3:pool:1",
      "projectName":"uniswapv3",
      "contractName":"pool",
      "methodName":"mint",
      "transactionIndex":233,
      "blockNumber":16644137,
      "networkId":1,
      "expiry":1681768835,
      "blockTimestamp":1676584835,
      "transactionHash":"0x989a37cad0bf5e3365a5d8dbf1967803a51f4961694eea0e2b68a9ad136696d1",
      "input":{
         "recipient":"0xC36442b4a4522E871399CD717aBDD847Ab11FE88",
         "tickLower":"-162200",
         "tickUpper":"-151000",
         "amount":"15328000950",
         "data":"0x0000000000000000000000002b591e99afe9f32eaa6214f7b7629768c40eeb39000000000000000000000000b5588c411ba0bb7d38865fdc51d082d004e519f70000000000000000000000000000000000000000000000000000000000002710000000000000000000000000971965f8981910763a8984204fd2249c04b4202d"
      },
      "output":{
         "amount0":"6430242443047",
         "amount1":"2000000"
      },
      "traceAddress":"1",
      "traceType":0,
      "traceIndex":674,
      "from":"0xc36442b4a4522e871399cd717abdd847ab11fe88",
      "to":"0xb595b590c504ae6bfd9ce9aaf1189881c6fc24e5",
      "methodId":"0x3c8a7d8d",
      "success":true
   }
}

Raw Call Trace

NameTypeDescription
actionRawCallTraceAction
blockHashstring
errorstring
blockNumbernumber
networkIdnumber
resultRawCallResult
subtracesnumber
traceAddressnumber[]
transactionHashstring
transactionPositionnumber
traceIndexnumberOptional
typestring

Raw Call Trace Action

NameTypeDescription
fromstring
callTypestring
gasstring
inputstring
tostring
valuestring
rewardTypestringOptional

Raw Call Result

NameTypeDescription
addressstringOptional
gasUsedstring
outputstring
codestringOptional

Example

{
   "type":"RAW_CALL_TRACE",
   "deduplicationId":"309e11ee-0707-4072-b3a2-b62983109d77-uniswapv3_1_pool_mint-0000#0000000016644137#00000233#000000000000000000000000000000000674",
   "webhookId":"309e11ee-0707-4072-b3a2-b62983109d77",
   "groupId":"uniswap",
   "hash":"1b7753a1220e3a73cb9ad80fe2995417391bbbdf5afdc2c20e8d09e1525b5a77",
   "data":{
      "action": {
         "from":"0xb2dccfe4d52dd067ecb8ee6d02f094e32ee5c3bd",
         "gas":"0x3ba742",
         "init":"0x60c0604052620000126012600a6200050e565",
      },
      "blockHash":
        "0x4c99bda3f74ef83c66ff980c75a6783d8f23ddad60c4feae260a396bc12663e3",
      "blockNumber": 16737240,
      "result": {
        "address": "0x5f927395213ee6b95de97bddcb1b2b1c0f16844f",
        "gasUsed": "0x2384fb",
        "code": "0000d28382620005e5565b506005620000e18282620005e5565b50620000ee9150506012905",
      },
      "networkId": 1,
      "subtraces": 0,
      "traceAddress": [2, 0],
      "transactionHash":
        "0xa4f1da4fdcc7831840e3a04452bdd3a18ad5284c7a394626a70010acb7322dc6",
      "transactionPosition": 22,
      "traceIndex": 320,
      "type": "create",
   }
}