Why $RULES
By: Cyotee Doge
Tags: Ethereum, Oracle, Cryptocurrency, Chain Link, Rules Engine

Business processes have become exceedingly more complex over time. More decisions to make. And those decisions get more complex even faster then they grow in number. This is why many enterprises are adopting rules engines and business process management systems to streamline and automate these decision making processes.

Companies like Visa, Mastercard, and Prudential have adopted business process automation and rules engines to drastically increase the efficiency and resolution time of process like credit evaluation, loan underwriting, and trade evaluation and execution. By automating these process, human resources can be more effectively leveraged. This can include validating data, correlating data submitted with data retrieved from external sources, and finding data based on submitted conditions. This sort of automation can be hard to envision in the abstract, so let’s look at some use cases.

Let’s say a user is seeking arbitrage opportunities. They hold a currency, like USDT, and want to trade it for another currency with a good exchange rate compared to other exchange rates. This sort of search can take a long time, meaning they might miss the opportunity. Even if they can find an opportunity, what is the market trend for that other currency? Is it of sufficient volume that if they buy they’ll be able to sell it quickly? Is there a similarly good exchange rate one another exchange back to USDT to realize that profit immediately? With so manner factors to consider, it’s very hard to find a opportunity, and take advantage of it. But with a rules engine able to retrieve market data several data points can be compared to find the be the best arbitrage opportunity. A user could submit a request to find arbitrage opportunities from USDT to any currency that meets the following conditions.

Traded on a compatible exchange with their currency.

Trading on an exchange within a jurisdiction where it is legal for them to trade.

Sufficient trading volume to trade quickly.

Arbitrage of a significant differential to offset the trading fees.

That the currency has been audited for security, and is not reported on Phishfront.

That the exchange has sufficient liquidity to process the trade without excessive slippage.

That the currency is covered by investment insurance.

And that the trade can be leveraged through a flash loan to maximize profits.

Let’s consider another scenario that’s a bit more esoteric. What if you wanted to take advantage of the rebase functionality of elastic finance tokens. If you could set a query on a schedule to right before the rebase, and provide funds that could be used to trade. A rules engine could execute that query on schedule to check the data point used to calculate the rebase. If it finds the data shows the rebase will be positive, increasing the supply, then it could calculate what the change is likely to be based on market trends. If the average transaction time would allow the trade to be executed before the rebase, and the transaction fee is low enough to still profit from the rebase, then the engine could execute the trade from your deposited currency, to the elastic currency, wait until after the rebase, then trade back to your preferred currency.

These capabilities could even be run continuously, provided a continuous stream of new data can be provided. So consider that you have funds deposited in the profitable new defi protocol. But it hasn’t been audited and the team is new, with no reputation. So you’d like some coverage. But it’s so new, there’s no coverage listing available. If you were willing to pay for the continual processing of data, a rules engine could watch for a large sell, or a withdrawal of liquidity in the pending transactions, and try to front-run the dump or rug pull. It may not succeed, hard to get such a move right. But if you had enough money on the line, it might be profitable to try.

And this is just a modest list of the amount of data a rules engine can process. Typically rules engines are used to evaluate hundreds, or thousands of data points to consider. So long as the intent can be broken down into a set of conditional checks, and sufficient data can be provided to effectively make a decision, then almost anything can be can be evaluated. The only limitation being the more data that needs to be processed, and the fresher the data needs to be, the longer the evaluation will take. Typically several hundred data points can be evaluated in only a few milliseconds. And good data design to facilitate rapid retrieval of relevant data.

Now imagine this was available through an oracle for on-chain transactions. Defi protocols could maximize profits by checking for arbitrage opportunities during deposits and withdrawals. You stake your DAI for that sweet APY, and the protocol makes a quick check during the transaction to see if there’s a way to maximize that DAI before settling your deposit. There might not be a chance, but if there is, you profited just by depositing. Same with withdrawals, or any transaction.

As you can see, the gas limit is restricting the possibilities of what defi can do. Smart money can’t be as smart as it could. $RULES can give contracts galaxy brain 300 IQ capabilities by oraclizing the data processing technology used to maximize traditional finance for years.