Cover Assurance
When you create a new cover, you can assign any ERC-20 (or BEP-20) token as an assurance token. The assurance token liquidity reduces cover fees, pays liquidity providers during cover incidents, thereby boosting the liquidity provider confidence. Along with the NPM provision token, the assurance tokens are also awarded as a support to the liquidity providers when a cover incident occurs. Without affecting the price much, the protocol will gradually convert the assurance tokens to a stable-coin liquidity.
Based on the available liquidity, the assurance contract will award up to 25% of the suffered loss back to the liquidity pool.

Add Assurance

1
import { ChainId, assurance } 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, assuranceToken } = info
8
const { symbol } = assuranceToken
9
10
const provider = getProvider()
11
const amount = ether(100_000)
12
13
let response = await assurance.get(ChainId.Mumbai, key)
14
console.info('[%s Assurance] Before: %s', coverName, weiAsToken(response.result, symbol))
15
16
await assurance.approve(ChainId.Mumbai, key, { amount }, provider)
17
response = await assurance.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 assurance.get(ChainId.Mumbai, key)
25
26
console.info('[%s Assurance] After: %s', coverName, weiAsToken(response.result, symbol))
27
}
28
29
increase()
30
31
/*****************************************************************************
32
[info] [Compound Finance Cover Assurance] 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 Assurance] After: 150,000.00 COMP
53
*****************************************************************************/
Copied!

Get Assurance

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