Indexer Documentation
Indexer API

Indexer API v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Base URLs:

Note: Messages on Indexer WebSocket feeds are typically more recent than data fetched via Indexer's REST API, because the latter is backed by read replicas of the databases that feed the former. Ordinarily this difference is minimal (less than a second), but it might become prolonged under load. Please see Indexer Architecture (opens in a new tab) for more information.

Authentication

Default

GetAddress

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/addresses/{address}', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/addresses/{address}`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /addresses/{address}

Parameters

NameInTypeRequiredDescription
addresspathstringtruenone

Example responses

200 Response

{
  "subaccounts": [
    {
      "address": "string",
      "subaccountNumber": 0.1,
      "equity": "string",
      "freeCollateral": "string",
      "openPerpetualPositions": {
        "property1": {
          "market": "string",
          "status": "OPEN",
          "side": "LONG",
          "size": "string",
          "maxSize": "string",
          "entryPrice": "string",
          "realizedPnl": "string",
          "createdAt": "string",
          "createdAtHeight": "string",
          "sumOpen": "string",
          "sumClose": "string",
          "netFunding": "string",
          "unrealizedPnl": "string",
          "closedAt": null,
          "exitPrice": "string",
          "subaccountNumber": 0.1
        },
        "property2": {
          "market": "string",
          "status": "OPEN",
          "side": "LONG",
          "size": "string",
          "maxSize": "string",
          "entryPrice": "string",
          "realizedPnl": "string",
          "createdAt": "string",
          "createdAtHeight": "string",
          "sumOpen": "string",
          "sumClose": "string",
          "netFunding": "string",
          "unrealizedPnl": "string",
          "closedAt": null,
          "exitPrice": "string",
          "subaccountNumber": 0.1
        }
      },
      "assetPositions": {
        "property1": {
          "symbol": "string",
          "side": "LONG",
          "size": "string",
          "assetId": "string",
          "subaccountNumber": 0.1
        },
        "property2": {
          "symbol": "string",
          "side": "LONG",
          "size": "string",
          "assetId": "string",
          "subaccountNumber": 0.1
        }
      },
      "marginEnabled": true,
      "updatedAtHeight": "string"
    }
  ],
  "totalTradingRewards": "string"
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkAddressResponse

GetSubaccount

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/addresses/{address}/subaccountNumber/{subaccountNumber}', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/addresses/{address}/subaccountNumber/{subaccountNumber}`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /addresses/{address}/subaccountNumber/{subaccountNumber}

Parameters

NameInTypeRequiredDescription
addresspathstringtruenone
subaccountNumberpathnumber(double)truenone

Example responses

200 Response

{
  "address": "string",
  "subaccountNumber": 0.1,
  "equity": "string",
  "freeCollateral": "string",
  "openPerpetualPositions": {
    "property1": {
      "market": "string",
      "status": "OPEN",
      "side": "LONG",
      "size": "string",
      "maxSize": "string",
      "entryPrice": "string",
      "realizedPnl": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "sumOpen": "string",
      "sumClose": "string",
      "netFunding": "string",
      "unrealizedPnl": "string",
      "closedAt": "string",
      "exitPrice": "string",
      "subaccountNumber": 0.1
    },
    "property2": {
      "market": "string",
      "status": "OPEN",
      "side": "LONG",
      "size": "string",
      "maxSize": "string",
      "entryPrice": "string",
      "realizedPnl": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "sumOpen": "string",
      "sumClose": "string",
      "netFunding": "string",
      "unrealizedPnl": "string",
      "closedAt": "string",
      "exitPrice": "string",
      "subaccountNumber": 0.1
    }
  },
  "assetPositions": {
    "property1": {
      "symbol": "string",
      "side": "LONG",
      "size": "string",
      "assetId": "string",
      "subaccountNumber": 0.1
    },
    "property2": {
      "symbol": "string",
      "side": "LONG",
      "size": "string",
      "assetId": "string",
      "subaccountNumber": 0.1
    }
  },
  "marginEnabled": true,
  "updatedAtHeight": "string"
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkSubaccountResponseObject

GetParentSubaccount

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/addresses/{address}/parentSubaccountNumber/{parentSubaccountNumber}', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/addresses/{address}/parentSubaccountNumber/{parentSubaccountNumber}`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /addresses/{address}/parentSubaccountNumber/{parentSubaccountNumber}

Parameters

NameInTypeRequiredDescription
addresspathstringtruenone
parentSubaccountNumberpathnumber(double)truenone

Example responses

200 Response

{
  "address": "string",
  "parentSubaccountNumber": 0.1,
  "equity": "string",
  "freeCollateral": "string",
  "childSubaccounts": [
    {
      "address": "string",
      "subaccountNumber": 0.1,
      "equity": "string",
      "freeCollateral": "string",
      "openPerpetualPositions": {
        "property1": {
          "market": "string",
          "status": "OPEN",
          "side": "LONG",
          "size": "string",
          "maxSize": "string",
          "entryPrice": "string",
          "realizedPnl": "string",
          "createdAt": "string",
          "createdAtHeight": "string",
          "sumOpen": "string",
          "sumClose": "string",
          "netFunding": "string",
          "unrealizedPnl": "string",
          "closedAt": null,
          "exitPrice": "string",
          "subaccountNumber": 0.1
        },
        "property2": {
          "market": "string",
          "status": "OPEN",
          "side": "LONG",
          "size": "string",
          "maxSize": "string",
          "entryPrice": "string",
          "realizedPnl": "string",
          "createdAt": "string",
          "createdAtHeight": "string",
          "sumOpen": "string",
          "sumClose": "string",
          "netFunding": "string",
          "unrealizedPnl": "string",
          "closedAt": null,
          "exitPrice": "string",
          "subaccountNumber": 0.1
        }
      },
      "assetPositions": {
        "property1": {
          "symbol": "string",
          "side": "LONG",
          "size": "string",
          "assetId": "string",
          "subaccountNumber": 0.1
        },
        "property2": {
          "symbol": "string",
          "side": "LONG",
          "size": "string",
          "assetId": "string",
          "subaccountNumber": 0.1
        }
      },
      "marginEnabled": true,
      "updatedAtHeight": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkParentSubaccountResponse

GetAssetPositions

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/assetPositions', params={
  'address': 'string',  'subaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/assetPositions?address=string&subaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /assetPositions

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
subaccountNumberquerynumber(double)truenone

Example responses

200 Response

{
  "positions": [
    {
      "symbol": "string",
      "side": "LONG",
      "size": "string",
      "assetId": "string",
      "subaccountNumber": 0.1
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkAssetPositionResponse

GetAssetPositionsForParentSubaccount

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/assetPositions/parentSubaccountNumber', params={
  'address': 'string',  'parentSubaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/assetPositions/parentSubaccountNumber?address=string&parentSubaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /assetPositions/parentSubaccountNumber

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
parentSubaccountNumberquerynumber(double)truenone

Example responses

200 Response

{
  "positions": [
    {
      "symbol": "string",
      "side": "LONG",
      "size": "string",
      "assetId": "string",
      "subaccountNumber": 0.1
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkAssetPositionResponse

GetCandles

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/candles/perpetualMarkets/{ticker}', params={
  'resolution': '1MIN'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/candles/perpetualMarkets/{ticker}?resolution=1MIN`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /candles/perpetualMarkets/{ticker}

Parameters

NameInTypeRequiredDescription
tickerpathstringtruenone
resolutionqueryCandleResolutiontruenone
limitquerynumber(double)falsenone
fromISOquerystringfalsenone
toISOquerystringfalsenone

Enumerated Values

ParameterValue
resolution1MIN
resolution5MINS
resolution15MINS
resolution30MINS
resolution1HOUR
resolution4HOURS
resolution1DAY

Example responses

200 Response

{
  "candles": [
    {
      "startedAt": "string",
      "ticker": "string",
      "resolution": "1MIN",
      "low": "string",
      "high": "string",
      "open": "string",
      "close": "string",
      "baseTokenVolume": "string",
      "usdVolume": "string",
      "trades": 0.1,
      "startingOpenInterest": "string",
      "id": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkCandleResponse

Screen

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/compliance/screen/{address}', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/compliance/screen/{address}`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /compliance/screen/{address}

Parameters

NameInTypeRequiredDescription
addresspathstringtruenone

Example responses

200 Response

{
  "status": "COMPLIANT",
  "reason": "MANUAL",
  "updatedAt": "string"
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkComplianceV2Response

GetFills

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/fills', params={
  'address': 'string',  'subaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/fills?address=string&subaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /fills

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
subaccountNumberquerynumber(double)truenone
marketquerystringfalsenone
marketTypequeryMarketTypefalsenone
limitquerynumber(double)falsenone
createdBeforeOrAtHeightquerynumber(double)falsenone
createdBeforeOrAtqueryIsoStringfalsenone
pagequerynumber(double)falsenone

Enumerated Values

ParameterValue
marketTypePERPETUAL
marketTypeSPOT

Example responses

200 Response

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "fills": [
    {
      "id": "string",
      "side": "BUY",
      "liquidity": "TAKER",
      "type": "LIMIT",
      "market": "string",
      "marketType": "PERPETUAL",
      "price": "string",
      "size": "string",
      "fee": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "orderId": "string",
      "clientMetadata": "string",
      "subaccountNumber": 0.1
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkFillResponse

GetFillsForParentSubaccount

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/fills/parentSubaccount', params={
  'address': 'string',  'parentSubaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/fills/parentSubaccount?address=string&parentSubaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /fills/parentSubaccount

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
parentSubaccountNumberquerynumber(double)truenone
marketquerystringfalsenone
marketTypequeryMarketTypefalsenone
limitquerynumber(double)falsenone
createdBeforeOrAtHeightquerynumber(double)falsenone
createdBeforeOrAtqueryIsoStringfalsenone
pagequerynumber(double)falsenone

Enumerated Values

ParameterValue
marketTypePERPETUAL
marketTypeSPOT

Example responses

200 Response

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "fills": [
    {
      "id": "string",
      "side": "BUY",
      "liquidity": "TAKER",
      "type": "LIMIT",
      "market": "string",
      "marketType": "PERPETUAL",
      "price": "string",
      "size": "string",
      "fee": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "orderId": "string",
      "clientMetadata": "string",
      "subaccountNumber": 0.1
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkFillResponse

GetHeight

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/height', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/height`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /height

Example responses

200 Response

{
  "height": "string",
  "time": "string"
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkHeightResponse

GetTradingRewards

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/historicalBlockTradingRewards/{address}', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/historicalBlockTradingRewards/{address}`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /historicalBlockTradingRewards/{address}

Parameters

NameInTypeRequiredDescription
addresspathstringtruenone
limitquerynumber(double)falsenone
startingBeforeOrAtqueryIsoStringfalsenone
startingBeforeOrAtHeightquerystringfalsenone

Example responses

200 Response

{
  "rewards": [
    {
      "tradingReward": "string",
      "createdAt": "string",
      "createdAtHeight": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkHistoricalBlockTradingRewardsResponse

GetHistoricalFunding

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/historicalFunding/{ticker}', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/historicalFunding/{ticker}`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /historicalFunding/{ticker}

Parameters

NameInTypeRequiredDescription
tickerpathstringtruenone
limitquerynumber(double)falsenone
effectiveBeforeOrAtHeightquerynumber(double)falsenone
effectiveBeforeOrAtqueryIsoStringfalsenone

Example responses

200 Response

{
  "historicalFunding": [
    {
      "ticker": "string",
      "rate": "string",
      "price": "string",
      "effectiveAt": "string",
      "effectiveAtHeight": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkHistoricalFundingResponse

GetHistoricalPnl

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/historical-pnl', params={
  'address': 'string',  'subaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/historical-pnl?address=string&subaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /historical-pnl

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
subaccountNumberquerynumber(double)truenone
limitquerynumber(double)falsenone
createdBeforeOrAtHeightquerynumber(double)falsenone
createdBeforeOrAtqueryIsoStringfalsenone
createdOnOrAfterHeightquerynumber(double)falsenone
createdOnOrAfterqueryIsoStringfalsenone
pagequerynumber(double)falsenone

Example responses

200 Response

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "historicalPnl": [
    {
      "id": "string",
      "subaccountId": "string",
      "equity": "string",
      "totalPnl": "string",
      "netTransfers": "string",
      "createdAt": "string",
      "blockHeight": "string",
      "blockTime": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkHistoricalPnlResponse

GetHistoricalPnlForParentSubaccount

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/historical-pnl/parentSubaccount', params={
  'address': 'string',  'parentSubaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/historical-pnl/parentSubaccount?address=string&parentSubaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /historical-pnl/parentSubaccount

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
parentSubaccountNumberquerynumber(double)truenone
limitquerynumber(double)falsenone
createdBeforeOrAtHeightquerynumber(double)falsenone
createdBeforeOrAtqueryIsoStringfalsenone
createdOnOrAfterHeightquerynumber(double)falsenone
createdOnOrAfterqueryIsoStringfalsenone
pagequerynumber(double)falsenone

Example responses

200 Response

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "historicalPnl": [
    {
      "id": "string",
      "subaccountId": "string",
      "equity": "string",
      "totalPnl": "string",
      "netTransfers": "string",
      "createdAt": "string",
      "blockHeight": "string",
      "blockTime": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkHistoricalPnlResponse

GetAggregations

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/historicalTradingRewardAggregations/{address}', params={
  'period': 'DAILY'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/historicalTradingRewardAggregations/{address}?period=DAILY`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /historicalTradingRewardAggregations/{address}

Parameters

NameInTypeRequiredDescription
addresspathstringtruenone
periodqueryTradingRewardAggregationPeriodtruenone
limitquerynumber(double)falsenone
startingBeforeOrAtqueryIsoStringfalsenone
startingBeforeOrAtHeightquerystringfalsenone

Enumerated Values

ParameterValue
periodDAILY
periodWEEKLY
periodMONTHLY

Example responses

200 Response

{
  "rewards": [
    {
      "tradingReward": "string",
      "startedAt": "string",
      "startedAtHeight": "string",
      "endedAt": "string",
      "endedAtHeight": "string",
      "period": "DAILY"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkHistoricalTradingRewardAggregationsResponse

GetPerpetualMarket

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/orderbooks/perpetualMarket/{ticker}', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/orderbooks/perpetualMarket/{ticker}`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /orderbooks/perpetualMarket/{ticker}

Parameters

NameInTypeRequiredDescription
tickerpathstringtruenone

Example responses

200 Response

{
  "bids": [
    {
      "price": "string",
      "size": "string"
    }
  ],
  "asks": [
    {
      "price": "string",
      "size": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkOrderbookResponseObject

ListOrders

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/orders', params={
  'address': 'string',  'subaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/orders?address=string&subaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /orders

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
subaccountNumberquerynumber(double)truenone
limitquerynumber(double)falsenone
tickerquerystringfalsenone
sidequeryOrderSidefalsenone
typequeryOrderTypefalsenone
statusqueryarray[any]falsenone
goodTilBlockBeforeOrAtquerynumber(double)falsenone
goodTilBlockTimeBeforeOrAtqueryIsoStringfalsenone
returnLatestOrdersquerybooleanfalsenone

Enumerated Values

ParameterValue
sideBUY
sideSELL
typeLIMIT
typeMARKET
typeSTOP_LIMIT
typeSTOP_MARKET
typeTRAILING_STOP
typeTAKE_PROFIT
typeTAKE_PROFIT_MARKET

Example responses

200 Response

[
  {
    "id": "string",
    "subaccountId": "string",
    "clientId": "string",
    "clobPairId": "string",
    "side": "BUY",
    "size": "string",
    "totalFilled": "string",
    "price": "string",
    "type": "LIMIT",
    "reduceOnly": true,
    "orderFlags": "string",
    "goodTilBlock": "string",
    "goodTilBlockTime": "string",
    "createdAtHeight": "string",
    "clientMetadata": "string",
    "triggerPrice": "string",
    "timeInForce": "GTT",
    "status": "OPEN",
    "postOnly": true,
    "ticker": "string",
    "updatedAt": "string",
    "updatedAtHeight": "string",
    "subaccountNumber": 0.1
  }
]

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
anonymous[OrderResponseObject]falsenonenone
» idstringtruenonenone
» subaccountIdstringtruenonenone
» clientIdstringtruenonenone
» clobPairIdstringtruenonenone
» sideOrderSidetruenonenone
» sizestringtruenonenone
» totalFilledstringtruenonenone
» pricestringtruenonenone
» typeOrderTypetruenonenone
» reduceOnlybooleantruenonenone
» orderFlagsstringtruenonenone
» goodTilBlockstringfalsenonenone
» goodTilBlockTimestringfalsenonenone
» createdAtHeightstringfalsenonenone
» clientMetadatastringtruenonenone
» triggerPricestringfalsenonenone
» timeInForceAPITimeInForcetruenonenone
» statusanytruenonenone

anyOf

NameTypeRequiredRestrictionsDescription
»» anonymousOrderStatusfalsenonenone

or

NameTypeRequiredRestrictionsDescription
»» anonymousBestEffortOpenedStatusfalsenonenone

continued

NameTypeRequiredRestrictionsDescription
» postOnlybooleantruenonenone
» tickerstringtruenonenone
» updatedAtIsoStringfalsenonenone
» updatedAtHeightstringfalsenonenone
» subaccountNumbernumber(double)truenonenone

Enumerated Values

PropertyValue
sideBUY
sideSELL
typeLIMIT
typeMARKET
typeSTOP_LIMIT
typeSTOP_MARKET
typeTRAILING_STOP
typeTAKE_PROFIT
typeTAKE_PROFIT_MARKET
timeInForceGTT
timeInForceFOK
timeInForceIOC
anonymousOPEN
anonymousFILLED
anonymousCANCELED
anonymousBEST_EFFORT_CANCELED
anonymousUNTRIGGERED
anonymousBEST_EFFORT_OPENED

ListOrdersForParentSubaccount

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/orders/parentSubaccountNumber', params={
  'address': 'string',  'parentSubaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/orders/parentSubaccountNumber?address=string&parentSubaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /orders/parentSubaccountNumber

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
parentSubaccountNumberquerynumber(double)truenone
limitquerynumber(double)falsenone
tickerquerystringfalsenone
sidequeryOrderSidefalsenone
typequeryOrderTypefalsenone
statusqueryarray[any]falsenone
goodTilBlockBeforeOrAtquerynumber(double)falsenone
goodTilBlockTimeBeforeOrAtqueryIsoStringfalsenone
returnLatestOrdersquerybooleanfalsenone

Enumerated Values

ParameterValue
sideBUY
sideSELL
typeLIMIT
typeMARKET
typeSTOP_LIMIT
typeSTOP_MARKET
typeTRAILING_STOP
typeTAKE_PROFIT
typeTAKE_PROFIT_MARKET

Example responses

200 Response

[
  {
    "id": "string",
    "subaccountId": "string",
    "clientId": "string",
    "clobPairId": "string",
    "side": "BUY",
    "size": "string",
    "totalFilled": "string",
    "price": "string",
    "type": "LIMIT",
    "reduceOnly": true,
    "orderFlags": "string",
    "goodTilBlock": "string",
    "goodTilBlockTime": "string",
    "createdAtHeight": "string",
    "clientMetadata": "string",
    "triggerPrice": "string",
    "timeInForce": "GTT",
    "status": "OPEN",
    "postOnly": true,
    "ticker": "string",
    "updatedAt": "string",
    "updatedAtHeight": "string",
    "subaccountNumber": 0.1
  }
]

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
anonymous[OrderResponseObject]falsenonenone
» idstringtruenonenone
» subaccountIdstringtruenonenone
» clientIdstringtruenonenone
» clobPairIdstringtruenonenone
» sideOrderSidetruenonenone
» sizestringtruenonenone
» totalFilledstringtruenonenone
» pricestringtruenonenone
» typeOrderTypetruenonenone
» reduceOnlybooleantruenonenone
» orderFlagsstringtruenonenone
» goodTilBlockstringfalsenonenone
» goodTilBlockTimestringfalsenonenone
» createdAtHeightstringfalsenonenone
» clientMetadatastringtruenonenone
» triggerPricestringfalsenonenone
» timeInForceAPITimeInForcetruenonenone
» statusanytruenonenone

anyOf

NameTypeRequiredRestrictionsDescription
»» anonymousOrderStatusfalsenonenone

or

NameTypeRequiredRestrictionsDescription
»» anonymousBestEffortOpenedStatusfalsenonenone

continued

NameTypeRequiredRestrictionsDescription
» postOnlybooleantruenonenone
» tickerstringtruenonenone
» updatedAtIsoStringfalsenonenone
» updatedAtHeightstringfalsenonenone
» subaccountNumbernumber(double)truenonenone

Enumerated Values

PropertyValue
sideBUY
sideSELL
typeLIMIT
typeMARKET
typeSTOP_LIMIT
typeSTOP_MARKET
typeTRAILING_STOP
typeTAKE_PROFIT
typeTAKE_PROFIT_MARKET
timeInForceGTT
timeInForceFOK
timeInForceIOC
anonymousOPEN
anonymousFILLED
anonymousCANCELED
anonymousBEST_EFFORT_CANCELED
anonymousUNTRIGGERED
anonymousBEST_EFFORT_OPENED

GetOrder

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/orders/{orderId}', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/orders/{orderId}`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /orders/{orderId}

Parameters

NameInTypeRequiredDescription
orderIdpathstringtruenone

Example responses

200 Response

{
  "id": "string",
  "subaccountId": "string",
  "clientId": "string",
  "clobPairId": "string",
  "side": "BUY",
  "size": "string",
  "totalFilled": "string",
  "price": "string",
  "type": "LIMIT",
  "reduceOnly": true,
  "orderFlags": "string",
  "goodTilBlock": "string",
  "goodTilBlockTime": "string",
  "createdAtHeight": "string",
  "clientMetadata": "string",
  "triggerPrice": "string",
  "timeInForce": "GTT",
  "status": "OPEN",
  "postOnly": true,
  "ticker": "string",
  "updatedAt": "string",
  "updatedAtHeight": "string",
  "subaccountNumber": 0.1
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkOrderResponseObject

ListPerpetualMarkets

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/perpetualMarkets', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/perpetualMarkets`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /perpetualMarkets

Parameters

NameInTypeRequiredDescription
limitquerynumber(double)falsenone
tickerquerystringfalsenone

Example responses

200 Response

{
  "markets": {
    "property1": {
      "clobPairId": "string",
      "ticker": "string",
      "status": "ACTIVE",
      "oraclePrice": "string",
      "priceChange24H": "string",
      "volume24H": "string",
      "trades24H": 0.1,
      "nextFundingRate": "string",
      "initialMarginFraction": "string",
      "maintenanceMarginFraction": "string",
      "openInterest": "string",
      "atomicResolution": 0.1,
      "quantumConversionExponent": 0.1,
      "tickSize": "string",
      "stepSize": "string",
      "stepBaseQuantums": 0.1,
      "subticksPerTick": 0.1,
      "marketType": "CROSS",
      "openInterestLowerCap": "string",
      "openInterestUpperCap": "string",
      "baseOpenInterest": "string"
    },
    "property2": {
      "clobPairId": "string",
      "ticker": "string",
      "status": "ACTIVE",
      "oraclePrice": "string",
      "priceChange24H": "string",
      "volume24H": "string",
      "trades24H": 0.1,
      "nextFundingRate": "string",
      "initialMarginFraction": "string",
      "maintenanceMarginFraction": "string",
      "openInterest": "string",
      "atomicResolution": 0.1,
      "quantumConversionExponent": 0.1,
      "tickSize": "string",
      "stepSize": "string",
      "stepBaseQuantums": 0.1,
      "subticksPerTick": 0.1,
      "marketType": "CROSS",
      "openInterestLowerCap": "string",
      "openInterestUpperCap": "string",
      "baseOpenInterest": "string"
    }
  }
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkPerpetualMarketResponse

ListPositions

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/perpetualPositions', params={
  'address': 'string',  'subaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/perpetualPositions?address=string&subaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /perpetualPositions

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
subaccountNumberquerynumber(double)truenone
statusqueryarray[string]falsenone
limitquerynumber(double)falsenone
createdBeforeOrAtHeightquerynumber(double)falsenone
createdBeforeOrAtqueryIsoStringfalsenone

Enumerated Values

ParameterValue
statusOPEN
statusCLOSED
statusLIQUIDATED

Example responses

200 Response

{
  "positions": [
    {
      "market": "string",
      "status": "OPEN",
      "side": "LONG",
      "size": "string",
      "maxSize": "string",
      "entryPrice": "string",
      "realizedPnl": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "sumOpen": "string",
      "sumClose": "string",
      "netFunding": "string",
      "unrealizedPnl": "string",
      "closedAt": "string",
      "exitPrice": "string",
      "subaccountNumber": 0.1
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkPerpetualPositionResponse

ListPositionsForParentSubaccount

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/perpetualPositions/parentSubaccountNumber', params={
  'address': 'string',  'parentSubaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/perpetualPositions/parentSubaccountNumber?address=string&parentSubaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /perpetualPositions/parentSubaccountNumber

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
parentSubaccountNumberquerynumber(double)truenone
statusqueryarray[string]falsenone
limitquerynumber(double)falsenone
createdBeforeOrAtHeightquerynumber(double)falsenone
createdBeforeOrAtqueryIsoStringfalsenone

Enumerated Values

ParameterValue
statusOPEN
statusCLOSED
statusLIQUIDATED

Example responses

200 Response

{
  "positions": [
    {
      "market": "string",
      "status": "OPEN",
      "side": "LONG",
      "size": "string",
      "maxSize": "string",
      "entryPrice": "string",
      "realizedPnl": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "sumOpen": "string",
      "sumClose": "string",
      "netFunding": "string",
      "unrealizedPnl": "string",
      "closedAt": "string",
      "exitPrice": "string",
      "subaccountNumber": 0.1
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkPerpetualPositionResponse

Get

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/sparklines', params={
  'timePeriod': 'ONE_DAY'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/sparklines?timePeriod=ONE_DAY`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /sparklines

Parameters

NameInTypeRequiredDescription
timePeriodquerySparklineTimePeriodtruenone

Enumerated Values

ParameterValue
timePeriodONE_DAY
timePeriodSEVEN_DAYS

Example responses

200 Response

{
  "property1": [
    "string"
  ],
  "property2": [
    "string"
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkSparklineResponseObject

GetTime

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/time', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/time`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /time

Example responses

200 Response

{
  "iso": "string",
  "epoch": 0.1
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkTimeResponse

GetTrades

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/trades/perpetualMarket/{ticker}', headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/trades/perpetualMarket/{ticker}`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /trades/perpetualMarket/{ticker}

Parameters

NameInTypeRequiredDescription
tickerpathstringtruenone
limitquerynumber(double)falsenone
createdBeforeOrAtHeightquerynumber(double)falsenone
createdBeforeOrAtqueryIsoStringfalsenone
pagequerynumber(double)falsenone

Example responses

200 Response

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "trades": [
    {
      "id": "string",
      "side": "BUY",
      "size": "string",
      "price": "string",
      "type": "LIMIT",
      "createdAt": "string",
      "createdAtHeight": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkTradeResponse

GetTransfers

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/transfers', params={
  'address': 'string',  'subaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/transfers?address=string&subaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /transfers

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
subaccountNumberquerynumber(double)truenone
limitquerynumber(double)falsenone
createdBeforeOrAtHeightquerynumber(double)falsenone
createdBeforeOrAtqueryIsoStringfalsenone
pagequerynumber(double)falsenone

Example responses

200 Response

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "transfers": [
    {
      "id": "string",
      "sender": {
        "subaccountNumber": 0.1,
        "address": "string"
      },
      "recipient": {
        "subaccountNumber": 0.1,
        "address": "string"
      },
      "size": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "symbol": "string",
      "type": "TRANSFER_IN",
      "transactionHash": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkTransferResponse

GetTransfersForParentSubaccount

Code samples

import requests
headers = {
  'Accept': 'application/json'
}
 
# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
 
r = requests.get(f'{baseURL}/transfers/parentSubaccountNumber', params={
  'address': 'string',  'parentSubaccountNumber': '0.1'
}, headers = headers)
 
print(r.json())
 
 
const headers = {
  'Accept':'application/json'
};
 
// For the deployment by DYDX token holders, use
// const baseURL = 'https://indexer.dydx.trade/v4';
const baseURL = 'https://dydx-testnet.imperator.co/v4';
 
fetch(`${baseURL}/transfers/parentSubaccountNumber?address=string&parentSubaccountNumber=0.1`,
{
  method: 'GET',
 
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
 

GET /transfers/parentSubaccountNumber

Parameters

NameInTypeRequiredDescription
addressquerystringtruenone
parentSubaccountNumberquerynumber(double)truenone
limitquerynumber(double)falsenone
createdBeforeOrAtHeightquerynumber(double)falsenone
createdBeforeOrAtqueryIsoStringfalsenone
pagequerynumber(double)falsenone

Example responses

200 Response

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "transfers": [
    {
      "id": "string",
      "sender": {
        "subaccountNumber": 0.1,
        "address": "string"
      },
      "recipient": {
        "subaccountNumber": 0.1,
        "address": "string"
      },
      "size": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "symbol": "string",
      "type": "TRANSFER_IN",
      "transactionHash": "string"
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OK (opens in a new tab)OkParentSubaccountTransferResponse

Schemas

PerpetualPositionStatus

"OPEN"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousOPEN
anonymousCLOSED
anonymousLIQUIDATED

PositionSide

"LONG"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousLONG
anonymousSHORT

IsoString

"string"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

PerpetualPositionResponseObject

{
  "market": "string",
  "status": "OPEN",
  "side": "LONG",
  "size": "string",
  "maxSize": "string",
  "entryPrice": "string",
  "realizedPnl": "string",
  "createdAt": "string",
  "createdAtHeight": "string",
  "sumOpen": "string",
  "sumClose": "string",
  "netFunding": "string",
  "unrealizedPnl": "string",
  "closedAt": "string",
  "exitPrice": "string",
  "subaccountNumber": 0.1
}
 

Properties

NameTypeRequiredRestrictionsDescription
marketstringtruenonenone
statusPerpetualPositionStatustruenonenone
sidePositionSidetruenonenone
sizestringtruenonenone
maxSizestringtruenonenone
entryPricestringtruenonenone
realizedPnlstringtruenonenone
createdAtIsoStringtruenonenone
createdAtHeightstringtruenonenone
sumOpenstringtruenonenone
sumClosestringtruenonenone
netFundingstringtruenonenone
unrealizedPnlstringtruenonenone
closedAtIsoString¦nullfalsenonenone
exitPricestring¦nullfalsenonenone
subaccountNumbernumber(double)truenonenone

PerpetualPositionsMap

{
  "property1": {
    "market": "string",
    "status": "OPEN",
    "side": "LONG",
    "size": "string",
    "maxSize": "string",
    "entryPrice": "string",
    "realizedPnl": "string",
    "createdAt": "string",
    "createdAtHeight": "string",
    "sumOpen": "string",
    "sumClose": "string",
    "netFunding": "string",
    "unrealizedPnl": "string",
    "closedAt": "string",
    "exitPrice": "string",
    "subaccountNumber": 0.1
  },
  "property2": {
    "market": "string",
    "status": "OPEN",
    "side": "LONG",
    "size": "string",
    "maxSize": "string",
    "entryPrice": "string",
    "realizedPnl": "string",
    "createdAt": "string",
    "createdAtHeight": "string",
    "sumOpen": "string",
    "sumClose": "string",
    "netFunding": "string",
    "unrealizedPnl": "string",
    "closedAt": "string",
    "exitPrice": "string",
    "subaccountNumber": 0.1
  }
}
 

Properties

NameTypeRequiredRestrictionsDescription
additionalPropertiesPerpetualPositionResponseObjectfalsenonenone

AssetPositionResponseObject

{
  "symbol": "string",
  "side": "LONG",
  "size": "string",
  "assetId": "string",
  "subaccountNumber": 0.1
}
 

Properties

NameTypeRequiredRestrictionsDescription
symbolstringtruenonenone
sidePositionSidetruenonenone
sizestringtruenonenone
assetIdstringtruenonenone
subaccountNumbernumber(double)truenonenone

AssetPositionsMap

{
  "property1": {
    "symbol": "string",
    "side": "LONG",
    "size": "string",
    "assetId": "string",
    "subaccountNumber": 0.1
  },
  "property2": {
    "symbol": "string",
    "side": "LONG",
    "size": "string",
    "assetId": "string",
    "subaccountNumber": 0.1
  }
}
 

Properties

NameTypeRequiredRestrictionsDescription
additionalPropertiesAssetPositionResponseObjectfalsenonenone

SubaccountResponseObject

{
  "address": "string",
  "subaccountNumber": 0.1,
  "equity": "string",
  "freeCollateral": "string",
  "openPerpetualPositions": {
    "property1": {
      "market": "string",
      "status": "OPEN",
      "side": "LONG",
      "size": "string",
      "maxSize": "string",
      "entryPrice": "string",
      "realizedPnl": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "sumOpen": "string",
      "sumClose": "string",
      "netFunding": "string",
      "unrealizedPnl": "string",
      "closedAt": "string",
      "exitPrice": "string",
      "subaccountNumber": 0.1
    },
    "property2": {
      "market": "string",
      "status": "OPEN",
      "side": "LONG",
      "size": "string",
      "maxSize": "string",
      "entryPrice": "string",
      "realizedPnl": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "sumOpen": "string",
      "sumClose": "string",
      "netFunding": "string",
      "unrealizedPnl": "string",
      "closedAt": "string",
      "exitPrice": "string",
      "subaccountNumber": 0.1
    }
  },
  "assetPositions": {
    "property1": {
      "symbol": "string",
      "side": "LONG",
      "size": "string",
      "assetId": "string",
      "subaccountNumber": 0.1
    },
    "property2": {
      "symbol": "string",
      "side": "LONG",
      "size": "string",
      "assetId": "string",
      "subaccountNumber": 0.1
    }
  },
  "marginEnabled": true,
  "updatedAtHeight": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
addressstringtruenonenone
subaccountNumbernumber(double)truenonenone
equitystringtruenonenone
freeCollateralstringtruenonenone
openPerpetualPositionsPerpetualPositionsMaptruenonenone
assetPositionsAssetPositionsMaptruenonenone
marginEnabledbooleantruenonenone
updatedAtHeightstringtruenonenone

AddressResponse

{
  "subaccounts": [
    {
      "address": "string",
      "subaccountNumber": 0.1,
      "equity": "string",
      "freeCollateral": "string",
      "openPerpetualPositions": {
        "property1": {
          "market": "string",
          "status": "OPEN",
          "side": "LONG",
          "size": "string",
          "maxSize": "string",
          "entryPrice": "string",
          "realizedPnl": "string",
          "createdAt": "string",
          "createdAtHeight": "string",
          "sumOpen": "string",
          "sumClose": "string",
          "netFunding": "string",
          "unrealizedPnl": "string",
          "closedAt": null,
          "exitPrice": "string",
          "subaccountNumber": 0.1
        },
        "property2": {
          "market": "string",
          "status": "OPEN",
          "side": "LONG",
          "size": "string",
          "maxSize": "string",
          "entryPrice": "string",
          "realizedPnl": "string",
          "createdAt": "string",
          "createdAtHeight": "string",
          "sumOpen": "string",
          "sumClose": "string",
          "netFunding": "string",
          "unrealizedPnl": "string",
          "closedAt": null,
          "exitPrice": "string",
          "subaccountNumber": 0.1
        }
      },
      "assetPositions": {
        "property1": {
          "symbol": "string",
          "side": "LONG",
          "size": "string",
          "assetId": "string",
          "subaccountNumber": 0.1
        },
        "property2": {
          "symbol": "string",
          "side": "LONG",
          "size": "string",
          "assetId": "string",
          "subaccountNumber": 0.1
        }
      },
      "marginEnabled": true,
      "updatedAtHeight": "string"
    }
  ],
  "totalTradingRewards": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
subaccounts[SubaccountResponseObject]truenonenone
totalTradingRewardsstringtruenonenone

ParentSubaccountResponse

{
  "address": "string",
  "parentSubaccountNumber": 0.1,
  "equity": "string",
  "freeCollateral": "string",
  "childSubaccounts": [
    {
      "address": "string",
      "subaccountNumber": 0.1,
      "equity": "string",
      "freeCollateral": "string",
      "openPerpetualPositions": {
        "property1": {
          "market": "string",
          "status": "OPEN",
          "side": "LONG",
          "size": "string",
          "maxSize": "string",
          "entryPrice": "string",
          "realizedPnl": "string",
          "createdAt": "string",
          "createdAtHeight": "string",
          "sumOpen": "string",
          "sumClose": "string",
          "netFunding": "string",
          "unrealizedPnl": "string",
          "closedAt": null,
          "exitPrice": "string",
          "subaccountNumber": 0.1
        },
        "property2": {
          "market": "string",
          "status": "OPEN",
          "side": "LONG",
          "size": "string",
          "maxSize": "string",
          "entryPrice": "string",
          "realizedPnl": "string",
          "createdAt": "string",
          "createdAtHeight": "string",
          "sumOpen": "string",
          "sumClose": "string",
          "netFunding": "string",
          "unrealizedPnl": "string",
          "closedAt": null,
          "exitPrice": "string",
          "subaccountNumber": 0.1
        }
      },
      "assetPositions": {
        "property1": {
          "symbol": "string",
          "side": "LONG",
          "size": "string",
          "assetId": "string",
          "subaccountNumber": 0.1
        },
        "property2": {
          "symbol": "string",
          "side": "LONG",
          "size": "string",
          "assetId": "string",
          "subaccountNumber": 0.1
        }
      },
      "marginEnabled": true,
      "updatedAtHeight": "string"
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
addressstringtruenonenone
parentSubaccountNumbernumber(double)truenonenone
equitystringtruenonenone
freeCollateralstringtruenonenone
childSubaccounts[SubaccountResponseObject]truenonenone

AssetPositionResponse

{
  "positions": [
    {
      "symbol": "string",
      "side": "LONG",
      "size": "string",
      "assetId": "string",
      "subaccountNumber": 0.1
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
positions[AssetPositionResponseObject]truenonenone

CandleResolution

"1MIN"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymous1MIN
anonymous5MINS
anonymous15MINS
anonymous30MINS
anonymous1HOUR
anonymous4HOURS
anonymous1DAY

CandleResponseObject

{
  "startedAt": "string",
  "ticker": "string",
  "resolution": "1MIN",
  "low": "string",
  "high": "string",
  "open": "string",
  "close": "string",
  "baseTokenVolume": "string",
  "usdVolume": "string",
  "trades": 0.1,
  "startingOpenInterest": "string",
  "id": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
startedAtIsoStringtruenonenone
tickerstringtruenonenone
resolutionCandleResolutiontruenonenone
lowstringtruenonenone
highstringtruenonenone
openstringtruenonenone
closestringtruenonenone
baseTokenVolumestringtruenonenone
usdVolumestringtruenonenone
tradesnumber(double)truenonenone
startingOpenIntereststringtruenonenone
idstringtruenonenone

CandleResponse

{
  "candles": [
    {
      "startedAt": "string",
      "ticker": "string",
      "resolution": "1MIN",
      "low": "string",
      "high": "string",
      "open": "string",
      "close": "string",
      "baseTokenVolume": "string",
      "usdVolume": "string",
      "trades": 0.1,
      "startingOpenInterest": "string",
      "id": "string"
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
candles[CandleResponseObject]truenonenone

ComplianceResponse

{
  "restricted": true,
  "reason": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
restrictedbooleantruenonenone
reasonstringfalsenonenone

ComplianceStatus

"COMPLIANT"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousCOMPLIANT
anonymousFIRST_STRIKE_CLOSE_ONLY
anonymousFIRST_STRIKE
anonymousCLOSE_ONLY
anonymousBLOCKED

ComplianceReason

"MANUAL"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousMANUAL
anonymousUS_GEO
anonymousCA_GEO
anonymousSANCTIONED_GEO
anonymousCOMPLIANCE_PROVIDER

ComplianceV2Response

{
  "status": "COMPLIANT",
  "reason": "MANUAL",
  "updatedAt": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
statusComplianceStatustruenonenone
reasonComplianceReasonfalsenonenone
updatedAtstringfalsenonenone

OrderSide

"BUY"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousBUY
anonymousSELL

Liquidity

"TAKER"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousTAKER
anonymousMAKER

FillType

"LIMIT"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousLIMIT
anonymousLIQUIDATED
anonymousLIQUIDATION
anonymousDELEVERAGED
anonymousOFFSETTING

MarketType

"PERPETUAL"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousPERPETUAL
anonymousSPOT

FillResponseObject

{
  "id": "string",
  "side": "BUY",
  "liquidity": "TAKER",
  "type": "LIMIT",
  "market": "string",
  "marketType": "PERPETUAL",
  "price": "string",
  "size": "string",
  "fee": "string",
  "createdAt": "string",
  "createdAtHeight": "string",
  "orderId": "string",
  "clientMetadata": "string",
  "subaccountNumber": 0.1
}
 

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenonenone
sideOrderSidetruenonenone
liquidityLiquiditytruenonenone
typeFillTypetruenonenone
marketstringtruenonenone
marketTypeMarketTypetruenonenone
pricestringtruenonenone
sizestringtruenonenone
feestringtruenonenone
createdAtIsoStringtruenonenone
createdAtHeightstringtruenonenone
orderIdstringfalsenonenone
clientMetadatastringfalsenonenone
subaccountNumbernumber(double)truenonenone

FillResponse

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "fills": [
    {
      "id": "string",
      "side": "BUY",
      "liquidity": "TAKER",
      "type": "LIMIT",
      "market": "string",
      "marketType": "PERPETUAL",
      "price": "string",
      "size": "string",
      "fee": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "orderId": "string",
      "clientMetadata": "string",
      "subaccountNumber": 0.1
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
pageSizenumber(double)falsenonenone
totalResultsnumber(double)falsenonenone
offsetnumber(double)falsenonenone
fills[FillResponseObject]truenonenone

HeightResponse

{
  "height": "string",
  "time": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
heightstringtruenonenone
timeIsoStringtruenonenone

HistoricalBlockTradingReward

{
  "tradingReward": "string",
  "createdAt": "string",
  "createdAtHeight": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
tradingRewardstringtruenonenone
createdAtIsoStringtruenonenone
createdAtHeightstringtruenonenone

HistoricalBlockTradingRewardsResponse

{
  "rewards": [
    {
      "tradingReward": "string",
      "createdAt": "string",
      "createdAtHeight": "string"
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
rewards[HistoricalBlockTradingReward]truenonenone

HistoricalFundingResponseObject

{
  "ticker": "string",
  "rate": "string",
  "price": "string",
  "effectiveAt": "string",
  "effectiveAtHeight": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
tickerstringtruenonenone
ratestringtruenonenone
pricestringtruenonenone
effectiveAtIsoStringtruenonenone
effectiveAtHeightstringtruenonenone

HistoricalFundingResponse

{
  "historicalFunding": [
    {
      "ticker": "string",
      "rate": "string",
      "price": "string",
      "effectiveAt": "string",
      "effectiveAtHeight": "string"
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
historicalFunding[HistoricalFundingResponseObject]truenonenone

PnlTicksResponseObject

{
  "id": "string",
  "subaccountId": "string",
  "equity": "string",
  "totalPnl": "string",
  "netTransfers": "string",
  "createdAt": "string",
  "blockHeight": "string",
  "blockTime": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenonenone
subaccountIdstringtruenonenone
equitystringtruenonenone
totalPnlstringtruenonenone
netTransfersstringtruenonenone
createdAtstringtruenonenone
blockHeightstringtruenonenone
blockTimeIsoStringtruenonenone

HistoricalPnlResponse

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "historicalPnl": [
    {
      "id": "string",
      "subaccountId": "string",
      "equity": "string",
      "totalPnl": "string",
      "netTransfers": "string",
      "createdAt": "string",
      "blockHeight": "string",
      "blockTime": "string"
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
pageSizenumber(double)falsenonenone
totalResultsnumber(double)falsenonenone
offsetnumber(double)falsenonenone
historicalPnl[PnlTicksResponseObject]truenonenone

TradingRewardAggregationPeriod

"DAILY"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousDAILY
anonymousWEEKLY
anonymousMONTHLY

HistoricalTradingRewardAggregation

{
  "tradingReward": "string",
  "startedAt": "string",
  "startedAtHeight": "string",
  "endedAt": "string",
  "endedAtHeight": "string",
  "period": "DAILY"
}
 

Properties

NameTypeRequiredRestrictionsDescription
tradingRewardstringtruenonenone
startedAtIsoStringtruenonenone
startedAtHeightstringtruenonenone
endedAtIsoStringfalsenonenone
endedAtHeightstringfalsenonenone
periodTradingRewardAggregationPeriodtruenonenone

HistoricalTradingRewardAggregationsResponse

{
  "rewards": [
    {
      "tradingReward": "string",
      "startedAt": "string",
      "startedAtHeight": "string",
      "endedAt": "string",
      "endedAtHeight": "string",
      "period": "DAILY"
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
rewards[HistoricalTradingRewardAggregation]truenonenone

OrderbookResponsePriceLevel

{
  "price": "string",
  "size": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
pricestringtruenonenone
sizestringtruenonenone

OrderbookResponseObject

{
  "bids": [
    {
      "price": "string",
      "size": "string"
    }
  ],
  "asks": [
    {
      "price": "string",
      "size": "string"
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
bids[OrderbookResponsePriceLevel]truenonenone
asks[OrderbookResponsePriceLevel]truenonenone

APITimeInForce

"GTT"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousGTT
anonymousFOK
anonymousIOC

OrderStatus

"OPEN"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousOPEN
anonymousFILLED
anonymousCANCELED
anonymousBEST_EFFORT_CANCELED
anonymousUNTRIGGERED

BestEffortOpenedStatus

"BEST_EFFORT_OPENED"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousBEST_EFFORT_OPENED

APIOrderStatus

"OPEN"
 

Properties

anyOf

NameTypeRequiredRestrictionsDescription
anonymousOrderStatusfalsenonenone

or

NameTypeRequiredRestrictionsDescription
anonymousBestEffortOpenedStatusfalsenonenone

OrderType

"LIMIT"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousLIMIT
anonymousMARKET
anonymousSTOP_LIMIT
anonymousSTOP_MARKET
anonymousTRAILING_STOP
anonymousTAKE_PROFIT
anonymousTAKE_PROFIT_MARKET

OrderResponseObject

{
  "id": "string",
  "subaccountId": "string",
  "clientId": "string",
  "clobPairId": "string",
  "side": "BUY",
  "size": "string",
  "totalFilled": "string",
  "price": "string",
  "type": "LIMIT",
  "reduceOnly": true,
  "orderFlags": "string",
  "goodTilBlock": "string",
  "goodTilBlockTime": "string",
  "createdAtHeight": "string",
  "clientMetadata": "string",
  "triggerPrice": "string",
  "timeInForce": "GTT",
  "status": "OPEN",
  "postOnly": true,
  "ticker": "string",
  "updatedAt": "string",
  "updatedAtHeight": "string",
  "subaccountNumber": 0.1
}
 

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenonenone
subaccountIdstringtruenonenone
clientIdstringtruenonenone
clobPairIdstringtruenonenone
sideOrderSidetruenonenone
sizestringtruenonenone
totalFilledstringtruenonenone
pricestringtruenonenone
typeOrderTypetruenonenone
reduceOnlybooleantruenonenone
orderFlagsstringtruenonenone
goodTilBlockstringfalsenonenone
goodTilBlockTimestringfalsenonenone
createdAtHeightstringfalsenonenone
clientMetadatastringtruenonenone
triggerPricestringfalsenonenone
timeInForceAPITimeInForcetruenonenone
statusAPIOrderStatustruenonenone
postOnlybooleantruenonenone
tickerstringtruenonenone
updatedAtIsoStringfalsenonenone
updatedAtHeightstringfalsenonenone
subaccountNumbernumber(double)truenonenone

PerpetualMarketStatus

"ACTIVE"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousACTIVE
anonymousPAUSED
anonymousCANCEL_ONLY
anonymousPOST_ONLY
anonymousINITIALIZING
anonymousFINAL_SETTLEMENT

PerpetualMarketType

"CROSS"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousCROSS
anonymousISOLATED

PerpetualMarketResponseObject

{
  "clobPairId": "string",
  "ticker": "string",
  "status": "ACTIVE",
  "oraclePrice": "string",
  "priceChange24H": "string",
  "volume24H": "string",
  "trades24H": 0.1,
  "nextFundingRate": "string",
  "initialMarginFraction": "string",
  "maintenanceMarginFraction": "string",
  "openInterest": "string",
  "atomicResolution": 0.1,
  "quantumConversionExponent": 0.1,
  "tickSize": "string",
  "stepSize": "string",
  "stepBaseQuantums": 0.1,
  "subticksPerTick": 0.1,
  "marketType": "CROSS",
  "openInterestLowerCap": "string",
  "openInterestUpperCap": "string",
  "baseOpenInterest": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
clobPairIdstringtruenonenone
tickerstringtruenonenone
statusPerpetualMarketStatustruenonenone
oraclePricestringtruenonenone
priceChange24Hstringtruenonenone
volume24Hstringtruenonenone
trades24Hnumber(double)truenonenone
nextFundingRatestringtruenonenone
initialMarginFractionstringtruenonenone
maintenanceMarginFractionstringtruenonenone
openIntereststringtruenonenone
atomicResolutionnumber(double)truenonenone
quantumConversionExponentnumber(double)truenonenone
tickSizestringtruenonenone
stepSizestringtruenonenone
stepBaseQuantumsnumber(double)truenonenone
subticksPerTicknumber(double)truenonenone
marketTypePerpetualMarketTypetruenonenone
openInterestLowerCapstringfalsenonenone
openInterestUpperCapstringfalsenonenone
baseOpenIntereststringtruenonenone

PerpetualMarketResponse

{
  "markets": {
    "property1": {
      "clobPairId": "string",
      "ticker": "string",
      "status": "ACTIVE",
      "oraclePrice": "string",
      "priceChange24H": "string",
      "volume24H": "string",
      "trades24H": 0.1,
      "nextFundingRate": "string",
      "initialMarginFraction": "string",
      "maintenanceMarginFraction": "string",
      "openInterest": "string",
      "atomicResolution": 0.1,
      "quantumConversionExponent": 0.1,
      "tickSize": "string",
      "stepSize": "string",
      "stepBaseQuantums": 0.1,
      "subticksPerTick": 0.1,
      "marketType": "CROSS",
      "openInterestLowerCap": "string",
      "openInterestUpperCap": "string",
      "baseOpenInterest": "string"
    },
    "property2": {
      "clobPairId": "string",
      "ticker": "string",
      "status": "ACTIVE",
      "oraclePrice": "string",
      "priceChange24H": "string",
      "volume24H": "string",
      "trades24H": 0.1,
      "nextFundingRate": "string",
      "initialMarginFraction": "string",
      "maintenanceMarginFraction": "string",
      "openInterest": "string",
      "atomicResolution": 0.1,
      "quantumConversionExponent": 0.1,
      "tickSize": "string",
      "stepSize": "string",
      "stepBaseQuantums": 0.1,
      "subticksPerTick": 0.1,
      "marketType": "CROSS",
      "openInterestLowerCap": "string",
      "openInterestUpperCap": "string",
      "baseOpenInterest": "string"
    }
  }
}
 

Properties

NameTypeRequiredRestrictionsDescription
marketsobjecttruenonenone
» additionalPropertiesPerpetualMarketResponseObjectfalsenonenone

PerpetualPositionResponse

{
  "positions": [
    {
      "market": "string",
      "status": "OPEN",
      "side": "LONG",
      "size": "string",
      "maxSize": "string",
      "entryPrice": "string",
      "realizedPnl": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "sumOpen": "string",
      "sumClose": "string",
      "netFunding": "string",
      "unrealizedPnl": "string",
      "closedAt": "string",
      "exitPrice": "string",
      "subaccountNumber": 0.1
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
positions[PerpetualPositionResponseObject]truenonenone

SparklineResponseObject

{
  "property1": [
    "string"
  ],
  "property2": [
    "string"
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
additionalProperties[string]falsenonenone

SparklineTimePeriod

"ONE_DAY"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousONE_DAY
anonymousSEVEN_DAYS

TimeResponse

{
  "iso": "string",
  "epoch": 0.1
}
 

Properties

NameTypeRequiredRestrictionsDescription
isoIsoStringtruenonenone
epochnumber(double)truenonenone

TradeType

"LIMIT"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousLIMIT
anonymousLIQUIDATED
anonymousDELEVERAGED

TradeResponseObject

{
  "id": "string",
  "side": "BUY",
  "size": "string",
  "price": "string",
  "type": "LIMIT",
  "createdAt": "string",
  "createdAtHeight": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenonenone
sideOrderSidetruenonenone
sizestringtruenonenone
pricestringtruenonenone
typeTradeTypetruenonenone
createdAtIsoStringtruenonenone
createdAtHeightstringtruenonenone

TradeResponse

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "trades": [
    {
      "id": "string",
      "side": "BUY",
      "size": "string",
      "price": "string",
      "type": "LIMIT",
      "createdAt": "string",
      "createdAtHeight": "string"
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
pageSizenumber(double)falsenonenone
totalResultsnumber(double)falsenonenone
offsetnumber(double)falsenonenone
trades[TradeResponseObject]truenonenone

TransferType

"TRANSFER_IN"
 

Properties

NameTypeRequiredRestrictionsDescription
anonymousstringfalsenonenone

Enumerated Values

PropertyValue
anonymousTRANSFER_IN
anonymousTRANSFER_OUT
anonymousDEPOSIT
anonymousWITHDRAWAL

TransferResponseObject

{
  "id": "string",
  "sender": {
    "subaccountNumber": 0.1,
    "address": "string"
  },
  "recipient": {
    "subaccountNumber": 0.1,
    "address": "string"
  },
  "size": "string",
  "createdAt": "string",
  "createdAtHeight": "string",
  "symbol": "string",
  "type": "TRANSFER_IN",
  "transactionHash": "string"
}
 

Properties

NameTypeRequiredRestrictionsDescription
idstringtruenonenone
senderobjecttruenonenone
» subaccountNumbernumber(double)falsenonenone
» addressstringtruenonenone
recipientobjecttruenonenone
» subaccountNumbernumber(double)falsenonenone
» addressstringtruenonenone
sizestringtruenonenone
createdAtstringtruenonenone
createdAtHeightstringtruenonenone
symbolstringtruenonenone
typeTransferTypetruenonenone
transactionHashstringtruenonenone

TransferResponse

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "transfers": [
    {
      "id": "string",
      "sender": {
        "subaccountNumber": 0.1,
        "address": "string"
      },
      "recipient": {
        "subaccountNumber": 0.1,
        "address": "string"
      },
      "size": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "symbol": "string",
      "type": "TRANSFER_IN",
      "transactionHash": "string"
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
pageSizenumber(double)falsenonenone
totalResultsnumber(double)falsenonenone
offsetnumber(double)falsenonenone
transfers[TransferResponseObject]truenonenone

ParentSubaccountTransferResponse

{
  "pageSize": 0.1,
  "totalResults": 0.1,
  "offset": 0.1,
  "transfers": [
    {
      "id": "string",
      "sender": {
        "subaccountNumber": 0.1,
        "address": "string"
      },
      "recipient": {
        "subaccountNumber": 0.1,
        "address": "string"
      },
      "size": "string",
      "createdAt": "string",
      "createdAtHeight": "string",
      "symbol": "string",
      "type": "TRANSFER_IN",
      "transactionHash": "string"
    }
  ]
}
 

Properties

NameTypeRequiredRestrictionsDescription
pageSizenumber(double)falsenonenone
totalResultsnumber(double)falsenonenone
offsetnumber(double)falsenonenone
transfers[TransferResponseObject]truenonenone