Skip to content

Commit

Permalink
Maker show only active triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
piekczyk committed Sep 25, 2024
1 parent 760c500 commit fdbc64a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion features/automation/api/automationTriggersData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ async function loadTriggerDataFromSubgraph({
},
})) as SubgraphsResponses['Discover']['getMakerTriggersOld']

const triggers = response.cdps[0].triggers
// get only active triggers
const triggers = response.cdps[0].triggers.filter(
(trigger) => !trigger.removedBlock && !trigger.executedBlock,
)

return {
isAutomationDataLoaded: true,
Expand Down
2 changes: 2 additions & 0 deletions features/subgraphLoader/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,8 @@ export const subgraphMethodsRecord: SubgraphMethodsRecord = {
id
commandAddress
triggerData
removedBlock
executedBlock
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions handlers/portfolio/positions/handlers/maker/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export interface MakerTriggersOldResponse {
id: number
commandAddress: string
triggerData: string
removedBlock: string
executedBlock: string
}[]
}[]
}

0 comments on commit fdbc64a

Please sign in to comment.