Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


An example php binding for the lmax api

Classes to connect to the LMAX API and hopefully do some useful things with it.

Released under the lgpl vn 3. You should have a copy of the lgpl alongside this file.

No warranty or fitness for any purpose. Use at your own risk. This program is provided for the purpose of learning about the LMAX API and my own personal monitoring projects.

You take it on your own head if you use this for trading. This API library was not intended for that. I've never put real money through it and strongly advise you don't either. I'd advise you to look at the "proper" LMAX .NET and Java APIs for supported trading apis.

They're tested and QA'ed. This is not. Here be dragons and lions and tigers.

LMAX don't support or even know about this. You can try and ask them for support on general protocol questions, but they will stare at you blankly and point you at the Java and .NET api's if you ask about this.


This is a synchronous, single threaded library that uses longpoll. As a result you have to poll for events using the get_events method. This will return various objects that represent the events returned.

Brief Usage;

Include the library


Create a new instance of the class pointing at the default venue (demo)

$foo = new lmaxapi();





place order, in this case a limit good til cancel on EUR/GBP, 1 contract at a price of 0.81782.


close out order with id of $market_order_id, one contract.


return data on all GBP crosses instruments.


Examples, Test

All of these require a username and password to the LMAX demo exchange.

test/test.php - has a verbose set of tests to exercise part of the library. It can give you an idea of how to use it.

examples/ticker - a simple ticker app that prints out the current GBP/USD prices from the demo exchange.

examples/positions - A web app that logs in, and retrieves data on the currently open positions for an account.

Reminder: this is sample code for learning about the lmax protocol. Do not use for trading. This is not officially or unofficially supported. If this code eats your dog, then its at your own risk.


an example php binding for the lmax api



No releases published


No packages published
You can’t perform that action at this time.