Cover Reassurance
When launching a new cover, you can include a reassurance fund. Liquidity from the reassurance fund lowers cover fees and offsets liquidity providers' losses during cover incidents, enhancing the confidence of the liquidity providers. When a cover incident is finalized, the reassurance tokens are reimbursed as support to the liquidity providers.
Based on available liquidity, the reassurance contract will capitalize up to 25% of the suffered loss to the liquidity pool.

Add Reassurance

1
import { ChainId, reassurance } from '@neptunemutual/sdk'
2
import { info } from './info.js'
3
import { getProvider } from './provider.js'
4
import { ether, weiAsToken } from './bn.js'
5
6
const increase = async () => {
7
const { key, coverName, reassuranceToken } = info
8
const { symbol } = reassuranceToken
9
10
const provider = getProvider()
11
const amount = ether(100_000)
12
13
let response = await reassurance.get(ChainId.Mumbai, key)
14
console.info('[%s Reassurance] Before: %s', coverName, weiAsToken(response.result, symbol))
15
16
await reassurance.approve(ChainId.Mumbai, key, { amount }, provider)
17
response = await reassurance.add(ChainId.Mumbai, key, amount, provider)
18
19
console.info(response)
20
21
// Wait for the transaction to get included in a block
22
await response.result.wait()
23
24
response = await reassurance.get(ChainId.Mumbai, key)
25
26
console.info('[%s Reassurance] After: %s', coverName, weiAsToken(response.result, symbol))
27
}
28
29
increase()
30
31
/*****************************************************************************
32
[info] [Compound Finance Cover Reassurance] Before: 50,000.00 COMP
33
[info] {
34
status: 'Success',
35
result: {
36
nonce: 1,
37
gasPrice: BigNumber { _hex: '0x06fc23ac00', _isBigNumber: true },
38
gasLimit: BigNumber { _hex: '0x01fe55', _isBigNumber: true },
39
to: '0xC551E926F7B251cc6579BE111C65079f25e50e53',
40
value: BigNumber { _hex: '0x00', _isBigNumber: true },
41
data: '0x9295182570726f746f3a636f6e7472616374733a636f7665723a6366633a303100000002000000000000000000000000076f91c0a411197e6fce476f37c6385cceacd26d00000000000000000000000000000000000000000000152d02c7e14af6800000',
42
chainId: 80001,
43
v: 160037,
44
r: '0xb648e7979b067ae87af2789e64bcc16bfd3d13c9d2bd6fb4bae9d6c1f75b7f17',
45
s: '0x15956535e8d34fb17cfa36cdcfd5d58a5d3f57956d57de2dc519bc8abc7c52aa',
46
from: '0x076F91C0A411197e6Fce476F37c6385CCeacd26D',
47
hash: '0xc2d7e8ff50b2463f2a2b044baadff3cedfd7caa1369eacd31ec864fbe5651d41',
48
type: null,
49
wait: [Function (anonymous)]
50
}
51
}
52
[info] [Compound Finance Cover Reassurance] After: 150,000.00 COMP
53
*****************************************************************************/
Copied!

Get Reassurance

1
import { ChainId, reassurance } from '@neptunemutual/sdk'
2
import { info } from './info.js'
3
import { weiAsNep } from './bn.js'
4
5
const get = async () => {
6
const { key, coverName, reassuranceToken } = info
7
const { symbol } = reassuranceToken
8
9
const response = await reassurance.get(ChainId.Mumbai, key)
10
console.info('[%s Reassurance] %s', coverName, weiAsNep(response.result, symbol))
11
}
12
13
get()
14
15
/*****************************************************************************
16
[info] [Compound Finance Cover Reassurance] 150,000.00 NPM
17
*****************************************************************************/
Copied!