All Projects → 0x13a → Bitcoin Arbitrage

0x13a / Bitcoin Arbitrage

Licence: mit
An AWS Lambda function that looks for Bitcoin Arbitrage opportunities

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Bitcoin Arbitrage

Ccxt
A JavaScript / Python / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
Stars: ✭ 22,501 (+19466.09%)
Mutual labels:  bitcoin, btc, arbitrage, exchange
Crypto vba
An Excel/VBA project to communicate with various cryptocurrency exchanges APIs
Stars: ✭ 103 (-10.43%)
Mutual labels:  bitcoin, cryptocurrencies, btc, exchange
Ccxt Rest
Open Source Unified REST API of 100+ Crypto Exchange Sites (18k+ docker pulls) - https://ccxt-rest.io/
Stars: ✭ 210 (+82.61%)
Mutual labels:  bitcoin, btc, arbitrage, exchange
Ccxt.net
CCXT.NET – CryptoCurrency eXchange Trading Library for .NET
Stars: ✭ 89 (-22.61%)
Mutual labels:  bitcoin, arbitrage, exchange
Cryptotrader
A cryptocurrency trader for all famous exchanges
Stars: ✭ 228 (+98.26%)
Mutual labels:  bitcoin, arbitrage, exchange
Coinapi Sdk
SDKs for CoinAPI
Stars: ✭ 238 (+106.96%)
Mutual labels:  bitcoin, cryptocurrencies, exchange
Socktrader
🚀 Websocket based trading bot for 💰cryptocurrencies 📈
Stars: ✭ 152 (+32.17%)
Mutual labels:  bitcoin, cryptocurrencies, exchange
Wolfbot
Crypto currency trading bot written in TypeScript for NodeJS
Stars: ✭ 335 (+191.3%)
Mutual labels:  bitcoin, cryptocurrencies, exchange
Bitcore
BitCore (BTX) - Cryptocurrency 220 Byte Datacarriersize
Stars: ✭ 94 (-18.26%)
Mutual labels:  bitcoin, cryptocurrencies, btc
Go Binance
A Go SDK for Binance API
Stars: ✭ 441 (+283.48%)
Mutual labels:  bitcoin, btc, exchange
Crypto Arbitrage
Automatic Cryptocurrency Trading Bot using Triangular or Exchange Arbitrages
Stars: ✭ 369 (+220.87%)
Mutual labels:  bitcoin, arbitrage, exchange
Qtbitcointrader
Secure multi crypto exchange trading client
Stars: ✭ 520 (+352.17%)
Mutual labels:  bitcoin, btc, exchange
Cryptocompare
CryptoCompare JavaScript API
Stars: ✭ 212 (+84.35%)
Mutual labels:  bitcoin, btc, exchange
coinaly
🚀 Fast and easy to use mobile trade interface for cryptocurrencies. Track your trades to the moon and beyond. Currently only for Bittrex.
Stars: ✭ 32 (-72.17%)
Mutual labels:  exchange, btc, cryptocurrencies
Bot18
Bot18 is a high-frequency cryptocurrency trading bot developed by Zenbot creator @carlos8f
Stars: ✭ 157 (+36.52%)
Mutual labels:  bitcoin, btc, arbitrage
Donate
Cryptocurrency donation daemon
Stars: ✭ 34 (-70.43%)
Mutual labels:  bitcoin, cryptocurrencies, btc
Binance Trader
💰 Cryptocurrency Trading Bot for Binance (Experimental)
Stars: ✭ 2,128 (+1750.43%)
Mutual labels:  bitcoin, btc, arbitrage
My Token
📈Track token prices of your favorite exchanges in terminal!
Stars: ✭ 141 (+22.61%)
Mutual labels:  bitcoin, btc, exchange
Bitcoinlib
Bitcoin Core RPC compatible, battle-tested .NET library and RPC wrapper for Bitcoin and Altcoins
Stars: ✭ 350 (+204.35%)
Mutual labels:  bitcoin, cryptocurrencies, exchange
Octobot
Cryptocurrency trading bot: high frequency, daily trading, social trading, ...
Stars: ✭ 706 (+513.91%)
Mutual labels:  bitcoin, arbitrage, exchange

An AWS Lambda function that looks for Bitcoin Arbitrage opportunities

License: MIT chat

