Loading Analytics...
Learn how to integrate XyloNet into your dApp, wallet, or protocol.
XyloNet provides three main integration points:
Execute stablecoin swaps with minimal slippage
Bridge native USDC from any supported chain
Deposit and earn yield on USDC
// Arc Testnet (Chain ID: 5042002)
FACTORY = "0x60EDeFB094B84BBC6430cc130B358A43Ba1979e2"
ROUTER = "0x73742278c31a76dBb0D2587d03ef92E6E2141023"
BRIDGE = "0xf7Df65Ce418E938ee8d9a0A0d227A43441fe4641"
VAULT = "0x240Eb85458CD41361bd8C3773253a1D78054f747"
// Pools
USDC_EURC_POOL = "0x3DF3966F5138143dce7a9cFDdC2c0310ce083BB1"
USDC_USYC_POOL = "0x8296cC7477A9CD12cF632042fDDc2aB89151bb61"
// Tokens
USDC = "0x3600000000000000000000000000000000000000"
EURC = "0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a"
USYC = "0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C"
Get the expected output amount for a swap:
// Solidity — the router resolves the pool via the factory,
// no pool address needed
function getAmountOut(
address tokenIn,
address tokenOut,
uint256 amountIn
) external view returns (uint256 amountOut);
// Multi-hop quote along a path (all paths route through USDC)
function getAmountsOut(
uint256 amountIn,
address[] calldata path
) external view returns (uint256[] memory amounts);
// Example: Get quote for 1000 USDC -> EURC
uint256 amountOut = router.getAmountOut(
0x3600000000000000000000000000000000000000, // USDC
0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a, // EURC
1000 * 1e6 // 1000 USDC (6 decimals)
);Execute a swap through the router:
// Solidity — Uniswap-V2-style exact-input swap (recommended)
function swapExactTokensForTokens(
uint256 amountIn,
uint256 minAmountOut,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
// Example: Swap 1000 USDC for EURC with 0.5% slippage
uint256 amountIn = 1000 * 1e6;
IERC20(USDC).approve(router, amountIn);
// Quote first, then derive the slippage floor from the quote
uint256 quoted = router.getAmountOut(USDC, EURC, amountIn);
uint256 minOut = (quoted * 995) / 1000; // 0.5% slippage
address[] memory path = new address[](2);
path[0] = USDC;
path[1] = EURC;
uint256[] memory amounts = router.swapExactTokensForTokens(
amountIn,
minOut,
path,
msg.sender, // Recipient
block.timestamp + 300 // 5 min deadline
);
// One-transaction alternative (no separate approve):
// swapWithPermit(...) — USDC, EURC and USYC all support
// EIP-2612 permit on Arc// ERC-4626 Standard
function deposit(
uint256 assets, // USDC amount
address receiver // Share recipient
) external returns (uint256 shares);
// Example
IERC20(USDC).approve(vault, 1000 * 1e6);
uint256 shares = IXyloVault(vault).deposit(1000 * 1e6, msg.sender);// Withdraw by asset amount
function withdraw(
uint256 assets,
address receiver,
address owner
) external returns (uint256 shares);
// Withdraw by share amount
function redeem(
uint256 shares,
address receiver,
address owner
) external returns (uint256 assets);// Get total assets in vault uint256 total = vault.totalAssets(); // Convert shares to assets uint256 assets = vault.convertToAssets(shares); // Convert assets to shares uint256 shares = vault.convertToShares(assets); // Preview deposit/withdraw uint256 shares = vault.previewDeposit(assets); uint256 assets = vault.previewWithdraw(shares);
Ready-to-use ABIs and a machine-readable address/config file are in the integration pack on GitHub:
import { useWriteContract, useReadContract } from 'wagmi'
import ROUTER_ABI from './abis/XyloRouter.json' // integration-pack/abis
const ROUTER = '0x73742278c31a76dBb0D2587d03ef92E6E2141023'
// Read quote — router resolves the pool internally
const { data: amountOut } = useReadContract({
address: ROUTER,
abi: ROUTER_ABI,
functionName: 'getAmountOut',
args: [tokenIn, tokenOut, amountIn]
})
// Execute swap (after ERC-20 approve to the router)
const { writeContract } = useWriteContract()
writeContract({
address: ROUTER,
abi: ROUTER_ABI,
functionName: 'swapExactTokensForTokens',
args: [amountIn, minAmountOut, [tokenIn, tokenOut], recipient, deadline]
})Monitor protocol activity by listening to events:
// Pool Events
event Swap(
address indexed sender,
address indexed tokenIn,
address indexed tokenOut,
uint256 amountIn,
uint256 amountOut,
address to
);
event AddLiquidity(
address indexed provider,
uint256[] amounts,
uint256 lpTokens
);
event RemoveLiquidity(
address indexed provider,
uint256[] amounts,
uint256 lpTokens
);
// Vault Events
event Deposit(
address indexed sender,
address indexed owner,
uint256 assets,
uint256 shares
);
event Withdraw(
address indexed sender,
address indexed receiver,
address indexed owner,
uint256 assets,
uint256 shares
);For integration support: