External Layer
External Clients
- Web & Mobile Apps
- Fintech Integrations
- Merchant Systems
Gateway
API Gateway
- Request Routing
- OAuth2 Authentication
- Rate Limiting
- Webhook Management
Core Services
Authentication Service
- OAuth2 Token Management
- Multi-Factor Authentication
- Session Management
- Access Token Generation and Validation
Account Management Service
- User Profile Creation and Management
- KYC Process Integration
- External Account Linking
- Account Status Management
Wallet Service
- USDX Wallet Creation and Management
- Balance Tracking and Updates
- Transaction History Maintenance
- Wallet Recovery and Backup
Transaction Service
- USDX Transfers (On/Off Chain)
- Payment Processing
- Virtual Account Transactions
- Transaction Fee Calculation
- Idempotency Handling
Treasury Service
- Reserve Management
- Yield Distribution
- Cash Flow Management
- Liquidity Monitoring and Management
Support Services
Compliance Service
- KYC/AML Checks
- Regulatory Reporting
- Geographic Restrictions Enforcement
- Sanctions Screening
Exchange Rate Service
- Real-Time Exchange Rate Updates
- Historical Rate Data Storage and Retrieval
- Rate Conversion Calculations
Notification Service
- Transaction Alerts
- System Updates
- Compliance Notifications
- Custom User Notifications
Blockchain Layer
Blockchain Service
- Network Interactions
- Smart Contract Management
- Token Minting/Burning
- Block Confirmation Monitoring
Infrastructure
Database Service
- Transaction Ledger Maintenance
- User Data Storage and Retrieval
- Audit Trail Logging
- Data Backup and Recovery
Monitoring & Analytics Service
- Performance Metrics Collection and Analysis
- Error Logging and Alerting
- Business Intelligence Reporting
- System Health Monitoring
Security Service
- End-to-End Encryption
- Fraud Detection Algorithms
- Access Control Management
- Security Incident Response
X Protocol
USDX is a permissionless, yield-bearing stablecoin for payments.
Features
- Access Control
- Rebasing token mechanism
- Minting and burning functionality
- Block/Unblock accounts
- Pausing emergency stop mechanism
- Reward multiplier system
- EIP-2612 permit support
- OpenZeppelin UUPS upgrade pattern
Use Cases
- Cash management
- Yield-bearing collateral
- Cross-border payments
Token Types
- USDX: ERC-20, rebasing, yield-bearing collateral
- wUSDX: ERC-4626, accumulating, DeFi
USDX
Public and External Functions
- initialize(string memory name_, string memory symbol_, address owner)
- name()
- symbol()
- decimals()
- convertToShares(uint256 amount)
- convertToTokens(uint256 shares)
- totalShares()
- totalSupply()
- balanceOf(address account)
- sharesOf(address account)
- mint(address to, uint256 amount)
- burn(address from, uint256 amount)
- transfer(address to, uint256 amount)
- blockAccounts(address[] addresses)
- unblockAccounts(address[] addresses)
- isBlocked(address account)
- pause()
- unpause()
- setRewardMultiplier(uint256 _rewardMultiplier)
- addRewardMultiplier(uint256 _rewardMultiplierIncrement)
- approve(address spender, uint256 amount)
- allowance(address owner, address spender)
- transferFrom(address from, address to, uint256 amount)
- increaseAllowance(address spender, uint256 addedValue)
- decreaseAllowance(address spender, uint256 subtractedValue)
- DOMAIN_SEPARATOR()
- nonces(address owner)
- permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
Private and Internal Functions
- _authorizeUpgrade(address newImplementation)
- _mint(address to, uint256 amount)
- _burn(address account, uint256 amount)
- _beforeTokenTransfer(address from, address to, uint256 amount)
- _afterTokenTransfer(address from, address to, uint256 amount)
- _transfer(address from, address to, uint256 amount)
- _blockAccount(address account)
- _unblockAccount(address account)
- _setRewardMultiplier(uint256 _rewardMultiplier)
- _spendAllowance(address owner, address spender, uint256 amount)
- _useNonce(address owner)
- _approve(address owner, address spender, uint256 amount)
Events
- Transfer(from indexed addr, to uint256, amount uint256)
- RewardMultiplier(uint256 indexed value)
- Approval(address indexed owner, address indexed spender, uint256 value)
- AccountBlocked(address indexed addr)
- AccountUnblocked(address indexed addr)
- Paused(address account)
- Unpaused(address account)
- Upgraded(address indexed implementation)
Roles
- DEFAULT_ADMIN_ROLE
- MINTER_ROLE
- BURNER_ROLE
- BLOCKLIST_ROLE
- ORACLE_ROLE
- UPGRADE_ROLE
- PAUSE_ROLE
wUSDX
Public and External Functions
- initialize(IUSDX _USDX, address owner)
- pause()
- unpause()
- paused()
- DOMAIN_SEPARATOR()
- nonces(address owner)
- permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
Private and Internal Functions
- _beforeTokenTransfer(address from, address to, uint256 amount)
- _authorizeUpgrade(address newImplementation)
- _useNonce(address owner)
Events
- Transfer(from indexed addr, to uint256, amount uint256)
- Approval(address indexed owner, address indexed spender, uint256 value)
- Paused(address account)
- Unpaused(address account)
- Upgraded(address indexed implementation)
Roles
- DEFAULT_ADMIN_ROLE
- UPGRADE_ROLE
- PAUSE_ROLE
Description
USDX is a stablecoin designed to maintain a 1 USD valuation backed by short-term US Treasury bills. The yield generated by these T-bills is automatically distributed to USDX token holders through rebasing. This feature keeps the price of USDX stable while steadily increasing the balance of USDX for token holders.
X Protocol hosts the primary market that establishes the price peg. KYC-verified users can deposit collateral, either USDC or fiat currency, on our platform. In exchange, they receive USDX and can choose to redeem USDX for collateral or withdraw USDX to any Ethereum address. Since X Protocol offers an exchange rate of one dollar per USDX in both directions, any price movement in the external (secondary) market can be traded in the primary market to re-establish the peg.
USDX is a rebasing ERC-20 token with a set of additional features, including pausing, blocking/unblocking accounts, role-based access control, and upgradability. The contract’s primary objective is to reflect the T-bills’ annual percentage yield (APY) within the token’s value. It achieves this through a reward multiplier rebasing mechanism, where the addRewardMultiplier function is called daily to adjust the reward multiplier, guaranteeing an accurate representation of yield from the underlying assets.
Acknowledging the complexities of handling rebasing tokens in the DeFi ecosystem, the wUSDX contract serves as a wrapped token, simplifying integration while preserving stability. The wUSDX contract is an ERC-4626 token vault, enabling users to deposit USDX in exchange for wUSDX tokens. The USDX tokens are rebasing, whereas the wUSDX tokens are non-rebasing, making wUSDX ideal for seamless integration with protocols in the DeFi ecosystem.
The wUSDX contract incorporates the ERC-2612 permit functionality, allowing the use of signatures to grant token allowances. Additionally, the close relationship between the wUSDX and USDX contracts is also worth noting; the wUSDX contract leverages the account block list from the USDX contract to govern transfers and, specifically, prevent transfers from accounts included in the block list.
Finally, the wUSDX token transfers can be paused in two ways: either by being paused directly from within the wUSDX contract or in the event the USDX contract is paused.
API Endpoints List
- /auth/token
- /public/nav
- /public/yield
- /accounts
- /accounts/{accountId}
- /customers
- /customers/{customerId}
- /wallets
- /wallets/{walletId}
- /external-accounts
- /external-accounts/{externalAccountId}
- /transactions
- /transactions/{transactionId}
- /payments
- /payments/{paymentId}
- /transfers
- /transfers/{transferId}
- /virtual-accounts
- /virtual-accounts/{virtualAccountId}
- /treasury/assets
- /treasury/rebase
- /compliance/attestations
- /kyc/generate-link
- /kyc/status/{kycId}
- /exchange-rates
- /fees
- /webhooks
- /webhooks/{webhookId}
- /cash-management/cash-flow
- /cash-management/allocate-funds
- /cash-management/reconcile
- /auto-sweep/rules
- /auto-sweep/rules/{ruleId}
- /stablecoin/mint
- /stablecoin/burn
Based on openapi.yaml spec
API Services Overview
- Authentication: OAuth2 for secure API access
- Account Management: User accounts and KYC processes
- Wallet Management: USDX wallet operations
- Transactions: On-chain and off-chain USDX transfers
- External Accounts: Linking and managing external financial accounts
- Compliance: KYC, AML, and regulatory reporting
- Treasury Management: Reserve management and yield distribution
- Virtual Accounts: Support for virtual account creation and management
- Exchange Rates: Real-time rate information
- Webhooks: Event-driven notifications for system integrations
- Cash Management: Automated fund transfers and reporting
- Stablecoin Operations: Minting, burning, and core token management
API request/response schemas
Authentication
Request
{ "client_id": "string", "client_secret": "string" }
Response (200 OK)
{ "access_token": "string", "token_type": "string", "expires_in": "integer" }
Public
Response (200 OK)
{ "navPerToken": "number", "timestamp": "string (date-time)" }
Public
Response (200 OK)
{ "currentAPY": "number", "sevenDayYield": "number", "lastUpdated": "string (date-time)" }
Account Management
Request
{ "email": "string", "name": "string" }
Response (201 Created)
{ "accountId": "string", "email": "string", "name": "string", "createdAt": "string (date-time)" }
Account Management
Response (200 OK)
{ "accountId": "string", "email": "string", "name": "string", "createdAt": "string (date-time)" }
Customer Management
Request
{ "name": "string", "email": "string", "phone": "string (optional)" }
Response (201 Created)
{ "customerId": "string", "name": "string", "email": "string", "phone": "string", "createdAt": "string (date-time)" }
Customer Management
Response (200 OK)
{ "customerId": "string", "name": "string", "email": "string", "phone": "string", "createdAt": "string (date-time)" }
Wallet Management
Request
{ "accountId": "string" }
Response (201 Created)
{ "walletId": "string", "accountId": "string", "balance": "string", "currency": "string" }
Wallet Management
Response (200 OK)
{ "walletId": "string", "accountId": "string", "balance": "string", "currency": "string" }
External Accounts
Request
{ "accountId": "string", "type": "string (bank|card)", "accountNumber": "string", "routingNumber": "string (optional)" }
Response (201 Created)
{ "externalAccountId": "string", "accountId": "string", "type": "string", "accountNumber": "string", "routingNumber": "string" }
External Accounts
Response (200 OK)
{ "externalAccountId": "string", "accountId": "string", "type": "string", "accountNumber": "string", "routingNumber": "string" }
Transactions
Request
{ "sourceWalletId": "string", "destinationWalletId": "string", "amount": "string", "currency": "string (default: USDX)" }
Response (201 Created)
{ "transactionId": "string", "sourceWalletId": "string", "destinationWalletId": "string", "amount": "string", "currency": "string", "status": "string", "createdAt": "string (date-time)" }
Transactions
Response (200 OK)
{ "transactionId": "string", "sourceWalletId": "string", "destinationWalletId": "string", "amount": "string", "currency": "string", "status": "string", "createdAt": "string (date-time)" }
Payments
Request
{ "sourceAccountId": "string", "destinationAccountId": "string", "amount": "string", "currency": "string", "paymentMethod": "string (ACH|wire|SWIFT)", "paymentDetails": { ... } }
Response (201 Created)
{ "paymentId": "string", "sourceAccountId": "string", "destinationAccountId": "string", "amount": "string", "currency": "string", "status": "string", "createdAt": "string (date-time)" }
Payments
Response (200 OK)
{ "paymentId": "string", "sourceAccountId": "string", "destinationAccountId": "string", "amount": "string", "currency": "string", "status": "string", "createdAt": "string (date-time)" }
Transfers
Request
{ "sourceAccountId": "string", "destinationAccountId": "string", "amount": "string", "currency": "string", "transferMethod": "string (internal|ACH|wire|SWIFT)", "transferDetails": { ... } }
Response (201 Created)
{ "transferId": "string", "sourceAccountId": "string", "destinationAccountId": "string", "amount": "string", "currency": "string", "status": "string", "createdAt": "string (date-time)" }
Transfers
Response (200 OK)
{ "transferId": "string", "sourceAccountId": "string", "destinationAccountId": "string", "amount": "string", "currency": "string", "status": "string", "createdAt": "string (date-time)" }
Virtual Accounts
Request
{ "accountId": "string", "currency": "string" }
Response (201 Created)
{ "virtualAccountId": "string", "accountId": "string", "currency": "string", "status": "string", "createdAt": "string (date-time)" }
Virtual Accounts
Response (200 OK)
{ "virtualAccountId": "string", "accountId": "string", "currency": "string", "status": "string", "createdAt": "string (date-time)" }
Treasury
Response (200 OK)
{ "totalAssets": "string", "treasuryBillsValue": "string", "circulatingUSDX": "string", "reserveRatio": "number" }
Treasury
Request
{ "yieldAmount": "number" }
Response (200 OK)
{ "rebaseId": "string", "timestamp": "string (date-time)", "yieldDistributed": "string", "newTotalSupply": "string" }
Compliance
Response (200 OK)
{ "latestReport": { "reportId": "string", "reportDate": "string (date)", "auditor": "string", "reportUrl": "string (uri)" }, "historicalReports": [ { "reportId": "string", "reportDate": "string (date)", "auditor": "string", "reportUrl": "string (uri)" } ] }
KYC
Request
{ "accountId": "string" }
Response (201 Created)
{ "kycId": "string", "verificationLink": "string (uri)", "expiresAt": "string (date-time)" }
KYC
Response (200 OK)
{ "kycId": "string", "status": "string (pending|in_progress|completed|rejected)", "lastUpdated": "string (date-time)" }
Exchange Rates
Response (200 OK)
{ "base": "string", "rates": { "CURRENCY_CODE": "number" }, "timestamp": "string (date-time)" }
Fee Management
Response (200 OK)
{ "transactionFeePercentage": "number", "minimumFee": "number", "maximumFee": "number", "lastUpdated": "string (date-time)" }
Webhooks
Request
{ "url": "string (uri)", "events": ["string"] }
Response (201 Created)
{ "webhookId": "string", "url": "string (uri)", "events": ["string"], "createdAt": "string (date-time)" }
Webhooks
Response (200 OK)
{ "webhookId": "string", "url": "string (uri)", "events": ["string"], "createdAt": "string (date-time)" }
Cash Management
Response (200 OK)
{ "startDate": "string (date)", "endDate": "string (date)", "inflows": "number", "outflows": "number", "netCashFlow": "number", "transactions": [ { "date": "string (date)", "type": "string (inflow|outflow)", "amount": "number", "description": "string" } ] }
Cash Management
Request
{ "allocations": [ { "accountId": "string", "amount": "number" } ] }
Response (200 OK)
{ "allocationId": "string", "timestamp": "string (date-time)", "allocations": [ { "accountId": "string", "amount": "number", "status": "string (success|failed)" } ] }
Cash Management
Request
{ "accountId": "string", "date": "string (date)" }
Response (200 OK)
{ "reconciliationId": "string", "accountId": "string", "date": "string (date)", "balancePerBooks": "number", "balancePerBank": "number", "discrepancy": "number", "status": "string (matched|discrepancy_found)" }
Auto-Sweep
Request
{ "sourceAccountId": "string", "destinationAccountId": "string", "thresholdAmount": "number", "thresholdType": "string (minimum|maximum)", "frequency": "string (daily|weekly|monthly)" }
Response (201 Created)
{ "ruleId": "string", "sourceAccountId": "string", "destinationAccountId": "string", "thresholdAmount": "number", "thresholdType": "string", "frequency": "string", "createdAt": "string (date-time)", "lastExecuted": "string (date-time)" }
Auto-Sweep
Response (200 OK)
{ "ruleId": "string", "sourceAccountId": "string", "destinationAccountId": "string", "thresholdAmount": "number", "thresholdType": "string", "frequency": "string", "createdAt": "string (date-time)", "lastExecuted": "string (date-time)" }
Stablecoin Operations
Request
{ "amount": "string", "sourceType": "string (usd_deposit|treasury_bill)", "depositId": "string (conditional)", "billId": "string (conditional)" }
Response (201 Created)
{ "mintId": "string", "amount": "string", "status": "string (completed|pending|failed)", "txHash": "string", "timestamp": "string (date-time)" }
Stablecoin Operations
Request
{ "amount": "string", "destinationType": "string (usd_withdrawal|treasury_bill)", "withdrawalAccount": "string (conditional)" }
Response (200 OK)
{ "burnId": "string", "amount": "string", "status": "string (completed|pending|failed)", "txHash": "string", "timestamp": "string (date-time)" }