Protocol Integration
Integration Process
To integrate with Tycho, you need to provide 3 components:
Indexing: Provide access to the protocol state that the simulation needs.
Simulation: Provides simulations of the protocols logic.
Execution: Define how to encode and execute swaps against your protocol.
Indexing
Provide a substreams package that emits a specified set of messages. If your protocol already has a substreams package, you can adjust it to emit the required messages.
Simulation
Tycho currently exposes two integration modes to specify the protocols' underlying logic:
VM Integration: This integration type requires implementing an adapter interface in any language that compiles to the respective VM byte code. This SDK provides the interface only in Solidity. Read more here.
Native Rust Integration: Implement a Rust trait that describes the protocol logic.
Execution
To enable solvers to execute swaps over your protocol, you need to implement two components:
SwapEncoder: A Rust struct that formats input/output tokens, pool addresses, and other parameters correctly for the
Executor
contract.Executor: A Solidity contract that handles the execution of swaps over your protocol's liquidity pools.
Last updated