Market

GET all

GET /v1/market/all

Fetch all market data used in Moby.

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/market/all \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "market": {
        "BTC": {
            "expiries": [...],
            "options": {...}
        },
        "ETH": {
            "expiries": [...],
            "options": {...}
        }
    },
    "futuresIndices": {...},
    "riskFreeRates": {...},
    "olpStats": {...},
    "options": {...},
    "olpGreeks": {...},
    "olpAssetAmounts": {...},
    "olpUtilityRatio": {...}
}

Properties in the Response

Name
Type
Description

market

Object

Contains market data for various cryptocurrencies.

market.BTC

Object

Contains data related to Bitcoin (BTC) market.

market.BTC.expiries

Array

An array of expiry dates for BTC options.

market.BTC.options

Object

Contains BTC options data.

market.ETH

Object

Contains data related to Ethereum (ETH) market. Structure of object is same as BTC.

futuresIndices

Object

The value of futures index regarding underlying assets.

riskFreeRates

Object

Risk-free rates corresponding all active options' each underlying asset and its expiry

olpStats

Object

Contains OLP (Option Liquidity Pool) statistics: greeks, assetAmounts, and utilityRatio for each vault.

options

Object

Contains all active and inactive instrument data.

olpGreeks

Object

Contains Greek metrics (e.g., delta, gamma) for each OLP.

olpAssetAmounts

Object

Contains the utilizedAmount, availableAmount, depositedAmount of all underlying assets and vault in OLP.

olpUtilityRatio

Object

Calculate the sum of all utilizedAsset and depositedAsset amounts in USD to display utilizedUsd and depositedUsd for each OLP

GET Spot Price

GET /v1/market/spotPrice

Fetch spot prices of all supported underlying asset in Moby.

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/market/spotPrice \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "BTC": 59185.00333333333,
    "btc": 59185.00333333333,
    "ETH": 3110.6466666666665,
    "eth": 3110.6466666666665,
    "USDC": 1.0000666666666667,
    "usdc": 1.0000666666666667
}

GET instrumentList

GET /v1/market/instrumentList

Fetch the name of all active and inactive instruments.

Path Parameters

Name
Type
Description

instrument_name*

String

The name of instrument which is active. You can query the list of instrument_name via here.

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/market/instrumentList \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "instruments": {
        "active": [...],
        "inactive": [...]
    },
    "updatedAt": 1720575152781
}

GET instrument

GET /v1/market/instrument/{instrument_name}

Fetch the information of certain instrument by its name.

Path Parameters

Name
Type
Description

instrument_name*

String

The name of instrument which is active. You can query the list of instrument_name via here.

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/market/instrument/BTC-10JUL24-57500-P \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "optionId": "0x000100668e3f8000000000e09c00000000000000000000000000000000000000",
    "strikePrice": 57500,
    "markIv": 0.4763663587432049,
    "markPrice": 133.64147670623424,
    "riskPremiumRateForBuy": 0.00030108891800288804,
    "riskPremiumRateForSell": 0.013620006349789781,
    "delta": -0.2851112950414407,
    "gamma": 0.0004545865894053803,
    "vega": 5.324574907963104,
    "theta": -474.02275519292436,
    "isActive": true
}

GET Forecast Execution Price for Buy Position

GET /v1/market/forecastExecutionPrice/buy

Keep in mind that the forecasted value is dynamic, so the actual value may differ at the time of trade.

Estimate the execution price for a specific instrument and option contract size for buying position.

Query Parameters

Name
Type
Description

instrument*

String

The name of instrument which is active. You can query the list of instrument_name via here.

size*

number

The amount of option contracts that you want to buy

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/market/forecastExecutionPrice/buy?instrument=BTC-19JUL24-66000-P&size=3 \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

You can estimate the risk premium(RP) and total execution prices through the response.

