End-to-end integration steps

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 1Level 2Level 3Level 4Level 5Level 6Level 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)

Last updated