--- title: Pricing Network Outages version: 0.1.0 license: Apache-2.0 / CC-2.5-SA author: Sam Bacha, et al. --- # Pricing Network Outage > Abstract How do we price the cost of service interruption for end users for Sushi Relay? **Sushi Relay** is a service that accepts user transactions for purposes of private inclusion and rebating this transaction flow by reimbursing end users / protocols with a percentage of profits obtained by arbitrage/MEV transactions. It operates as a private and permissioned mempool. Since users are paid for their submissions of transactions the question evidently rises on how to price transaction inclusion delays. > Note: Read documentation and access the API > Docs: https://docs.openmev.org > HTTPS: https://api.sushirelay.com/v1 > Websocket wss://api.sushirelay.com/v1 How do price a network outage for our transaction services? The current existing Gas Pricing API can be used for this purposes by applying the principle of *Little’s Law* [1]. $$ L=\lambda W $$ We can take the value for Littles Law (we apply this to a new field called 'networkCongestion') and apply it to the time of *networkOutage*, which is the time that *zero transactions are able to be included in the network*. A period of *networkOutage* can be defined as a value that is *three standard deviations* above *networkCongestion*. Think of this as the time it takes to return to a normal value of *networkCongestion* after the outage is over, i.e. how long it takes to return to normal network congestions (how long it takes to process the transactions that have accumulated during an outage) after networkOutage is over. ### Existing Fields * **baseFeePerGas** Base fee per gas for current block in gwei. (Only type2 transactions Post EIP-1559 have this value and it's burned by the network upon transaction success). * **estimatedTransactionCount** Number of items we estimate will be included in next block based on mempool snapshot * **confidence** 0-99 likelihood the next block will contain a transaction with a gas price >= to the listed price * **Price** Price in Gwei (used for type0 transactions: Pre EIP-1559) * **maxPriorityFeePerGas** Max priority fee per gas in gwei also known as the "tip" (used for type2 transactions: EIP-1559) * **maxFeePerGas** Max fee per gas in gwei (used for type2 transactions: EIP-1559). Our current max fee heuristic is Base Fee * 2 + Priority Fee. This is to protect against a ‘rapid’ rise in the base fee while your transaction fee is pending. In most cases, the actual transaction fee will approximate Base Fee + Priority Fee. ### New Field: networkCongestion * **networkCongestion** - A normalized number that can be used to gauge the congestion level of the network, with 0 meaning not congested and 1 meaning extremely congested ### New Field: networkOutage * **networkOutage** - A true/false indicating a recognized network outage event. True means we are currently experiencing a network outage #### Example networkCongestion: Assume transactions arrive at the rate of 10 per hour and stay an average of 0.5 hour. This means we should find the average number of transactions successfuly included at any time to be 5. ## Improved Gas Price API > Source[2] ```json= "currentBlockNumber": 13095949, "msSinceLastBlock": 4542, "estimatedBaseFee": "networkCongestion": "blockPrices": [ { "blockNumber": 13095950, "baseFeePerGas": 113.110076547, "estimatedTransactionCount": 172, "estimatedPrices": [ { "confidence": 99, "price": 129, "maxPriorityFeePerGas": 15.96, "maxFeePerGas": 242.18 }, { "confidence": 95, "price": 119, "maxPriorityFeePerGas": 6.84, "maxFeePerGas": 233.06 }, { "confidence": 90, "price": 118, "maxPriorityFeePerGas": 5.09, "maxFeePerGas": 231.31 }, { "confidence": 80, "price": 116, "maxPriorityFeePerGas": 3.21, "maxFeePerGas": 229.43 }, { "confidence": 70, "price": 115, "maxPriorityFeePerGas": 2.28, "maxFeePerGas": 228.5 } ] } ] ``` ## Citations Alberto Leon-Garcia (2008). Probability, statistics, and random processes for electrical engineering (3rd ed.). Prentice Hall. ISBN 978-0-13-147122-1. Bacha, S. (2021). Gas Reporting Index (Version 1.1.4) [Computer software]. https://doi.org/10.5281/zenodo.1234