Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions webhooks/queries/polymarket/track-market-events.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Track Polymarket market creation and resolution events
#
# This webhook tracks ConditionPreparation and ConditionResolution events,
# which occur when new markets are created or resolved.

{
block {
number
logs(
filter: {
addresses: [
# Conditional Tokens
"0x4d97dcd97ec945f40cf65f87097ace5ea0476045"
]
topics: [
[
# ConditionPreparation event signature
"0xab3760c3bd2bb38b5bcf54dc79802ed67338b4cf29f3054ded67ed24661e4177"
# ConditionResolution event signature
"0xb44d84d3289691f71497564b85d4233648d9dbae8cbdbb4329f301c3a0185894"
]
]
}
) {
data
topics
account {
address
}
transaction {
hash
}
}
}
}
39 changes: 39 additions & 0 deletions webhooks/queries/polymarket/track-order-filled-maker.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Track Polymarket OrderFilled events where maker matches tracked wallets
#
# We filter by maker address in the event topics.
#
# Note - You'll need to create a custom webhook variable named 'trackedWallets'
# containing padded addresses. See the TypeScript example for setup details.

query ($trackedWallets: [Bytes32!]!) {
block {
number
logs(
filter: {
addresses: [
# CTF Exchange
"0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"
# Neg Risk CTF Exchange
"0xC5d563A36AE78145C45a50134d48A1215220f80a"
]
topics: [
# OrderFilled event signature
"0xd0a08e8c493f9c94f29311604c9de1b4e8c8d4c06bd0c789af57f2d65bfec0f6"
[]
# maker address is in topic[2]
$trackedWallets
[]
]
}
) {
data
topics
account {
address
}
transaction {
hash
}
}
}
}
39 changes: 39 additions & 0 deletions webhooks/queries/polymarket/track-order-filled-taker.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Track Polymarket OrderFilled events where taker matches tracked wallets
#
# We filter by taker address in the event topics.
#
# Note - You'll need to create a custom webhook variable named 'trackedWallets'
# containing padded addresses. See the TypeScript example for setup details.

query ($trackedWallets: [Bytes32!]!) {
block {
number
logs(
filter: {
addresses: [
# CTF Exchange
"0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E"
# Neg Risk CTF Exchange
"0xC5d563A36AE78145C45a50134d48A1215220f80a"
]
topics: [
# OrderFilled event signature
"0xd0a08e8c493f9c94f29311604c9de1b4e8c8d4c06bd0c789af57f2d65bfec0f6"
[]
[]
# taker address is in topic[3]
$trackedWallets
]
}
) {
data
topics
account {
address
}
transaction {
hash
}
}
}
}
43 changes: 43 additions & 0 deletions webhooks/queries/polymarket/track-split-merge.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Track Polymarket split / merge events where stakeholder matches tracked wallets
#
# This uses the Neg Risk Adapter contract, which emits explicit PositionSplit and
# PositionsMerge events with stakeholder as an indexed field.
#
# Note - You'll need to create a custom webhook variable named 'trackedWallets'
# containing padded addresses. See the TypeScript example for setup details.

query ($trackedWallets: [Bytes32!]!) {
block {
number
logs(
filter: {
addresses: [
# Conditional Tokens
"0x4d97dcd97ec945f40cf65f87097ace5ea0476045"
# Neg Risk Adapter
"0xd91e80cf2e7be2e162c6513ced06f1dd0da35296"
]
topics: [
[
# PositionSplit(address,bytes32,uint256)
"0xbbed930dbfb7907ae2d60ddf78345610214f26419a0128df39b6cc3d9e5df9b0"
# PositionsMerge(address,bytes32,uint256)
"0xba33ac50d8894676597e6e35dc09cff59854708b642cd069d21eb9c7ca072a04"
]
# stakeholder address is in topic[1]
$trackedWallets
[]
]
}
) {
data
topics
account {
address
}
transaction {
hash
}
}
}
}
Loading