Book a free call

Why Build a Margin Trading Crypto Exchange?

A margin trading exchange earns fees on margin trading volume, but it carries liquidation, custody and compliance risk. The business case, the costs and the risks.

Hertiv engineering teamReviewed by a senior engineer
6 min read
Why Build a Margin Trading Crypto Exchange?
On this page

Short answer

You build a margin trading crypto exchange to earn trading, funding and liquidation fees from margin trading volume that spot trading alone cannot produce. The case only holds if you can fund deep liquidity, run a fast liquidation engine, manage custody risk and meet licensing rules in every market you serve.

Why build a margin trading crypto exchange?

You build a margin trading crypto exchange to earn fees from margin trading volume that spot trading alone cannot produce. A margin trader who borrows to open a larger position pays trading fees on the full position size, funding on the borrowed amount, and sometimes a liquidation fee, so the same user generates several times the revenue of a spot trader.

Margin trading also keeps users on your platform longer. Traders who manage margin positions check prices, adjust collateral and hedge, which creates daily activity that a spot-only exchange does not see. That activity is the business case, and it is also the source of the risk.

Revenue stream How it is earned What drives it
Taker and maker fees Fee on each trade Trading volume
Funding payments Share of funding between positions Open interest
Liquidation fees Fee when a position is closed Volatility and borrowing
Interest on borrowed funds Interest on margin loans Margin loan balances
Withdrawals and listings Fees on transfers and new pairs User and token growth

The revenue case is real, but it depends on volume. Without deep liquidity and active traders, the fee streams are small and the fixed costs dominate. That is why the decision starts with a volume model, not a feature list. For the build side, crypto exchange development covers the platform pieces.

Where the revenue comes from

Margin exchange revenue comes from several streams that all depend on margin trading volume. Trading fees are the largest, because they are charged on the full position size rather than the margin posted, so a trader with a 10-to-1 margin ratio pays fees on ten times the collateral.

Funding payments are the second stream. In perpetual margin markets, longs and shorts pay each other to keep the contract price near spot, and the exchange usually keeps a share of that flow. Liquidation fees are a third stream, earned when the risk engine closes a position whose margin has run out.

Interest on borrowed funds is the fourth. In a cross-margin model, traders borrow the asset they are shorting, and the exchange charges interest on the loan. Withdrawal and listing fees are smaller but steadier, and they grow with the user base rather than with market volatility.

None of these streams is guaranteed. In a quiet market, volume falls, funding shrinks and liquidations dry up, so revenue can drop sharply in the same month your costs stay fixed.

What it takes to build one

Building a margin trading exchange takes a matching engine, a risk engine, custody, liquidity and compliance, all working together at speed. The matching engine pairs orders, the risk engine watches every position against its margin, and the liquidation engine closes positions before losses exceed collateral.

  • Matching engine. Fast order matching with low latency, because margin traders react to price moves in seconds.
  • Risk and liquidation engine. Real-time margin checks, maintenance margin rules and an insurance fund for positions that close below zero.
  • Custody. Hot and cold wallets, withdrawal controls and key management, since the exchange holds user funds.
  • Liquidity. Market makers or a liquidity pool deep enough that large orders do not move the price against your own users.
  • Compliance. KYC, AML checks, licensing and reporting for every market you serve, which varies widely by jurisdiction.

The risk engine is the hardest part to get right. A matching engine that is slow costs you trades; a liquidation engine that is slow costs you the insurance fund. DeFi development covers the on-chain version of the same risk design.

Costs and risks

Margin exchange costs and risks are higher than for a spot exchange, because borrowed funds turn small errors into large losses. The table below is the honest version of the business case: every revenue stream has a matching cost or risk.

Cost or risk What it means How teams handle it
Development and audit Matching, risk and custody systems Phased build, independent audits
Liquidity costs Paying market makers for depth Maker incentives, shared pools
Insurance fund losses Positions closing below zero Conservative borrowing limits
Security and custody Hot wallet and key risk Cold storage, withdrawal limits
Compliance and licensing Rules differ by market Licensed jurisdictions first
Reputation risk Liquidations anger users Clear rules, fair liquidation design

The largest single risk is a market event that liquidates many positions at once and drains the insurance fund. When that happens, the exchange must cover the gap from its own capital or socialise the loss across users, and either choice damages trust.

Example: a first-year margin exchange

