# Onyx App (Mainnet)

**Onyx App** is the primary DeFi interface for Goliath Mainnet. It provides swap, bridge, and liquid staking functionality in a single application.

**Access:** <https://app.onyx.org>

## Modules

| Module             | Description                                                        |
| ------------------ | ------------------------------------------------------------------ |
| **Swap**           | Token swaps via UniswapV2-style AMM on Goliath Mainnet             |
| **Bridge**         | Cross-chain transfers between Ethereum Mainnet and Goliath Mainnet |
| **Liquid Staking** | Stake XCN and receive staked position tokens                       |

***

## Swap (DEX)

Onyx App's swap module uses a UniswapV2 constant-product AMM deployed on Goliath Mainnet (Chain 327).

### Supported Tokens

| Token                  | Contract Address                             | Notes                                                         |
| ---------------------- | -------------------------------------------- | ------------------------------------------------------------- |
| **WXCN** (Wrapped XCN) | `0x1a0Da75ADf091a69E7285e596bB27218D77E17a9` | Fully permissionless. Anyone can deposit/withdraw.            |
| **ETH**                | `0x9253587505c3B7E7b9DEE118AE1AcB53eEC0E4b6` | Bridged ERC-20. Minted by BridgeMint on cross-chain transfer. |
| **USDC**               | `0xC8410270bb53f6c99A2EFe6eD3686a8630Efe22B` | Bridged ERC-20. Minted by BridgeMint on cross-chain transfer. |

{% hint style="info" %}
XCN is the native gas token on Goliath Mainnet. WXCN is the ERC-20 wrapped form used in AMM pools.
{% endhint %}

### Core DEX Contracts

| Contract              | Address                                      | Notes                                                |
| --------------------- | -------------------------------------------- | ---------------------------------------------------- |
| **UniswapV2Factory**  | `0x008c99EedA17E193e5F788536234C6b3520B8D15` | Protocol fees permanently locked (feeToSetter = 0x0) |
| **UniswapV2Router02** | `0xa973c5626eEaF7F482439753953e9B28C6aF3674` | Stateless utility, no admin functions                |
| **Multicall3**        | `0x88b4BC8e5bd74327B5456466F3f30143986cC1f9` | Permissionless read-only aggregator                  |

{% hint style="warning" %}
The UniswapV2Factory `feeToSetter` is permanently locked to the zero address due to a relay deployment issue. Protocol fees can never be enabled on this factory instance.
{% endhint %}

### User Flow

