Midgard Public API (1.0.0-oas3)

Download OpenAPI specification:Download

The Midgard Public API queries THORChain and any chains linked via the Bifröst and prepares information about the network to be readily available for public users. The API parses transaction event data from THORChain and stores them in a time-series database to make time-dependent queries easy. Midgard does not hold critical information. To interact with BEPSwap and Asgardex, users should query THORChain directly.

Specification

Get Swagger

Returns human and machine readable swagger/openapi specification.

Responses

200

human and machine readable swagger/openapi specification

get /v1/swagger.json
http://127.0.0.1:8080/v1/swagger.json
https://127.0.0.1:8080/v1/swagger.json

Documentation

Get Documents

Swagger/openapi 3.0 specification generated documents.

Responses

200

swagger/openapi 3.0 spec generated docs

get /v1/doc
http://127.0.0.1:8080/v1/doc
https://127.0.0.1:8080/v1/doc

Get Health

Returns an object containing the health response of the API.

Responses

200

health response of the API.

get /v1/health
http://127.0.0.1:8080/v1/health
https://127.0.0.1:8080/v1/health

Get transaction

Return an object containing the tx details

path Parameters
address
required
string
Example: tbnb1fj2lqj8dvr5pumfchc7ntlfqd2v6zdxqwjewf5

An address

Responses

200

Returns an array of transaction events

get /v1/tx/{address}
http://127.0.0.1:8080/v1/tx/{address}
https://127.0.0.1:8080/v1/tx/{address}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get transaction

Return an object containing the tx details

path Parameters
address
required
string
Example: tbnb1fj2lqj8dvr5pumfchc7ntlfqd2v6zdxqwjewf5

An address

txid
required
string
Example: TCAN-014

An Asset

Responses

200

Returns an array of transaction events

get /v1/tx/{address}/txid/{txid}
http://127.0.0.1:8080/v1/tx/{address}/txid/{txid}
https://127.0.0.1:8080/v1/tx/{address}/txid/{txid}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get transaction

Return an object containing the tx details

path Parameters
address
required
string
Example: tbnb1fj2lqj8dvr5pumfchc7ntlfqd2v6zdxqwjewf5

An address

asset
required
string
Example: TCAN-014

An Asset

Responses

200

Returns an array of transaction events

get /v1/tx/{address}/asset/{asset}
http://127.0.0.1:8080/v1/tx/{address}/asset/{asset}
https://127.0.0.1:8080/v1/tx/{address}/asset/{asset}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get transaction

Return an object containing the tx details

path Parameters
asset
required
string
Example: TCAN-014

An Asset

Responses

200

Returns an array of transaction events

get /v1/tx/asset/{asset}
http://127.0.0.1:8080/v1/tx/asset/{asset}
https://127.0.0.1:8080/v1/tx/asset/{asset}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get Global Stats

Returns an object containing global stats for all pools and all transactions.

Responses

200

object containing global BEPSwap data

get /v1/stats
http://127.0.0.1:8080/v1/stats
https://127.0.0.1:8080/v1/stats

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "dailyActiveUsers": 0,
  • "monthlyActiveUsers": 0,
  • "totalUsers": 0,
  • "dailyTx": 0,
  • "monthlyTx": 0,
  • "totalTx": 0,
  • "totalVolume24hr": 0,
  • "totalVolume": 0,
  • "totalStaked": 0,
  • "totalDepth": 0,
  • "totalEarned": 0,
  • "poolCount": 0,
  • "totalAssetBuys": 0,
  • "totalAssetSells": 0,
  • "totalStakeTx": 0,
  • "totalWithdrawTx": 0
}

Get Asset Information

Detailed information about a specific asset. Returns enough information to display a unique asset in various user interfaces, including latest price. The logo is sourced from an internal database.

path Parameters
asset
required
string
Example: BNB.TOMOB-1E1

Unique asset (CHAIN.SYMBOL)

Responses

200

object containing detailed asset information

400

error message

get /v1/assets/{asset}
http://127.0.0.1:8080/v1/assets/{asset}
https://127.0.0.1:8080/v1/assets/{asset}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "asset": "string",
  • "name": "string",
  • "dateCreated": 0,
  • "logo": "string",
  • "priceRune": 0
}

Get Asset Pools