Example (hypothetical): a new margin exchange has 500 active traders, each trading an average of 2,000 dollars of volume a month. Total monthly volume is 500 times 2,000 dollars, which is 1,000,000 dollars.

With a taker fee of 0.2 percent, monthly fee revenue is 0.2 percent of 1,000,000 dollars, which is 2,000 dollars. Over a year that is 24,000 dollars from trading fees, before funding and liquidation income.

If running costs are 180,000 dollars a year for engineering, infrastructure, compliance and market making, the exchange is 156,000 dollars short on trading fees alone. To break even on fees, monthly volume must reach 180,000 dollars divided by 12, divided by 0.002, which is 7,500,000 dollars a month, or 15,000 dollars per trader.

That arithmetic is the decision. Either the exchange can realistically reach that volume, or it needs funding and liquidation income to close the gap, or the project should not start. A margin exchange that launches without this model usually discovers the gap a year later, after the money is spent.

What are the common mistakes?

The most common margin exchange mistakes are launching with thin liquidity, setting borrowing limits too high, and treating compliance as an afterthought.

  • Thin liquidity at launch. Wide spreads and slippage drive traders away in the first week, and they rarely come back.
  • Borrowing limits set too high. Very high borrowing creates frequent liquidations, angry users and insurance fund losses.
  • Slow liquidation engine. If liquidations lag the market, positions close below zero and the fund pays the difference.
  • Compliance as an afterthought. Licensing, KYC and reporting take months. Starting them after launch means pausing the product or operating without a licence.
  • No insurance fund. Without a fund, a single bad market event can leave the exchange owing users money it does not have.

How to decide whether to build

You decide whether to build a margin trading exchange by testing the volume model, the liquidity plan and the licensing path before writing production code. Each of the three can kill the project on its own, so test all three early.

  1. Model the volume. Estimate traders, volume per trader and fee income, then find the break-even volume and judge honestly whether it is reachable.
  2. Secure liquidity. Talk to market makers before building, and confirm the depth and pricing you can actually get at launch.
  3. Map the licensing path. List every market you want to serve, the licence each one needs, and the time and cost to obtain it.
  4. Design the risk engine first. Set borrowing limits, maintenance margin and the insurance fund size before designing the trading interface.
  5. Run a closed pilot. Launch with a small group of traders and capped borrowing, and only open up once liquidations and funding behave as designed.

If the pilot shows the volume model holds and the risk engine works, the exchange has a case. If not, you have learned that before spending the full build budget. For the platform decision, DEX development covers the decentralised alternative to a centralised margin exchange.

Key takeaways

  • Margin fees come from margin trading volume, so the case depends on reaching real volume
  • Trading, funding, liquidation and interest fees all rise and fall with the market
  • The risk and liquidation engine is the hardest part to build correctly
  • Thin liquidity, high borrowing and late compliance are the usual failure modes
  • Model break-even volume before building, not after launching

Frequently asked questions

How is a margin exchange different from a spot exchange?

A spot exchange trades assets directly, while a margin exchange lets traders borrow to open larger positions. Margin trading earns fees on the full position size and adds funding, liquidation and interest income, but it also needs a risk engine, an insurance fund and deeper liquidity.

Do I need a licence to run a margin exchange?

In most jurisdictions, yes, and the requirements vary widely. Margin and derivatives trading are regulated more strictly than spot trading in many markets, so map the licensing path for each market you want to serve before building.

How much does it cost to build a margin exchange?

Costs vary with scope, but the main items are the matching and risk engines, custody, security audits, liquidity incentives and compliance. The running cost is often larger than the build cost in year one, so model both before committing.

What borrowing limits should a new margin exchange offer?

Most new exchanges start with conservative limits, such as 5x or 10x, and raise them only after the liquidation engine proves itself. Very high borrowing creates frequent liquidations and insurance fund losses that a new exchange cannot absorb.

Can a margin exchange be decentralised?

Yes. Decentralised perpetual exchanges offer margin trading through smart contracts with self-custody. They avoid holding user funds, but they face their own challenges with liquidity, execution speed and gas costs.

What happens if the insurance fund runs out?

The exchange must cover the shortfall from its own capital, or socialise the loss across users through a clawback or reduced payouts. Either option damages trust, which is why conservative borrowing limits and a well-funded insurance pool matter.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning a margin trading exchange? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Crypto Exchange service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call