Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

SIREN logo

Siren Markets Core Smart Contracts

This repository contains the source code for the Siren Markets core smart contracts.

SIREN CI Coverage Status GitHub contributors GitHub commit activity GitHub Stars GitHub repo size GitHub

Website Blog Docs Governance Twitter SirenProtocol

GitHub pull requests by-label GitHub Issues

Mainnet Contract List

Build and test

$ npm install
$ npm test

Design Goals

  • Build a fully unit tested system with 100% code coverage, including error scenarios and event logging
  • Allow the Siren system to be upgradeable over time by the governance system to include new functionality not included in the initial launch, without requiring migration to a new token (e.g. Augur)
  • Minimize gas by deploying proxy contracts whenever possible instead of full logic contracts
  • Utilize Open Zeppelin contracts whenever possible instead of rolling our own version
  • Fully comment the codebase so new developers can quickly grok the protocol and contribute

Protocol Overview

See the technical documentation for more details on the protocol

Series Lifecycle Example

Below is one of the unit tests showing the flow for, minting options, exercising an option, and claiming the remaining series' collateral.

it("Allows claiming after expiration with full redemptions", async () => {
  // Amount we will be minting
  const MINT_AMOUNT = 100

  // Give Alice 100 tokens
  await, MINT_AMOUNT)

  // Save off the tokens
  const bTokenIndex = await deployedSeriesController.bTokenIndex(seriesId)

  // approve the amount and mint alice some options - wBTC collateral will be locked into series contract
  await collateralToken.approve(deployedSeriesController.address, MINT_AMOUNT, {
    from: aliceAccount,
  await deployedSeriesController.mintOptions(seriesId, MINT_AMOUNT, {
    from: aliceAccount,

  // Send the bTokens from alice to Bob - simulates alice selling option
  await deployedERC1155Controller.safeTransferFrom(
    { from: aliceAccount },

  // Move the block time into the future so the contract is expired
  await time.increaseTo(expiration + ONE_DAY)

  // Bob exercises
  await deployedERC1155Controller.setApprovalForAll(
    { from: bobAccount },
  await deployedSeriesController.exerciseOption(seriesId, MINT_AMOUNT, true, {
    from: bobAccount,

  // Should succeed from Alice claiming leftover collateral
  await deployedERC1155Controller.setApprovalForAll(
    { from: aliceAccount },
  await deployedSeriesController.claimCollateral(seriesId, MINT_AMOUNT, {
    from: aliceAccount,

  // Bob should own his share of collateral tokens
    await collateralToken.balanceOf(bobAccount),
    "bob should have his collateral",

  // Alice should own her share of collateral tokens
    await collateralToken.balanceOf(aliceAccount),
    "alice should have her collateral",


This repo will generate TS clients for the contracts on install. When updating the contracts, the TS definitions can be manually updated by:

  1. Running npm run compile
  2. Running npm run build

The compiled JSON ABI files should be commited after deployment so that the deployment metadata is available in the repo.