API Specification

Our API is defined using the OpenAPI 3.0 specification. You can easily explore and test the endpoints using tools like Swagger UI, or Postman. For convenience, you can interact with our API on our hosted SwaggerUI page: https://app.runesdex.com/v1/swaggerarrow-up-right

You can also quickly send sample API requests using the API Explorer below. If you'd prefer to use a tool like Postman, download our OpenAPI spec available at: https://app.runesdex.com/v1/swagger/swagger.yamlarrow-up-right

API Explorer

Healthcheck endpoint

get


This endpoint is used to check if the service is up and running.\

Responses
chevron-right
200

Ok Status

No content

get
/v1/healthcheck
200

Ok Status

No content

Version endpoint

get


This endpoint is used to get the version of the service.\

Responses
chevron-right
200

App Info

application/json
appstringRequiredExample: runes_dex
buildstringRequiredExample: main
commitstringRequiredExample: 03798661f49a25592975d96bf9a80b9b0555ae5a
versionstringRequiredExample: 0.4.5
get
/v1/version
200

App Info

List known runes

get


This endpoint is used to list known runes.

Query parameters
namestring · nullableOptional

Filter by rune name as %NAME%. "SUPER" will match "MYSUPERRUNE", for example.

Example: SUPER
exists_in_pool_with_liquidityboolean · nullableOptional

Specify true for pairs with liquidity, false for pairs without, or omit for all pairs.

featuredboolean · nullableOptional

Will return only featured runes.

limitinteger · int32 · min: 1 · max: 100 · nullableOptional

Number of runes to return.

Default: 50
pageinteger · int32 · nullableOptional

Page number for pagination.

orderstring · enum · nullableOptional

Order of the results.

Example: ASCPossible values:
Responses
chevron-right
200

List of matched runes

application/json
get
/v1/runes

Status endpoint

get


Returns the last indexed block to assert the status of the service.\

Responses
chevron-right
200

Sync status is returned

application/json
heightinteger · int64Required

Height of the last indexed block

Example: 10
indexerstringRequiredExample: runes_index
get
/v1/status
200

Sync status is returned

get


This endpoint is used to search for Runes.\

Query parameters
sstringRequiredExample: BIG
Responses
chevron-right
200

Success

application/json
get
/v1/runes/search

Get Rune by name

get


This endpoint is used to get a Rune by name.\

Path parameters
runestringRequired
Responses
chevron-right
200

Success

application/json
idstringOptional

block number : transaction number in that block

Example: 3009048:5
runestringOptionalExample: MAXDECIMALSRUNESOBIG
display_namestringOptionalExample: MAXDECIMALSRUNESOBIG
symbolstringOptional

A single UTF8 character, including emoji

Example: ¤
blockinteger · int64OptionalExample: 3009048
tx_idinteger · int32Optional

A tx position in a block

Example: 5
mintsinteger · int32OptionalExample: 0
max_supplystringOptional

Total amount of runes minted

Example: 1000000000
mintedstringOptionalExample: 1000000000
in_circulationstringOptional

Total amount of runes in circulation (max_supply - burned)

Example: 1000000000
divisibilityinteger · int32 · max: 38Optional

Number of subunits in a super unit of runes

Example: 8
turbobooleanOptionalExample: true
timestampinteger · int64OptionalExample: 1727898475
etching_txstringOptionalExample: 81972d23a9abaa1c6f0d96b7bccd9af905ff8a4f44ac50f2a62366f92e5a8efb
commitment_txstringOptionalExample: 3caae66d4c38c46f56f12571fc518bbb36ce3ec03a4e3b6c3ed44dbee9fa9630
raw_datastringOptional

a raw transaction hex

Example: 7b22656469637473223a5b5d2c2265746368696e67223a7b2264697669736962696c697479223a33382c227072656d696e65223a313030303030303030302c2272756e65223a224d4158444543494d414c5352554e45534f424947222c2273706163657273223a302c2273796d626f6c223a6e756c6c2c227465726d73223a6e756c6c2c22747572626f223a747275657d2c226d696e74223a6e756c6c2c22706f696e746572223a317d
is_featuredbooleanOptionalDefault: falseExample: false
get
/v1/runes/{rune}

Get Rune balance

get


This endpoint is used to get a Rune balance by address.\

Path parameters
addressstringRequired
runestringRequired

BTC or rune name

Responses
chevron-right
200

Success

application/json
addressstringRequiredExample: bc1p0x6psjqeawtw8zvekup2gcg8uuwejhgjfad3sp9xklmpeaq80m4qd0ly9f
balancestringRequiredExample: 1000000000
get
/v1/runes/by-address/{address}/balance/{rune}

