All Projects → vdbelt → ftx-php

vdbelt / ftx-php

Licence: MIT license
PHP wrapper for FTX.com REST API

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to ftx-php

MT5-TradingToolCrypto
All the tradingtools: crypto integration to metatrader including cryptobridgepro, crypto charts, paymentbot, indicators, robots are located here. Just download the zip folder, drag and drop into Metatrader 5 directory
Stars: ✭ 70 (+311.76%)
Mutual labels:  ftx
unicorn-fy
Convert received raw data from crypto exchange API endpoints into well-formed python dictionaries.
Stars: ✭ 51 (+200%)
Mutual labels:  cryptoexchange
ftx-lending-bot
Renew lending amount on FTX
Stars: ✭ 55 (+223.53%)
Mutual labels:  ftx
ftx-keep-lending
FTX - lending all available balance(USD/USDT) per hour using crontab
Stars: ✭ 18 (+5.88%)
Mutual labels:  ftx
add-tradingview-alerts-tool
Automated entry of TradingView alerts for bot trading tools such as 3Commas, Alertatron, CryptoHopper, etc.
Stars: ✭ 467 (+2647.06%)
Mutual labels:  ftx
goftx
FTX exchange golang library
Stars: ✭ 28 (+64.71%)
Mutual labels:  ftx
api-docs
Official documentation for WhiteBIT APIs
Stars: ✭ 2 (-88.24%)
Mutual labels:  cryptoexchange
exchange-proxy
exchange-proxy
Stars: ✭ 88 (+417.65%)
Mutual labels:  cryptoexchange
moon-doge
Buy DogeCoin automatically when Elon Musk tweet about it, and sell after profit
Stars: ✭ 20 (+17.65%)
Mutual labels:  ftx
cryptogalaxy
Get any cryptocurrencies ticker and trade data in real time from multiple exchanges and then save it in multiple storage systems.
Stars: ✭ 96 (+464.71%)
Mutual labels:  ftx
ftx-api-wrapper-python3
FTX Exchange API wrapper in python3
Stars: ✭ 31 (+82.35%)
Mutual labels:  ftx
FTX.Net
No description or website provided.
Stars: ✭ 31 (+82.35%)
Mutual labels:  ftx

PHP client for FTX

GitHub Workflow Status Codecov Packagist GitHub

This package aims to implement the FTX.com REST API endpoints.

Installation

You can install the package via composer:

composer require vdbelt/ftx-php

This library is not hard coupled to Guzzle or any other HTTP library. It follows PSR-18 client abstraction. You'll need to install your own preferred client.

If you want to get started quickly:

composer require vdbelt/ftx-php php-http/curl-client nyholm/psr7

Basic usage

use FTX\FTX;

// Unauthenticated
$ftx = FTX::create();

// Authenticated
$ftx = FTX::create('key', 'secret');

$markets = $ftx->markets()->all();
$btcPerp = $ftx->markets()->get('BTC-PERP');

If you want to perform an action on a certain subaccount, you can do so:

$orders = $ftx->onSubaccount('foo')->orders()->open();

Subaccounts

$ftx->subaccounts()->all()
$ftx->subaccounts()->create('nickname')
$ftx->subaccounts()->rename('old', 'new')
$ftx->subaccounts()->delete('nickname')
$ftx->subaccounts()->balances('nickname') // Get balances for a specific subaccount
$ftx->subaccounts()->transfer('BTC', 1, 'main', 'nickname') // Transfer funds between subaccounts

Markets

$ftx->markets()->all()
$ftx->markets()->get('BTC-PERP')
$ftx->markets()->orderbook('BTC-PERP', 100)
$ftx->markets()->trades('BTC-PERP', 100, new \DateTime('2020-03-01'), new \DateTime('2020-03-01 06:00:00'))
$ftx->markets()->candles('BTC-PERP', 15, 100)

Futures

