While this has been mentioned while discussing other ideas on how to address the front running bot, I wanted to have a single place where we could present and push through the deploy & signal idea.
This has pretty consistent support from what I’ve seen. The concept is that as a subgraph developer or a DApp is publishing their subgraph, within the same transaction they can also signal to their subgraph (GNS).
From a developer position the benefits of this are:
-
It assists helps indexers immediately see that there is something to sync.
-
By maintaining a self-signal, your subgraph is never at risk of having 0 signal and being dropped by all indexers
-
You stand to earn a portion of your query fees back
-
If your subgraph produces query traffic others will signal and your share value will increase.
From a curator perspective:
-
The developer who made and published the subgraph likely deserves the 1:1 position.
-
A DApp is the least likely person to unsignal since they benefit the most of having a secure subgraph. In other words, if someone is going to signal before me they are the safest for me to signal after.
From a Graph development position
- Since this utilizes two functions that are already built (mintNSignal and publishNewSubgraph) coding this should be much faster compared to other solutions that have been discussed.
While others address additional pain points, this one specifically addresses the front running bot.
The bots behavior:
Scanning a transaction that came from the bot we can see how it currently operates:
Specifically the below line we can see that he has a slippage parameter so that if his 3,500 transaction does not mint 55 shares, the transaction fails.
(delegate) GraphProxy[GNS.mintNSignal](_graphAccount=0xde910777c787903f78c89e7a0bf7f4c435cbb1fe, _subgraphNumber=1, _tokensIn=3500000000000000000000, _nSignalOutMin=55000000000000000000) => ()
This primarily occurs when gas is volatile. After setting his transaction, if another comes in with higher gas before his transaction is confirmed the bot’s transaction will no longer mint 55 shares and thus will not take a position on this subgraph (as occured with sushi mainnet exchange).
With deploy & signal, the bot will be prevented from entering anything that self signals more than 17 GRT with his current parameters. While there is still room for minor exploits the reason why this is the best initial defense is as the bot opens up his slippage tolerance, it can be exploited. Or it can be happy with the funds that it managed to gather thus far and look for a new project to attempt to exploit.