1. Connect wallet to Goliath Mainnet (Chain ID `327`)
2. Open [app.onyx.org](https://app.onyx.org)
3. Choose input/output token pair
4. Set amount and review price impact/slippage
5. Approve token (first swap per token)
6. Confirm swap transaction

***

## Bridge

The Onyx App bridge transfers assets between **Ethereum Mainnet** (Chain 1) and **Goliath Mainnet** (Chain 327).

### Supported Bridge Assets

| Asset    |        Ethereum -> Goliath        |          Goliath -> Ethereum         |
| -------- | :-------------------------------: | :----------------------------------: |
| **ETH**  | Lock on Ethereum, mint on Goliath | Burn on Goliath, release on Ethereum |
| **USDC** | Lock on Ethereum, mint on Goliath | Burn on Goliath, release on Ethereum |
| **XCN**  | Lock on Ethereum, mint on Goliath | Burn on Goliath, release on Ethereum |

### Bridge Contracts

| Contract       | Network          | Address                                      |
| -------------- | ---------------- | -------------------------------------------- |
| **BridgeLock** | Ethereum Mainnet | `0xa9fd64b5095d626f5a3a67e6db7fb766345f8092` |
| **BridgeMint** | Goliath Mainnet  | `0x1d14ae13ca030eb5e9e2857e911af515cf5ffff2` |

### How the Bridge Works

```
Ethereum Mainnet                              Goliath Mainnet
================                              ===============

+------------------+                          +------------------+
| BridgeLock       |    Relayer monitors      | BridgeMint       |
| Locks ETH/USDC/  | ======================> | Mints bridged    |
| XCN on Ethereum  |    and relays proofs     | tokens on Goliath|
+------------------+                          +------------------+

+------------------+                          +------------------+
| BridgeLock       |    Relayer monitors      | BridgeMint       |
| Releases tokens  | <====================== | Burns bridged    |
| on Ethereum      |    and relays proofs     | tokens on Goliath|
+------------------+                          +------------------+
```

### Bridge Transfer Times

| Direction               | Approximate Time | Why                                                                 |
| ----------------------- | ---------------- | ------------------------------------------------------------------- |
| **Ethereum -> Goliath** | \~5 minutes      | Waits for Ethereum block finality (6 confirmations) before relaying |
| **Goliath -> Ethereum** | \~1 hour         | Includes a security hold period before releasing funds on Ethereum  |

### Bridge Fees

Bridging from **Ethereum to Goliath is free** — no fees are charged on deposits.

Bridging from **Goliath to Ethereum** incurs a withdrawal fee to cover Ethereum gas costs. The fee is calculated as:

> **Fee = max(0.25% of transfer amount, minimum fee for the token)**

This means the bridge always charges at least the **minimum fee** (which covers Ethereum gas costs for the relayer), even if 0.25% of your transfer would be less. For larger transfers, the standard 0.25% rate applies.

#### Fee Schedule (Goliath -> Ethereum)

| Token    | Fee Rate | Minimum Fee | Minimum Bridge Amount |
| -------- | -------- | ----------- | --------------------- |
| **ETH**  | 0.25%    | 0.003 ETH   | 0.01 ETH              |
| **USDC** | 0.25%    | 5 USDC      | 10 USDC               |
| **XCN**  | 0.25%    | 1,000 XCN   | 5,000 XCN             |

{% hint style="info" %}
The **minimum fee** is a gas-coverage floor — if 0.25% of your transfer is less than the minimum fee, the minimum fee is charged instead. For example, withdrawing 100 USDC would result in a 5 USDC fee (the minimum), not 0.25 USDC.
{% endhint %}

#### Examples

| Transfer      | 0.25% Would Be | Minimum Fee | Actual Fee Charged              |
| ------------- | -------------- | ----------- | ------------------------------- |
| 0.5 ETH       | 0.00125 ETH    | 0.003 ETH   | **0.003 ETH** (minimum applies) |
| 5 ETH         | 0.0125 ETH     | 0.003 ETH   | **0.0125 ETH** (0.25% applies)  |
| 100 USDC      | 0.25 USDC      | 5 USDC      | **5 USDC** (minimum applies)    |
| 10,000 USDC   | 25 USDC        | 5 USDC      | **25 USDC** (0.25% applies)     |
| 10,000 XCN    | 25 XCN         | 1,000 XCN   | **1,000 XCN** (minimum applies) |
| 1,000,000 XCN | 2,500 XCN      | 1,000 XCN   | **2,500 XCN** (0.25% applies)   |

{% hint style="warning" %}
Transfers below the **minimum bridge amount** are rejected. You must bridge at least 0.01 ETH, 10 USDC, or 5,000 XCN when withdrawing to Ethereum.
{% endhint %}

### User Flow

**Ethereum -> Goliath** (\~5 minutes, no fee)**:**

1. Connect wallet to Ethereum Mainnet
2. Approve and lock tokens in BridgeLock
3. Wait for relayer confirmation (\~5 minutes)
4. Switch to Goliath Mainnet to verify receipt

**Goliath -> Ethereum** (\~1 hour, 0.25% fee)**:**

1. Connect wallet to Goliath Mainnet
2. Approve and burn bridged tokens via BridgeMint
3. Wait for relayer confirmation (\~1 hour)
4. Switch to Ethereum Mainnet to verify receipt

***

## Liquid Staking

Liquid staking on Goliath Mainnet lets users stake XCN and earn rewards while maintaining liquidity through a staked position token.

### Staking Contract

| Contract            | Address                                      | Notes                  |
| ------------------- | -------------------------------------------- | ---------------------- |
| **StakedXCNDirect** | `0xA553a603e2f84fEa6c1fc225E0945FE176C72F74` | UUPS upgradeable proxy |

**Current balance:** 107,790 XCN staked

### Key Features

* Stake XCN and earn rewards automatically
* UUPS upgradeable contract with owner controls
* Owner can adjust reward rates, treasury, and fee parameters
* Pause/unpause functionality for emergency situations

### User Flow

1. Connect wallet to Goliath Mainnet (Chain ID `327`)
2. Open [app.onyx.org](https://app.onyx.org) liquid staking module
3. Enter XCN amount and submit stake
4. Rewards accrue automatically
5. Unstake when ready to receive XCN back

***

## Network Configuration

To use Onyx App, connect your wallet to Goliath Mainnet:

| Field                  | Value                                                          |
| ---------------------- | -------------------------------------------------------------- |
| **Network Name**       | Goliath Mainnet                                                |
| **RPC URL**            | [`https://rpc.goliath.net`](https://rpc.goliath.net)           |
| **Chain ID**           | `327`                                                          |
| **Currency Symbol**    | `XCN`                                                          |
| **Block Explorer URL** | [`https://explorer.goliath.net`](https://explorer.goliath.net) |

***

## Related Documentation

* [**Slingshot (Testnet DeFi)**](https://docs.goliath.net/defi/slingshot) - DeFi interface for Goliath Testnet
* [**Smart Contract Addresses**](https://docs.goliath.net/reference/contracts) - Full contract registry for both networks
* [**Rewards Overview**](https://docs.goliath.net/rewards/overview) - Staking and validator reward details
