Summary

The Synthetix V3 API project is designed to create a canonical data analytics API that serves as the single source of truth for the Synthetix ecosystem, addressing the need for reliable, up-to-date information in the face of evolving smart contracts. By incorporating and expanding upon the existing Infinex Perps V3 API, the project will provide a comprehensive suite of open-source endpoints for perps, markets, and pools data. This initiative, spearheaded by the Treasury Council and executed with the technical expertise of the Gateway team, aims to ensure long-term maintenance, backward compatibility, and to facilitate the development of community-driven tools and services, enhancing the overall Synthetix trading experience.

Requirement

  1. Unified Data Access: The API must offer a unified interface for accessing real-time and historical data related to Synthetix V3, including perps, markets, and pools. This ensures consistency and reliability in data retrieval for community and developer use.
  2. Maintenance and Compatibility: The system should be maintained to reflect the latest updates to Synthetix smart contracts, ensuring backward compatibility for users and developers who have built on top of the existing API.
  3. Open Source with Ownership: While the API should remain open source to allow for community contributions and forks, there must be clear ownership to guarantee long-term maintenance and to prevent the data from becoming outdated.
  4. Comprehensive Endpoint Coverage: The API should include all endpoints developed for the Infinex Perps V3 API, as well as additional endpoints for pools, deposits, delegations, mints, rewards, and liquidations as specified by the Treasury Council.
  5. Performance and Reliability: The system must be optimized for high performance and reliability, ensuring fast response times even under high-load scenarios, which is critical for analytics and trading operations.
  6. Scalable Infrastructure: The backend should be built on scalable infrastructure to accommodate growth in Synthetix usage and the subsequent increase in data requests and analytics processing.
  7. Data Accuracy and Verification: The API must implement mechanisms to verify the accuracy of the data, especially when smart contract upgrades occur, to maintain the integrity of the 'source of truth'.

Technical Stack

  1. Blockchain: The Base blockchain will be the platform where the PerpsV3 contracts are deployed. The system will interact with these contracts for trading functions and to access trade events.
  2. ScyllaDB: ScyllaDB, a high-performance NoSQL database, will be used to store and query historical data. It's well-suited for handling large amounts of data and providing high availability.
  3. PostgreSQL: PostgreSQL, a powerful, open-source object-relational database system, will be used to store other data that doesn't require the high write and read loads that ScyllaDB can handle.
  4. Go: Go will be the main programming language for the project. It's efficient, easy to work with, and has strong support for concurrent programming, making it a good fit for a high-performance trading API.
  5. Ethereum-Go: Ethereum-Go (go-ethereum) will be used as the Ethereum client. It provides a robust and efficient interface to the Ethereum network and can interact with smart contracts on the Ethereum blockchain.
  6. Swagger: Swagger will be used to design the API and generate backend code. This will help ensure that the API is well-documented and consistent.
  7. Go-Swagger: Go-Swagger will be used for the API-gateway microservice. It's a powerful tool for building APIs in Go using Swagger, and can generate server and client code from Swagger 2.0 specifications.