PHPackages                             feedex/coinex - 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. feedex/coinex

ActiveLibrary[API Development](/categories/api)

feedex/coinex
=============

Coinex PHP API wrapper - based on the Coinex official documents.

v1.0.0(4mo ago)08↓90.9%MITPHPPHP ^8.4CI passing

Since Mar 19Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/feedex/coinex)[ Packagist](https://packagist.org/packages/feedex/coinex)[ RSS](/packages/feedex-coinex/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (12)Versions (15)Used By (0)

feedex/coinex
=============

[](#feedexcoinex)

CoinEx adapter package for the Feedex ecosystem.

This package implements CoinEx API v2 modules and plugs into `feedex/feedex` via factory registration.

Installation
------------

[](#installation)

```
composer require feedex/feedex feedex/coinex
```

Compatibility
-------------

[](#compatibility)

- `feedex/coinex ^1.0` requires `feedex/feedex ^1.0`

Usage (recommended via Feedex core)
-----------------------------------

[](#usage-recommended-via-feedex-core)

```
use Feedex\Feedex;
use Feedex\Coinex\v2\CoinexFactory;

$feedex = (new Feedex())
    ->register(new CoinexFactory());

$coinex = $feedex->exchange('coinex', [
    'access_id' => getenv('COINEX_ACCESS_ID'),
    'secret_key' => getenv('COINEX_SECRET_KEY'),
    // optional:
    // 'base_url' => 'https://api.coinex.com',
    // 'timeout' => 60,
]);

$markets = $coinex->spotMarket()->listMarkets();
$balance = $coinex->asset()->getSpotBalance();
```

Direct usage (without registry)
-------------------------------

[](#direct-usage-without-registry)

```
use Feedex\Coinex\v2\Coinex;

$coinex = new Coinex(
    accessId: getenv('COINEX_ACCESS_ID'),
    secretKey: getenv('COINEX_SECRET_KEY')
);

$tickers = $coinex->spotMarket()->listMarketTicker();
```

Examples
--------

[](#examples)

See runnable scripts in [`examples/`](examples):

- [`examples/balances.php`](examples/balances.php)
- [`examples/spot_order.php`](examples/spot_order.php)
- [`examples/futures_order.php`](examples/futures_order.php)

Endpoint coverage table
-----------------------

[](#endpoint-coverage-table)

DomainVisibilityEndpointsStatusCommonPublic3✅ ImplementedAccountPrivate2✅ ImplementedAssetPrivate4✅ ImplementedAccount SubPrivate14✅ ImplementedAsset TransferPrivate2✅ ImplementedAsset Deposit/WithdrawalPrivate9✅ ImplementedAsset LoanPrivate4✅ ImplementedSpot MarketPublic6✅ ImplementedSpot OrderPrivate20✅ ImplementedSpot DealPrivate2✅ ImplementedFutures MarketPublic12✅ ImplementedFutures OrderPrivate20✅ ImplementedFutures DealPrivate2✅ ImplementedFutures PositionPrivate15✅ Implemented**Total****115**✅> Coverage reflects the adapter’s currently exposed CoinEx v2 modules/methods.

Implemented modules (detailed)
------------------------------

[](#implemented-modules-detailed)

### Common (public)

[](#common-public)

- `ping()`
- `time()`
- `maintainInfo()`

### Account (private)

[](#account-private)

- `getAccountInfo()`
- `getTradeFeeRate()`

### Asset (private)

[](#asset-private)

- `getSpotBalance()`
- `getFuturesBalance()`
- `getMarginBalance()`
- `getFinancialBalance()`

### Account Sub (private)

[](#account-sub-private)

- `createSub()`
- `listSub()`
- `getSubInfo()`
- `frozenSub()`
- `cancelFrozenSub()`
- `createSubApi()`
- `listSubApi()`
- `getSubApi()`
- `editSubApi()`
- `deleteSubApi()`
- `getSubBalance()`
- `getSubSpotBalance()`
- `subTransfer()`
- `listSubTransferHistory()`

### Asset Transfer (private)

[](#asset-transfer-private)

- `transfer()`
- `listTransferHistory()`

### Asset Deposit/Withdrawal (private)

[](#asset-depositwithdrawal-private)

- `listAssetsInfo()`
- `getDepositAddress()`
- `updateDepositAddress()`
- `getDepositWithdrawalConfig()`
- `listAllDepositWithdrawalConfig()`
- `listDepositHistory()`
- `listWithdrawalHistory()`
- `withdrawal()`
- `cancelWithdrawal()`

### Asset Loan (private)

[](#asset-loan-private)

- `marginBorrow()`
- `marginRepay()`
- `listMarginBorrowHistory()`
- `listMarginInterestLimit()`

### Spot Market (public)

[](#spot-market-public)

- `listMarkets()`
- `listMarketTicker()`
- `listMarketDepth()`
- `listMarketDeals()`
- `listMarketKline()`
- `listMarketIndex()`

### Spot Order (private)

[](#spot-order-private)

- `putOrder()`
- `putBatchOrder()`
- `putStopOrder()`
- `putBatchStopOrder()`
- `editOrder()`
- `editBatchOrder()`
- `editStopOrder()`
- `cancelOrder()`
- `cancelOrderByClientId()`
- `cancelBatchOrder()`
- `cancelAllOrder()`
- `cancelStopOrder()`
- `cancelStopOrderByClientId()`
- `cancelBatchStopOrder()`
- `getOrderStatus()`
- `getBatchOrderStatus()`
- `listPendingOrder()`
- `listFinishedOrder()`
- `listPendingStopOrder()`
- `listFinishedStopOrder()`

### Spot Deal (private)

[](#spot-deal-private)

- `listUserDeals()`
- `listUserOrderDeals()`

### Futures Market (public)

[](#futures-market-public)

- `listMarkets()`
- `listMarketTicker()`
- `listMarketDepth()`
- `listMarketDeals()`
- `listMarketKline()`
- `listMarketIndex()`
- `listMarketFundingRate()`
- `listMarketFundingRateHistory()`
- `listMarketBasisHistory()`
- `listMarketLiquidationHistory()`
- `listMarketPositionLevel()`
- `listMarketPremiumHistory()`

### Futures Order (private)

[](#futures-order-private)

- `putOrder()`
- `putBatchOrder()`
- `putStopOrder()`
- `putBatchStopOrder()`
- `editOrder()`
- `editBatchOrder()`
- `editStopOrder()`
- `cancelOrder()`
- `cancelOrderByClientId()`
- `cancelBatchOrder()`
- `cancelAllOrder()`
- `cancelStopOrder()`
- `cancelStopOrderByClientId()`
- `cancelBatchStopOrder()`
- `getOrderStatus()`
- `getBatchOrderStatus()`
- `listPendingOrder()`
- `listFinishedOrder()`
- `listPendingStopOrder()`
- `listFinishedStopOrder()`

### Futures Deal (private)

[](#futures-deal-private)

- `listUserDeals()`
- `listUserOrderDeals()`

### Futures Position (private)

[](#futures-position-private)

- `closePosition()`
- `adjustPositionMargin()`
- `adjustPositionLeverage()`
- `setPositionStopLoss()`
- `setPositionTakeProfit()`
- `modifyPositionStopLoss()`
- `modifyPositionTakeProfit()`
- `cancelPositionStopLoss()`
- `cancelPositionTakeProfit()`
- `listPendingPosition()`
- `listFinishedPosition()`
- `listPositionMarginHistory()`
- `listPositionFundingHistory()`
- `listPositionAdlHistory()`
- `listPositionSettleHistory()`

Authentication notes
--------------------

[](#authentication-notes)

CoinEx v2 signature format used by this adapter:

`METHOD + request_path(+query_string) + body + timestamp`

Request headers:

- `X-COINEX-KEY`
- `X-COINEX-SIGN`
- `X-COINEX-TIMESTAMP`

Quality architecture additions
------------------------------

[](#quality-architecture-additions)

### Lightweight payload builders/validators

[](#lightweight-payload-buildersvalidators)

Available for complex order calls:

- `Feedex\Coinex\v2\Payload\SpotOrderPayload`
- `Feedex\Coinex\v2\Payload\FuturesOrderPayload`

These provide reusable payload construction and basic required-key validation without heavy abstraction.

### Typed error model

[](#typed-error-model)

The HTTP layer maps failures into typed exceptions:

- `CoinexAuthenticationException`
- `CoinexRateLimitException`
- `CoinexValidationException`
- `CoinexTransientException`
- fallback: `CoinexRequestException`

### Optional retry/backoff (disabled by default)

[](#optional-retrybackoff-disabled-by-default)

You can configure retries through factory config:

- `max_retries` (default `0`)
- `retry_delay_ms` (default `100`)
- `retry_backoff_multiplier` (default `2.0`)

Example:

```
$coinex = $feedex->exchange('coinex', [
    'access_id' => 'xxx',
    'secret_key' => 'yyy',
    'max_retries' => 2,
    'retry_delay_ms' => 150,
    'retry_backoff_multiplier' => 2.0,
]);
```

Core architecture integration
-----------------------------

[](#core-architecture-integration)

This adapter provides:

- `Feedex\Coinex\v2\Coinex` implementing Feedex exchange/capability contracts
- `Feedex\Coinex\v2\CoinexFactory` implementing `ExchangeFactoryInterface`

v1.0.0 scope freeze (coinex)
----------------------------

[](#v100-scope-freeze-coinex)

For the first stable adapter release, the v1 scope is frozen to:

- current implemented CoinEx v2 module surface documented in this README
- current typed error model and optional retry/backoff behavior
- current payload builder helpers for spot/futures order flows

Out of scope for coinex v1.0.0:

- websocket/streaming APIs
- breaking renames of public module methods
- exchange-wide DTO normalization layer

Changelog
---------

[](#changelog)

See [`CHANGELOG.md`](CHANGELOG.md) for clear per-release evolution of this plugin.

License
-------

[](#license)

MIT

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance75

Regular maintenance activity

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

14

Last Release

133d ago

Major Versions

v0.2.10 → v1.0.02026-03-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/b05c2ddda48012b729ab705af8cc239a2d90b44205bc8708099145eca188688e?d=identicon)[mehrna](/maintainers/mehrna)

---

Top Contributors

[![mehrna](https://avatars.githubusercontent.com/u/6211768?v=4)](https://github.com/mehrna "mehrna (34 commits)")

---

Tags

coinexCoinex PHP API

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/feedex-coinex/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k51](/packages/neuron-core-neuron-ai)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.7M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2482.9k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

2084.7k6](/packages/aimeos-prisma)

PHPackages © 2026

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