{
    "RP_rate": 0.0030122401844937335,
    "G0_delta": -3.076047014405784,
    "G0_vega": 146.31805031870834,
    "G0_theta": -444.33322715213035,
    "G1_delta": -1.4449699935214169,
    "G1_vega": 87.62053705108039,
    "G1_theta": 398.74707515601676,
    "UG_delta": 33.59971322022118,
    "UG_vega": 0.3987695145573606,
    "UG_theta": 0.8506829912102671,
    "forecast": {
        "markPrice": 1374.5565772454065,
        "size": 3,
        "RP": 4.140494557838778,
        "singleOptionPrice": 1378.6970718032453,
        "totalOptionPrice": 4136.091215409736,
        "tradeFee": 59.007534,
        "totalExecutionPrice": 4195.098749409736
    }
}

Properties in the Response

Additional Context

  • G0 (Original Greeks):

    • Represents the initial Greeks (delta, vega, theta) of the existing OLP before any new trade is factored in.

    • These values are critical for understanding the baseline risk parameters.

  • G1 (Updated Greeks):

    • Represents the updated Greeks after accounting for the new trade.

    • These values reflect the adjusted risk parameters post-trade, showing the immediate impact of the new position.

  • UG (Unit Greeks):

    • Scaled and adjusted values of the updated Greeks (G1).

    • These normalized values are used for calculating the risk premium rate, taking into account the size of the OLP and other scaling factors.

Name
Type
Description

RP_rate

number

The risk premium rate applied to the forecast execution price.

G0_delta

number

The initial delta value of the OLP Greeks before the new trade.

G0_vega

number

The initial vega value of the OLP Greeks before the new trade.

G0_theta

number

The initial theta value of the OLP Greeks before the new trade.

G1_delta

number

The updated delta value of the OLP Greeks after the new trade.

G1_vega

number

The updated vega value of the OLP Greeks after the new trade.

G1_theta

number

The updated theta value of the OLP Greeks after the new trade.

UG_delta

number

The scaled and adjusted (Unit) delta value for calculating the risk premium.

UG_vega

number

The scaled and adjusted (Unit) vega value for calculating the risk premium.

UG_theta

number

The scaled and adjusted (Unit) theta value for calculating the risk premium.

forecast

object

Contains detailed forecast data for the execution price.

forecast.markPrice

number

The current mark price of the instrument.

forecast.size

number

The size of the position for which the execution price is forecasted.

forecast.RP

number

The risk premium (RP) of a single option.

forecast.singleOptionPrice

number

The price of a single option including the risk premium.

forecast.totalOptionPrice

number

The total price for the specified size of options.

forecast.tradeFee

number

The fee for executing the trade.

forecast.totalExecutionPrice

number

The total execution price including trade fees and risk premiums.

GET Forecast Execution Price for Sell Position

GET /v1/market/forecastExecutionPrice/sell

Keep in mind that the forecasted value is dynamic, so the actual value may differ at the time of trade.

Estimate the execution price for a specific instrument and option contract size for selling position.

Query Parameters

Name
Type
Description

instrument*

String

The name of instrument which is active. You can query the list of instrument_name via here.

size*

number

The amount of option contracts that you want to sell

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/market/forecastExecutionPrice/sell?instrument=BTC-19JUL24-66000-P&size=3 \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "RP_rate": 0.03792843087288748,
    "G0_delta": -3.0365582425903628,
    "G0_vega": 150.48604291046834,
    "G0_theta": -455.133828188879,
    "G1_delta": -4.5994947568479,
    "G1_vega": 209.77247541582796,
    "G1_theta": -1303.9947987846938,
    "UG_delta": 90.8652681843935,
    "UG_vega": 0.858533916923668,
    "UG_theta": 3.071134592865212,
    "forecast": {
        "markPrice": 1292.3400473676884,
        "size": 3,
        "RP": 49.016430150849494,
        "singleOptionPrice": 1243.3236172168388,
        "totalOptionPrice": 3729.970851650516,
        "tradeFee": 59.145684,
        "totalExecutionPrice": 3789.116535650516
    }
}

Response Properties

Name
Type
Description

RP_rate

number

