Arbitrage in Bitfinex

in #blockchain7 years ago

Our goal, simply, is to take advantage of different exchange rate between each coin in Bitfinex.

Arbitrage, huh?

Currency arbitrage is the practice of taking advantage of price differences between markets. These price differences emerge because certain exchanges are more liquid than others.

For example, there is always a different change rate between each cryptocurrency change to Bitcoin or USD (see figure 1). What you need to do, is calculating if it is profitable when you buy LTC with USD, and sell LTC to BTC, and buy ETH with BTC and sell ETH back to USD and if it’s profitable, good for you.
1_92Qumwv3H4eXXMuoc_uaQw.png
figure 1

So what is the strategy here?
Using your luminous eyes to read every single data (which either red or green) into your brain,
and let your gifted brain work as fast as it could be,
then try to figure out what might be profitable.
Then use the mouse you just bought or the trackpad on your laptop,
click click click click, and literate it all at once.


Kidding, let the code do the work!

I wrote it in nodejs, including both part of finding the most profitable trading
and automated trading if a single arbitrage’s profit margin is higher than a threshold.

And this is how it looks like.
1_89WMO0zjP2S1VCVNt7vunQ.png
The profit margin of different combination.

So what does the picture above actually mean?

Take the row start with “0.6895” as an example,
it means that if you buy NEO with USD and sell it back to BTC and buy ETP with BTC and sell it back to USD, you have a 0.6895% profit, say if you start with $50 you’ll get $50.34475 ideally(without the fees in Bitfinex, buy and sell all at correct pirce), after doing four steps above.


It should be noted that this code is only a proof of concept, it’s still far from make sustainable profit from it,
things like the fee is too high for most of the users and the trading speed is too slow to get the correct price, will lead to an unexpected result.

There will be a breaking change in bitfinex-api-node v2.0, if the code failed to work correctly, that might be a reason. Any pull request is welcome!
Cheers!

Sort:  

Coins mentioned in post:

CoinPrice (USD)📈 24h📈 7d
BTCBitcoin11342.100$9.72%9.69%
ETHEthereum1032.260$9.84%14.68%
ETPMetaverse ETP2.621$13.11%14.0%
LTCLitecoin184.389$8.58%11.08%
NEONEO135.257$19.42%18.47%

Congratulations @ju5td0m7m1nd! You received a personal award!

1 Year on Steemit

Click here to view your Board

Do not miss the last post from @steemitboard:

SteemWhales has officially moved to SteemitBoard Ranking
SteemitBoard - Witness Update

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @ju5td0m7m1nd! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.22
TRX 0.20
JST 0.035
BTC 91483.13
ETH 3152.10
USDT 1.00
SBD 3.10