Smart Contracts
Last updated
Last updated
Contract responsible for creating/deploying new AMM pair pools. It has only the following functions:
createPool()
getPool()
Contract responsible for managing all the addresses for the auxiliary contracts. It contains BlackScholes, IVGuesser, IVProvider, NormalDistribution, and Price Provider setters and getters.
The contract pool responsible for trade, add and remove liquidity of a pair PodOption:ERC20
. Some of the actions that you can do:
addLiquidity()
removeLiquidity()
tradeExactAInput()
tradeExactAOutput()
tradeExactBInput()
tradeExactBOutput()
getUserBalance()
getPoolBalances()
getRemoveLiquidityAmounts()
Contract responsible for the calculation of the BlackScholes formula for Puts and Calls. This contract uses the NormalDistribution
contract to calculate the probability functions. You can check the prices using:
getCallPrice()
getPutPrice()
To find the IV (also known as sigma) for a given price is not trivial. We need to use a numeric method. This contract is responsible for the interaction process that will find the IV given a targetPrice
depending if the option is a Call or a Put. For gas cost purposes, a variable called IVInitialGuess
can be passed to help the numeric method converge faster.
getCallIV()
getCallPut()
Since we do not have libraries to deal with normal distribution functions, and our goal is to be as cost-efficient as possible, we can use this contract to find probabilities given a Z using:
getProbability()
Contract responsible for finding the OracleIV
of a given option. That IV will represent the external market IV of a given option, taking into account the option strike price, maturity, and underlying asset. As of now, the oracle is updated by the team (admin keys) since the current solutions for IV oracles are nascent. The weight of the Oracle IV can be reduced in big liquidity scenarios or increased, in low liquidity scenarios. We looking forward to exploring TWAP solutions in the future. This way users would need to do even more large transactions to manipulate the Pool's IV.
getIV()
updateIV()
setUpdater()
Contract responsible for finding the spotPrice
of a given asset that the priceFeed
was previously registered. This contract can interact with many different price sources and even create an average between feeds. You can use it calling:
getPriceFeed()
latestRoundData()
getAssetPrice()
getAssetDecimals()
setAssetFeeds()
removeAssetFeeds()
Contract responsible for finding the spotPrice
of a given asset that the priceFeed
was previously registered. This contract can interact with many different price sources and even create an average between feeds. You can use it calling:
getPriceFeed()
latestRoundData()
getAssetPrice()
getAssetDecimals()
setAssetFeeds()
removeAssetFeeds()
Contract responsible for finding the spotPrice
of a given asset that the priceFeed
was previously registered. This contract can interact with many different price sources and even create an average between feeds. You can use it calling:
getPriceFeed()
latestRoundData()
getAssetPrice()
getAssetDecimals()
setAssetFeeds()
removeAssetFeeds()
Its our facade Chainlink contract used to get spotPrice
and even other data in future like implied volatility:
getLatestPrice()
latestRoundData()
decimals()
Contract responsible for managing the fees paid to the LP providers. This contract is not supposed to be called from an EOA (external owned account). We are showing here only to make a more digestible understanding of the whole system.
Contract responsible for pause and resume a certain target contract.