Spectra is the ultimate marketplace for yield derivatives and the first protocol for future yield tokenisation.
This subgraph can be found on The Graph Hosted Service for the following networks:
You can also run this subgraph locally, if you wish. Instructions for that can be found in The Graph Documentation.
- Foundry, along with
anvil
(included) - The IPFS CLI
- A running instance of Postgres
- The quickest way to get this up and running is through the official Docker image (
docker run -it --rm --network some-network postgres psql -h some-postgres -U postgres
).
- The quickest way to get this up and running is through the official Docker image (
- The cargo Rust package manager
- The Graph CLI
yarn
- Mainnet
yarn generate-config
- other supported networks
yarn generate-config:<NETWORK>
This step will load all contract ABIs used by our subgraph and generate the corresponding TypeScript interfaces.
yarn codegen
To deploy and run test scenarios on the locally running blockchain:
anvil --timestamp 100
ipfs init
ipfs daemon
createdb db_subgraph
git clone https://github.com/graphprotocol/graph-node/
RUST_BACKTRACE=1 cargo run -p graph-node --release -- \
--postgres-url postgresql://<USER>:@localhost:5432/db_subgraph \
--ethereum-rpc mainnet:http://127.0.0.1:8545 \
--ipfs 127.0.0.1:5001 \
--debug
yarn generate-config:local
yarn create:local
yarn deploy:local
npm i
forge test --fork-url http://localhost:8545
http://127.0.0.1:8000/subgraphs/name/perspectivefi/spectra-mainnet/graphql
- Mainnet
yarn generate-config
- other supported networks
generate-config:<NETWORK>
yarn codegen
yarn create
graph auth https://api.thegraph.com/deploy/ <ACCESS_TOKEN>
- Mainnet
yarn deploy
- other network
yarn deploy:<NETWORK>
Graph definition written in PlantUML framework - schema.puml
Coming soon