Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Developer Documentation

Welcome to the Vif Protocol developer documentation. This section covers everything you need to build applications on top of Vif.

What You'll Find Here

TypeScript SDK (vifdk)

The official TypeScript SDK for building applications on Vif:

Contract Interactions

Learn how to interact directly with the Vif smart contracts:

  • Using VifRouter - The built-in command-based router for executing trades, placing limit orders, and managing positions
  • Reading State - Query order book data, market information, and user positions using VifReader
  • Building Custom Routers - Create your own specialized routers for advanced use cases

Indexer Documentation

The Vif indexer provides efficient access to historical and current protocol data through GraphQL queries.

Getting Started

If you're new to Vif, we recommend:

  1. Understand the protocol - Start with How It Works to learn about tick trees, flash accounting, and the order book structure
  2. Use the TypeScript SDK - Most applications should use vifdk for a type-safe, high-level interface
  3. Or use VifRouter directly - For direct contract interaction, use the built-in VifRouter
  4. Read state efficiently - Use VifReader to query order book data
  5. Build advanced features - Create custom routers only when needed

Contract Addresses

Support & Resources

What's Next?

Choose your path: