Account

GET Positions

GET /v1/account/positions/{address}

Get all statistics related to Moby.

Path Parameters

Name
Type
Description

address*

String

EVM address to check

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/account/positions/0x1234123412341234000000000000000000000000 \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "account": "0xc45d5902d25af59d765837ebf2ce4871f67d741f",
    "BTC": [],
    "ETH": [
    {
        "expiry": "1719993600",
        "settlePrice": "3355.6346210083343",
        "positions": [
        {
            "underlyingAsset": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
            "optionTokenId": "3536458052708603627014226979739327865384555007091614891234083384688902144",
            "length": "1",
            "markPrice": 0,
            "markIv": 0,
            "mainOptionStrikePrice": 3400,
            "pairedOptionStrikePrice": 0,
            "isBuys": "true,false,false,false",
            "strikePrices": "3400,0,0,0",
            "isCalls": "true,false,false,false",
            "optionNames": "ETH-3JUL24-3400-C,,,",
            "size": "1192516486319087",
            "sizeOpened": "1192516486319087",
            "sizeClosing": "0",
            "sizeClosed": "0",
            "sizeSettled": "0",
            "isBuy": true,
            "executionPrice": "27447000000000000000000000000000",
            "openedToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "openedAmount": "32731",
            "openedCollateralToken": "",
            "openedCollateralAmount": "0",
            "openedAvgExecutionPrice": "27447000000000000000000000000000",
            "openedAvgSpotPrice": "3422163333333333000000000000000000",
            "closedToken": "",
            "closedAmount": "0",
            "closedCollateralToken": "",
            "closedCollateralAmount": "0",
            "closedAvgExecutionPrice": "0",
            "closedAvgSpotPrice": "0",
            "settledToken": "",
            "settledAmount": "0",
            "settledCollateralToken": "",
            "settledCollateralAmount": "0",
            "settledPrice": "0",
            "isSettled": false,
            "lastProcessBlockTime": "1719969792"
        },
        {
            "underlyingAsset": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
            "optionTokenId": "3536458052708691506438522393270021566436479914421440324210305881172082688",
            "length": "1",
            "markPrice": 0,
            "markIv": 0,
            "mainOptionStrikePrice": 3400,
            "pairedOptionStrikePrice": 0,
            "isBuys": "false,false,false,false",
            "strikePrices": "3400,0,0,0",
            "isCalls": "true,false,false,false",
            "optionNames": "ETH-3JUL24-3400-C,,,",
            "size": "99970000000000",
            "sizeOpened": "99970000000000",
            "sizeClosing": "0",
            "sizeClosed": "0",
            "sizeSettled": "0",
            "isBuy": false,
            "executionPrice": "22105000000000000000000000000000",
            "openedToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "openedAmount": "2209",
            "openedCollateralToken": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
            "openedCollateralAmount": "99970000000000",
            "openedAvgExecutionPrice": "22105000000000000000000000000000",
            "openedAvgSpotPrice": "3416529999999999700000000000000000",
            "closedToken": "",
            "closedAmount": "0",
            "closedCollateralToken": "",
            "closedCollateralAmount": "0",
            "closedAvgExecutionPrice": "0",
            "closedAvgSpotPrice": "0",
            "settledToken": "",
            "settledAmount": "0",
            "settledCollateralToken": "",
            "settledCollateralAmount": "0",
            "settledPrice": "0",
            "isSettled": false,
            "lastProcessBlockTime": "1719969520"
        }]
    }],
    "lastUpdatedAt": "1719970232"
}

Properties in the Response

Name
Type
Description

account

String

The account address for which the positions are being retrieved.

BTC

Array

An array of BTC positions.

ETH

Array

An array of ETH positions.

expiry

String

The expiry timestamp of the option in Unix epoch time.

settlePrice

String

The settle price of the option.

positions

Array

An array of position objects for the given cryptocurrency.

underlyingAsset

String

The address of the underlying asset.

optionTokenId

String

The unique identifier for the ERC-1155 option token.

length

String

The number of instrument that the corresponding position held. (naked: 1, combo: 2)

markPrice

Number

The mark price of the position.

markIv

Number

The implied volatility of the mark price.

mainOptionStrikePrice

Number

The strike price of the main option.

pairedOptionStrikePrice

Number

The strike price of the paired option. If the position is naked, it would be 0.

isBuys

String

A string indicating buy/sell status of the each instrument.

strikePrices

String

A string indicating the strike prices of each instrument.

isCalls

String

A string indicating call/put status of the each instrument.

optionNames

String

The names of the instrument.

size

String

The option size of the position.

sizeOpened

String

The size of the position when opened.

sizeClosing

String

The size of the position when closing.

sizeClosed

String

The size of the position when closed.

sizeSettled

String

The size of the position when settled.

isBuy

