V1 Contracts Versions Save

Primitive protocol solidity contracts.

v0.5.1

3 years ago

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

3 years ago

0.5.0 (2020-12-02)

Features

  • Fix workflow with updated node version. (8d4e550)
  • #133: Hardhat migration. Updates readme. (c799035), closes #133
  • #133: Hardhat migration. Updates readme. (3f231b5), closes #133

v0.4.2

3 years ago

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.

v0.4.1

3 years ago

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.

v0.4.0

3 years ago

Description

  • Deploys core contracts to mainnet.

v0.3.1

3 years ago

alpha-v0.2.0

3 years ago

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

0.1.0

4 years ago

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.