This is a simple AWS Lambda function that finds interesting arbitrage opportunities for cryptocurrencies. At the moment there are only two exchanges with relatively different volumes (Kraken and BitStamp). It runs every 10 (you can setup your interval) minutes.

What is arbitrage

In order to buy/sell cryptocurrencies we need to be in a market. This market is called Exchange. We assume that there are different markets that let people trade the same digital assets. Due to market inefficiencies and difference of trading volume between each other, the price for the same digital asset can be different from an exchange to another. This is true in traditional markets (like New York Stock Exchang vs London Stock Exchang, others...), but is as well in crypto currencies markets (like Kraken and Bitstamp, others...).

Now I am Bob and I want to buy 1 BTC in the exchange A, the price in there is 1BTC=3672$. I am Bob and I can also buy 1 BTC on exchange B, the price in there is 1BTC=3630$. Now what I can do is buying 1 BTC at exchange B and sell the same 1BTC at exchange A. This is called arbitrage.

Arbitrage is the simultaneous purchase and sale of an asset to profit from a difference in the price. It is a trade that profits by exploiting the price differences of identical or similar financial instruments on different markets or in different forms. Arbitrage exists as a result of market inefficiencies. -- Investopedia

An Example of BTC price in two different exchanges. Basically with this lambda function we look at the price difference between the red and the blue line. When this difference is large enough (like 3%), we buy a fixed sum in the red exchange and we sell on the blue exchange.

What this lambda function does

This script pulles the exchange rates of BTCEUR (or a list of currencies you want) every 10 minutes and whenever it detects a spread of at least 3% (you can choose your spread level) between the two rates it tries to buy on the cheapest exchange and sell on the more expensive one. It will text you in case of success (or failure)

Assumptions and constraints

  • You need to have two verified accounts in both (or how many exchange you want to do arbitrage on)
  • Both accounts (or more) must have funds (BTC, EUR or whatever assets you want to arbitrage on)
  • The spread can change quickly, but the transactions can get approved with dealy which would cause you potential losses

Disclaimer

Past performance is not necessarily indicative of future results. Use this software at your own risk.

Setup the function

In order to get started you just have to use serverless

$ serverless install --url https://github.com/0x13a/bitcoin-arbitrage --name my-btc-arbitrage

In order to deploy to your AWS Lambda function (or other serverless platform if you like) you need to follow this guide https://serverless.com/framework/docs/providers/aws/guide/functions/. Sorry, if for the moment it looks too cumbersome to configure, i will make a better readme.

Configuration file

This is an example of configuration file for serverless.yml. In my case I've used kraken and Bitstamp. So you will need to recover API access keys from there in order to automate the trades.

Unless you want to use this in another serverless service (Google Cloud Functions, IBM OpenWhisks, etc). You need to configure your AWS Lambda function to access your Amazon SNS.

service: bitcoin-arbitrage

# Use the serverless-webpack plugin to transpile ES6
plugins:
  - serverless-webpack

# Enable auto-packing of external modules
custom:
  webpackIncludeModules: true

provider:
  name: aws
  runtime: nodejs6.10
  iamRoleStatements:
    - Effect: "Allow"
      Action:
          - "sns:Publish"
          - "sns:Subscribe"
      Resource: { "Fn::Join" : ["", ["arn:aws:sns:${aws-region}:", { "Ref" : "${aws-account-id}" }, ":${aws-arn}" ] ]  }

functions:
  watch:
    handler: handler.watch
    environment:
        KRAKEN_KEY: ${kraken-key}
        KRAKEN_SECRET: ${kraken-secret}
        BITSTAMP_KEY: ${bitstamp-key}
        BITSTAMP_SECRET: ${bitstamp-secret}
        BITSTAMP_CLIENT_ID: ${bitstamp-client-id}
        ASSET: BTCEUR
        AMOUNT: 100EUR
        SNS_TOPIC_ARN: ${sns-topic-arn}
        SNS_REGION: ${sns-region}
        SPREAD_THRESHOLD: "3"
    events:
        - schedule: cron(10 * * * ? *)
    timeout: 50

It text you when you make profit or when something goes wrong

Thanks to the integration of Amazon SNS the lambda function communicate with the amazon notification systema and it's able to send you a text message when something goes wrong or when the function succeed to make a profitable arbitrage operation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].