$ftx->futures()->all()
$ftx->futures()->get('BTC-0626')
$ftx->futures()->stats('BTC-0626')
$ftx->futures()->fundingRates()

Account

$ftx->account()->get()
$ftx->account()->positions()
$ftx->account()->changeAccountLeverage(101)

Wallet

$ftx->wallet()->coins()
$ftx->wallet()->balances()
$ftx->wallet()->allBalances() // Balances accross all subaccounts
$ftx->wallet()->depositAddress('BTC')
$ftx->wallet()->depositAddress('USDT', 'erc20')
$ftx->wallet()->deposits()
$ftx->wallet()->withdrawals()
$ftx->wallet()->createWithdrawalRequest('BTC', 1, 'address')->withdraw()
$ftx->wallet()->createWithdrawalRequest('BTC', 1, 'address')->fees()
$ftx->wallet()->createWithdrawalRequest('BTC', 1, 'address')->withPassword()->withCode()->withTag()->withdraw()

Orders

$ftx->orders()->open();
$ftx->orders()->open('BTC-PERP');

// history
$ftx->orders()->history();
$ftx->orders()->history('BTC-PERP')

// Placing orders
// You can either pass the properties of your order directly:
$ftx->orders()->create(['market' => 'BTC-PERP', 'type' => 'market', 'size' => 1])->place();

// or use the fluent api to build up an order:
$ftx->orders()->create()->buy('BTC-PERP')->limit(1, 4000)->place();

// order status
$ftx->orders()->status(123456);

// cancel order
$ftx->orders()->cancel(123456);

// cancel all orders, including conditional orders
$ftx->orders()->cancelAll();
$ftx->orders()->cancelAll('BTC-PERP', $conditionalOrdersOnly = false, $limitOrdersOnly = true)

Conditional Orders

$ftx->conditionalOrders()->open();
$ftx->conditionalOrders()->open('BTC-PERP', 'take_profit');

//history
$ftx->conditionalOrders()->history();
$ftx->conditionalOrders()->history('BTC-PERP', null, null, 'buy', 'stop', 'market', 10);

// Placing orders
// You can either pass the properties of your order directly:
$ftx->conditionalOrders()->create(['market' => 'BTC-PERP', 'type' => 'takeProfit', 'triggerPrice' => 7000.99, 'size' => 1, 'side' => 'buy', 'reduceOnly' => true])->place();

// or use the fluent api to build up an order:
$ftx->conditionalOrders()->create()->stop($size = 1, $triggerPrice = 7000.99)->buy('BTC-PERP')->reduceOnly()->place();

// order status
$ftx->conditionalOrders()->status(123456);

// cancel order
$ftx->conditionalOrders()->cancel(123456);

// cancel all orders conditional orders
$ftx->conditionalOrders()->cancelAll();
$ftx->conditionalOrders()->cancelAll('BTC-PERP', $conditionalOrdersOnly = true, $limitOrdersOnly = true)

Fills

$ftx->fills()->all()

Funding Payments

$ftx->fundingPayments()->all()

Leveraged Tokens

$ftx->leveragedTokens()->all()
$ftx->leveragedTokens()->info('foo')
$ftx->leveragedTokens()->balances()
$ftx->leveragedTokens()->creationRequests()
$ftx->leveragedTokens()->redemptions()
$ftx->leveragedTokens()->requestCreation('foo', 10)
$ftx->leveragedTokens()->requestRedemption('foo', 10)

Options

$ftx->options()->requests()
$ftx->options()->myRequests()
$ftx->options()->cancelRequest('id')
$ftx->options()->quotesForRequest('id')
$ftx->options()->createQuote('id', 100)
$ftx->options()->myQuotes()
$ftx->options()->cancelQuote('id')
$ftx->options()->acceptQuote('id')
$ftx->options()->accountInfo()
$ftx->options()->positions()
$ftx->options()->trades()
$ftx->options()->fills()
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].