HTTP Webhooks allow you to receive DeFi Alerts as soon as they happen. Instead of polling the API constantly, you can receive the alerts directly on your server as soon as they happen. There are a few requirements to work with HTTP Webhooks on Xypher.
[
{
"protocol": "curve", // str() protocol in lowercase
"internal_id": "Curve_TokenExchange_0x8b3e96", // str() internal id we use to identify events
"level": 1, // int() level filtering (check docs for level filtering)
"hash": "0x4297bd2523853cdaf79d16a02e1be56237eda58034137eaa9ab5f1d3e02d2a03", // str() hash where the event was found"network": "Ethereum", // str() EVM network"sender": "0x0000000000000000000000000000000000000000", // str() address who initiated the transaction
"receiver": "0x0000000000000000000000000000000000000000, // str() address who received the transaction
"tokens": [ // a list of every token found in the event,
{
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18,
"id": "token0" // unique identifier (for this event only)
},
{
"address": "0xb26C4B3Ca601136Daf98593feAeff9E0CA702a8D",
"name": "Aladdin Token",
"symbol": "ALD",
"decimals": 18,
"id": "token1" // unique identifier (for this event only)
}
],
"amounts": [ // important amounts found in the event // human: str() amount in human-readable format. We output this to alerts // raw: int() raw amount. Can be used with their respective ID from the tokens list // id: str() unique identifier (for this event only)
{
"human": "2.00",
"raw": 2000000000000000000,
"id": "token0_amount"
},
{
"human": "53.89 K",
"raw": 5.388544565048564574574e+22,
"id": "token1_amount"
}
],
"addresses": { // list of addresses found in the event. Every msg is from the point of view of the address // address: str() checksummed ethereum address // id: str() unique identifier (for this type of event only) // filter: str() correlates the amounts list to a message
"0x58BD13974D76FCEc0F7d7C31f725CeD41c9C4287": {
"id": "sender",
"msg": "Trade 2.00 WETH for 53.89 K ALD on Curve"
},
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2": {
"id": "token0",
"msg": "0x58BD13 traded 2.00 WETH for 53.89 K ALD on Curve",
"filter": "token0_amount"
},
"0xb26C4B3Ca601136Daf98593feAeff9E0CA702a8D": {
"id": "token1",
"msg": "0x58BD13 traded 2.00 WETH for 53.89 K ALD on Curve",
"filter": "token1_amount"
},
"0xBDFAe7D2cF2E69E27b75a5287ECD3808F62B5a76": {
"id": "pool",
"msg": "0x58BD13 traded 2.00 WETH for 53.89 K ALD on Curve"
}
}
}
]