Returns an array containing all the assets supported on BEPSwap pools

Responses

200

array of assets

400

error message

get /v1/pools
http://127.0.0.1:8080/v1/pools
https://127.0.0.1:8080/v1/pools

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "string"
]

Get Pools Data

Returns an object containing all the pool data for that asset. All assets on BEPSwap have associated pools.

path Parameters
asset
required
string
Example: BNB.TOMOB-1E1

Unique asset (CHAIN.SYMBOL)

Responses

200

object containing pool data for that asset

get /v1/pools/{asset}
http://127.0.0.1:8080/v1/pools/{asset}
https://127.0.0.1:8080/v1/pools/{asset}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "asset": "string",
  • "status": "bootstrapped",
  • "price": 0,
  • "assetStakedTotal": 0,
  • "runeStakedTotal": 0,
  • "poolStakedTotal": 0,
  • "assetDepth": 0,
  • "runeDepth": 0,
  • "poolDepth": 0,
  • "poolUnits": 0,
  • "sellVolume": 0,
  • "buyVolume": 0,
  • "poolVolume": 0,
  • "poolVolume24hr": 0,
  • "sellTxAverage": 0,
  • "buyTxAverage": 0,
  • "poolTxAverage": 0,
  • "sellSlipAverage": 0,
  • "buySlipAverage": 0,
  • "poolSlipAverage": 0,
  • "sellFeeAverage": 0,
  • "buyFeeAverage": 0,
  • "poolFeeAverage": 0,
  • "sellFeesTotal": 0,
  • "buyFeesTotal": 0,
  • "poolFeesTotal": 0,
  • "sellAssetCount": 0,
  • "buyAssetCount": 0,
  • "swappingTxCount": 0,
  • "swappersCount": 0,
  • "stakeTxCount": 0,
  • "withdrawTxCount": 0,
  • "stakingTxCount": 0,
  • "stakersCount": 0,
  • "assetROI": 0,
  • "runeROI": 0,
  • "poolROI": 0,
  • "poolROI12": 0
}

Get Stakers

Returns an array containing the addresses for all stakers.

Responses

200

array of all the stakers

get /v1/stakers
http://127.0.0.1:8080/v1/stakers
https://127.0.0.1:8080/v1/stakers

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • "tbnb1fj2lqj8dvr5pumfchc7ntlfqd2v6zdxqwjewf5"
]

Get Staker Data

Returns an array containing all the pools the staker is staking in.

path Parameters
address
required
string
Example: bnb1jxfh2g85q3v0tdq56fnevx6xcxtcnhtsmcu64m

Unique staker address

Responses

200

array of all the pools the staker is staking in

get /v1/stakers/{address}
http://127.0.0.1:8080/v1/stakers/{address}
https://127.0.0.1:8080/v1/stakers/{address}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "poolsArray":
    [
    ],
  • "totalStaked": 0,
  • "totalEarned": 0,
  • "totalROI": 0
}

Get Staker Pool Data

Returns an object containing staking data for the specified staker and pool.

path Parameters
address
required
string
Example: bnb1jxfh2g85q3v0tdq56fnevx6xcxtcnhtsmcu64m

Unique staker address

asset
required
string
Example: BNB.TOMOB-1E1

Unique asset

Responses

200

object containing staking data for a specific staker and asset

get /v1/stakers/{address}/{asset}
http://127.0.0.1:8080/v1/stakers/{address}/{asset}
https://127.0.0.1:8080/v1/stakers/{address}/{asset}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "asset": "string",
  • "stakeUnits": 0,
  • "runeStaked": 0,
  • "assetStaked": 0,
  • "poolStaked": 0,
  • "runeEarned": 0,
  • "assetEarned": 0,
  • "poolEarned": 0,
  • "runeROI": 0,
  • "assetROI": 0,
  • "poolROI": 0,
  • "dateFirstStaked": 0
}

Get the Proxied Pool Addresses

Returns a proxied endpoint for the pool_addresses endpoint from a local thornode

Responses

200

Get Return an object for the proxied pools_addresses endpoint.

get /v1/thorchain/pool_addresses
http://127.0.0.1:8080/v1/thorchain/pool_addresses
https://127.0.0.1:8080/v1/thorchain/pool_addresses

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "current":
    [
    ]
}