Boolean

Indicates if the position is a buy.

executionPrice

String

The execution price of the trade. Represented as a string to handle large numbers.

openedToken

String

The paid token contract when the position was opened.

openedAmount

String

The amount of the paid token used when the position was opened.

openedCollateralToken

String

The collateral token contract when the position was opened.

openedCollateralAmount

String

The amount of the collateral token when the position was opened.

openedAvgExecutionPrice

String

The average execution price when the position was opened.

openedAvgSpotPrice

String

The average spot price when the position was opened.

closedToken

String

The closed token contract when the position was closed.

closedAmount

String

The amount of the token used when the position was closed.

closedCollateralToken

String

The collateral token used when the position was closed.

closedCollateralAmount

String

The amount of the collateral token used when the position was closed.

closedAvgExecutionPrice

String

The average execution price when the position was closed.

closedAvgSpotPrice

String

The average spot price when the position was closed.

settledToken

String

The token used when the position was settled.

settledAmount

String

The amount of the token used when the position was settled.

settledCollateralToken

String

The collateral token used when the position was settled.

settledCollateralAmount

String

The amount of the collateral token used when the position was settled.

settledPrice

String

The settle price of the position.

isSettled

Boolean

Indicates if the position is settled.

lastProcessBlockTime

String

The timestamp of the last block when the position was processed, in Unix epoch time.

lastUpdatedAt

String

The timestamp of the last update to the positions data, in Unix epoch time.

GET Trade History

GET /v1/account/optionTradeHistories/{address}

Path Parameters

Name
Type
Description

address*

String

EVM address to check

Query Parameters

Name
Type
Description

period

Integer

Query the last {period} days. If the value is undefined, the default is to query entire history.

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/account/optionTradeHistories/0x1234123412341234000000000000000000000000?period=7 \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "positionHistories": {
        "nodes": [
            {
                "avgExecutionPrice": "520544000000000000000000000000000",
                "collateralAmount": "258",
                "collateralToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                "expiry": "1719993600",
                "processBlockTime": "1719975483",
                "quoteToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                "quoteAmount": "686",
                "requestIndex": "8122",
                "roi": "-2.256485522837646769533411200590151841150796090244052375975902133153009159648368",
                "cashFlow": "-686654100000000000000000000",
                "executionPrice": "532290000000000000000000000000000",
                "optionTokenId": "1769610987930947441232244654660689200347727778291612626361544332479037440",
                "pnl": "-15152340000000000000000000",
                "settlePayoff": "0",
                "settlePrice": "0",
                "size": "129",
                "spotPrice": "61345333333333330000000000000000000",
                "type": "close"
            }
        ],
        "totalCount": 1
    }
}

Properties in the Response

Name
Type
Description

positionHistories

Object

Contains the list of position histories and related metadata.

positionHistories.nodes

Array

An array of position history objects.

avgExecutionPrice

String

The average execution price of the position. Represented as a string to handle large numbers.

collateralAmount

String

The amount of collateral associated with the position.

collateralToken

String

The address of the collateral token.

expiry

String

The expiry timestamp of the option in Unix epoch time.

processBlockTime

String

The timestamp of the block when the process was executed, in Unix epoch time.

quoteToken

String

The address of the quote token.

quoteAmount

String

The amount of quote token involved in the trade.

requestIndex

String

The index of the request in the system.

roi

String

Return on investment (ROI) of the trade, represented as a string for precision.

cashFlow

String

The cash flow amount associated with the trade.

executionPrice

String

The execution price of the trade. Represented as a string to handle large numbers.

optionTokenId

String

The unique identifier for the ERC-1155 option token.

pnl

String

Profit and loss (P&L) from the trade, represented as a string for precision.

settlePayoff

String

The payoff amount when the option is settled.

settlePrice

String

The price at which the option was settled.

size

String

The size of the option contract

spotPrice

String

The spot price at the time of the trade.

type

String

The type of action, e.g., "close".

totalCount

Integer

The total number of trade until now.

GET Settlement History

GET /v1/account/optionSettlementHistories/{address}

Path Parameters

Name
Type
Description

address

String

EVM address to check

Query Parameters

Name
Type
Description

period

Integer

