Skip to content

UMAprotocol/subgraphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UMA related subgraphs

Install dependencies

yarn

Running Tests

This repository uses Matchstick for subgraph testing.

Prerequisites

  • PostgreSQL 14 must be installed and running on your machine. Matchstick requires this for its testing environment.

Running the tests

Tests are available for select packages and can be run using the following commands:

# Run tests for all packages with test suites
yarn test

# Run tests in parallel (faster)
yarn test:parallel

# Run full CI pipeline (prepare and test)
yarn ci

The yarn test command runs tests for the following packages (when available):

  • managed-optimistic-oracle-v2-subgraph
  • optimistic-oracle-subgraph
  • optimistic-oracle-v2-subgraph
  • optimistic-oracle-v3-subgraph
  • skinny-optimistic-oracle-subgraph
  • votingV2-subgraph

To run tests for a specific package, navigate to the package directory and run yarn test or graph test directly.

Voting V1 Events

This subgraph indexes events emitted by the core Oracle contracts. The code can be found in packages/voting

Skinny Optimistic Oracle Events

This subgraph indexes events emitted by the "Skinny Optimistic Oracle" contracts. The code can be found in packages/skinny-optimistic-oracle

Optimistic Oracle Events

This subgraph indexes events emitted by the "Optimistic Oracle" contracts. The code can be found in packages/optimistic-oracle

Optimistic Oracle V2 Events and Calls

This subgraph indexes events and function calls by the "Optimistic Oracle V2" contracts. The code can be found in packages/optimistic-oracle-v2

Note: L2 chains does not support callHandlers. This means we cannot use callHandlers to index the setBond, setCustomLiveness, and setEventBased function calls. These properties are also not available via events. Our compromise here is that in the case of L2 chains, we read this data from the contract state in the event handler instead. This workaround works when setCustomLiveness and setEventBased are called in the same transaction as requestPrice. So it doesn't work for all cases. Ideally we should have callHandlers in the chains that support this. We therefore must also remove the call handlers from the subgraph.yaml file for Polygon. See scripts/remove-call-handlers.js for implementation.

Managed Optimistic Oracle V2 Events and Calls

This subgraph indexes events and function calls by the "Managed Optimistic Oracle V2" contracts. We reuse the code from packages/optimistic-oracle-v2 because the events emitted are the same.

Financial Contract Events

This subgraph indexes events emitted by the ExpiringMultiParty and Perpetual contracts. The code can be found in packages/financial-contracts

Token Events

This subgraph indexes events emitted by the UMA voting token contracts. The code can be found in packages/token

Voting V2 Events

This subgraph indexes events emitted by the core Oracle contracts. The code can be found in packages/votingV2

Optimistic Oracle V3 Events

This subgraph indexes events emitted by the "Optimistic Oracle V3" contracts. The code can be found in packages/optimistic-oracle-v3

Optimistic Governor Events

This subgraph indexes events emitted by all the Optimistic Governor deployments.

Resources

About

Monorepo for all subgraphs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8