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

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

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

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

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.

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

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

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

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

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

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

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