Core protocol functions
Core functions to issue and settle derivative assets using DIVA Protocol
Create a contingent pool
where PoolParams
contains the following list of parameters in the corresponding order:
Parameter | Type | Category | Description |
---|---|---|---|
| string | Event | The metric or event whose outcome will determine the payout for long and short position tokens. |
| uint96 | Event | Expiration time of position tokens expressed as a unix timestamp in seconds. The value of the reference asset observed at that point in time determines the payoffs for long and short position tokens. |
| uint256 | Payoff | Value of the reference asset at or below which the long token pays out 0 and the short token 1 (max payout). Input expects an integer with 18 decimals. |
| uint256 | Payoff | Value of the reference asset at which the long token pays out |
| uint256 | Payoff | Value of the reference asset at or above which the long token pays out 1 (max payout) and the short token 0. Input expects an integer with 18 decimals. |
| uint256 | Payoff | Long token payout at inflection (value between 0 and 1). Input expects an integer with 18 decimals. |
| uint256 | Payoff | Collateral amount to be deposited into the pool to back the position tokens. Input expects an integer with collateral token decimals. |
| address | Settlement asset | Address of the ERC20 collateral token. |
| address | Oracle | Ethereum account (EOA or smart contract) that will report the final reference asset value. |
| uint256 | Pool size | Maximum collateral amount that a contingent pool can accept. Choose a large number (e.g., |
Adding liquidity
Add liquidity to an existing pool using the following function:
Removing liquidity
Remove liquidity from an existing pool using the following function:
Last updated