Building a connector for Veridex Connector, a 0x Relayer

Hi, I am creating a connector for Veridex, an 0x based relayer. Following advice from Joshua from Bamboo Relay, I copy cat all the endpoints from Radar Relay and implemented on Veridex. I add this repo with commits replacing radar with veridex. https://github.com/JoaoCampos89/hummingbot/tree/feature/add-veridex-conector. Which steps do I need to follow to test it and try to merge it?

Hi @joaocampos,

Please review the requirements here: https://docs.hummingbot.io/developers/connectors/#requirements-for-community-developed-connectors

Typically we suggest building out the modules of the connector in this sequence:

  1. Data Source & Orderbook Tracker
  2. Active Order Tracker & User stream tracker(if applicable)
  3. Market Connector itself

What functionality have you implemented and been able to successfully test?

And what are the errors you’re running into?

At the moment I can compile the bot and running the configs, where it detects the veridex market maker. However now I getting this error when running the bot:

My changes I applied to the code base:

duplicate connector radar relay in hummingbot.market folder:

  • replace radar_relay to target veridex
  • replace RadarRelay to target Veridex

under hummingbot.core.data_type

  • create a VeridexOrderBookMessage class from RadarRelayOrderBookMessage for Veridex in order_book_message.py
  • create a VeridexOrderBookTrackerEntry class from RadarRelayOrderBookTrackerEntry for Veridex in order_book_tracker_entry.py

under hummingbot.client

in settings.py

  • add veridex on Exchangers and DEXES
  • Example pairs with “veridex”: “VSF-WETH”,
  • example assets: “veridex”: “VSF”,

in hummingbot_application.py

  • add Market Classes
  • add market_name like radar_relay in initialize markets

The error was gone when add the market_name in humming bot application,
now the current screen is this one:

Hi @joaocampos ,

Looking at your changes, it does not seem sufficient for a new connector. You would be required to examine the responses from the relevant API endpoints and modifying the Data Source, OrderBookTracker and other components accordingly.

Additionally, I would not recommend that you use the client to test your integration. I would suggest that you write your own Unit Tests to test each component. You can use it to debug functions and it would really help with implementing your own connectors into Hummingbot.

My Api is the same as Radar Relay, so the behaviour is to be the same as Radar Relay. And even the tests are equal I made are equal.

These are the implemented classes:

under https://github.com/JoaoCampos89/hummingbot/tree/feature/add-veridex-conector/hummingbot/market/veridex

VeridexActiveOrderTracker
VeridexAPIOrderBookDataSource
VeridexInFlightOrder
VeridexTransactionTracker
VeridexOrderBook
VeridexOrderBookTracker

There are more class’s to implement? Besides these ones?

Hi @joaocampos

I am not specifically talking about the classes. Rather I was talking about the implementation of the certain classes.

i.e.
In VeridexAPIOrderBookDataSource in the get_active_exchange_market() function:

async with client.get(f"{MARKETS_URL}?include=ticker,stats") as response:

This does not return the same response as that of Radar Relay. So you would have to modify the function accordingly to obtain the necessary variables.
In this case, you would have make an additional query to this endpoint(https://veridex.herokuapp.com/v2/0x/markets/{marketId}/stats) to obtain the volume24Hour value that is necessary to calculate the USDVolume

Got it, I will go through all classes and check the responses and compare with Radar Relay response. I will prefer to change my api instead of hummingbot implementation. That way I will be on sync with hummingbot upgrades to radar relay connector. I will work on this and reply here when get the tests running good.

I get all my units running OK on my localhost. The units test are the same used by Radar Relay. Which are now the next steps I need to test? Run the client?