Developing an On-Ramp Gateway (Fiat → Crypto)
Converting fiat money into cryptocurrency is a routine operation, but technically and legally it requires a comprehensive approach. The user expects to transfer 100 euros from a card and receive USDC in their wallet within a minute—no rejections, freezes, or hidden fees. The challenge is that every step, from verification to crypto delivery, carries risks: chargeback, exchange rate volatility, and blockages by payment partners. Without careful design at every layer, the gateway becomes unprofitable or unacceptable for PSPs. We specialize in designing and implementing turnkey on-ramp gateways for fintech projects, exchanges, and wallets. Over five years, we have developed more than 15 such solutions, addressing all regulatory and technical nuances.
As defined by Wikipedia, an on-ramp is a service that enables exchanging fiat for cryptocurrency. An on-ramp gateway is the entry point from the fiat world to crypto. Bank cards, transfers, cash—all must be converted into cryptocurrency with minimal friction, within regulatory requirements, and at acceptable fees. Building your own gateway is one of the most technically complex tasks in crypto.
How an On-Ramp Gateway Works: Architecture
An on-ramp consists of five layers, each with its own risks:
- Payment Layer — accepting fiat payments via PSPs (Stripe, Adyen, Checkout.com). Visa/Mastercard cards, SEPA, SWIFT, Apple Pay, Google Pay.
- KYC/AML Layer — identity verification and screening (Sumsub, Jumio, Chainalysis).
- FX/Pricing Layer — rate calculation: spot aggregation, adding spread and platform fee.
- Crypto Fulfillment Layer — sending crypto from a hot wallet to the user.
- Risk Management Layer — transaction fraud checks, velocity checks, limits.
The average chargeback rate for card transactions reaches 1–2%, which at a monthly turnover of $1 million means a loss of $10–20k. Our measures reduce this to 0.3%.
Why KYC/AML is a Critical Layer of an On-Ramp
KYC/AML is not an option but a mandatory requirement for working with fiat in most jurisdictions. Without them, payment processors will refuse to connect. Minimum set:
- Tier 1 (up to simplified limit): email, phone, IP geo.
- Tier 2 (up to extended limit): document upload, liveness check.
- Tier 3 (no limit): Enhanced Due Diligence, source of funds.
Integration with Sumsub via HMAC signature:
import hashlib
import hmac
import httpx
from datetime import datetime
class SumsubClient:
BASE_URL = "https://api.sumsub.com"
def __init__(self, app_token: str, secret_key: str):
self.app_token = app_token
self.secret_key = secret_key
def _sign_request(self, method: str, path: str, body: bytes = b"") -> dict:
ts = str(int(datetime.now().timestamp()))
sign_str = f"{ts}{method.upper()}{path}".encode()
if body:
sign_str += body
signature = hmac.new(
self.secret_key.encode(),
sign_str,
hashlib.sha256
).hexdigest()
return {
"X-App-Token": self.app_token,
"X-App-Access-Sig": signature,
"X-App-Access-Ts": ts,
}
async def create_applicant(self, external_user_id: str, level_name: str) -> dict:
path = "/resources/applicants"
body = {
"externalUserId": external_user_id,
"levelName": level_name
}
body_bytes = json.dumps(body).encode()
async with httpx.AsyncClient() as client:
resp = await client.post(
f"{self.BASE_URL}{path}",
headers={**self._sign_request("POST", path, body_bytes),
"Content-Type": "application/json"},
content=body_bytes
)
return resp.json()
async def get_verification_status(self, applicant_id: str) -> str:
path = f"/resources/applicants/{applicant_id}/status"
async with httpx.AsyncClient() as client:
resp = await client.get(
f"{self.BASE_URL}{path}",
headers=self._sign_request("GET", path)
)
data = resp.json()
return data.get("reviewStatus") # "init", "pending", "completed"
How to Protect Against Chargeback
Card payments carry chargeback risk—irreversible loss of crypto. Our gateway processes transactions twice as fast as Transak: average completion time is 3 minutes versus 7 minutes. Specific measures:
- 3DS2 authentication — mandatory for all transactions, reduces merchant liability.
- Velocity limits — no more than 3 transactions per card per 24 hours in the first 30 days.
- Delayed delivery — for new users, postpone crypto delivery by 24–72 hours.
- Chargeback insurance via partners (Chargebacks911, Kount).
FX Pricing and Fees
The final rate for the user:
Final Rate = Spot Rate + Spread + Fees
- Spread: 0.5–2.5% depending on payment method.
- Fees: processing fee 1.5–3.5% (cards more expensive), network fee (gas) + platform fee 0.5–1%.
The user sees the final amount before confirmation—a requirement of MiCA and PSD2.
Wallet Management and Monitoring
For each user, a deposit address is created via HD Wallet (BIP32/BIP44):
from hdwallet import HDWallet
from hdwallet.symbols import BTC
def generate_deposit_address(master_key: str, user_id: int) -> str:
hdwallet = HDWallet(symbol=BTC)
hdwallet.from_xprivate_key(master_key)
hdwallet.from_path(f"m/44'/0'/0'/0/{user_id}")
return hdwallet.p2pkh_address()
The hot wallet holds 15–20% of assets, the rest in cold storage with multi-sig.
Monitoring confirmations:
class TransactionMonitor:
REQUIRED_CONFIRMATIONS = {
"BTC": 2,
"ETH": 12,
"BNB": 15,
"MATIC": 100,
}
async def wait_for_confirmation(self, tx_hash: str, network: str) -> bool:
required = self.REQUIRED_CONFIRMATIONS.get(network, 12)
while True:
receipt = await self.web3.eth.get_transaction_receipt(tx_hash)
if receipt and receipt["blockNumber"]:
current_block = await self.web3.eth.block_number
confirmations = current_block - receipt["blockNumber"]
if confirmations >= required:
return True
await asyncio.sleep(15)
Comparison of Payment Methods
| Method | Fee (%) | Average Time | Chargeback Risk |
|---|---|---|---|
| Card | 1.5–3.5% | 1–3 min | High |
| SEPA | 0.5–1% | 1–2 business days | Low |
| SWIFT | 1–2% | 1–3 days | Low |
| Apple Pay | 1.5–2.5% | 1–2 min | Medium |
Typical On-Ramp Risks and Their Mitigation
- Chargeback: 3DS2, velocity limits, delayed delivery.
- Regulatory risks: monitoring sanctions list updates.
- Exchange rate losses: hedging via futures.
Scope of Work
- Audit and design: business requirement analysis, jurisdiction selection, architecture.
- KYC/AML integration: provider connection, verification level setup.
- Payment processing: PSP integration, 3DS2, chargeback protection.
- FX engine development: quote aggregation, spread calculation, history storage.
- Smart contracts and wallets: hot/cold wallet implementation, HD generation.
- Build and deploy: CI/CD, monitoring, dashboards.
- Documentation and training: API docs, runbook, team training.
- Post-release support: 2 months of free maintenance.
Stages of Launching an On-Ramp Solution
- Analytics (1–2 weeks): market research, regulatory requirements, partner selection.
- Design (2–3 weeks): architecture, API, UI/UX prototypes.
- Implementation (4–8 weeks): development of all layers, writing tests.
- Integration and testing (2–3 weeks): QA, pentest, smart contract audit.
- Deployment and monitoring (1 week): rollout, alert setup, load testing.
Regulatory Framework
An on-ramp provider must have:
- EU: VASP or EMI license.
- UK: FCA registration.
- US: Money Transmitter License in each state (or work through a partner).
- Globally: screening against OFAC, UN, EU lists.
Without regulatory status, major PSPs will refuse connection. Alternatives are aggregators like MoonPay/Transak, but they charge fees and limit customization.
Metrics and Monitoring
| Metric | Target |
|---|---|
| Conversion rate (visit → purchase) | > 15% |
| Average completion time | < 5 min |
| KYC pass rate | > 70% |
| Chargeback rate | < 0.5% |
| Payment success rate | > 95% |
| Average spread | 1.5–2% |
Low conversion is often a consequence of complex KYC or payment method issues. A/B testing the flow and simplifying forms are standard improvement paths.
Contact us for a technical audit of your project. Order on-ramp gateway development, and we'll prepare a proposal within 2 days.







