Releases: primitivefinance/v1-contracts
v0.5.1
v0.5.0
UniswapConnector03 - The Flash Close
Description
- Fixes bug in the case of negative premiums causing underflow reverts in the uniswapV2Callee callback function.
- Adds UniswapConnector03.sol and UniswapConnectorLib03.sol.
- Removes functions related to longOptionToken liquidity provision, the scope of this contract is focused on shortOptionToken liquidity.
- Adds closeFlashLong function to close longOptionTokens using flash borrowed redeemTokens.
- Adds conditional code branches in the case that openFlashLong or closeFlashLong will have negative payout or costs.
The Flash Open - Connector Update
Description
Minor update with many changes.
- Adds UniswapConnector02 contract.
- Adds UniswapConnector02Lib library.
- Adds WethConnector01 contract.
- Adds WethConnector01Lib library.
- Adds test_uni_flash test file.
- New comment styling using
///
for natspec and//
for comments. - Adds
getName()
andgetVersion()
version to connector contracts for clarity, not responsible for any logic, pure view functions.
WethConnector
Not any significant changes to the contract logic. The contract's business logic was separated into its own library so that the functions logic can be used in other periphery contracts.
UniswapConnector
Major Addition - The Flash Open
Users can get longOptionToken exposure by paying in underlyingTokens through the interaction of a shortOptionToken<>underlyingToken Uniswap V2 Pair. UnderlyingTokens are received from the Uniswap V2 swap function call as a flash borrow. Those underlyingTokens are used to mint longOptionTokens + shortOptionTokens. To have long exposure, we need to get rid of the shortOptionTokens. Since the pair is underlyingTokens and shortOptionTokens, the shortOptionTokens are sent back to the pair as partial (up to full) repayment of the flash borrow. If the pair's ratio between reserves is 1:1, then only the swap fee has to be paid. If the shortOptionTokens are worth less than the underlyingTokens, the remaining balance of the flash loan is paid by the user in underlyingTokens. This remaining flash loan balance is effectively the premium of the longOptionToken, denominated in underlyingTokens.
Other Additions and Updates
Added significant business logic and a test suite to support it. Adds two functions that combine Primitive's mintOptions()
function with Uniswap V2's swapExactTokensForTokens
function. Can mint long + short tokens and swap either of those to a desired token in a single transaction. This means that a user can use underlying tokens, mint long + short tokens, and sell either the long or short token for dai or any other token.
Adds two functions that combine Primitive's mintOptions()
function and Uniswap V2's addLiquidity
function. This means users can use underlyingTokens to mint optionTokens, which are then provided as liquidity to a optionToken pair. This is done in the same transaction. The second function lets minted shortOptionTokens to be provided as liquidity instead of the longOptionTokens.
Adds two functions that combine Uniswap V2's removeLiquidity
function with Primitive's closeOptions()
function. This means users can remove longOptionToken or shortOptionToken pair liquidity and close the positions in the same transaction.
Contracts v0.4.0 Mainnet
Description
- Deploys core contracts to mainnet.
Protocol Genesis - Phase 1 Audit
Merge pull request #93 from primitivefinance/develop Release v0.3.0
Protocol Genesis - Major Release
Protocol Genesis - Primitive Improvement Proposal - PIP
Number: 0
Status: Final
Authors: Alexander Angel
Created: 2020-05-30
Summary
The Primitive Protocol initial implementation.
Abstract
To be updated with finalized PIP document...
Alpha Release v0.1.0 Mainnet
In this release, we have the Prime: an ERC-20 Base Option Primitive for Ethereum.
Prime:
- Acts like an option.
- Holders have the right to swap their strike assets for underlying assets.
- Supports any ERC-20 Pair.
- Needs an expiration date.
- Not user friendly for direct interaction.
Trader:
- User friendly contract to safely interact with Prime contract.
- Mint, Swap, Redeem, and Close Prime positions directly.
Pool:
- Customized Pool that acts like the trader.
- Pools liquidity which is tapped when users want to purchase options.
- Premium (price per option) is calculating with an implied volatility proxy, the utilization of the Pool.
- The deployed Pool is an ETH Short Put pool for the 200 DAI strike put expiring May 30, 2020 at 8PM UTC.