Query the last {period} days. If the value is undefined, the default is to query entire history.

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/account/optionSettlementHistories/0x1234123412341234000000000000000000000000?period=7 \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "data": {
    "positionHistories": {
    "nodes": [
        {
            "avgExecutionPrice": "439800000000000000000000000000000",
            "collateralAmount": "59852",
            "collateralToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "expiry": "1719648000",
            "processBlockTime": "1719758242",
            "quoteToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "quoteAmount": "162",
            "requestIndex": "0",
            "roi": "62.349338436230104592996816734879490677580718508412914961346066393815370623010459",
            "cashFlow": "-162275857366310800000000000",
            "executionPrice": "0",
            "optionTokenId": "1769610432572719948203728359705121581943010641362055698700830170540933120",
            "pnl": "268728142633689200000000000",
            "settlePayoff": "165587609557460000000000000000000",
            "settlePrice": "61084412390442540000000000000000000",
            "size": "98",
            "spotPrice": "0",
            "type": "settle"
        },
        {
            "avgExecutionPrice": "236653000000000000000000000000000",
            "collateralAmount": "52",
            "collateralToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "expiry": "1719648000",
            "processBlockTime": "1719758237",
            "quoteToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            "quoteAmount": "14",
            "requestIndex": "0",
            "roi": "30.029363854478920613725581336387030800370162220635276121578851736508727968798198",
            "cashFlow": "-14902884860171400000000000",
            "executionPrice": "0",
            "optionTokenId": "1769610432573159345325205293554118896057718128428862753112610152738979840",
            "pnl": "6395885139828600000000000",
            "settlePayoff": "165587609557460000000000000000000",
            "settlePrice": "61084412390442540000000000000000000",
            "size": "9",
            "spotPrice": "0",
            "type": "settle"
        }
    ],
    "totalCount": 2
    }
    }
}

Properties in the Response

Name
Type
Description

data

Object

The root object containing the settlement history data.

data.positionHistories

Object

Contains the list of position histories and related metadata.

data.positionHistories.nodes

Array

An array of position history objects.

avgExecutionPrice

String

The average execution price of the position. Represented as a string to handle large numbers.

collateralAmount

String

The amount of collateral associated with the position.

collateralToken

String

The address of the collateral token.

expiry

String

The expiry timestamp of the option in Unix epoch time.

processBlockTime

String

The timestamp of the block when the process was executed, in Unix epoch time.

quoteToken

String

The address of the quote token.

quoteAmount

String

The amount of quote token involved in the trade.

requestIndex

String

The index of the request in the system.

roi

String

Return on investment (ROI) of the trade, represented as a string for precision.

cashFlow

String

The cash flow amount associated with the trade.

executionPrice

String

The execution price of the trade. Represented as a string to handle large numbers.

optionTokenId

String

The unique identifier for the option token.

pnl

String

Profit and loss (P&L) from the trade, represented as a string for precision.

settlePayoff

String

The payoff amount when the option is settled.

settlePrice

String

The price at which the option was settled.

size

String

The size of the position

spotPrice

String

The spot price at the time of the trade

type

String

The type of action, e.g., "open", "close"

totalCount

Integer

The total number of settled position history.

GET Trade Status

GET /v1/account/optionTradeStatus/{address}

Path Parameters

Name
Type
Description

address

String

EVM address to check

Query Examples

curl --request GET \
     --url https://api.moby.trade/v1/account/optionTradeStatus/0x1234123412341234000000000000000000000000?period=7 \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

Response Examples

{
    "BTC": {
        "tradeCount": 106,
        "tradeSize": 0.024331320000000004,
        "notionalVolume": 2658.7363451839738,
        "open": {
            "call": {
                "buy": 0.0030655400000000007,
                "sell": 0.00002672
            },
            "put": {
                "buy": 0.008198859999999999,
                "sell": 0.00087572
            },
            "type": {
                "buyNakedCall": 0.0021817600000000005,
                "buyCallSpread": 0.00088378,
                "buyNakedPut": 0.0009324899999999999,
                "buyPutSpread": 0.00726637,
                "sellNakedCall": 0.00000142,
                "sellCallSpread": 0.0000253,
                "sellNakedPut": 0.00000886,
                "sellPutSpread": 0.00086686
            }
        },
        "close": {
            "call": {
                "buy": 0.0030655400000000007,
                "sell": 0.00002672
            },
            "put": {
                "buy": 0.00819757,
                "sell": 0.00087465
            }
        },
        "tradeSizeByTerm": {
        "sVault": 0.024331320000000004,
        "mVault": 0,
        "lVault": 0
        }
    },
    "ETH": {...},
    "address": "0x1234123412341234000000000000000000000000"
}

Properties in the Response

Name
Type
Description

BTC

Object

Contains trade status information for Bitcoin (BTC)

BTC.tradeCount

Integer

The total number of trades executed for BTC

BTC.tradeSize

Number

Sum of all trade executed for BTC

BTC.notionalVolume

Number

The total notional volume (sum of the trade sizes times their prices) for BTC trades

BTC.open

Object

Statistic of overall tradeSize per each type of options for open position

BTC.close

Object

Statistic of overall tradeSize per each type of options for close position

BTC.tradeSizeByTerm

Object

Each tradeSize regarding the type of vault

ETH

Object

Same as BTC

address

String

The EVM address for which the trade status is provided

Last updated