Cross-chain stablecoin remittance engine on Polkadot.
Send money globally with sub-1% fees, real-time FX conversion, and instant on-chain settlement — no banks, no intermediaries.
Remyra lets anyone send USDT or USDC to a recipient on the same chain or to any connected parachain via XCM, with the FX Oracle automatically converting the amount to the destination currency at the point of transfer.
| Provider | Fee | Speed |
|---|---|---|
| Western Union | 5.3% | 3–5 days |
| MoneyGram | 3.8% | 2–3 days |
| Wise | 1.2% | 1–2 days |
| Remyra | 0.30% | Instant |
┌─────────────────────────────────────────────────────┐
│ Frontend (Next.js) │
│ MetaMask / EVM wallet ←→ ethers.js v6 │
└──────────────────────┬──────────────────────────────┘
│
┌──────────────────────▼──────────────────────────────┐
│ Remyra.sol │
│ sendRemittance() / sendCrossChainRemittance() │
│ ↓ FX conversion ↓ XCM dispatch │
│ FXOracle.sol XCM Precompile (0x…0803) │
└─────────────────────────────────────────────────────┘
│ XCM
┌──────────────┼──────────────┐
Moonbeam Astar Hydration …
| Contract | Description |
|---|---|
Remyra.sol |
Core remittance engine — handles token transfers, fee collection, XCM dispatch, and remittance history |
FXOracle.sol |
FX rate oracle with 18-decimal precision; designed as the Solidity interface to a Rust PVM library in production |
MockStablecoin.sol |
ERC-20 with faucet() for local/testnet use |
interfaces/IXcmPrecompile.sol |
Interface for the Polkadot Asset Hub XCM precompile at 0x…0803 |
USD → INR, PHP, MXN, NGN, BRL, GBP, EUR, KES (and USDT ↔ USDC at 1:1)
Polkadot Hub (same-chain), Moonbeam (2004), Astar (2006), Hydration (2034), Bifrost (2030)
- Contracts: Solidity 0.8.24, OpenZeppelin v5, Hardhat
- Frontend: Next.js 14, React 18, ethers.js v6, TypeScript
- Networks: Polkadot Asset Hub, Westend Asset Hub (testnet), Hardhat localhost
- Node.js ≥ 18
- A
.envfile at the project root (see below)
PRIVATE_KEY=0x... # Deployer private key
WESTEND_RPC_URL=... # Optional override for Westend RPC
POLKADOT_HUB_RPC_URL=... # Optional override for Polkadot Hub RPC# Root (contracts + tooling)
npm install
# Frontend
cd frontend && npm installnpm run compile
npm run test# Terminal 1 — start local node
npm run node
# Terminal 2 — deploy contracts
npm run deploy:localAfter deployment, copy the printed contract addresses into frontend/src/constants/index.ts under CONTRACTS.
cd frontend
npm run devOpen http://localhost:3000 and connect MetaMask to localhost:8545 (Chain ID 31337).
npm run deploy:westendMake sure PRIVATE_KEY is set and the account has WND for gas. Update frontend/src/constants/index.ts with the new addresses and set DEFAULT_NETWORK = 'westend'.
- Connect — user connects an EVM wallet to Polkadot Hub or Westend.
- Approve — the frontend requests an ERC-20
approveon the chosen stablecoin. - Send —
sendRemittance(same-chain) orsendCrossChainRemittance(XCM) is called. - Convert —
FXOracle.convert()applies the FX rate and deducts the 0.30% fee. - Settle — tokens land at the recipient address on the destination chain in the same block.
// Estimate before sending
function estimateRemittance(address tokenIn, uint256 amount, string destCurrency)
external view returns (uint256 amountOut, uint256 fee);
// Same-chain transfer
function sendRemittance(address tokenIn, uint256 amount, address recipient, string destCurrency)
external returns (uint256 remittanceId);
// Cross-chain transfer via XCM
function sendCrossChainRemittance(address tokenIn, uint256 amount, address recipient, uint32 destChainId, string destCurrency)
external returns (uint256 remittanceId);
// History
function getUserRemittances(address user) external view returns (uint256[] memory);
function getRemittance(uint256 id) external view returns (Remittance memory);
function getStats() external view returns (uint256 volume, uint256 fees, uint256 count, uint256 tokens);function getRate(string from, string to) external view returns (uint256 rate, uint256 updatedAt);
function convert(string from, string to, uint256 amountIn) external view returns (uint256 amountOut, uint256 fee);
function calculateFee(uint256 amount) external view returns (uint256 fee, uint256 feeBps);| Category | Implementation |
|---|---|
| PVM-experiments | FXOracle.sol is the Solidity interface to a Rust FX library (compiled to PVM via RISC-V). Rust entry points: get_exchange_rate(), calculate_optimal_route() |
| Native Assets | USDT and USDC handled as native Polkadot Asset Hub tokens via SafeERC20 |
| Precompiles | XCM precompile at 0x0000000000000000000000000000000000000803 used for cross-chain dispatch |
Remyra/
├── contracts/
│ ├── Remyra.sol
│ ├── FXOracle.sol
│ ├── MockStablecoin.sol
│ └── interfaces/
│ └── IXcmPrecompile.sol
├── scripts/
│ └── deploy.ts
├── test/
│ └── Remyra.test.ts
├── frontend/
│ └── src/
│ ├── app/ # Next.js pages
│ ├── components/ # SendRemittance, Header
│ ├── hooks/ # useWallet
│ └── constants/ # ABIs, addresses, token/chain config
├── hardhat.config.ts
└── package.json
MIT