Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update testnet indexer endpoint. #189

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions pages/developers/indexer/indexer_api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Base URLs:

* For **the deployment by DYDX token holders**, use <a href="https://indexer.dydx.trade/v4">https://indexer.dydx.trade/v4</a>
* For **Testnet**, use <a href="https://dydx-testnet.imperator.co/v4">https://dydx-testnet.imperator.co/v4</a>
* For **Testnet**, use <a href="https://indexer.v4testnet.dydx.exchange/v4">https://indexer.v4testnet.dydx.exchange/v4</a>

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](https://dydx.exchange/blog/v4-deep-dive-indexer) for more information.

Expand All @@ -27,7 +27,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/addresses/{address}', headers = headers)

Expand All @@ -43,7 +43,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/addresses/${address}`,
{
Expand Down Expand Up @@ -160,7 +160,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/addresses/{address}/subaccountNumber/{subaccountNumber}', headers = headers)

Expand All @@ -176,7 +176,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/addresses/${address}/subaccountNumber/${subaccountNumber}`,
{
Expand Down Expand Up @@ -289,7 +289,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/assetPositions', params={
'address': 'string', 'subaccountNumber': '0'
Expand All @@ -307,7 +307,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/assetPositions?address=${address}&subaccountNumber=${subaccountNumber}`,
{
Expand Down Expand Up @@ -373,7 +373,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/candles/perpetualMarkets/{ticker}', params={
'resolution': '1MIN', 'limit': '0'
Expand All @@ -391,7 +391,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/candles/perpetualMarkets/{ticker}?resolution=1MIN&limit=0`,
{
Expand Down Expand Up @@ -480,7 +480,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/screen', params={
'address': 'string'
Expand All @@ -498,7 +498,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/screen?address=string`,
{
Expand Down Expand Up @@ -557,7 +557,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/fills', params={
'address': 'string', 'subaccountNumber': '0', 'market': 'string', 'marketType': 'PERPETUAL', 'limit': '0'
Expand All @@ -575,7 +575,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/fills?address=string&subaccountNumber=0&market=string&marketType=PERPETUAL&limit=0`,
{
Expand Down Expand Up @@ -662,7 +662,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/height', headers = headers)

Expand All @@ -678,7 +678,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/height`,
{
Expand Down Expand Up @@ -731,7 +731,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/historicalBlockTradingRewards/{address}', params={
'limit': '0'
Expand All @@ -749,7 +749,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/historicalBlockTradingRewards/{address}?limit=0`,
{
Expand Down Expand Up @@ -816,7 +816,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/historicalFunding/{ticker}', params={
'limit': '0'
Expand All @@ -834,7 +834,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/historicalFunding/{ticker}?limit=0`,
{
Expand Down Expand Up @@ -903,7 +903,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/historical-pnl', params={
'address': 'string', 'subaccountNumber': '0', 'limit': '0'
Expand All @@ -921,7 +921,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/historical-pnl?address=string&subaccountNumber=0&limit=0`,
{
Expand Down Expand Up @@ -996,7 +996,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/historicalTradingRewardAggregations/{address}', params={
'period': 'DAILY', 'limit': '0'
Expand All @@ -1014,7 +1014,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/historicalTradingRewardAggregations/{address}?period=DAILY&limit=0`,
{
Expand Down Expand Up @@ -1093,7 +1093,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/orderbooks/perpetualMarket/{ticker}', headers = headers)

Expand All @@ -1109,7 +1109,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/orderbooks/perpetualMarket/{ticker}`,
{
Expand Down Expand Up @@ -1178,7 +1178,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/orders', params={
'address': 'string', 'subaccountNumber': '0', 'limit': '0'
Expand All @@ -1196,7 +1196,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/orders?address=string&subaccountNumber=0&limit=0`,
{
Expand Down Expand Up @@ -1376,7 +1376,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/orders/{orderId}', headers = headers)

Expand All @@ -1392,7 +1392,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/orders/{orderId}`,
{
Expand Down Expand Up @@ -1471,7 +1471,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/perpetualMarkets', params={
'limit': '0'
Expand All @@ -1489,7 +1489,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/perpetualMarkets?limit=0`,
{
Expand Down Expand Up @@ -1587,7 +1587,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/perpetualPositions', params={
'address': 'string', 'subaccountNumber': '0', 'status': [
Expand All @@ -1607,7 +1607,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/perpetualPositions?address=string&subaccountNumber=0&status=OPEN&limit=0`,
{
Expand Down Expand Up @@ -1696,7 +1696,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/sparklines', params={
'timePeriod': 'ONE_DAY'
Expand All @@ -1714,7 +1714,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/sparklines?timePeriod=ONE_DAY`,
{
Expand Down Expand Up @@ -1784,7 +1784,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/time', headers = headers)

Expand All @@ -1800,7 +1800,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/time`,
{
Expand Down Expand Up @@ -1853,7 +1853,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/trades/perpetualMarket/{ticker}', params={
'limit': '0'
Expand All @@ -1871,7 +1871,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/trades/perpetualMarket/{ticker}?limit=0`,
{
Expand Down Expand Up @@ -1942,7 +1942,7 @@ headers = {

# For the deployment by DYDX token holders, use
# baseURL = 'https://indexer.dydx.trade/v4'
baseURL = 'https://dydx-testnet.imperator.co/v4'
baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

r = requests.get(f'{baseURL}/transfers', params={
'address': 'string', 'subaccountNumber': '0', 'limit': '0'
Expand All @@ -1960,7 +1960,7 @@ const headers = {

// For the deployment by DYDX token holders, use
// baseURL = 'https://indexer.dydx.trade/v4'
const baseURL = 'https://dydx-testnet.imperator.co/v4'
const baseURL = 'https://indexer.v4testnet.dydx.exchange/v4'

fetch(`${baseURL}/transfers?address=string&subaccountNumber=0&limit=0`,
{
Expand Down
Loading