List all balances of specific address

get


This endpoint is used to list balances of Runes by address.\

Path parameters
addressstringRequired
Responses
chevron-right
200

Success

application/json
get
/v1/runes/by-address/{address}/balance

List UTXOs by asset and address

get


This endpoint is used to list UTXOs by asset and address.\

Path parameters
assetstringRequired
addressstringRequired
Query parameters
limitinteger · int32 · min: 1 · max: 100 · nullableOptional

Number of runes to return.

Default: 50
namestring · nullableOptional

Filter by rune name as %NAME%. "SUPER" will match "MYSUPERRUNE", for example.

Example: SUPER
orderstring · enum · nullableOptional

Order of the results.

Example: ASCPossible values:
pageinteger · int32 · nullableOptional

Page number for pagination.

Responses
chevron-right
200

Success

application/json
get
/v1/utxo/{asset}/{address}

Get BTC balance by address

get


This endpoint is used to get a BTC balance by address.\

Path parameters
addressstringRequiredExample: tb1ps07g3t8hctex0ula3jaxxa85dqw28ewl0krmnt8mlpxukmzp9zeqmzjfdw
Responses
chevron-right
200

Success

application/json
addressstringOptionalExample: tb1ps07g3t8hctex0ula3jaxxa85dqw28ewl0krmnt8mlpxukmzp9zeqmzjfdw
balanceinteger · uint64Optional
get
/v1/btc/balance/{address}

Get list of Trading Pairs

get


This endpoint is used to get a list of trading pairs.\

Query parameters
limitinteger · int32 · min: 1 · max: 100 · nullableOptional

Number of runes to return.

Default: 50
namestring · nullableOptional

Filter by rune name as %NAME%. "SUPER" will match "MYSUPERRUNE", for example.

Example: SUPER
orderstring · enum · nullableOptional

Order of the results.

Example: ASCPossible values:
pageinteger · int32 · nullableOptional

Page number for pagination.

Responses
chevron-right
200

Success

application/json
get
/v1/pairs

Create Trading Pair

post


This endpoint is used to create a new trading pair. Idempotent. If pair exists, returns existing pool address.

Path parameters
basestringRequiredExample: BTC
quotestringRequiredExample: MYLOVELYRUNE
Body
base_assetstringRequiredExample: BTC
quote_assetstringRequiredExample: MYLOVELYRUNE
Responses
chevron-right
200

Success

application/json
idinteger · int64OptionalExample: 2
pool_addressstringOptionalExample: tb1pptp2yfl3xjvltfxwwvqnsspe60uyc0a24d90ymas4qxl8xs8rxss94quj9
post
/v1/pairs/create

Get Trading Pair

get


This endpoint is used to get a trading pair.

Path parameters
basestringRequiredExample: BTC
quotestringRequiredExample: MYLOVELYRUNE
Responses
chevron-right
200

Success

application/json
base_amountstringOptionalExample: 1279361
quote_amountstringOptionalExample: 35200000
ratestringOptional

base_amount / quote_amount

Example: 3634548.2954545454545454545
idinteger · int64OptionalExample: 2
pool_addressstringOptionalExample: tb1pptp2yfl3xjvltfxwwvqnsspe60uyc0a24d90ymas4qxl8xs8rxss94quj9
price_btcstringOptionalExample: 2.751373537258053043668E-7
price_satstringOptionalExample: 7.51373537258053043668
price_usdstringOptionalExample: 0.0170889585035029197178120051
btcisd_pricestringOptionalExample: 62110.64
market_capstringOptional

in USD

Example: 17088958.50
fdvstringOptional

in USD

Example: 17088958.50
tvlstringOptional

in USD

Example: 43725.89
done_swap_countinteger · int64Optional

number of finalized swaps in this pool (buy+sell)

Example: 3
base_1d_volumestringOptional

in base units

Example: 1279361
quote_1d_volumestringOptional

in quote units

Example: 35200000
get
/v1/pairs/{base}-{quote}

Get Address Position

get


This endpoint is used to get the position of an address in a trading pair.\

Path parameters
basestringRequiredExample: BTC
quotestringRequiredExample: MYLOVELYRUNE
addressstringRequiredExample: tb1ps07g3t8hctex0ula3jaxxa85dqw28ewl0krmnt8mlpxukmzp9zeqmzjfdw
Responses
chevron-right
200

Success

