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 NEP 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

import { ChainId, assurance } from '@neptunemutual/sdk'
import { info } from './info.js'
import { getProvider } from './provider.js'
import { ether, weiAsToken } from './bn.js'
const increase = async () => {
const { key, coverName, assuranceToken } = info
const { symbol } = assuranceToken
const provider = getProvider()
const amount = ether(100_000)
let response = await assurance.get(ChainId.Mumbai, key)
console.info('[%s Assurance] Before: %s', coverName, weiAsToken(response.result, symbol))
await assurance.approve(ChainId.Mumbai, key, { amount }, provider)
response = await assurance.add(ChainId.Mumbai, key, amount, provider)
console.info(response)
// Wait for the transaction to get included in a block
await response.result.wait()
response = await assurance.get(ChainId.Mumbai, key)
console.info('[%s Assurance] After: %s', coverName, weiAsToken(response.result, symbol))
}
increase()
/*****************************************************************************
[info] [Compound Finance Cover Assurance] Before: 50,000.00 COMP
[info] {
status: 'Success',
result: {
nonce: 1,
gasPrice: BigNumber { _hex: '0x06fc23ac00', _isBigNumber: true },
gasLimit: BigNumber { _hex: '0x01fe55', _isBigNumber: true },
to: '0xC551E926F7B251cc6579BE111C65079f25e50e53',
value: BigNumber { _hex: '0x00', _isBigNumber: true },
data: '0x9295182570726f746f3a636f6e7472616374733a636f7665723a6366633a303100000002000000000000000000000000076f91c0a411197e6fce476f37c6385cceacd26d00000000000000000000000000000000000000000000152d02c7e14af6800000',
chainId: 80001,
v: 160037,
r: '0xb648e7979b067ae87af2789e64bcc16bfd3d13c9d2bd6fb4bae9d6c1f75b7f17',
s: '0x15956535e8d34fb17cfa36cdcfd5d58a5d3f57956d57de2dc519bc8abc7c52aa',
from: '0x076F91C0A411197e6Fce476F37c6385CCeacd26D',
hash: '0xc2d7e8ff50b2463f2a2b044baadff3cedfd7caa1369eacd31ec864fbe5651d41',
type: null,
wait: [Function (anonymous)]
}
}
[info] [Compound Finance Cover Assurance] After: 150,000.00 COMP
*****************************************************************************/

Get Assurance

import { ChainId, assurance } from '@neptunemutual/sdk'
import { info } from './info.js'
import { weiAsNep } from './bn.js'
const get = async () => {
const { key, coverName, assuranceToken } = info
const { symbol } = assuranceToken
const response = await assurance.get(ChainId.Mumbai, key)
console.info('[%s Assurance] %s', coverName, weiAsNep(response.result, symbol))
}
get()
/*****************************************************************************
[info] [Compound Finance Cover Assurance] 150,000.00 NEP
*****************************************************************************/