Xyra is a universal cross-chain lending protocol built on ZetaChain. It unifies liquidity across multiple blockchains, enabling seamless supply, borrow, repay, and withdraw actions from any chain to any chain.
Traditional lending protocols are siloed per chain - liquidity on Ethereum, Solana, or Base cannot easily interact. Xyra.Fi leverages ZetaChainβs universal smart contracts to unify liquidity, letting users supply and borrow across chains without bridging or manual swaps.

Xyra/
βββ contracts/ # Solidity smart contracts
β βββ src/ # Protocol source code
β β βββ pool/ # LendingPool, PoolManager
β β βββ vaults/ # ERC4626 reserves
β β βββ interestRate/ # Interest rate logic
β β βββ liquidation/ # Liquidation mechanisms
β β βββ oracle/ # Price oracles
β β βββ swap/ # Cross-chain swap integration via Uni V2
β β βββ accessControl/ # Role & access control
β β βββ collateral/ # Collateral management
β β βββ protocol/ # Base + Universal contracts
β βββ script/ # Deployment & setup scripts
β βββ test/ # Foundry unit tests
β
βββ e2e/ # End-to-end cross-chain tests
β βββ src/ # Scripts for testing cross-chain calls
β
βββ frontend/ # Next.js frontend app
β βββ app/ # Pages (home, supply, borrow, portfolio)
β βββ lib/ # Chain configs, ABIs, utilities, Zeta Gateway Interaction
β βββ components/ # Reusable UI components
β
βββ README.md # Project documentation
-
Supply to Vaults
- Supply liquidity from Ethereum Sepolia, Base Sepolia, Zeta Athens, or Solana Devnet.
- Supply can be done on behalf of another address.
- If the supplied asset differs from the vaultβs reserve asset, it is automatically swapped.
-
Borrow Across Chains
- Borrow from vaults to any chain and any address.
- Assets are swapped internally if the borrowed asset differs from the vaultβs underlying.
-
Withdraw Anywhere
- Withdraw supplied liquidity to a specific chain and address.
- Withdrawals also support cross-asset swaps.
-
Repay Flexibly
- Repay borrowed positions from any chain, any asset, and even on behalf of another address.
sequenceDiagram
autonumber
participant U as User Wallet (External Chain)
participant ASSET as Source Asset (ERC20/SPL)
participant GW as External Gateway (EVM/Solana)
participant LP as LendingPool (ZetaChain β’ Universal)
participant DEX as DEX/Aggregator (Zeta)
participant VAULT as Target Vault (ERC4626Reserve on Zeta)
participant ID as UniversalIdentityLib
participant IR as InterestRateManager
participant OR as PriceOracle
participant CM as CollateralManager
Note over U,GW: Params: fromChain, fromAsset, amount,<br/>toVault (ETH/SOL/USDC...), onBehalfOf(Chain, Address)
Note over VAULT: Vault asset = vault ZRC20 (e.g., ETH/SOL/USDC as ZRC20)
rect rgb(245,245,245)
Note over ASSET: (EVM) ERC20 approve may be required
U->>ASSET: (1) approve() β΅ if ERC20
end
U->>GW: (2) depositAndCall(supply,fromAsset, toVault, amount, onBehalfOf(Chain, Address))
GW-->>LP: (3) CCTX to ZetaChain + credit incoming ZRC20 equivalent
LP->>ID: (4) map(onBehalfOf) β universal identity
LP-->>LP: (5) validate params & basic health checks
alt fromAsset (ZRC20) β vaultAsset (ZRC20)
LP->>DEX: (6) swap fromAsset.ZRC20 β vaultAsset.ZRC20
DEX-->>LP: (7) receive vaultAsset.ZRC20
else already correct asset
LP-->>LP: (6) skip swap
end
LP->>VAULT: (8) deposit(vaultAsset.ZRC20, amount)
VAULT-->>LP: (9) mint xERC20 to onBehalfOf
par Post-accounting
LP->>IR: (10) update utilization/interest
LP->>OR: (11) record spot/price snapshot
LP->>CM: (12) refresh collateral/LTV state
end
LP-->>U: (13) success: xERC20 credited to onBehalfOf (cross-chain supply finalized)
sequenceDiagram
autonumber
participant U as User Wallet (External Chain)
participant GW as External Gateway (EVM/Solana)
participant LP as LendingPool (ZetaChain β’ Universal)
participant VAULT as Source Vault (ERC4626Reserve on Zeta)
participant DEX as DEX/Aggregator (Zeta)
participant IR as InterestRateManager
participant OR as PriceOracle
participant CM as CollateralManager
participant OUT as Outbound Gateway (to Target Chain)
Note over U,GW: Params: fromChain, fromVault, amount, borrowAsset, deliverTo(Chain, Address)
Note over VAULT: Vault asset = vault ZRC20 (e.g., ETH/SOL/USDC as ZRC20)
U->>GW: (1) call(borrow, fromVault, amount, borrowAsset, deliverTo)
GW-->>LP: (2) CCTX delivery to LendingPool (Zeta)
LP-->>LP: (3) validate collateral & health factor, max borrowable
LP->>VAULT: (4) withdraw/redeem(vaultAsset.ZRC20, amount)
VAULT-->>LP: (5) send vaultAsset.ZRC20 to LP
alt borrowAsset (ZRC20) β vaultAsset (ZRC20)
LP->>DEX: (6) swap vaultAsset.ZRC20 β borrowAsset.ZRC20
DEX-->>LP: (7) receive borrowAsset.ZRC20
else already correct asset
LP-->>LP: (6) skip swap
end
LP->>OUT: (8) outbound transfer to deliverTo(Chain, Address)
OUT-->>U: (9) asset delivered on target chain/address
par Post-accounting
LP->>IR: (10) accrue interest & update utilization
LP->>OR: (11) record price snapshot for health checks
LP->>CM: (12) update borrower debt & health factor
end
LP-->>U: (13) success: borrow finalized, debt recorded
The Xyra frontend is live on Vercel:
π https://xyra-sigma.vercel.app/
-
LendingPool (Main)
0x3e89A980F8f160228Bc37E2f95ceF2c8d5e443b2 -
AccessControlManager
0x01335A08Fd2de2F57794E9DC081a11936F139DC1 -
PriceOracle
0xDd33f3F29f1D41FF7E82ce4bb861051DAE0a7e5E -
InterestRateManager
0xe64e99D90a702d5F40b80730A8beE7F0B1c21186 -
CollateralManager
0xa2A7B313Cc506c8D8887FCAbEbd58E4d1BE567Fe -
PoolManager
0xf76C0491B360Ce9625226C85A70b6C6516dFf7AF
| Action | Sepolia | Base Sepolia | Zeta Athens | Solana Devnet |
|---|---|---|---|---|
| Wallet Connections | β | β | β | β |
| Interact via | β | β | β | Coming Soon |
| Supply | β | β | β | β |
| Borrow | β | β | β | β |
| Withdraw | β | β | β | β |
| Repay | β | β | β | β |
- Foundry for smart contracts
- Node.js + pnpm for frontend
- Zeta Universal CLI for cross-chain calls and running E2E Test cases
- Setup
.envas required by each subdir
cd contracts
forge install
forge build
forge testcd frontend
pnpm install
pnpm devcd e2e
npm install
npm testMade with β€οΈ by
for the ZetaChain Γ Google Cloud AI Buildathon π