Skip to content

Releases: primitivefinance/v1-contracts

v0.5.1

13 Mar 00:03
df67a94
Compare
Choose a tag to compare

0.5.1 (2021-03-13)

Bug Fixes

  • sushi: Deploys some sushi options. (666a5db)
  • update-deployments: Deploy 700 Jan 8 Eth call put. (fe3984b)

v0.5.0

02 Dec 19:34
3427291
Compare
Choose a tag to compare

0.5.0 (2020-12-02)

Features

UniswapConnector03 - The Flash Close

01 Nov 03:00
7eb5ebd
Compare
Choose a tag to compare

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

30 Oct 04:10
4594738
Compare
Choose a tag to compare

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() and getVersion() 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

28 Oct 02:09
Compare
Choose a tag to compare

Description

  • Deploys core contracts to mainnet.

Protocol Genesis - Phase 1 Audit

16 Aug 18:31
9e046c7
Compare
Choose a tag to compare
Merge pull request #93 from primitivefinance/develop

Release v0.3.0

Protocol Genesis - Major Release

10 Jun 20:04
255d901
Compare
Choose a tag to compare
Pre-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

01 May 06:57
eb55b89
Compare
Choose a tag to compare

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.