rainlanguage / arb-bot

NodeJS app that finds arbitrage trades for Rain orderbook orders against major DeFi platforms liquidity
5 stars 4 forks source link

update to newest subgraph schema with multi orderbook capability #146

Open rouzwelt opened 3 weeks ago

rouzwelt commented 3 weeks ago

update the bot to be able to use newest subgraph schema which has orderbook entity and is able to index multiple orderbooks, indexing orders of each orderbook.

for acheiving the above, query the orders entity and then get orders with the underlying orderbook and process them, this also allows to apply a filter on orderbook by providing an address from cli which we already have that option, so the cli API wont change. some other minor changes will be needed to handle the returned value from the subgraph query.

the major required update for this feature is to have Arb contract that can also support many order books, ie the orderbook should not be a constructor arg for the Arb contract but rather be an arg that can be passed to arb() method when calling it, or another approach can be to be able to add array of orderbook addresses as an admin action, this is ofc some suggestions, but the main point here is that current Arb contract format is not really compatible with multiorderbook subgraph format, at least from bot's perspective.

hardyjosh commented 2 weeks ago

@thedavidmeister assigning this to you until you can weigh in on whether we need a new arb contract

hardyjosh commented 2 weeks ago

We will need arb contract changes, however this is deprioritised for now. When we have multiple obs on one network we can make the arb contract changes and prioritise this issue.