application/json
trading_pairinteger · int64OptionalExample: 2
pool_sharestring · max: 1OptionalExample: 0.153
user_locked_value_usdstringOptionalExample: 1223123.23
earningsstringOptionalExample: 333.33
base_value_usdstringOptionalExample: 1223123.23
quote_value_usdstringOptionalExample: 1223123.23
get
/v1/pairs/{base}-{quote}/address-position/{address}

Add Liquidity

post


This endpoint is used to add liquidity to a trading pair.\

Path parameters
basestringRequiredExample: BTC
quotestringRequiredExample: MYLOVELYRUNE
Body
base_addressstringRequiredExample: bc1pkr9xwf5n6ugue9ra4p3quy940gl3qaaju57pvvhy5xh8xehmzh3syzdqs3
base_address_pubkeystring · nullableOptionalExample: 8f0f508a694fe6991fd6fd8be19bfec9dad34afbc5e16c2c6af1b57ee4a75f28
base_amountstringRequiredExample: 41533
quote_addressstringRequiredExample: 37LHryP6Pj6Z98bQZj76YBcQ1JNKZsSXoC
quote_address_pubkeystring · nullableOptionalExample: 02c64921f5c9b2c209ada61c78719eec30bebcdfc1d63ee051a68aa241ffb3190a
quote_amountstringRequiredExample: 10000
Responses
chevron-right
200

Success

application/json
request_idstringOptionalExample: 123
pair_idinteger · int64OptionalExample: 2
pairstringOptionalExample: BTC/MYLOVELYRUNE
base_addressstringOptionalExample: bc1p0x6psjqeawtw8zvekup2gcg8uuwejhgjfad3sp9xklmpeaq80m4qd0ly9f
quote_addressstringOptionalExample: 37LHryP6Pj6Z98bQZj76YBcQ1JNKZsSXoC
base_amountstringOptionalExample: 41533
quote_amountstringOptionalExample: 10000
btc_tx_feeinteger · int64OptionalExample: 1000
psbtstringOptional

partially signed bitcoin transaction

raw_txstringOptional
base_inputsinteger · uint64[]Optional
quote_inputsinteger · uint64[]Optional
post
/v1/pairs/{base}-{quote}/add-liquidity

Calculate

get


This endpoint is used to calculate the base and quote amounts.\

Path parameters
basestringRequiredExample: BTC
quotestringRequiredExample: MYLOVELYRUNE
Query parameters
basestringOptionalExample: BTC
quotestringOptionalExample: MYLOVELYRUNE
Responses
chevron-right
200

Success

application/json
basestringOptionalExample: 1000
quotestringOptionalExample: 10000
get
/v1/pairs/{base}-{quote}/calculate

Swap

post


This endpoint is used to swap assets in a trading pair.\

Path parameters
basestringRequiredExample: BTC
quotestringRequiredExample: MYLOVELYRUNE
Body
ask_addressstringRequired
ask_amountstringRequired
bid_addressstringRequired
bid_address_pubkeystring · nullableOptional
bid_amountstringRequired
bid_assetstringRequired
fee_addressstringRequired
fee_address_pubkeystring · nullableOptional
ratestringRequired
slippagenumber · doubleRequired
slippage_tolerancebooleanRequired
Responses
chevron-right
200

Success

application/json
request_idstringOptionalExample: 123
pair_idinteger · int64OptionalExample: 2
pairstringOptionalExample: BTC/MYLOVELYRUNE
base_addressstringOptionalExample: bc1p0x6psjqeawtw8zvekup2gcg8uuwejhgjfad3sp9xklmpeaq80m4qd0ly9f
quote_addressstringOptionalExample: 37LHryP6Pj6Z98bQZj76YBcQ1JNKZsSXoC
base_amountstringOptionalExample: 41533
quote_amountstringOptionalExample: 10000
btc_tx_feeinteger · int64OptionalExample: 1000
psbtstringOptional

partially signed bitcoin transaction

raw_txstringOptional
base_inputsinteger · uint64[]Optional
quote_inputsinteger · uint64[]Optional
post
/v1/pairs/{base}-{quote}/swap

Remove Liquidity

post


This endpoint is used to remove liquidity from a trading pair.\

Path parameters
basestringRequiredExample: BTC
quotestringRequiredExample: MYLOVELYRUNE
Body
base_addressstringRequired
base_amountstringRequired
fee_addressstringRequired
fee_address_pubkeystring · nullableOptional
quote_addressstringRequired
quote_amountstringRequired
Responses
chevron-right
200

Success

