Documentation
  • DBOE
    • 🔑What is DBOE?
    • ⌚Key Timelines
      • 🏆Milestones
      • 🎯Future Plan
    • 🪙Tokenomics
      • Token Details
      • Token Features
      • Commitment to Transparency and Accountability
    • 🧊DBOE Point Rewards Program
    • 💲Fees
    • 🌎Community Power
      • 💦Airdrops
        • Go-live Airdrop
        • Exclusive Whitelist Airdrop
      • 👥Referral
      • 🎁Minigame
    • 🔰Brand Assets
  • FAQs
    • 📗DBOE Tutorial
      • DBOE Options Basics
      • Instructions for creating a Metamask wallet
      • Step-by-Step Guide to Start Trading Spot on DBOE
      • Step-by-Step Guide to Start Trading Options on DBOE
      • Beginners' FAQs: Exploring DBOE Trading Features
      • How to download the DBOE app (Beta version) on iPhone through TestFlight?
      • Guide for Mobile App
      • Terminology and Indicators in Derivatives
        • Orderbook
        • AMM
        • Options
        • The Greeks
        • Options Pricing
        • Options Strategies
      • How to read 3D Volatility Surface
      • How to calculate Premium with Black Scholes
    • ⁉️General FAQs
      • 1. What is the max loss for DBOE Option Sellers?
      • 2. What is the max loss for DBOE Option Buyers?
      • 3. What are order types currently supported by DBOE?
      • 4. Does DBOE support “Fill Or Kill” order attribute?
      • 5. How to amend an order?
      • 6. What is DBOE daily maintenance time window?
      • 7. Do I need to register and deposit on DBOE?
      • 8. How is DBOE Options different from Futures, Spot and Options?
      • 9. Why say DBOE Options helps protect Portfolio Investment?
      • 10. How does the final settlement of DBOE Options work?
      • Other questions?
    • 📁Others/Misc
      • Options Basics
      • The Benefits of Derivatives
      • What Is The Difference Between European and American Style Options?
      • Crypto Basics
        • What is Blockchain?
        • What are Cryptocurrencies?
        • What is a Decentralised Network?
        • What is a Centralised Market?
        • What is Proof of Stake?
        • What is a Smart Contract?
        • What is Gas?
      • What is Custody?
      • What is a DEX?
  • Algo Trading
    • 🛡️Algo Trading on DBOE
      • High level architecture
      • End-to-end integration steps
      • Sample Codes
      • DBOE On-Chain CLOB logic
    • ⁉️FAQs on DBOE On-Chain CLOB logic
      • 1. What is the methodology to calculate the mark price (or reference price)?
      • 2. Can we have some illustrations on the mark price methodology?
      • 3. Noticed the first spread level is 0, how does it help?
      • 4. Any constraints when submitting an order?
      • 5. How to query all the configurations of on-chain CLOB?
      • 6. Would LMT order trigger matching?
      • 7. What would happen if a MKT order is submitted?
      • 8. Who is going to pay for the gas fee when submitting orders?
      • 9. Any suggestion to adjust gas fee when the network is unable to predict it?
      • 10. What is the rough estimation of gas fee so far?
      • 11. What are the order submission steps and the Min. Allowance in DBOE?
    • ⚠️Disclaimer
  • Security
    • Audits
      • Round 1
      • Round 2
    • Smart Contracts Addresses
    • Privacy Policy
      • What Personal Information do we collect about you, why and on which legal basis?
      • Do we share your Personal Information?
      • Do we transfer your Personal Information?
      • For how long do we keep your Personal Information?
      • How do we secure your Personal Information?
      • Your rights
      • Changes to the Privacy Policy
      • Contact us
    • Term of use
      • 1. Definitions
      • 2. Right to Use the Site
      • 3. Proprietary Rights
      • 4. Additional Rights
      • 5. Prohibited Uses*
      • 6. Non-Custodial and No Fiduciary Duties
      • 7. Non-Solicitation; No Investment Advice
      • 8. No Warranties
      • 9. Assumption of Risk
      • 10. Third-Party Resources and Promotions
      • 11. Release of Claims
      • 12. Indemnity
      • 13. Limitation of Liability
      • 14. Resolution of Disputes
      • 15. Class Action and Jury Trial Waiver
      • 16. Governing Law
      • 17. Language and Contact details
      • 18. Entire Agreement
    • Contract Specifications
    • Whitepaper
  • OFFICIAL LINKS
  • DBOE
  • Medium
  • Tele
  • Twitter
