> Developers Blog
We're very happy to announce that Stellar Development Foundation is releasing a new ticker API to provide the freshest data about Markets, Issuers and Assets on the Stellar Network.
SDF already had a long-running ticker, but its refresh rate wasn't fast enough to represent the dynamic and ever-growing network, and the data provided was only a subset of what's currently available through tools like Horizon.
The new ticker provides a backend API with the same functionality as the previous one, plus:
{% code-block language="json" %}
{
ticker(numHoursAgo: 24) {
tradePair
baseVolume
counterVolume
orderbookStats {
bidMax
askMin
spread
}
}
}
{% code-block-end %}
According to Investopedia:
A stock ticker is a report of the price for certain securities, updated continuously throughout the trading session by the various stock exchanges. A “tick” is any change in price, whether that movement is up or down. A stock ticker automatically displays these ticks, along with other relevant information, like volume, that investors and traders use to stay informed about current market conditions.
In the context of the Stellar Network, a ticker provides the data associated with different trade Asset pairs (e.g. XLM and USDT), which we call Markets.
A ticker is important to give an accurate overview of the market activity at any given instant. Websites such as CoinMarketCap rely on ticker data to correctly display information about trade pairs.
As a backend project, the new ticker is UI-agnostic, i.e. it doesn't offer by itself a user-friendly interface for visualizing data–although we have some projects for building UIs for displaying ticker data in our roadmap.
In more technical terms, this is the new ticker's API root: https://ticker.stellar.org.
The new ticker offers two JSON endpoints:
{% code-block language="json" %}
// Example Response:
{
"generated_at": 1555536150576,
"assets": [
{
"code": "AngelXYZ",
"issuer": "GANZBUS4726LBT2CBJ3BGF3TP4NJT5MHZMI423NHMXFRWGO2DCBQEXYZ",
"type": "credit_alphanum12",
"num_accounts": 282,
"auth_required": false,
"auth_revocable": false,
"amount": 4999999999.999953,
"asset_controlled_by_domain": true,
"anchor_asset": "",
"anchor_asset_type": "",
"display_decimals": 0,
"name": "",
"desc": "",
"conditions": "",
"is_asset_anchored": false,
"fixed_number": 0,
"max_number": 0,
"is_unlimited": false,
"redemption_instructions": "",
"collateral_addresses": [],
"collateral_address_signatures": [],
"countries": "",
"status": "",
"last_valid": 1555509989002
},
{
"code": "PUSH",
"issuer": "GBB5TTFQE5KT3TEBCR7Z3FZR3R3WTVD654XL2KHKVONRIOBEI5UGOFQQ",
"type": "credit_alphanum4",
"num_accounts": 15,
"auth_required": false,
"auth_revocable": false,
"amount": 1000000000,
"asset_controlled_by_domain": true,
"anchor_asset": "",
"anchor_asset_type": "",
"display_decimals": 2,
"name": "Push",
"desc": "1 PUSH token entitles you to access the push API.",
"conditions": "Token used to access the PUSH api to send a push request to the stellar network.",
"is_asset_anchored": false,
"fixed_number": 0,
"max_number": 0,
"is_unlimited": false,
"redemption_instructions": "",
"collateral_addresses": [],
"collateral_address_signatures": [],
"countries": "",
"status": "",
"last_valid": 1555509990457
}
]
}
{% code-block-end %}
{% code-block language="json" %}
// Example Response:
{
"generated_at": 1555529876427,
"pairs": [
{
"name": "ABDT_DOP",
"base_volume": 2936.8559372,
"counter_volume": 67288.46914140001,
"trade_count": 48,
"open": 0.043734167043589976,
"low": 0.04348452989055152,
"high": 0.044444444444444446,
"change": -0.0001736265897799502,
"base_volume_7d": 93793.14427990005,
"counter_volume_7d": 1939718.2717202017,
"trade_count_7d": 399,
"open_7d": 0.049850448654037885,
"low_7d": 0.04348452989055152,
"high_7d": 0.05100629529387713,
"change_7d": 0.0059426550206679585,
"price": 0.043907793633369926,
"close": 0.043907793633369926,
"close_time": 1555484876000
},
{
"name": "BTC_ETH",
"base_volume": 0,
"counter_volume": 0,
"trade_count": 0,
"open": 0,
"low": 0,
"high": 0,
"change": 0,
"base_volume_7d": 0.00001,
"counter_volume_7d": 0.00025,
"trade_count_7d": 1,
"open_7d": 0,
"low_7d": 0.04,
"high_7d": 0.04,
"change_7d": 0,
"price": 0.04,
"close": 0.04,
"close_time": 1554943803000
}
]
}
{% code-block-end %}
The new ticker also speaks GraphQL:
Yes! The ticker is an open-source project hosted on SDFs Go monorepo. It consists of a series of routines that scrape data from Horizon, and that process and store that data in a way that enables easy querying.
The README.md contains Docker quick start instructions for any developer who is interested in running / tweaking their own ticker.
This project is under active development, so please feel free to send feedback, create issues and send Pull Requests directly on the monorepo.
Subscribe to developer updates