Lending and Borrowing
GX Core includes a native lending and borrowing protocol that enables users to lend assets to earn interest or borrow assets using their portfolio as collateral. The system uses algorithmic interest rates that adjust automatically based on supply and demand.
Overview
The lending system is integrated directly into the GX Core execution layer, providing the same performance and determinism as the trading engine. Unlike standalone DeFi lending protocols, GX lending is aware of the user’s trading positions, enabling more capital-efficient collateral calculations.
How It Works
Lending (Supplying)
- Deposit supported assets into the lending pool
- Earn interest continuously, accruing per block
- Interest rate is determined algorithmically based on pool utilization
- Withdraw your supplied assets plus accrued interest at any time
Borrowing
- Post collateral (USDC, GX, or other supported assets)
- Borrow up to the collateral factor limit
- Interest accrues per block on your outstanding borrow
- Repay the borrow plus accrued interest to unlock your collateral
Interest Rate Model
GX uses an algorithmic interest rate model where rates adjust based on the utilization ratio of each lending pool:
utilization = total_borrowed / total_supplied| Utilization Range | Borrow Rate Behavior |
|---|---|
| 0% - 80% (normal) | Gradual linear increase |
| 80% - 100% (high) | Steep exponential increase (kink model) |
The “kink” at 80% utilization incentivizes borrowers to repay when pools are highly utilized, ensuring lenders can always withdraw.
Rate Parameters
| Parameter | Description |
|---|---|
| Base rate | Minimum borrow rate at 0% utilization |
| Slope 1 | Rate increase per unit utilization below the kink |
| Kink | Utilization threshold where the rate curve steepens (default: 80%) |
| Slope 2 | Rate increase per unit utilization above the kink |
| Supply rate | borrow_rate * utilization * (1 - reserve_factor) |
| Reserve factor | Percentage of interest reserved for the protocol (default: 10%) |
Collateral
Collateral Factors
Each asset has a collateral factor that determines how much can be borrowed against it:
| Asset | Collateral Factor | Description |
|---|---|---|
| USDC | 90% | Stablecoin — highest collateral efficiency |
| GX | 60% | Native token — moderate volatility |
| Other tokens | 40-70% | Based on liquidity and volatility assessment |
Example: If you supply 10,000 USDC (90% collateral factor), you can borrow up to 9,000 USDC worth of other assets.
Liquidation
If the value of your collateral falls below the required maintenance ratio, your position is subject to liquidation:
| Parameter | Value |
|---|---|
| Liquidation threshold | 5% above the collateral factor |
| Liquidation penalty | 5% of the liquidated amount |
| Liquidation incentive | Liquidators receive the penalty as a reward |
Interest Accrual
Interest accrues per block (sub-second), not per day or per hour. This provides the most granular and fair interest calculation possible:
interest_per_block = principal * (annual_rate / blocks_per_year)
accrued_interest = sum of interest_per_block over all blocksInterest is applied to both lender earnings and borrower obligations at every block.
Integration with Trading
GX lending is integrated with the trading clearinghouse:
- Cross-margin awareness — Your lending deposits and trading collateral can be considered together for margin calculations
- Instant collateral — Supplied assets can serve as both lending collateral and trading margin
- Unified liquidation — The risk engine considers both lending and trading positions when evaluating account health
This integration is unique to GX and is only possible because both systems run natively in the same execution layer.
Supported Operations
| Operation | Description |
|---|---|
supply(asset, amount) | Deposit assets into the lending pool |
withdraw(asset, amount) | Withdraw supplied assets plus interest |
borrow(asset, amount) | Borrow assets against your collateral |
repay(asset, amount) | Repay outstanding borrow |
liquidate(account, asset) | Liquidate an undercollateralized position (public) |
All operations are signed with EIP-712 and processed through BFT consensus like any other GX Core transaction.
Risk Parameters
| Parameter | Description | Governance-Adjustable |
|---|---|---|
| Collateral factors | Per-asset borrow limits | Yes |
| Liquidation threshold | Point at which liquidation triggers | Yes |
| Reserve factor | Protocol share of interest | Yes |
| Kink utilization | Threshold for rate curve steepening | Yes |
| Supply caps | Maximum supply per asset | Yes |
| Borrow caps | Maximum borrow per asset | Yes |