VitreusDEX Developer Documentation
Everything you need to integrate with VitreusDEX — the native exchange for the Vitreus blockchain. Access real-time price data, portfolio analytics, AI-powered market insights, and on-chain pallet extrinsics.
Chain Information
Public APIs
All endpoints are unauthenticated and CORS-enabled. Rate limit: 60 requests/minute.
https://vitreusdex.com/api/vtrs-priceReturns the current VTRS price aggregated from multiple sources.
curl https://vitreusdex.com/api/vtrs-price{
"symbol": "VTRS",
"price_usd": 0.0098,
"price_change_24h": 4.2,
"volume_24h": 1420000,
"sources": ["coingecko", "vitreus-oracle"],
"last_updated": "2026-04-24T12:00:00Z"
}https://vitreusdex.com/api/vnrg-priceReturns the current VNRG (Vitreus Energy) price.
curl https://vitreusdex.com/api/vnrg-price{
"symbol": "VNRG",
"price_usd": 0.012,
"price_change_24h": -1.8,
"volume_24h": 980000,
"sources": ["coingecko", "vitreus-oracle"],
"last_updated": "2026-04-24T12:00:00Z"
}https://vitreusdex.com/api/portfolio?address=0x...Returns VTRS and VNRG balances with USD values for any wallet address on Vitreus.
| Parameter | Type | Required | Description |
|---|---|---|---|
| address | string | Yes | Wallet address (0x...) |
curl "https://vitreusdex.com/api/portfolio?address=0x7a3F8b2e1c4d9f01ab123456789abcdef0123456"{
"address": "0x7a3F8b2e1c4d9f01ab123456789abcdef0123456",
"balances": {
"VTRS": { "balance": 125000, "usd_value": 1225.00 },
"VNRG": { "balance": 82104, "usd_value": 985.25 }
},
"total_usd": 2210.25,
"last_updated": "2026-04-24T12:00:00Z"
}https://vitreusdex.com/api/market-insightReturns AI-powered market analysis using HiveIQ. Powered by Claude AI.
| Parameter | Type | Required | Description |
|---|---|---|---|
| price | number | Yes | Current VTRS price in USD |
| volatility | number | Yes | 24h volatility percentage |
| poolDepth | number | Yes | Total liquidity depth in USD |
curl -X POST https://vitreusdex.com/api/market-insight \
-H "Content-Type: application/json" \
-d '{"price": 0.0098, "volatility": 4.2, "poolDepth": 4800000}'{
"insight": "VTRS is showing bullish momentum with moderate volatility...",
"sentiment": "bullish",
"confidence": 0.78,
"recommendation": "Favorable conditions for liquidity provision.",
"model": "claude-sonnet-4-20250514"
}Embeddable Widgets
Drop these into any website to show live Vitreus data.
Price Widget
Displays live VTRS price with 24h change. Two lines of HTML, zero dependencies.
<script src="https://vitreusdex.com/widget.js"></script>
<div id="vtrs-widget"></div>Portfolio Widget
Shows wallet balances for any connected address.
<div id="vitreus-portfolio-widget" data-address="0x..."></div>
<script src="https://vitreusdex.com/widgets/portfolio.js" async></script>Preview
Pallet Reference
On-chain extrinsics for pallet-vitreus-dex (pallet index 43, PalletId: vtrs/dex).
create_pool
Create a new AMM pool for a given asset pair. Restricted to ManageOrigin (governance).
| Parameter | Type | Required | Description |
|---|---|---|---|
| asset_a | AssetKind | Yes | First asset in the pair |
| asset_b | AssetKind | Yes | Second asset in the pair |
| fee_tier | u32 | Yes | Fee tier: 1 (0.1%), 3 (0.3%), or 10 (1.0%) |
// Pair is automatically canonicalized — (A,B) and (B,A) map to the same pool.
// Fee tier must be 1, 3, or 10. Pool account derived from PalletId + pair encoding.
api.tx.vitreusDex.createPool(assetA, assetB, 3);add_liquidity
Add liquidity to an existing pool. Optimal amounts are computed automatically — no excess token donation.
| Parameter | Type | Required | Description |
|---|---|---|---|
| asset_a | AssetKind | Yes | First asset |
| asset_b | AssetKind | Yes | Second asset |
| amount_a | Balance | Yes | Maximum amount of asset_a to deposit |
| amount_b | Balance | Yes | Maximum amount of asset_b to deposit |
| amount_a_min | Balance | Yes | Minimum acceptable asset_a (slippage) |
| amount_b_min | Balance | Yes | Minimum acceptable asset_b (slippage) |
// First deposit: sqrt(a*b) shares minted, MINIMUM_LIQUIDITY (1000) locked.
// Subsequent: optimal amounts calculated, min(share_a, share_b) minted.
api.tx.vitreusDex.addLiquidity(assetA, assetB, 10000, 40000, 9500, 38000);remove_liquidity
Remove liquidity by burning LP shares. Reserves are synced from actual balances before withdrawal.
| Parameter | Type | Required | Description |
|---|---|---|---|
| asset_a | AssetKind | Yes | First asset |
| asset_b | AssetKind | Yes | Second asset |
| shares | Balance | Yes | Number of LP shares to burn |
| amount_a_min | Balance | Yes | Minimum asset_a to receive |
| amount_b_min | Balance | Yes | Minimum asset_b to receive |
// Respects locked_until — reverts if position is still locked.
// MINIMUM_LIQUIDITY shares can never be removed.
api.tx.vitreusDex.removeLiquidity(assetA, assetB, 19000, 9000, 36000);swap_exact_tokens_for_tokens
Swap an exact input amount for as much output as the pool yields. Constant product formula with fee.
| Parameter | Type | Required | Description |
|---|---|---|---|
| asset_in | AssetKind | Yes | Input asset |
| asset_out | AssetKind | Yes | Output asset |
| amount_in | Balance | Yes | Exact amount to swap |
| amount_out_min | Balance | Yes | Minimum output (slippage protection) |
| recipient | AccountId | Yes | Recipient of output tokens |
// Fee deducted from input. Only after-fee amount added to reserves.
// Reserves synced from actual balances at start of swap.
api.tx.vitreusDex.swapExactTokensForTokens(vtrs, vnrg, 100, 90, recipient);lock_liquidity
Lock a liquidity position until a specified block number. Prevents removal until the lock expires.
| Parameter | Type | Required | Description |
|---|---|---|---|
| asset_a | AssetKind | Yes | First asset |
| asset_b | AssetKind | Yes | Second asset |
| lock_until | BlockNumber | Yes | Block number until which position is locked |
// Can only be called by the position owner. Emits LiquidityLocked event.
api.tx.vitreusDex.lockLiquidity(assetA, assetB, 1_000_000);Security
Security Audit — April 2026
pallet-vitreus-dex underwent a comprehensive AI-assisted security audit. 12 findings were identified and resolved — 1 Critical, 4 High, 4 Medium, 3 Low. All 11 unit tests pass. Full runtime compiles clean.
1
Critical
4
High
4
Medium
3
Low
Key fixes: first depositor attack prevention (MINIMUM_LIQUIDITY), pair canonicalization, reserve syncing, fee separation, optimal deposit calculation, slippage enforcement.
Security Contact
Report vulnerabilities to security@vitreus.io. We operate a responsible disclosure policy.
Changelog
- Native AMM swap interface with real-time price feeds
- Liquidity pool creation wizard with HiveIQ AI advisor
- Token Launch Wizard — 3-step ERC-20 deployment with tokenomics designer
- Pool detail pages with price charts, trade history, LP leaderboard
- Analytics dashboard — ecosystem overview, volume/TVL charts, burn tracker
- Token Explorer with AI analyst and 8-token universe
- Portfolio tracker with wallet connection (MetaMask, WalletConnect)
- Staking interface with VIP tiers and yield display
- Bridge interface for cross-chain asset transfers
- pallet-vitreus-dex security audit — 12 findings resolved
- Preview mode banner with localStorage dismissal
- Developer documentation and public API reference