PHPackages                             feedex/feedex - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. feedex/feedex

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

feedex/feedex
=============

Feedex core contracts and exchange registry.

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

Since Mar 19Pushed 4mo agoCompare

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

READMEChangelog (1)Dependencies (4)Versions (12)Used By (2)

feedex/feedex
=============

[](#feedexfeedex)

Feedex core package.

`feedex/feedex` is an exchange-agnostic foundation for building a unified crypto exchange SDK ecosystem. It does **not** implement any exchange API directly. Instead, it provides contracts and a registry so adapter packages (like `feedex/coinex`) can plug in cleanly.

Why this package exists
-----------------------

[](#why-this-package-exists)

- Keep core independent from exchange-specific details
- Let users install only the adapters they need
- Enforce a consistent, typed contract across adapters
- Make adding new exchanges predictable and maintainable

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

[](#installation)

```
composer require feedex/feedex
```

You will usually install at least one adapter as well:

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

Core concepts
-------------

[](#core-concepts)

### 1) `ExchangeInterface`

[](#1-exchangeinterface)

Represents a concrete exchange client instance (e.g. CoinEx, KuCoin).

### 2) `ExchangeFactoryInterface`

[](#2-exchangefactoryinterface)

Responsible for creating exchange instances from config.

### 3) Module contracts

[](#3-module-contracts)

Standard capabilities for exchange modules, e.g.:

- `CommonModuleInterface`
- `AccountModuleInterface`
- `AccountSubModuleInterface`
- `AssetModuleInterface`
- `AssetTransferModuleInterface`
- `AssetDepositWithdrawalModuleInterface`
- `AssetLoanModuleInterface`
- `SpotMarketModuleInterface`
- `SpotOrderModuleInterface`
- `SpotDealModuleInterface`
- `FuturesMarketModuleInterface`
- `FuturesOrderModuleInterface`
- `FuturesDealModuleInterface`
- `FuturesPositionModuleInterface`

For adapter flexibility, core also provides granular sub-contracts (additive, non-breaking), for example:

- `AssetSpotBalanceModuleInterface`
- `AssetExtendedBalancesModuleInterface`
- `SpotMarketCoreModuleInterface`
- `SpotMarketIndexModuleInterface`
- `SpotOrderCoreModuleInterface`
- `SpotOrderAdvancedModuleInterface`
- `FuturesMarketCoreModuleInterface`
- `FuturesMarketAnalyticsModuleInterface`
- `FuturesOrderCoreModuleInterface`
- `FuturesOrderAdvancedModuleInterface`

### 4) Capability contracts

[](#4-capability-contracts)

Exchange clients declare supported modules via capability interfaces, e.g.:

- `HasCommonModuleInterface`
- `HasAccountModuleInterface`
- `HasAccountSubModuleInterface`
- `HasAssetModuleInterface`
- `HasAssetTransferModuleInterface`
- `HasAssetDepositWithdrawalModuleInterface`
- `HasAssetLoanModuleInterface`
- `HasSpotMarketModuleInterface`
- `HasSpotOrderModuleInterface`
- `HasSpotDealModuleInterface`
- `HasFuturesMarketModuleInterface`
- `HasFuturesOrderModuleInterface`
- `HasFuturesDealModuleInterface`
- `HasFuturesPositionModuleInterface`

Granular capability contracts are also available for partial implementations, for example:

- `HasAssetSpotBalanceModuleInterface`
- `HasAssetExtendedBalancesModuleInterface`
- `HasSpotMarketCoreModuleInterface`
- `HasSpotMarketIndexModuleInterface`
- `HasSpotOrderCoreModuleInterface`
- `HasSpotOrderAdvancedModuleInterface`
- `HasFuturesMarketCoreModuleInterface`
- `HasFuturesMarketAnalyticsModuleInterface`
- `HasFuturesOrderCoreModuleInterface`
- `HasFuturesOrderAdvancedModuleInterface`

### 5) `Feedex` registry/manager

[](#5-feedex-registrymanager)

Central place to register adapter factories and resolve exchanges by id.

Quick usage
-----------

[](#quick-usage)

```
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'),
]);

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

Capability-driven consumption (multi-adapter safe)
--------------------------------------------------

[](#capability-driven-consumption-multi-adapter-safe)

When using multiple adapters, check capabilities before calling module methods:

```
use Feedex\Contracts\Capabilities\HasSpotOrderAdvancedModuleInterface;
use Feedex\Contracts\Capabilities\HasSpotOrderCoreModuleInterface;
use Feedex\Contracts\Capabilities\HasSpotOrderModuleInterface;

$exchange = $coinex; // or any resolved exchange instance

if ($exchange instanceof HasSpotOrderModuleInterface
    || $exchange instanceof HasSpotOrderCoreModuleInterface) {
    $exchange->spotOrder()->putOrder($payload);
}

if ($exchange instanceof HasSpotOrderModuleInterface
    || $exchange instanceof HasSpotOrderAdvancedModuleInterface) {
    // available only on adapters that support advanced order flows
    $exchange->spotOrder()->putBatchOrder($batchPayload);
}
```

This allows clients to consume a common core while adapting behavior to each exchange’s supported depth.

Error handling
--------------

[](#error-handling)

If you request an exchange that is not registered, `Feedex` throws:

- `Feedex\Exceptions\UnknownExchangeException`

Creating a new adapter
----------------------

[](#creating-a-new-adapter)

An adapter package should:

1. Depend on `feedex/feedex`
2. Implement `ExchangeInterface` in its exchange client
3. Implement module/capability contracts as supported
4. Provide an `ExchangeFactoryInterface` implementation
5. Be registered in `Feedex` via `->register(...)`

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

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

For the first stable release, core scope is frozen to:

- registry and factory contracts (`Feedex`, `ExchangeInterface`, `ExchangeFactoryInterface`)
- current broad module/capability contracts
- current granular module/capability contracts for partial adapter implementations
- stable error behavior for unknown exchange resolution

Out of scope for core v1.0.0:

- transport/auth/signing logic
- exchange-specific DTO mapping
- exchange endpoint implementations

Changelog
---------

[](#changelog)

See [`CHANGELOG.md`](CHANGELOG.md) for release history.

Package scope
-------------

[](#package-scope)

This repository is intentionally minimal and stable.

Exchange-specific HTTP clients, auth signing rules, endpoint methods, and DTO mapping belong in adapter repositories (e.g. `feedex/coinex`).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance76

Regular maintenance activity

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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

9

Last Release

132d ago

Major Versions

v0.1.7 → 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 (21 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[ircmaxell/random-lib

A Library For Generating Secure Random Numbers

84032.7M135](/packages/ircmaxell-random-lib)[fact-finder/fact-finder-php-library

FACT Finder PHP Library

17343.8k1](/packages/fact-finder-fact-finder-php-library)

PHPackages © 2026

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