

Identifying Arbitrage Opportunities with Graphs - nicolewhite
http://gist.neo4j.org/?7331087

======
TheAlchemist
Besides the fact that you don't take into accunt the spread (the buy / sell
prices, which are never equal), the big risk associated with this kind of
'arbitrage' is the fact that the transactions won't occur simultaneously. What
happens if during the sequence of this 'arbitrage' prices move enough to
offset the potential gain ?

~~~
j_lev
Doesn't take into account the fact that FX is "last look" for the provider of
the liquidity and so any one of the transactions along the way could be
rejected. In fact even if the trade wasn't rejected at the time of
transaction, the liquidity provider could come back later and request a
particular trade be reversed or manually adjusted as it was unprofitable for
the liquidity provider.

Also doesn't take into account that in FX specifically, arbitraging is heavily
frowned upon and if you are caught you are likely to have your account closed
down.

The reasons for both of the above is that unlike for
commodities/equity/futures/etc which are traded on a market, FX is more like a
"gentleman's wild west" ie no defined market rules, but a lot of unofficial
gentlemans agreements in place about what you can and can't do.

Various exchanges have tried to offer a standardised FX product and they all
have the same issue - because a transaction on an exchange doesn't allow "last
look" provision and the market makers _have_ to honor the transaction, once an
arbitrager infiltrates the market the market makers are basically at the mercy
of the exchange (and all the latencies and rules within) and are forced to
widen their spreads to the point that it no longer an attractive marketplace
for all other market takers.

Having said that, arbitragers still do exist in FX. The most (in)famous one in
Japan is a guy "Arb-san" who was making a motza in the countryside in Gifu. He
had a great blog where he uploaded photos of his cars and piles of cash and
trading rig, and commentary of how he was sticking it to the dumb banks.
Unfortunately I can't find this blog anymore, but I did manage to find a
profile of someone with the same name online that has some cars that I
recognise from the that blog:

[http://minkara.carview.co.jp/en/userid/1956440/car/](http://minkara.carview.co.jp/en/userid/1956440/car/)

~~~
jklein11
Can you explain the rational behind arbitrage being heavily frowned upon?
Either arbitrage is effective, and prices are set efficiently without any
intervention, or they aren't and the exchange makes collects their fees for
the trades.

~~~
j_lev
Essentially the assumption that prices are set efficiently does not hold for
FX. Errors in pricing can occur, and when there is an arbitrage opportunity
and a market maker loses money then it is assumed (possibly) due to a pricing
error which the arbitrager shouldn't have taken advantage of.

A bit of history how the messaging protocol works might make things clearer.

In the old days a trade would take place over the phone as follows:

You: "I'd like to buy USDJPY, $1 million worth please" Market Maker or broker
(MM): "Ok you can get $1 million dollars worth for 123"

At this point there was a gentleman's agreement you would respond within 4
seconds whether you want that price or not (as the market may move)

You: "Mine, I'll take it"

Here you have completed your side of the contract and cannot back out. You
just need the MM to confirm that they can still get your USDJPY 1 million 123
(this was traditionally confirmed with a trader sitting nearby who could see
all the prices and volumes being published in the market and could give a
price at which they could hedge the entire volume and still make a profit.
These days traders still perform this role to a small extent but generally the
broker would read a price off a screen themselves).

If they can, MM: "It's yours, USDJPY 1 million at 123" and the transaction
(contract) is confirmed good. The position is transferred to you, and the
trader who provided the original price hedges the risk and gets out of the
position, flattening his trading book.

If the market has since moved and the trade is no longer profitable, MM: "I'm
sorry the price has changed, you can now buy at 123.1" and you jump back up to
the previous

Ok, so all this has been upgraded with technology over the years, specifically
messaging is now done via the FIX protocol (same as is used for other asset
classes). But the basic flow is still the same:

You: Request price at a quantity MM: provides price You: decide whether to
take that price MM: confirms that the price is still good, then sends you
confirmation the trade was good (and hedges the trade), or otherwise rejects
the trade.

The issue arbitraging causes is that if the prices in the market move and
those moves are known to the arbitrageur but not to the market maker then the
market maker gets into a position where they accept and confirm the trade, but
can't hedge out at the price they thought they could, and so lose money on the
trade. A few of these trades and the losses start to build up, and if it keeps
happening with a certain client (remember, no anonymous exchanges here) then
it's easy to punish that client (show them worse prices, cut them off
completely, etc). If an arbitrageur is hiding behind a third party then the
market maker might have enough clout to punish the entire third party (in
which case it would be in the third party's interest to seek out the
arbitrageur and punish them themselves).

------
murbard2
This doesn't take into account available volume. For that you need to solve a
min-cost flow algorithm, using for instance the Ford–Fulkerson algorithm.

~~~
codesci
Available volume? Forex is the most liquid market in the world.

~~~
foobar2020
Yes. But if your arbitrage pattern is only 3 pips profitable, and you are
exchanging millions at once, you might expect that the amount of available
orders matching your path may actually matter.

------
dataker
I'm assuming one would have to manage a hedge fund to actually be benefited?

Seems somewhat unfeasible for an individual investor.

~~~
ziles88
Well, hedge-funds don't play arbitrage games anyways. This is for scalpers and
mostly day-traders. Banks don't even really play arbitrage - not as a means to
profit at least.

Only benefit to being a hedge-fund is you have lots of money to play with,
which you'll need because the profits in arbitrage are very thin. You need
likely 20K+, good spreads, fast execution, and an automated strategy to
consider it worth your time.

~~~
syphon7
Hedge funds make insane amounts of money using arbitrage strategies.

------
genericacct
You know it is a recent snippet because it mentions currencies that havent
been in use for over a decade..

~~~
to3m
Bringing it up to date must be one of those exercises for the reader.

------
grandalf
been using neo4j lately and loving it.

