AI Executor Incentive Mechanism
There are two ways for executors to receive executor rewards. One is constantly keeping the program online, while the other is through executing the requests.
When the executor program is running, it periodically invokes a ping transaction onto a ping smart contract, which will increment the number of times the executor pings. The total ping value is used as proof that the executor is online. It is also a value to calculate the total reward that an executor will receive.
An executor can claim the ping reward anytime by invoking the claim reward transaction function through Oraiscan or CLI. However, the transaction will fail if the contract does not have enough funds, and the Oraichain team will have to deposit some tokens before anyone can claim.
One note is that, at the moment, there is a maximum reward parameter for executors which is used as an upper bound for the reward one can receive. If an executor receives, for example, 5 ORAI in total due to not claiming the rewards for a long time while the maximum reward value is 4 ORAI, then that executor can only receive 4 ORAI. The purpose of the parameter is to limit the executor rewards within the first months. When the AI Oracle becomes more stable, we will remove this parameter.
Below is the basic formula for the passive incentive mechanism:
reward_amount = executor_total_ping + base_reward_unit
if (reward_amount < maximum_reward_can_claim) reward_amount = maximum_reward_can_claim
base_reward_unitis a contract parameter set by the contract owner, which is currently the Oraichain team. In the future, this parameter will be only adjusted through DAO.
After sending the reward successfully, the executor's total ping will reset to 0.
AI Executors can also earn active rewards by executing AI Oracle requests. Each request will accumulate to the total reward that an executor will receive. Each executor has a reward pool to measure such rewards. Below is the equation to calculate the executor's reward when executing an AI Oracle request:
new_total_reward = current_total_reward + (minimum value between preference_requester_fee & preference_executor_fee)
preference_executor_feeare set by the requester and executor, respectively. We choose the minimum value between the two to prevent a specific case, where an executor sets a low preference fee at first, then immediately increases it after finishing a request to try getting more rewards. Typically, executors with higher fee preferences will not execute requests that have lower fee preferences.
The reward pool is accumulated automatically through the AI Oracle smart contract. Nevertheless, the pool's rewards can be slashed for a certain amount if an executor acts maliciously when executing a request. Currently, the process of slashing is being designed & implemented at the moment.
In order to claim the rewards, executors must trigger a
claim rewardtransaction either on Oraiscan or through CLI, which will move such rewards from a normal to an unbonding state. During the unbonding period, the slashing mechanism still applies to the unbonding amount, which prevents executors from executing requests poorly that yet can still claim the rewards before getting slashed.
After the unbonding period ends, the executors can trigger the
claim rewardtransaction again to finally receive the rewards.