application/json
request_idstringOptionalExample: 123
pair_idinteger · int64OptionalExample: 2
pairstringOptionalExample: BTC/MYLOVELYRUNE
base_addressstringOptionalExample: bc1p0x6psjqeawtw8zvekup2gcg8uuwejhgjfad3sp9xklmpeaq80m4qd0ly9f
quote_addressstringOptionalExample: 37LHryP6Pj6Z98bQZj76YBcQ1JNKZsSXoC
base_amountstringOptionalExample: 41533
quote_amountstringOptionalExample: 10000
btc_tx_feeinteger · int64OptionalExample: 1000
psbtstringOptional

partially signed bitcoin transaction

raw_txstringOptional
base_inputsinteger · uint64[]Optional
quote_inputsinteger · uint64[]Optional
post
/v1/pairs/{base}-{quote}/remove-liquidity

Get Trading Pair Price History

get


This endpoint is used to get the price history of a trading pair.\

Path parameters
basestringRequiredExample: BTC
quotestringRequiredExample: MYLOVELYRUNE
Query parameters
start_timestring · partial-date-time · nullableOptional
end_timestring · partial-date-time · nullableOptional
limitinteger · int32 · min: 1 · max: 1000Optional
Responses
chevron-right
200

Gapfilled candlestick data

application/json

Serialized as an array of fields (9 elements).

Fields: [start_time, trading_pair_id, open, close, high, low, base_volume, quote_volume, count]

All points are gapfilled - meaning that even if database contains 0 trades in range [start_time...end_time], but there were trades before start_time, then returned array will contain (end_time - start_time) points (with interval between them).

itemsarray · min: 9 · max: 9Optional

Serialized as an array of fields (9 elements).

Fields: [start_time, trading_pair_id, open, close, high, low, base_volume, quote_volume, count]

All points are gapfilled - meaning that even if database contains 0 trades in range [start_time...end_time], but there were trades before start_time, then returned array will contain (end_time - start_time) points (with interval between them).

Example: ["2023-07-09T07:46:40",0,"100","101","102","103","1000","102000",5]
get
/v1/pairs/{base}-{quote}/price-history

Get Trading Pair Swap History

get


This endpoint is used to get the swap history of a trading pair.\

Path parameters
basestringRequiredExample: BTC
quotestringRequiredExample: MYLOVELYRUNE
Query parameters
orderstring · enum · nullableOptional

Order of the results.

Example: ASCPossible values:
limitinteger · int32 · min: 1 · max: 100 · nullableOptional

Number of runes to return.

Default: 50
pageinteger · int32 · nullableOptional

Page number for pagination.

Responses
chevron-right
200

Success

application/json
get
/v1/pairs/{base}-{quote}/swap-history

Submit Transaction

post


This endpoint allows to submit a transaction to the Bitcoin network.\

Body
contextstring · nullableOptional
psbtstringRequired
request_idstring · nullableOptional
Responses
chevron-right
200

Success

application/json
tx_idstringOptionalExample: af7ef135a4469ec63af59e7244693418fdb96e852baf84c0adb70b28d9ec99e1
statusstring · enumOptionalExample: pendingPossible values:
post
/v1/publish-tx

Get User Liquidity

get


This endpoint is used to get a user's liquidity positions.\

Path parameters
addressstringRequiredExample: tb1ps07g3t8hctex0ula3jaxxa85dqw28ewl0krmnt8mlpxukmzp9zeqmzjfdw
Responses
chevron-right
200

Success

application/json
trading_pairinteger · int64OptionalExample: 2
pool_sharestring · max: 1OptionalExample: 0.153
user_locked_value_usdstringOptionalExample: 1223123.23
earningsstringOptionalExample: 333.33
base_value_usdstringOptionalExample: 1223123.23
quote_value_usdstringOptionalExample: 1223123.23
get
/v1/users/{address}/liquidity

Get user

get


This endpoint is used to get a user from the database.\

Path parameters
addressstringRequiredExample: tb1ps07g3t8hctex0ula3jaxxa85dqw28ewl0krmnt8mlpxukmzp9zeqmzjfdw
Responses
chevron-right
200

List of addresses

application/json
string[]OptionalExample: bc1p0x6psjqeawtw8zvekup2gcg8uuwejhgjfad3sp9xklmpeaq80m4qd0ly9f
get
/v1/users/{address}

Add a new user

post


This endpoint is used to add a new user to the database.\

Body
addressesstring[]RequiredExample: bc1p0x6psjqeawtw8zvekup2gcg8uuwejhgjfad3sp9xklmpeaq80m4qd0ly9f
termsbooleanRequired
wallet_typestringRequired
Responses
chevron-right
200

Success

application/json
user_idstring · integerOptional
post
/v1/users