# Automated Insurance Market Maker

Resolving disputes with insurance in a decentralized marketplace

The AMM allows insurance providers to stake tokens in liquidity pools corresponding to different risk profiles for the participating parties. In simple cases, risk profiles are determined by the reputation scores of the transacting parties. In more complex scenarios, liquidity providers can develop pools with more sophisticated risk profiles by indexing the verifiable history of a participant's personal data repositories, requiring sophisticated service-proofs (e.g. location-proofs in a delivery network), and/or requiring KYC/KYB for either or both of the transacting parties.

Providers and buyers can purchase insurance at a fee that is dynamically adjusted based on the supply and demand for insurance in each risk pool.

The AMM uses a concentrated liquidity approach, inspired by Uniswap v3, where insurance providers can choose to allocate their capital to specific risk profiles. This enables more efficient price discovery and allows for different pricing across varying levels of risk.

By decentralizing liquidity from the risk model, we remove centralization from the dispute resolution process. We hypothesize that the market clearing service fee will be much lower than centralized dispute resolution mechanisms as a result of an open insurance market.

In the event of a dispute, the insurance pool covers the cost of slashing the collateral of the party at fault. The pricing mechanism is designed to be self-correcting, ensuring that insurance fees are sufficient to cover the expected cost of slashing while remaining competitive.

By offering reputation-based insurance fees, the AMM incentivizes good behavior and reduces the likelihood of false claims.

Participants with strong reputations and low dispute histories are rewarded with lower insurance costs, while those with poor reputations face higher fees or may be unable to obtain insurance, which could be functionally equivalent to being blacklisted from the network.

### Role of the Insurance Provider

In the current model, the default contract is a Buyer-friendly contract, where if the order is not fulfilled, the provider will automatically get slashed.

The collateral to be slashed is given by,

Suppose there is a probability that this collateral will be slashed, $p_{\rm slash}(\tilde G_v,\tilde G_u)$, which depends on the reputations of the buyer and the provider. An insurance provider would build a risk model based on this, and perhaps other historical data.

The insurance provider can assume the risk of slashing, by selling an insurance service at a fee of $F$ to the provider for each transaction. How can this fee be priced?

Given the insurance provider has a risk model, $p_{\rm slash}$, they can compute their expected cost per transaction, as,

The provider now pays a constant fee, $F$ per transaction, but there is no risk of being slashed. The provider has therefore converted from a Buyer-friendly contract to a neutral contract, at a cost of $F$ per transaction.

### Automated Insurance Market Maker

We have discussed how it is possible that an insurance market arises, and it is a viable business model as long as $F>lp_{\rm slash}$. This still leaves a difficult problem of a provider and an insurance provider finding each other and negotiating an acceptable price $F$. Can we create an automated market making mechanism, where insurance providers only need to stake their resources, and the appropriate price for providers is discovered based on insurance supply and demand?

The inspiration here is comparing to the currency exchange problem, and how AMM's such as Uniswap discover a token exchange price, depending on the liquidity pools of different tokens. Later on we will also be inspired by Uniswap v3 and their concept of concentrated liquidity, where there are separate liquidity pools for each token exchange rate.

Suppose in the simplest case, there is a set of insurance providers, $W$. A given insurance provider, $w\in W$ stakes an amount $q_w$ of tokens into the insurance pool. There is a total $Q=\sum_{w\in W}q_w$ tokens in the insurance pool.

We split time into discrete periods of duration $\tau$. Let's label different periods as $t_0,t_1,t_d,\dots$, where $t_n=n\tau$. The insurance pricing at $t_n$ is determined by the insurance demand and supply in the previous period $t_{n-1}$.

If in the period of time from $t_{n-1}$ to $t_n$, a number of providers, $u\in U$ place a set of transactions, with collaterals $l^u_{n-1}$, such that the total collateral for that period is $L_{n-1}\equiv \sum_{u\in U} l^u_{n-1}$.

With this information we can define a mechanism to determine the price of insurance at the next epoch, $t_n$ to $t_{n+1}$. If a provider is completing a transaction with collateral $l_n^u$, they would need to pay a fee $F_n^u\equiv \hat F_n l_n^u$, where the pricing constant $\hat F_n$ is given by,

In this case, the pricing depends on what is the demand for insurance from the provider side ($L_{n-1}$) vs what is the supply from the insurance provider side, $Q_{n-1}$.

The collateral for the transactions will be taken from the pool $Q_{n}$. After the transaction period, some of this collateral will be slashed, due to transactions not getting completed.

After completion of the period $t_n$ to $t_{n+1}$ some of the pool will have either made a profit or a loss. This depends on whether the amount of fees collected exceeds the amount of capital that was slashed in that same period.

This mechanism leads to self-correcting market dynamics. If at current conditions the insurance pool is having loss rather than profit, that means insurance is underpriced. This will lead to some insurance providers abandoning the pool, reducing the pool $Q_n$. This then reduces the supply of insurance, therefore raises the price, this will happen until the price is found where the pool actually makes enough profit to satisfy the insurance providers.

In the same way, if the pool is making very large profits, it will attract more insurance providers to join the pool, this will increase the supply $Q_n$ which will result in reduction of fees, until a more appropriate market price is found.

### Concentrated Liquidity

Given our previous considerations that the risk of collateral slashing actually depends on quantities like $\tilde G_v, \tilde G_u$, it is likely unfair to charge the same fee, $\hat F_n$ across all risk profiles. A more sophisticated insurance provider would have different pricing depending on the level of risk.

We should therefore allow our mechanism to offer different pricing for different values of $\frac{\tilde G_v}{\tilde G_u}$. Our approach is inspired by Uniswap v3, where there are different liquidity pools for different exchange rate values.

The mechanism consists of splitting the interval $\frac{\tilde G_v}{\tilde G_u}\in \left(\frac{g}{h+g},\frac{h+g}{g}\right)$ into a set of N discrete ticks labeled by $i=1,\dots, N$. Insurance providers can now choose to deposit liquidity into any one of these N pools across different values of $\frac{\tilde G_v}{\tilde G_u}$.

Each of these pools now has an amount of liquidity $Q_n^i$. The same logic as before applies, where the pricing for each pool is given by,

This mechanism allows for more sophisticated self-correcting dynamics. If a particular risk level is currently under or over priced, Insurance providers will move their capital from one liquidity pool to another, allowing the mechanism to find the correct market price for each risk level.