DEVGRU

プログラミングと競馬予想について書きます

Zaif の XEM の最小取引量

Zaif でオルトコインとビットコインを用いた裁定取引を試しているんですが、 XEM/BTC と XEM/JPYで最小取引量が異なるようです。

curl https://api.zaif.jp/api/1/currency_pairs/all | jq . | less とかすると、各通貨ペアの最小取引量がでるのですが、 MONAとかBCHとかETHとかはJPY, BTCどちらも同じですが、 XEMだけ異なります。

currency_pairs — Zaif api document v1.1.1 ドキュメント

  {
    "title": "XEM/BTC",
    "aux_japanese": "ビットコイン",
    "id": 5,
    "is_token": false,
    "currency_pair": "xem_btc",
    "aux_unit_step": 1e-08,
    "item_unit_step": 1,
    "item_unit_min": 1,
    "name": "XEM/BTC",
    "item_japanese": "XEM",
    "event_number": 0,
    "seq": 2,
    "aux_unit_min": 1e-08,
    "description": "XEM・ビットコインの取引を行うことができます",
    "aux_unit_point": 8
  },
    {
    "title": "XEM/JPY",
    "aux_japanese": "日本円",
    "id": 4,
    "is_token": false,
    "currency_pair": "xem_jpy",
    "aux_unit_step": 0.0001,
    "item_unit_step": 0.1,
    "item_unit_min": 0.1,
    "name": "XEM/JPY",
    "item_japanese": "XEM",
    "event_number": 0,
    "seq": 1,
    "aux_unit_min": 0.0001,
    "description": "XEM・日本円の取引を行うことができます",
    "aux_unit_point": 4
  },

item_unit_min が、XEM/BTC では1, XEM/JPYでは0.1となっています。

なので、前者では1未満切り捨て、後者では0.1未満切り捨てしないとAPIがエラーを返します。

プログラム組むときは嵌らないようにお気をつけ下さい。

cookiecutter を使ってPyramidのプロジェクトをテンプレートから作成する

Pyramid 使いたいんですが、最近cookiecutterの記事(参考)がはてブに上がったりしていたので、 Pyramidのものがないか探したらありました。

https://github.com/Pylons/pyramid-cookiecutter-starter

あとは、書いてあるとおりにコマンドを打つと作れると思います。

こんな感じ。

$ cookiecutter gh:Pylons/pyramid-cookiecutter-starter
project_name [Pyramid Scaffold]: my-dictionary
repo_name [my_dictionary]: 
Select template_language:
1 - jinja2
2 - chameleon
3 - mako
Choose from 1, 2, 3 [1]: 3

===============================================================================
Documentation: https://docs.pylonsproject.org/projects/pyramid/en/latest/
Tutorials:     https://docs.pylonsproject.org/projects/pyramid_tutorials/en/latest/
Twitter:       https://twitter.com/PylonsProject
Mailing List:  https://groups.google.com/forum/#!forum/pylons-discuss
Welcome to Pyramid.  Sorry for the convenience.
===============================================================================

Change directory into your newly created project.
    cd my_dictionary

Create a Python virtual environment.
    python3 -m venv env

Upgrade packaging tools.
    env/bin/pip install --upgrade pip setuptools

Install the project in editable mode with its testing requirements.
    env/bin/pip install -e ".[testing]"

Run your project's tests.
    env/bin/pytest

Run your project.
    env/bin/pserve development.ini

参考:

qiita.com

blog.amedama.jp

wonderwall.hatenablog.com


退屈なことはPythonにやらせよう ―ノンプログラマーにもできる自動化処理プログラミング

退屈なことはPythonにやらせよう ―ノンプログラマーにもできる自動化処理プログラミング

詳細!Python 3 入門ノート

詳細!Python 3 入門ノート

入門 Python 3

入門 Python 3

はてなブログからはてなカウンタのスクリプトへのリンクが消えてくれたようだ

前回の続き。

team-6.hatenablog.jp

結局、はてなブログから対応中との連絡がその後来て、気づいたら消えていた。 Google Search Consoleのインデックス登録件数も上がったので、問題は解決したみたいだ。

できる100の新法則 Google Search Console これからのSEOを変える基本と実践

できる100の新法則 Google Search Console これからのSEOを変える基本と実践

マーケティング/検索エンジンに強くなる Google Search Consoleの教科書

マーケティング/検索エンジンに強くなる Google Search Consoleの教科書

できる逆引き Googleアナリティクス Web解析の現場で使える実践ワザ240 ユニバーサルアナリティクス&Googleタグマネージャ対応

できる逆引き Googleアナリティクス Web解析の現場で使える実践ワザ240 ユニバーサルアナリティクス&Googleタグマネージャ対応