Powered by GitBook
On this page
  • I. Interacting with DBOE Relayer
  • II. Interacting with DBOE Smart Contract

Was this helpful?

  1. Algo Trading
  2. Algo Trading on DBOE

End-to-end integration steps

PreviousHigh level architectureNextSample Codes

Last updated 1 year ago

Was this helpful?

I. Interacting with DBOE Relayer

1) Download DBOE Order Book Configurations such as minimum order notional for LMT orders, maximum time in effect and etc.

2) Download the details of the price spread: how many levels, and the spread value for each level.

For example, the current spread settings are as below:

Level 1
Level 2
Level 3
Level 4
Level 5
Level 6
Level 7

Spread

0%

0.5%

1.0%

2.0%

5.0%

10.0%

25.0%

3) Download all Options instruments including its Order Book Smart Contract Address.

Sample data returned

{
       "collateral_group": "20%",
"chain": "Polygon",
"cond_strike": 2170,
"kind": "Call",
"multiplier": 1,
"strike": 2070,
"currency_address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
"option_factory_address": "0x45c0bc8d80c64bdd676a9e7cc3099d40344a5ce6",
"underlying": "ETH",
"fsp_address": "0x731b70b86d494d6e6c3860ad4ef6fce04f25ba12",
"ltt": 150000,
"clearing_address": "0x8595df13f5dfdb89fa90464132478b1f31482820",
"instr_id": "E2070C1126",
"ob_address": "0xe68e5Ba4c4Af8D64296040484dbDCc775e6C6cB7",
"currency": "USDT",
"long_contract_address": "0x1c2a7ebfe814dedbef72e63eabd0a3a442b82605",
"expiry": 20231126,
"short_contract_address": "0xa1dd0c686837767204a0821ea6bdb42689cb3c8c",
"underlying_px_scale": 10000
  }

4) Pull Order Book data from DBOE Relayer (can do via Smart Contract alternatively)

  • To pull Level 1 Order Book for the whole expiry:

  • To pull Order Book for one particular Option Series:

II. Interacting with DBOE Smart Contract

With DBOE Smart Contract addresses found in step 3 above (e.g. clearing_house or ob_address)

5) Granting Spending Limit (both USDT and Long & Short Option) to Clearing House in order to start trading

  • Usual approve() on USDT

  • For Options, Users can either do one by one as regular ERC20 tokens or call function enableTrading(bytes32 _und, uint256 _exp) on the clearing house smart contract. Two input parameters are underlying and expiry.

6) To submit prices, there are two methods, one for MKT order and one for LMT orders:

  • LMT order: toPrice(bytes32 optionSeries, bool buySell, uint256 amount, uint256 priceLevel, uint256 validPeriodSecs). Please note: parameter priceLevel starting with 1 as the lowest level rather than 0.

  • MKT order:

i) toTrade(bytes32 optionSeries, bool buySell, uint256 notional)

ii) toTradeByQty(bytes32 optionSeries, bool buySell, uint256 amount)

7) To cancel order: toCancel(bytes32 optionSeries, bool buySell, uint256 priceLevel, uint256 orderSubmissionTime)

8) Pull order book from DBOE Order Book Smart Contract (address with property name ob_address): obDepth(bytes32 optionSeries, bool buySell)

9) To get the reference price of a given Option: refInfo(bytes32 optionSeries)

🛡️
https://dboe.exchange:8443/api/query/clobSpecsdboe.exchange
https://dboe.exchange:8443/api/query/fixedSpreadsdboe.exchange
https://dboe.exchange:8443/api/query/listInstrument?chain=Polygondboe.exchange
https://dboe.exchange:8443/api/query/optionChainMarket?chain=Polygon&underlying=ETH&expiry=20231125&collateralGroup=20%dboe.exchange
https://dboe.exchange:8443/api/query/orderbook?chain=Polygon&instrId=E2100C1125dboe.exchange