Purchase a Policy
The protocol automatically determines the premium or policy fees by taking numerous aspects such as policy term/cover duration, adverse selection, sum insured, utilization ratio, total pool balance, assurance pool, NPM provision pool, etc into account.
Equation:
The policy fee denoted
PFP_F
is given by the equation
PF=3CA1F+tc+NM+(AM.AW)ct+(CD.CA)+1C{P_F = { 3C_A \over {1\over F} + {{t - c + N_M + (A_M . A_W)} \over {{c \over t} + (C_D . C_A)}} + {1\over C}}}
where
FF
and
CC
are constants,
cc
is the cover commitment amount,
tt
is the total balance of the pool,
CDC_D
is the policy duration desired,
CAC_A
is the desired cover amount,
NMN_M
is NPM provision amount for the cover pool ,
AMA_M
is assurance token amount for the cover pool, and
AWA_W
is the assurance token liquidity weight.
For simplicity, this equation can be broken down further to the following subtopics:

Utilization Ratio

The utilization ratio simply tells us how much liquidity in a given cover pool has already been used. It is denoted as the ratio between cover commitment (sum insured) and total balance, given the pool has a positive balance.
u=ctu = {c \over t}
where
cc
is the cover commitment and
tt
is the total balance of the pool.

Available Liquidity

The available liquidity is always greater than or equal to the total balance of a cover pool. A cover pool may have additional liquidity available through Assurance Tokens and NPM Provision. The weight of assurance token is a constant.
l=tc+NM+(AM.AW)l = {t - c + N_M + (A_M . A_W)}
where
tt
is the total balance of the pool,
cc
is the cover commitment,
NMN_M
is NPM provision amount for the cover pool ,
AMA_M
is assurance token amount for the cover pool,
AWA_W
is the assurance token liquidity weight.

Impact Ratio

The impact ratio signifies the effect of the desired cover amount and duration on the liquidity pool.
i=u+(CD.CA)li = {u + (C_D . C_A) \over l}
where
uu
is the current utilization ratio,
CDC_D
is the policy duration desired,
CAC_A
is the desired cover amount, and
ll
is the available liquidity.

Policy Fee

Finally, the policy fee (
PFP_F
) equation can be now derived from a simple harmonic mean of the three values: namely floor, impact ratio, and ceiling, denoted as
PF=3CA1F+1i+1C{P_F = { 3C_A \over {1\over F} + {1 \over i} + {1\over C}}}
where
FF
and
CC
are constants,
CAC_A
is the desired cover amount, and i is the impact. Check the following sheet which contains this equation.

Get Fees

1
import { ChainId, policy } from '@neptunemutual/sdk'
2
import { info } from './info.js'
3
import { getProvider } from './provider.js'
4
import { weiAsPercent, weiAsDollars, ether } from './bn.js'
5
6
const get = async () => {
7
const { key } = info
8
const provider = getProvider()
9
const args = {
10
duration: 2,
11
amount: ether(100_000)
12
}
13
14
console.info('Getting %s cover for %d months', weiAsDollars(args.amount), args.duration)
15
console.info('--------------------------------------')
16
17
const response = await policy.getCoverFee(ChainId.Mumbai, key, args, provider)
18
const {
19
fee,
20
utilizationRatio,
21
totalAvailableLiquidity,
22
coverRatio,
23
rate
24
} = response.result
25
26
console.info('Rate: %s', weiAsPercent(rate))
27
console.info('Fee: %s', weiAsDollars(fee, 'xYZ'))
28
console.info('--------------------------------------')
29
console.info('Utilization Ratio: %s', weiAsPercent(utilizationRatio))
30
console.info('Total Available Liquidity: %s', weiAsDollars(totalAvailableLiquidity))
31
console.info('Cover Ratio: %s', weiAsPercent(coverRatio))
32
}
33
34
get()
35
36
/*****************************************************************************
37
[info] Getting $100,000.00 cover for 2 months
38
[info] --------------------------------------
39
[info] Rate: 16.66%
40
[info] Fee: $2,776.78
41
[info] --------------------------------------
42
[info] Utilization Ratio: 0.00%
43
[info] Total Available Liquidity: $299,700.00
44
[info] Cover Ratio: 66.73%
45
*****************************************************************************/
Copied!
Result Type
Property
Type
Description
fee
number
The amount required in DAI to purchase the policy for the specified amount.
utilizationRatio
number
Utilization Ratio = Total Commitment / Total Liquidity
totalAvailableLiquidity
number
Total Available Liquidity = Total Liquidity - Total Commitment + Amount in NPM Provision + Weighted Amount in Assurance Pool
coverRatio
number
Cover Ratio = Utilization Ratio + Cover Duration * (Amount to Cover / Total Liquidity)
floor
number
The base policy floor rate
ceiling
number
The base policy ceiling rate
rate
number
The annualized percentage required to purchase this policy for the specified amount

Purchase Policy

1
import { ChainId, policy } from '@neptunemutual/sdk'
2
import { info } from './info.js'
3
import { getProvider } from './provider.js'
4
import { ether } from './bn.js'
5
6
const purcahse = async () => {
7
const { key } = info
8
const provider = getProvider()
9
10
const args = {
11
duration: 2,
12
amount: ether(10_000) // <-- Amount to Cover (In DAI)
13
}
14
15
// First approve the Policy contract to spend your DAI, USDC, or BUSD
16
await policy.approve(ChainId.Mumbai, {}, provider)
17
18
const response = await policy.purchaseCover(ChainId.Mumbai, key, args, provider)
19
console.info(response)
20
}
21
22
purcahse()
23
24
/*****************************************************************************
25
[info] {
26
status: 'Success',
27
result: {
28
nonce: 1,
29
gasPrice: BigNumber { _hex: '0x06fc23ac00', _isBigNumber: true },
30
gasLimit: BigNumber { _hex: '0x2f788c', _isBigNumber: true },
31
to: '0x50443BED0C90987D3A3715f0A90e60503BB548dD',
32
value: BigNumber { _hex: '0x00', _isBigNumber: true },
33
data: '0x02bbd6e570726f746f3a636f6e7472616374733a636f7665723a6366633a303100000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000021e19e0c9bab2400000',
34
chainId: 80001,
35
v: 160038,
36
r: '0xc6539f52dfb2fc026bdef71082dccdcfd886fa6cef06c1d507ba18d1bbe6ed33',
37
s: '0x2b2ca2256d0a9513bc503e5f8496f54def3b2fb2ef9e2a988a0f21167a3c7cbe',
38
from: '0x076F91C0A411197e6Fce476F37c6385CCeacd26D',
39
hash: '0x1e6d351385c19d13e7e08fb372d23100d8000ef916909b18fabeb40252f9eb47',
40
type: null,
41
wait: [Function (anonymous)]
42
}
43
}
44
*****************************************************************************/
Copied!
Last modified 1mo ago