一起来玩内部市场吧(二)!/ Market history APIs by example

in #steemdev7 years ago

昨天发了一篇文章,《一起来玩内部市场吧!/ Let's play the internal market》

很多朋友私下里表示了极大的兴趣,因为内部市场最吸引人的特点:没有手续费!与其去其它各类市场被人家薅羊毛,不如咱们自己在内部市场愉快的玩耍,没有手续费,考验的就是技术和运气了。

关于内部市场,我之前也写过一系列的文章,当然其实就是自己学习的过程,毕竟在这之前,我对交易什么的也一窍不通。详情可参考页面底部的之前相关文章。在这篇文章中,我来介绍一下,自动操作可能涉及到的API等。


(图源:pixabay)

本篇文章介绍以下API / In this article, I'll introduce the following APIs by example:

  • get_ticker()
  • get_volume()
  • get_order_book()
  • get_recent_trades()
  • get_trade_history()
  • get_market_history_buckets()
  • get_market_history()

详情可以参考,market_history_api.hpp
They are located in market_history_api.hpp

API返回的结果是JSON 编码字符串,为了便于查看,我将其解码并格式化显示。
The return results are JSON encoded string, For convenience, I decode them and display them formatted.


get_ticker()

API: market_ticker get_ticker() const;
说明: 获取市场报价信息
Returns the market ticker for the internal SBD:STEEM market

调用示例 /Example:
curl -s --data '{"jsonrpc": "2.0", "method": "call", "params": ["market_history_api", "get_ticker", []], "id": 1}' https://steemd.steemit.com

返回信息 / Return:


get_volume()

API: market_volume get_volume() const;
说明: 最近24小时的时常交易量
Returns the market volume for the past 24 hours

调用示例 /Example:
curl -s --data '{"jsonrpc": "2.0", "method": "call", "params": ["market_history_api", "get_volume", []], "id": 1}' https://steemd.steemit.com

返回信息 / Return:


get_order_book()

API: order_book get_order_book( uint32_t limit = 500 ) const;
说明: 获取市场当前订单信息
Returns the current order book for the internal SBD:STEEM market.

调用示例 /Example:
curl -s --data '{"jsonrpc": "2.0", "method": "call", "params": ["market_history_api", "get_order_book", [5]], "id": 1}' https://steemd.steemit.com

返回信息 / Return:


get_recent_trades()

API: std::vector< market_trade > get_recent_trades( uint32_t limit = 1000 ) const;
说明: 获取内部市场最近成交信息
Returns the N most recent trades for the internal SBD:STEEM market.

调用示例 /Example:
curl -s --data '{"jsonrpc": "2.0", "method": "call", "params": ["market_history_api", "get_recent_trades", [5]], "id": 1}' https://steemd.steemit.com

返回信息 / Return:


get_trade_history()

API: std::vector< market_trade > get_trade_history( time_point_sec start, time_point_sec end, uint32_t limit = 1000 ) const;
说明: 获取内部市场指定时间范围内的成交信息
Returns the trade history for the internal SBD:STEEM market.

调用示例 /Example:
curl -s --data '{"jsonrpc": "2.0", "method": "call", "params": ["market_history_api", "get_trade_history", ["2016-08-01T00:00:00", "2016-08-05T00:00:00", 10]], "id": 1}' https://steemd.steemit.com

返回信息 / Return:


get_market_history_buckets()

API: flat_set< uint32_t > get_market_history_buckets() const;
说明: 获取市场行情处理区间(15秒/分钟/5分钟/等)
Returns the bucket seconds being tracked by the plugin.

调用示例 /Example:
curl -s --data '{"jsonrpc": "2.0", "method": "call", "params": ["market_history_api", "get_market_history_buckets", []], "id": 1}' https://steemd.steemit.com

返回信息 / Return:


get_market_history()

API: std::vector< bucket_object > get_market_history( uint32_t bucket_seconds, time_point_sec start, time_point_sec end ) const;
说明: 获取内部市场历史信息
Returns the market history for the internal SBD:STEEM market.

调用示例 /Example:
curl -s --data '{"jsonrpc": "2.0", "method": "call", "params": ["market_history_api", "get_market_history", [86400, "2016-08-01T00:00:00", "2016-08-05T00:00:00"]], "id": 1}' https://steemd.steemit.com

返回信息 / Return:


之前相关文章 / Previous articles

Sort:  

坏人,大家一堆去玩内部市场,其实赚的钱都是大家自己的,就有点像四个去打牌,赚来赚去都是这四个人的啦,哈哈。不上O哥的当。

哭,这都被你识破了。😭

不过,话说其实不完全是你说的这个样子。
大家都来玩内部市场,有助于币价的稳定,这对STEEM而言是好事。

另外,虽然是内部市场,但是因为STEEM和SBD都是可以在外部市场流动的,所以其实高级玩法可以内外结合。

我也覺得這是好事,高交易量才會令STEEM有著更多需求,而且交易量提高了自然會有其他的人進來玩,畢竟內部市場本身的設計就不錯。這樣就不存在賺自己人錢的問題了,而且

交易本身就是各憑本事呀,在所有市場都是一樣的。

请教一下交易达人
bucket seconds,这玩意该咋翻译啊?
我明白它的意思,但是用中文咋表达呢?

額,我不是交易達人,所以這個我也不懂啦T^T

哈哈,主要还是要看有没有法币入场,才可能有助于稳定币价吧,考虑到有些大佬在出货。

不过也不有关系,主要还是要看它的长远发展,是否真能创造价值。这些没有信心的大佬们出了货,反而更稳定。

看看比特币就知道了,换了多少回手,现在稳定多了。

我觉得也是,有人挣就有人赔呀,以我这种笨蛋,估计是其他人在挣我的钱。

其實以交易來說耐性和心態有時比䇿略和技巧更重要。

我怎么觉得运气更重要呢 😄

我觉得心态很重要,不然跌一点就沉不住气了。

😄快进来啊,你要再不进来,我都要赔钱了😢

我不会让你得逞的哈哈哈哈

nice

Cool Code thank you for providing it to us.

멋진 코드는 우리에게 제공 해줘서 고맙습니다.

Thank you so much for the info

Thank u for the info dude :)

Awesome Post !

Well keep it on

I need your support @oflyhigh pls resteem one of my post hehe..

有道理!

内部市场确实是一个特别好玩的东西,不过API就完全不懂了,整个市场如果steem最后不涨价的话,波动来波动去确实是个零和交易。o哥的机器人也坑能会被别的大牛机器人割韭菜的。。。。哈哈

我的发财梦,被你打击得粉碎 😭

不过你也是大牛,你肯定会割到不少我这种的韭菜

Congratulations @oflyhigh!
Your post was mentioned in the hit parade in the following category:

  • Pending payout - Ranked 8 with $ 169,91

里面的接口都是查询类的,哪里有挂单的接口?