SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
Ripple Api勉強会 
トレード用ライブラリを作ってみた
自己紹介 
you21979(ゆあ) 
暗号通貨を勉強中です 
仕事はサーバー周りの仕事をよくやります
rippleで覚えておきたい用語 
ledger(データーベースのこと) 
transaction(ledgerに格納する取引内容) 
ripple-lib(rippleのプロトコルを扱うjavascriptのラ 
イブラリ)
トレード用ライブラリを作った 
https://github.com/you21979/node-ripple-trade-helper 
よくあるビットコイン取引所のAPIに似せて作りました
トレードに必要な機能 
・口座情報(Balance) 
・売り(sell) 
・買い(buy) 
・取り消し(cancel) 
・注文一覧(open orders) 
・板情報(depth) 
・出来情報(trading history)
RIPPLE-LIBで用意されてる機能 
・アカウント情報取得 
・レジャー情報取得 
・トランザクション取得 
・トランザクション操作 
・オーダーブック取得(内部形式)
RIPPLE-LIBの機能に当てはめてみる 
・口座情報(アカウント情報取得) 
・売り(トランザクション操作) 
・買い(トランザクション操作) 
・取り消し(トランザクション操作) 
・注文一覧(アカウント情報取得) 
・板情報(オーダーブック取得) 
・出来情報(トランザクション取得)
どんな感じでデータを扱うか 
・XRP/IOUの値の変換 
・トランザクションの抽出
Rippleで扱うデータ(通貨) 
・XRP 
 100万倍されている( 1.0XRP = 1000000 ) 
・IOU 
 数値だけでなく発行元情報など含まれる
Rippleで扱うデータ(通貨) 
・XRP 
 xrp = ”123100000” 
 DECIMAL(15,6) 
 xrp = parseFloat(humanxrp) * 1000000 
 humanxrp = parseFloat(xrp) / 1000000
Rippleで扱うデータ(通貨) 
・IOU 
 jpy = { currency:”JPY”, value:”123.1”, 
   issuer:”rxxxxxxxxxxx” } 
 parseFloat(jpy.value) 
 
Rippleで扱うデータ(通貨) 
・IOUとXRPで扱い方が違う 
 差分を吸収する仕組みは使ったほうがいい 
  
 ripple-libにはAmountというクラスがある
Rippleで扱うデータ(取引) 
・トランザクション 
 なにが起きたというイベント情報 
 オーダー情報や約定の記録はこれに入ってる 
 注文を出すときにはトランザクションに秘密鍵で 
サインをする(トランザクションに触るとき以外秘密 
鍵はいらない)
Rippleで扱うデータ(取引) 
・板情報 
TransactionType: 'OfferCreate', 
TakerGets: '1000000', 
TakerPays: { currency: 'JPY', issuer: 'rxxxxx', 
value: '1.812' }, 
 ripple-libにはOrderBookというクラスがある
Rippleで扱うデータ(取引) 
・板情報 
Rippleには買いという概念しかない 
注文するときも買いしかない 
XRP/JPY 買い 
JPY/XRP 買い 
売りという情報はフラグ情報に入れる
Rippleで扱うデータ(取引)
デモ 
作ったツールでデモ
ライブラリ使ってこんなものを作ってる 
・マーケットメーカー 
 板を自動でならべる 
・アービトラージ 
 取引所間の価格差を埋める(サヤ取り) 
・タイムスライサー 
 時間で分割して成り行き注文を出す
ripple-lib使用感 
同じ機能やオプションなのに違う名前が 
たくさん用意されている 
今後ripple-libはリファクタリングでDEPRECATED 
が出ると思う。いきなり動かなくなると困るならバー 
ジョン固定したほうがいい
ご静聴ありがとうございました

Weitere ähnliche Inhalte

Empfohlen

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Empfohlen (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

ripple api 勉強会