# Fiat On/Off-Ramp Integration

<h3 align="center">Fiat Gateway Module</h3>

The Fiat Gateway enables users to convert between fiat currency and supported crypto assets, beginning with ETH, through regulated third-party providers such as Transak and Ramp Network. It is an interface-level module designed to improve access. It does not modify protocol contracts, influence economic logic, or participate in custody.

The gateway operates independently from the core system. Lending markets, stable issuance, liquidations, emissions, treasury routing, and buyback mechanics remain fully on-chain and unaffected by the presence or absence of fiat rails.

***

<h4 align="center">Architectural Structure</h4>

The system is divided into two layers.

The Core Protocol Layer consists of immutable or governed smart contracts that manage collateralization, stable issuance, redemptions, liquidations, and value routing. These contracts contain no references to fiat providers, no off-chain dependencies, and no gateway logic.

The Interface Layer contains the Fiat Gateway. It exists under a dedicated frontend route (e.g., `/fiat`) and embeds third-party SDKs. Provider selection, regional detection, and fee display logic reside entirely within this layer. The gateway can be enabled or disabled through configuration without requiring contract changes.

***

<h4 align="center">Operational Model</h4>

Horizon does not custody fiat or crypto during conversion. It does not perform KYC, AML, or payment processing. All identity verification, compliance, and settlement occur within the provider’s infrastructure.

In the buy flow, the user connects a wallet, selects region and payment method, and launches the embedded provider widget. The wallet address is passed to the provider as the destination. Upon completion, purchased crypto is delivered directly to the user’s wallet.

In the sell flow, the provider manages asset authorization and fiat payout to the user’s bank account. Horizon does not intermediate settlement or control funds at any stage.

***

<h4 align="center">User Flow</h4>

The Fiat Gateway is accessed through a top-level navigation item labeled “Buy / Sell.” This route is separate from lending, earning, and liquidity interfaces.

Region is detected automatically, with manual override available. Bank transfer is presented as the default payment method. Card payments are available as an alternative. Provider selection is determined dynamically based on region, payment rail support, and estimated fee.

The interface displays estimated fees and settlement times before initiating the provider widget.

***

<h4 align="center">Provider Routing</h4>

Initial providers include Transak and Ramp Network. Selection is handled through configurable routing logic that evaluates region, supported payment methods, and provider availability.

In regions where Ramp offers strong bank transfer support, it may be prioritized. In regions with broader Transak coverage, Transak may be selected. Card rails are presented where bank transfer is unavailable or declined.

All routing decisions are controlled at the interface level and adjustable without contract redeployment.

***

<h4 align="center">Configuration and Controls</h4>

The Fiat Gateway is governed by feature flags. A global configuration variable controls whether the module is active. Individual providers can be enabled or disabled independently.

Disabling the module removes the navigation entry and route. Protocol contracts and economic mechanisms remain unchanged.

Provider credentials and API tokens must be managed securely. Where required, server-side token signing is implemented. Webhook endpoints must validate provider signatures before processing events.

***

<h4 align="center">Security and Data Handling</h4>

The gateway does not store KYC data. It may store non-sensitive transaction metadata for analytics purposes. Wallet connection is required before launching provider flows. Destination addresses are validated and confirmed prior to submission.

The interface includes clear disclosure that fiat services are provided by regulated third parties and that Horizon does not custody funds.

***

<h4 align="center">Failure Handling</h4>

If a provider is unavailable, the interface offers fallback to another enabled provider. If no providers are available in a region, the interface displays a message without affecting other application functionality.

Gateway failure does not impact protocol operations.

***

<h4 align="center">Removal Procedure</h4>

The Fiat Gateway can be disabled through configuration. The navigation link and route are removed. No contract updates, migrations, or state changes are required.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trader-li.gitbook.io/horizon-protocol/build-on-horizon/fiat-on-off-ramp-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
