Stabilize protocol operates using a decentralized network of executors to interact with the strategy contract when arbitrage opportunities present themselves. These Executors are pivotal within the ecosystem of Stabilize, since they ensure a decentralized and redundant execution of trades.
In theory yes, anyone can "execute" the smart contract function executeSwapTokens to make the transaction happen, also manually. If the trade is not profitable it will not be executed, the strategies can`t loose due to Executors doing it "wrong" . Executors are getting a fair reward for executing the transaction.
The easiest way to start is to develop an off-chain bot that monitors the strategy continuously. You can also use services like Keeper for this purpose. This bot would query the expectedProfit function which returns wei units (10¹⁸ wei = 1 USD / BTC), calculate its own expected profit (10% of the expected profit) then calculate the gas cost based on current gas prices. If the profit is greater than the gas costs, the bot would create a transaction to executeSwapTokens with its own address as the parameter to receive its percent of profit. The bot may also set a minimum seconds since the last trade to limit its gas cost in case someone else beats it to the trade.
Ideally, the executor will make continuous profit, trading depositors funds at the right times and depositors will make the best compound interest possible as their funds are traded at the most profitable times. It is important to note that the contract itself doesn’t allow for trading at a loss.
Trade executors can earn a certain profit cut off each trade by timing the trade at the right time (depending on the strategy the % differs) . The expectedProfit (bool inWETHForExecutor) function includes a boolean that allows executors to see their WETH profit from the next prospective trade, instead of total profit (in tokens) for the trade.