Pods Options
app.pods.financeGithubBlogDiscord
  • Getting Started
  • Understand Options
    • What are options?
    • How do options work?
    • Pricing Options
  • The Protocol
    • Overview
    • Safety Measures
    • Ecosystem Participants
    • Use Cases
  • Options
    • Overview
    • Options Instrument
      • Variables
      • Functions
        • Mint
        • Unmint
        • Withdraw
        • Exercise
    • Smart Contracts
      • OptionFactory
      • PodPut
      • WPodPut
      • PodCall
      • WPodCall
    • Applied Use Cases
    • Understanding Returns
  • Options AMM
    • Overview
    • Options AMM
      • Variables
      • Components
      • Functions
        • Add Liquidity
        • Re-add Liquidity
        • Trade
        • Remove Liquidity
      • Pricing
      • Find The Next IV
      • Fees
      • Scenarios
        • LP Simulations
    • Smart Contracts
      • OptionAMMPool
      • OptionAMMFactory
      • OptionPoolRegistry
    • Applied Math
  • Developers
    • System Overview
    • Deployed Contracts
    • Dev Environment
  • Interfacing with Pods
    • Brand Assets
  • Code Integration Guides
    • Integrating with Pods (video)
    • How To Create Your Own Option
    • How To Create Your Own Pool
    • How To Trade (Buy/Sell)
    • How To Exercise
    • How To Remove Liquidity
  • User Guides
    • Videos
  • Security
    • Audits
  • APPENDIX
    • FAQ
    • Glossary of Terms
  • Additional Resources
  • app.pods.finance
  • Github
  • Blog
  • Discord
  • Twitter
  • Pods v0 Docs
Powered by GitBook
On this page
  • 1. Get the OptionAMMFactory address
  • 2. Get OptionAMMFactory ABI or Interface
  • 3. Define your pool parameters
  • 4. Call the createPool() function

Was this helpful?

  1. Code Integration Guides

How To Create Your Own Pool

PreviousHow To Create Your Own OptionNextHow To Trade (Buy/Sell)

Last updated 3 years ago

Was this helpful?

You will need 4 steps to create your own option:

  1. Get the OptionAMMFactoryaddress

  2. Get either the OptionAMMFactory ABI (web3) or the OptionAAMMFactory interface (solidity)

  3. Define the parameters of your pool

  4. Call the createPool() function with the parameters

1. Get the OptionAMMFactory address

1) Instantiate our ConfigurationManager contract. Check our deployed contracts page .

2) Call the function getAMMFactory().

2. Get OptionAMMFactory ABI or Interface

You can find both ABI and interface of OptionFactory in our Github repo. Always check if you are on the master branch to get our latest live update.

  • Interfaces .

  • ABIs .

3. Define your pool parameters

In order to deploy a new option amm pool you will need only 3 parameters:

  • OptionTokenAddress

  • StableTokenAddress (We use the assumption that any stable token is equal to 1 USD)

  • InitialIV => This is the initial implied volatility for the pool

4. Call the createPool() function

Now that we have the OptionAMMFactory address, ABI, interface and we have also defined the initial parameters, its time call the createPool()function.

/// Instantiate Option Factory
OptionAMMFactory optionAMMFactory = OptionAMMFactory("/*address*/");

address optionAddress = 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599;
address stableAsset = 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48; 
uint256 initialIV = 1200000000000000000; // Using 18 decimals (120%)

optionAMMFactory.createPool(
        optionAddress,
        stableAsset,
        initialIV
    )
    
// OptionAMMFactory.sol
/**
     * @param _optionAddress The option address (created with our OptionFactory).
     * @param _stableAsset The stable token address. 
     * @param _initialIV The 
*/
    function createPool(
        address _optionAddress,
        address _stableAsset,
        uint256 _initialIV
    ) public returns (address) {}
// Parameters example
const optionAMMFactoryAddress = '0x3c...'

const constructorParameters = [
"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599", // option address
"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // stable asset address
"1200000000000000000" // InitialIV: Using 18 decimals (E.g: 120%)
]

/////////////
// Web3.js

// Instantiate contract
const optionAMMFactory = await web3.eth.Contract('Contract ABI', optionAMMFactoryAddress)

await optionAMMFactory.methods.createPool(...constructorParameters).send({})

/////////////
// Ethers.js

// Instantiate contract
const optionAMMFactory = await ethers.getContractAt(optionAMMFactoryAddress, 'Contract ABI')

await optionAMMFactory.createPool(...constructorParameters)

here
here
here