Files
tycho-protocol-sdk/testing/tycho-client
Florian Pellissier ec435d6094 refactor: Several testing SDK improvements such as:
fix db reset, use latest wheel, print trace in case of failure and add logic to pull stateless contracts
2024-07-25 15:02:57 +02:00
..

Tycho Adapter

This repository contains the Tycho Adapter, a tool that allows you to interact with the Tycho API.

Installation

Prerequisites

  • Python 3.9

Install with pip

# Create conda environment
conda create -n tycho pip python=3.9
# Activate environment
conda activate tycho
# Install packages
pip install -r requirements.txt

Usage

from tycho_client.decoders import ThirdPartyPoolTychoDecoder
from tycho_client.models import Blockchain
from tycho_client.tycho_adapter import TychoPoolStateStreamAdapter

decoder = ThirdPartyPoolTychoDecoder(
    "MyProtocolSwapAdapter.evm.runtime", minimum_gas=0, hard_limit=False
)
stream_adapter = TychoPoolStateStreamAdapter(
    tycho_url="0.0.0.0:4242",
    protocol="my_protocol",
    decoder=decoder,
    blockchain=Blockchain.ethereum,
)