The risk premium rate applied to the forecast execution price.

G0_delta

number

The initial delta value of the OLP Greeks before the new trade.

G0_vega

number

The initial vega value of the OLP Greeks before the new trade.

G0_theta

number

The initial theta value of the OLP Greeks before the new trade.

G1_delta

number

The updated delta value of the OLP Greeks after the new trade.

G1_vega

number

The updated vega value of the OLP Greeks after the new trade.

G1_theta

number

The updated theta value of the OLP Greeks after the new trade.

UG_delta

number

The scaled and adjusted (Unit) delta value for calculating the risk premium.

UG_vega

number

The scaled and adjusted (Unit) vega value for calculating the risk premium.

UG_theta

number

The scaled and adjusted (Unit) theta value for calculating the risk premium.

forecast

object

Contains detailed forecast data for the execution price.

forecast.markPrice

number

The current mark price of the instrument.

forecast.size

number

The size of the position for which the execution price is forecasted.

forecast.RP

number

The risk premium (RP) of a single option.

forecast.singleOptionPrice

number

The price of a single option including the risk premium.

forecast.totalOptionPrice

number

The total price for the specified size of options.

forecast.tradeFee

number

The fee for executing the trade.

forecast.totalExecutionPrice

number

The total execution price including trade fees and risk premiums.

GET Option ID by Instrument

GET /v1/market/optionIdByInstrument/{instrument}

The concepts of optionId and optionTokenId may cause confusion as they are different. Please refer to Appendix 2 for more details.

Fetch the optionId by querying with instrument name.

Path Parameters

Name
Type
Description

instrument*

String

The name of instrument which is active. You can query the list of instrument_name via here.

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/market/optionIdByInstrument/BTC-10JUL24-57500-P \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "instrument": "BTC-10JUL24-57500-P",
    "optionId": "0x000100668e3f8000000000e09c"
}

GET A list of Instruments by Option ID

GET /v1/market/instrumentsByOptionId/{instrument}

The concepts of optionId and optionTokenId may cause confusion as they are different. Please refer to Appendix 2 for more details.

Fetch the instrument list related with optionId.

Path Parameters

Name
Type
Description

optionId*

String(hex)

The encoded type of instrument information.

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/market/instrumentsByOptionId/0x000100668e3f8000000000e09c \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "optionId": "0x000100668e3f8000000000e09c",
    "instruments": [
        "BTC-10JUL24-57500-C",
        "BTC-10JUL24-57500-P"
    ]
}

GET optionTokenId by Instrument Name

GET /v1/market/optionTokenIdByInstrument/{instrument}/{buyOrSell}

The concepts of optionId and optionTokenId may cause confusion as they are different. Please refer to Appendix 2 for more details.

Fetch the instrument list related with optionId.

Path Parameters

Name
Type
Description

instrument*

String

The name of instrument.

buyOrSell*

String

The direction of the position.

option: ["buy", "sell"]

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/market/optionTokenIdByInstrument/BTC-10JUL24-57500-P/buy \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "optionTokenId": "0x1769611959806549332523790152232844486013328925062407377440073165073022976",
    "instrument": "BTC-10JUL24-57500-P",
    "buyOrSell": "buy",
    "vaultType": "sVault"
}

GET A list of Instruments by optionTokenId

GET /v1/market/instrumentsByOptionTokenId/{optionTokenId}

The concepts of optionId and optionTokenId may cause confusion as they are different. Please refer to Appendix 2 for more details.

Fetch all composed instruments given an optionTokenId.

Path Parameters

Name
Type
Description

optionTokenId*

String(bytes)

ID of ERC-1155 option token

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/market/instrumentsByOptionTokenId/0x1769611959806549332523790152232844486013328925062407377440073165073022976 \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "optionTokenId": "0x1769611959806549332523790152232844486013328925062407377440073165073022976",
    "instruments": ["BTC-10JUL24-57500-P"],
    "isBuys": [true],
    "strategy": "BuyPut"
}

Last updated