Full Nodes
Full Node Endpoints

Full Node Endpoints

Full nodes provide two APIs:

Use these APIs to read the latest network data, to place orders quickly and efficiently, and to build upon with your own custom software.

Getting Started

The Full Node and CometBFT APIs offer different sets of functionality. They accept different query frameworks. Choose the query method and tool for your use case.

Choose Query Method

The Full Node API accepts gRPC or REST. The CometBFT API accepts only RPC.

Full Node APICometBFT API
gRPC
REST
RPC

Install Query Tools

You can use your own query tool, or your can install one or both of the following CLI tools:

Find Your Node URL

To query a full node, you need its URL. If you are running and querying your own full node on the same system, that URL is usually localhost. If you want to use an infrastructure provider's public full node, use a URL from the Full Node Endpoints section of the resources page. Choose a node for your deployment type and query method.

Then, check your connection to your target node using the command for your use case:

Full Node APICometBFT API
gRPCgrpcurl --plaintext <url>.dydxprotocol
RESTcurl <url>/dydxprotocol/
RPCgrpcurl --plaintext <url>.status

Full Node API

The Full Node API provides an identical set of gRPC endpoints and REST endpoints. You can use either framework. Generally, gRPC (opens in a new tab) provides a faster connection.

gRPC Endpoints

You can interact with the Full Node API using grpcurl (opens in a new tab) or your own tool to send gRPC requests. The gRPC server is available on port 9090 by default.

See the API specification for gRPC endpoints.

Examples

Get your USDC balance:

grpcurl --plaintext http://examplenode:9090 api.Service/Method

Get a list of instruments available to trade on a node's network:

grpcurl --plaintext http://examplenode:9090 api.Service/Method

Convert human-readable trade information into integers and quantums:

grpcurl --plaintext http://examplenode:9090 api.Service/Method

Place and broadcast an order:

grpcurl --plaintext http://examplenode:9090 api.Service/Method

Get a list of your open positions:

grpcurl --plaintext http://examplenode:9090 api.Service/Method

Get your liquidation price:

grpcurl --plaintext http://examplenode:9090 api.Service/Method

REST Endpoints

You can interact with the Full Node API using curl or your own tool to send RESTful requests. Nodes provide support for REST through gRPC-Gateway (opens in a new tab). The gRPC-Gateway server is available on port 1317 by default.

See the Silk Nodes API specification (opens in a new tab) for REST endpoints.

Examples

Get your USDC balance:

curl https://examplenode:1317/path/to/resource

Get the height of the network:

curl https://examplenode:1317/path/to/resource

CometBFT API

You can read CometBFT state information using grpcurl (opens in a new tab) or your own tool to send RPC requests. The RPC server is available on port 26657 by default.

See the CometBFT RPC v0.38 API specification (opens in a new tab) for CometBFT endpoints.

Examples

Get your USDC balance:

grpcurl --plaintext http://examplenode:26657 api.Service/Method

Get the height of the network:

grpcurl --plaintext http://examplenode:26657 api.Service/Method