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:
- Getting Started - Installation, setup, and quick start guide
- Core Classes - Token, Market, and fundamental types
- VifRouter - Building and executing transactions
- Router Actions - Available actions and parameters
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:
- Understand the protocol - Start with How It Works to learn about tick trees, flash accounting, and the order book structure
- Use the TypeScript SDK - Most applications should use vifdk for a type-safe, high-level interface
- Or use VifRouter directly - For direct contract interaction, use the built-in VifRouter
- Read state efficiently - Use VifReader to query order book data
- Build advanced features - Create custom routers only when needed
Contract Addresses
Support & Resources
- GitHub: github.com/mangrovedao/vif-core
- Discord: Join the Mangrove DAO community for developer support
- Twitter: @MangroveDAO
What's Next?
Choose your path:
- Building a TypeScript/JavaScript app? → Start with the TypeScript SDK
- Displaying order book data? → Check out Reading State
- Direct contract interaction? → Use VifRouter
- Creating a custom integration? → Learn about Building Custom Routers
- Need protocol background? → Read How the Protocol Works