OPEN YOUR CRYPTO OPTIONS TRADING ACCOUNT NOW

Lyra and StarkWare announce $10,000 Cairo Developer Grant

Lyra and StarkWare announce $10,000 Cairo Developer Grant

Lyra is an options trading platform that was built natively for Layer 2 Ethereum, accessing the scalability and performance of rollup technology with the security and composability of the Ethereum network. ZK-STARKs, a novel invention by StarkWare, provide an exciting new frontier offering theoretically unlimited scale for computation on-chain. Since launching in 2018, over 90M txs and $350B has been settled using StarkWare’s ZK-Rollup solutions.

To mark the beginning of Lyra’s foray into the world of Cairo and StarkNet, Lyra and StarkWare are partnering to offer a grant of $10,000 to any developer who implements a Black Scholes library in Cairo and deploys it on StarkNet. The grant will be $5,000 USDC and 20,000 LYRA tokens in kind.

Background

The Black-Scholes formula gives a theoretical estimate of the price of European-style options. It is an essential component of Lyra’s options AMM as every trade requires computing the option price.

Related to Black-Scholes are the "option greeks", which quantify the sensitivity of an option's price to different parameters. The greeks allow traders to manage their exposure to an options position. Lyra uses delta and vega as part of its risk management for liquidity providers.

Task

Implement a Black Scholes library in Cairo and deploy it on StarkNet. We have an implementation of Black-Scholes in Solidity here that you can use as inspiration. The following solidity interface should be adapted for Cairo:

Solidity Interface

interface IBlackScholes {
  // Maths
	
  // Return the absolute value of x
  function abs(int x) external pure returns (uint);
  
  // Return the exponent of x
  function exp(int x) external pure returns (uint);
	
  // Return the square root of x
  function sqrt(uint x) external pure returns (uint);
  
  // Return the natural log of x 
  function ln(uint x) external pure returns (int);

  // Internal coefficients of Black-Scholes
	function d1d2(
		uint tAnnualised,
		uint volatility,
		uint spot,
		uint strike,
		int rate
	) external pure returns (int d1, int d2)

	// Option Greeks

  // Sensitivity of option price to a $1 change in spot price
	function delta(
		uint tAnnualised,
    uint volatility,
    uint spot,
    uint strike,
    int rate
	) external pure returns (int callDelta, int putDelta);
	
  // Sensitivity of option delta to a $1 change in spot price
	function gamma(
		uint tAnnualised,
    uint volatility,
    uint spot,
    uint strike,
    int rate
	) external pure returns (int gamma);
	
  // Sensitivity of option price to a 1% change in IV
	function vega(
		uint tAnnualised,
    uint volatility,
    uint spot,
    uint strike,
    int rate
  ) external pure returns (int vega);

  // Sensitivity of option price to a 1% change in the rate
	function rho(
		uint tAnnualised,
    uint volatility,
    uint spot,
    uint strike,
    int rate
  ) external pure returns (int callRho, int putRho);

  // How much value the option loses per day
	function theta(
		uint tAnnualised,
    uint volatility,
    uint spot,
    uint strike,
    int rate
  ) external pure returns (int callTheta, int putTheta);

  // The value of a call/put option
  function optionPrices(
		uint tAnnualised,
    uint volatility,
    uint spot,
    uint strike,
    int rate
  ) external pure returns (uint callPrice, uint putPrice);
}

Cairo supports hints that are written in native Python, and these are executed by the prover right before it processes the next instruction. StarkNet supports hints, but these hints require approval before deployment, in order to ensure that malicious code is not being run in the Python code. In your solution, you can assume that StarkNet has approved hints for common mathematical operations like sqrt, ln and exp.

Submission requirements

The program will function like a gas golfing contest, the most accurate and efficient library will receive the grant. However, it is not intended to be a win or lose outcome, any functioning implementation should come forward and chat with us.

To submit an application for the grant, make a tweet with your Github repo, tag @LyraFinance, and include #CairoDeveloperGrant. We’ll review the code alongside the StarkWare team and get back to you.

About StarkWare

StarkWare invented, and continually develops, STARK-based Layer-2 Validity Proof scaling solutions over Ethereum. StarkWare’s solutions, which rely on Ethereum’s security, have settled over $350B, and over 90M transactions, serving hundreds of thousands of users. StarkNet, StarkWare’s permissionless general-purpose scaling solution, is live (Alpha) on Ethereum Mainnet. StarkEx, a custom standalone scaling service, has been powering applications since June 2020, including dYdX, Immutable X, Sorare, and DeversiFi.

Website | Twitter | Blog | StarkEx PlayGround | StarkNet Developer Hub

About Lyra

Lyra is an open protocol for trading options built on Ethereum. Lyra allows traders to buy and sell options that are accurately priced with the first market-based, skew adjusted pricing model. Lyra also quantifies the risks incurred by liquidity providers and actively hedges them, encouraging more liquidity to enter the protocol.

Stay tuned for more important updates, key date announcements, and exciting opportunities by following us on Twitter.

Join the Lyra community on Discord to get involved; be the first to learn about new opportunities with Lyra and be a part of building the future of DeFi.

Marquee Component
OPEN YOUR CRYPTO OPTIONS TRADING ACCOUNT NOW