-
Notifications
You must be signed in to change notification settings - Fork 16
TimeNode economic strategy reference
Economic strategy make sure that TimeNode operations stay profitable under various conditions.
- bounty - the amount of ETH added by the transaction sender to incentivize the TimeNode
- deposit - the amount of ETH set by the transaction sender to be locked by the TimeNode
- modifier - the payment modifier - the value between 0 and 1, proportional to a time position in the claiming window
- callGas - minimum gas price request by the transaction sender
-
reimbursedGasAmount -
(txRequest.callGas + 180000) / 64 * 65
-
reimbursement - each transaction execution is reimbursed by transaction sender with
reimbursedGasAmount * callGas
- claimingCost - cost of claiming transaction - 100000gas*gasPrice
- networkGasPrice - the current network gasPrice
- minimumProfitability - parameter set by TimeNode operator
Claiming by default starts 1h before the execution, at this point we need to estimate the futureNetworkGasPrice, also since the modifier* is increasing the closer we are to execution time, our knowledge about the futureNetworkGasPrice is getting better (assuming that the estimation is better the closer we are to the event) and we can assume futureNetworkGasPrice = networkGasPrice
totalClaimingCost = claimingCost + deposit
expectedReward = bounty * modifier - totalClaimingCost + deposit + reimbursement - reimbursedGasAmount * futureNetworkGasPrice
During the claiming process, we assume that TimeNode will start claiming as soon as:
expectedReward >= minimumProfitability
and variables at this point are modifier and futureNetworkGasPrice
During execution, the only variable is networkGasPrice which is known at this point.
-
networkGasPrice =< callGas
then thecallGas
has to be used andexpectedReward ~= minimumProfitability
-
networkGasPrice > callGas
TimeNode has to minimize the loss, the amount of ETH at risk isexpectedReward + deposit
, which means thatmaximumGasPrice = callGas + (expectedReward + deposit) / reimbursedGasAmount
minimumProfitability
parameter acts as protection from any significant networkGasPrice increase during between claiming event and execution event
(by default ~ 1h)
In this case since TimeNode didn't have the claiming cost:
expectedReward = bounty * modifier + deposit + reimbursement - reimbursedGas * futureNetworkGasPrice
which is
-
networkGasPrice =< callGas
then thecallGas
has to be used andexpectedReward ~= minimumProfitability
-
networkGasPrice > callGas
TimeNode will execute ifminimumProfitability
is reached somaximumGasPrice = callGas + (expectedReward - minimumProfitability) / reimbursedGasAmount