PHPackages                             linwj/ftx - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. linwj/ftx

ActiveLibrary[API Development](/categories/api)

linwj/ftx
=========

FTX API Like the official document interface, Support for arbitrary extension.

1.0.3(3y ago)22.7k4MITPHPPHP &gt;=7.0

Since Oct 12Pushed 3y ago2 watchersCompare

[ Source](https://github.com/zhouaini528/ftx-php)[ Packagist](https://packagist.org/packages/linwj/ftx)[ RSS](/packages/linwj-ftx/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

### It is recommended that you read the official document first

[](#it-is-recommended-that-you-read-the-official-document-first)

FTX docs

All interface methods are initialized the same as those provided by FTX. See details [src/api](https://github.com/zhouaini528/ftx-php/tree/master/src/Api)

Most of the interface is now complete, and the user can continue to extend it based on my design, working with me to improve it.

[中文文档](https://github.com/zhouaini528/ftx-php/blob/master/README_CN.md)

### Other exchanges API

[](#other-exchanges-api)

[Exchanges](https://github.com/zhouaini528/exchanges-php) It includes all of the following exchanges and is highly recommended.

[Bitmex](https://github.com/zhouaini528/bitmex-php) Support [Websocket](https://github.com/zhouaini528/bitmex-php/blob/master/README.md#Websocket)

[Okex](https://github.com/zhouaini528/okex-php) Support [Websocket](https://github.com/zhouaini528/okex-php/blob/master/README.md#Websocket)

[Huobi](https://github.com/zhouaini528/huobi-php) Support [Websocket](https://github.com/zhouaini528/huobi-php/blob/master/README.md#Websocket)

[Binance](https://github.com/zhouaini528/binance-php) Support [Websocket](https://github.com/zhouaini528/binance-php/blob/master/README.md#Websocket)

[Kucoin](https://github.com/zhouaini528/kucoin-php)

[Mxc](https://github.com/zhouaini528/Mxc-php)

[Coinbase](https://github.com/zhouaini528/coinbase-php)

[ZB](https://github.com/zhouaini528/zb-php)

[Bitfinex](https://github.com/zhouaini528/bitfinex-php)

[Bittrex](https://github.com/zhouaini528/bittrex-php)

[Kraken](https://github.com/zhouaini528/kraken-php)

[Gate](https://github.com/zhouaini528/gate-php)

[Bigone](https://github.com/zhouaini528/bigone-php)

[Crex24](https://github.com/zhouaini528/crex24-php)

[Bybit](https://github.com/zhouaini528/bybit-php)

[Coinbene](https://github.com/zhouaini528/coinbene-php)

[Bitget](https://github.com/zhouaini528/bitget-php)

[Poloniex](https://github.com/zhouaini528/poloniex-php)

[Coinex](https://github.com/zhouaini528/coinex-php)

[FTX](https://github.com/zhouaini528/ftx-php)

**If you don't find the exchange SDK you want, you can tell me and I'll join them.**

#### Installation

[](#installation)

```
composer require linwj/ftx

```

Support for more request Settings

```
//spot
use Lin\Ftx\Ftx;
$ftx=new Ftx();
//or
$ftx=new Ftx($key,$secret);

//You can set special needs
$ftx->setOptions([
    //Set the request timeout to 60 seconds by default
    'timeout'=>10,

    //https://github.com/guzzle/guzzle
    //'proxy'=>[],

    //https://www.php.net/manual/en/book.curl.php
    //'curl'=>[],

    //FTX-SUBACCOUNT (optional): URI-encoded name of the subaccount to use. Omit if not using subaccounts.
    //'headers'=>['FTX-SUBACCOUNT'=>'xxxx']
]);
```

### Exchange

[](#exchange)

Market API [More](https://github.com/zhouaini528/ftx-php/tree/master/src/Api/Markets.php)

```
$ftx=new Ftx();

try {
    $result=$ftx->markets()->gets();
    print_r($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}

try {
    $result=$ftx->markets()->get([
        'market_name'=>'BTC/USD',// BTC/USD   BTC-PERP  BTC-0626
        //'depth'=>'10'
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}

try {
    $result=$ftx->markets()->getOrderBook([
        'market_name'=>'BTC-PERP',// BTC/USD   BTC-PERP  BTC-0626
        //'depth'=>'10'
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}

try {
    $result=$ftx->markets()->getTrades([
        'market_name'=>'BTC-0626',// BTC/USD   BTC-PERP  BTC-0626
        //'depth'=>'10'
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}

try {
    $result=$ftx->markets()->getCandles([
        'market_name'=>'BTC-0628',// BTC/USD   BTC-PERP  BTC-0626
        'resolution'=>'60'
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}
```

Account API [More](https://github.com/zhouaini528/ftx-php/tree/master/src/Api/Account.php)

```
$ftx=new Ftx($key,$secret);

try {
    $result=$ftx->account()->get();
    print_r($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}

try {
    $result=$ftx->account()->getPositions();
    print_r($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}
```

Orders API [More](https://github.com/zhouaini528/ftx-php/tree/master/src/Api/Orders.php)

```
$ftx=new Ftx($key,$secret);

try {
    $result=$ftx->orders()->post([
        'market'=>'BTC/USD',
        'side'=>'buy',
        'price'=>'10000',
        'type'=>'limit',
        'size'=>'1',
        //'clientId'=>'1234567890',
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}

try {
    $result=$ftx->orders()->get([
        'order_id'=>'1234567890',
    ]);
    print_r($result);

    $result=$ftx->orders()->getByClientId([
        'client_order_id'=>'1234567890',
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}

try {
    $result=$ftx->orders()->delete([
        'order_id'=>'1234567890',
    ]);
    print_r($result);

    $result=$ftx->orders()->deleteByClientId([
        'client_order_id'=>'1234567890',
    ]);
    print_r($result);
}catch (\Exception $e){
    print_r($e->getMessage());
}
```

More Test [more](https://github.com/zhouaini528/ftx-php/tree/master/tests)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~112 days

Total

4

Last Release

1332d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5586e5fb008a98445932c41db11a328985476558c203458a684c70f3249f387a?d=identicon)[zhouaini528](/maintainers/zhouaini528)

---

Top Contributors

[![zhouaini528](https://avatars.githubusercontent.com/u/5442664?v=4)](https://github.com/zhouaini528 "zhouaini528 (9 commits)")[![booni3](https://avatars.githubusercontent.com/u/20134485?v=4)](https://github.com/booni3 "booni3 (2 commits)")[![llomgui](https://avatars.githubusercontent.com/u/14892748?v=4)](https://github.com/llomgui "llomgui (1 commits)")

---

Tags

binancebitmexcoinbasecoinexftxgatehuobiokexgatecoinbasebinanceBitMEXHuobiOKEXkucoinkumexbigonecoinexftx

### Embed Badge

![Health badge](/badges/linwj-ftx/health.svg)

```
[![Health](https://phpackages.com/badges/linwj-ftx/health.svg)](https://phpackages.com/packages/linwj-ftx)
```

###  Alternatives

[linwj/exchanges

This is a virtual currency SDK that brings together multiple exchanges

2546.8k](/packages/linwj-exchanges)[linwj/coinbase

Coinbase API Like the official document interface, Support for arbitrary extension.

1311.4k1](/packages/linwj-coinbase)[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

41.5k328.9k1](/packages/ccxt-ccxt)[linwj/bybit

Bybit API Like the official document interface, Support for arbitrary extension.

3010.5k1](/packages/linwj-bybit)[linwj/mxc

Mexc API Like the official document interface, Support for arbitrary extension.

207.3k1](/packages/linwj-mxc)[linwj/binance

Binance API Like the official document interface, Support for arbitrary extension.

11617.7k1](/packages/linwj-binance)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
