This guide provides a comprehensive resource for developers looking to integrate with MoneyX, a decentralized perpetual futures exchange on the Binance Smart Chain (BSC). Designed for developers of all experience levels, this page details how to interact with MoneyX’s smart contracts, access APIs, and build applications leveraging the platform’s trading, staking, vesting, and referral functionalities. As a clone of a well-known decentralized trading platform, MoneyX offers robust infrastructure for trading assets (BTC, ETH, BNB, SOL, XRP, DOGE) with up to 100x leverage, liquidity provision via MLP, and staking with MONEY and EsMONEY. Below, we outline the technical components, integration methods, and best practices for secure and efficient development.
Overview of MoneyX Integration
MoneyX’s ecosystem is powered by a suite of audited smart contracts, enabling developers to build tools, bots, analytics platforms, or user interfaces that interact with trading, liquidity provision, staking, vesting, and referral systems. Integration is facilitated through BSC’s EVM-compatible environment, public contract ABIs, and xAI’s API services. Key features include:
Smart Contracts: Fully audited, open-source contracts for trading, staking, and rewards.
API Access: Available via xAI’s API service for real-time data (e.g., prices, positions, rewards).
On-Chain Data: Accessible via BSC explorers (e.g., BscScan) or the Reader contracts.
Event Logs: Contracts emit events for trades, stakes, and vesting actions, enabling real-time monitoring.
Low-Cost Transactions: BSC’s minimal gas fees ensure cost-effective interactions.
This guide assumes familiarity with Ethereum Virtual Machine (EVM) development, Solidity, and Web3 libraries (e.g., ethers.js, Web3.js).
Core Smart Contracts
MoneyX’s functionality is driven by a set of audited smart contracts. Below are the primary contracts relevant for integration, with their addresses and roles. All contracts are deployed on BSC Mainnet (Chain ID: 56, RPC: https://bsc-dataseed.binance.org/).
Contract | Address | Description |
MONEY | 0x4fFe5ec4D8B9822e01c9E49678884bAEc17F60D9 | Native governance and utility token. |
MLP | 0x14C7E28d4Dd0D593cB2D481a7CBaF462b18a477a | Liquidity pool token for trading. |
EsMONEY | 0x4768232700c2f81721fA94822535d35c2354633B | Non-transferable escrowed reward token. |
BonusMONEY | 0x59B2f533928222feFf104f2FD1a1d0CE652C1718 | Non-transferable bonus reward token. |
Vault | 0xeB0E5E1a8500317A1B8fDd195097D5509Ef861de | Manages collateral, positions, and fees. |
MlpManager | 0x667e43E32372696c27B7AB72D435bC9261F35E01 | Handles MLP issuance and redemption. |
OrderBook | 0x6b448DF5a0E6BcA35e76e50D9CD53BEA3caa7efa | Processes limit and trigger orders. |
PositionManager | 0x62dEFAA710dcd1dA4d9231E1EED1fb16c2278CCF | Manages position creation and closure. |
PositionRouter | 0x065F9746b33F303c6481549BAc42A3885903fA44 | Executes market orders and position changes. |
VaultPriceFeed | 0x31086dBa211D1e66F51701535AD4C0e0f98A3482 | Provides real-time oracle pricing. |
FastPriceFeed | 0x1dE47321bc0e909969Dc97484FB4949fBf19068a | Enhances price update speed. |
RewardRouterV2 | 0xA92eaE4AB17f9091FBf5dA7C7cbB0AEa346649C9 | Routes staking, vesting, and reward claims. |
RewardReader | 0xa8433BC9DcB49875d218A15eF1d6AAC4D0076C8A | Reads staking and reward data. |
ReferralStorage | 0xA833940Ed3c260C2d603ad9d9152E2533D6005DF | Tracks referral codes and rewards. |
VestedMONEY | 0xe3394F30568D36593147c93Cce75cc497319C99D | Manages EsMONEY vesting. |
VestedMLP | 0xaCD327e3ec595F601C6c7b02585c3db01E6A2a09 | Handles MLP vesting/redemption. |
Timelock | 0x0cb8cf2EdccD329cEba9176D588A2B895a20ba3A | Delays administrative changes for security. |
Note: Always verify contract addresses via Telegram or BscScan to avoid phishing risks.
Integration Methods
1. Smart Contract Interaction
Developers can interact with MoneyX contracts using Web3 libraries (e.g., ethers.js, Web3.js) or direct RPC calls. Below are key integration points:
Trading
Contracts: Vault, PositionManager, PositionRouter, OrderBook.
Use Cases:
Open/close positions (market, limit, trigger orders).
Monitor positions and liquidation prices.
Example (ethers.js):
const { ethers } = require("ethers");
const provider = new ethers.providers.JsonRpcProvider("https://bsc-dataseed.binance.org/");
const wallet = new ethers.Wallet("PRIVATE_KEY", provider);
const positionRouter = new ethers.Contract(
"0x065F9746b33F303c6481549BAc42A3885903fA44",
PositionRouterABI,
wallet
);
// Open a 10x long BTC position
const tx = await positionRouter.createIncreasePosition(
["0x4fFe5ec4D8B9822e01c9E49678884bAEc17F60D9"], // path (collateral token)
"0x4fFe5ec4D8B9822e01c9E49678884bAEc17F60D9", // indexToken (BTC)
ethers.utils.parseUnits("1000", 6), // collateral in USDT
ethers.utils.parseUnits("10000", 6), // sizeDelta ($10,000 position)
true, // isLong
ethers.utils.parseEther("60000"), // acceptablePrice ($60,000/BTC)
ethers.utils.parseEther("0.01"), // executionFee (BNB)
{ gasLimit: 300000 }
);
await tx.wait();
Events: Listen for CreateIncreasePosition, ExecuteIncreasePosition from PositionRouter.
Staking and Rewards
Contracts: RewardRouterV2, RewardReader, RewardTrackerStakedMONEY, RewardDistributorStakedMONEY.
Use Cases:
Stake/unstake MONEY, EsMONEY, or Bonus MONEY.
Claim WBNB fees or EsMONEY rewards.
Example:
const rewardRouter = new ethers.Contract(
"0xA92eaE4AB17f9091FBf5dA7C7cbB0AEa346649C9",
RewardRouterV2ABI,
wallet
);
// Stake 100 MONEY
const tx = await rewardRouter.stakeMoney(ethers.utils.parseEther("100"));
await tx.wait();
// Claim WBNB rewards
const claimTx = await rewardRouter.handleRewards(true, false, true, false, false, true, false);
await claimTx.wait();
Events: Monitor StakeMoney, Claim from RewardRouterV2.
Vesting
Contracts: VestedMONEY, VestedMLP.
Use Cases:
Initiate/monitor EsMONEY or MLP vesting.
Track daily unlocks and reserved tokens.
Example:
const vestedMoney = new ethers.Contract(
"0xe3394F30568D36593147c93Cce75cc497319C99D",
VestedMoneyABI,
wallet
);
// Vest 10 EsMONEY
const tx = await vestedMoney.createVest(ethers.utils.parseEther("10"));
await tx.wait();
Events: Listen for Vest, Withdraw from VestedMONEY.
Liquidity Provision
Contracts: MlpManager, Vault.
Use Cases:
Buy/redeem MLP tokens.
Monitor pool composition and fees.
Example:
const mlpManager = new ethers.Contract(
"0x667e43E32372696c27B7AB72D435bC9261F35E01",
MlpManagerABI,
wallet
);
// Buy MLP with USDT
const tx = await mlpManager.addLiquidity(
"0x55d398326f99059fF775485246999027B3197955", // USDT
ethers.utils.parseUnits("1000", 6), // amount
0, // minUsdg
0, // minMlp
{ gasLimit: 300000 }
);
await tx.wait();
Events: Monitor AddLiquidity, RemoveLiquidity from MlpManager.
Referrals
Contracts: ReferralStorage, ReferralReader.
Use Cases:
Create/track referral codes.
Monitor WBNB rewards.
Example:
const referralStorage = new ethers.Contract(
"0xA833940Ed3c260C2d603ad9d9152E2533D6005DF",
ReferralStorageABI,
wallet
);
// Create referral code
const tx = await referralStorage.setTraderReferralCode(ethers.utils.formatBytes32String("TRADER123"));
await tx.wait();
Events: Listen for SetTraderReferralCode, RegisterCode from ReferralStorage.
2. API Integration
MoneyX supports API access through xAI’s API service for real-time data and off-chain interactions. Contact the team via Telegram for API key requests and documentation.
Endpoints:
Prices: Fetch mark prices for supported assets (BTC, ETH, etc.).
Positions: Retrieve user position data (size, collateral, liquidation price).
Rewards: Query staking rewards (WBNB, EsMONEY, Bonus MONEY).
Pool Data: Access MLP pool composition and TVL.
Example (Node.js):
const axios = require("axios");
async function getPrices() {
const response = await axios.get("https://api.x.ai/moneyx/prices", {
headers: { "Authorization": "Bearer YOUR_API_KEY" }
});
console.log(response.data); // { "BTC": 60000, "ETH": 2500, ... }
}
getPrices();
Use Cases:
Build trading bots for automated market/limit orders.
Create analytics dashboards for position and reward tracking.
Integrate with portfolio management tools.
3. On-Chain Data Access
Use Reader contracts for gas-efficient data queries:
VaultReader (0x3f033207dDb0eDf06A474990c1750ee7900E7776): Fetches position and collateral data.
RewardReader (0xa8433BC9DcB49875d218A15eF1d6AAC4D0076C8A): Retrieves staking and reward details.
ReferralReader (0xC8b438204D9C97f367A7039e06F8C266E2b22738): Accesses referral metrics.
Example:
const vaultReader = new ethers.Contract(
"0x3f033207dDb0eDf06A474990c1750ee7900E7776",
VaultReaderABI,
provider
);
const position = await vaultReader.getPosition(
wallet.address,
"0x55d398326f99059fF775485246999027B3197955", // collateralToken
"0x4fFe5ec4D8B9822e01c9E49678884bAEc17F60D9", // indexToken
true // isLong
);
console.log(position); // [size, collateral, entryPrice, ...]
4. Event Monitoring
Contracts emit events for key actions, enabling real-time tracking:
Vault: IncreasePosition, DecreasePosition, LiquidatePosition.
MlpManager: AddLiquidity, RemoveLiquidity.
RewardRouterV2: StakeMoney, UnstakeMoney, Claim.
Example (ethers.js):
const vault = new ethers.Contract("0xeB0E5E1a8500317A1B8fDd195097D5509Ef861de", VaultABI, provider);
vault.on("LiquidatePosition", (account, collateralToken, indexToken, isLong, size, collateral) => {
console.log(`Liquidation: ${account}, Size: ${ethers.utils.formatUnits(size, 6)} USD`);
});
Developer Best Practices
Verify Contract Addresses:
Always confirm addresses via Telegram or BscScan to avoid scams.
Example: Check Vault (0xeB0E5E1a8500317A1B8fDd195097D5509Ef861de) on BscScan.
Handle Gas Fees:
BSC gas fees are low (~$0.01–$0.10), but estimate gas using provider.estimateGas(tx) to prevent failures.
Batch transactions (e.g., compound multiple rewards) to save costs.
Secure API Usage:
Store API keys securely (e.g., environment variables).
Use rate limits to avoid throttling; contact xAI for limits.
Monitor Oracle Prices:
Use VaultPriceFeed or FastPriceFeed for accurate pricing to prevent slippage or invalid orders.
Example: Fetch BTC price before submitting a limit order.
Test on Testnet:
Use BSC Testnet (Chain ID: 97, RPC: https://data-seed-prebsc-1-s1.binance.org:8545/) for testing.
Deploy mock contracts or use MoneyX’s testnet environment (contact team for details).
Error Handling:
Use VaultErrorController (0xea1A12db62726a44673d01cF7990b16013501e1D) to catch invalid transactions (e.g., insufficient collateral).
Example: Check for InsufficientCollateral error in transaction logs.
Community Engagement:
Risks and Considerations
Smart Contract Risk: Audited contracts minimize vulnerabilities, but risks remain. Review audits via Telegram (Governance and Security Guide).
Oracle Risk: VaultPriceFeed relies on external oracles; delays or manipulation could affect pricing.
Gas Cost Variability: BSC fees are low but may spike during network congestion.
API Availability: Ensure API key validity and monitor xAI’s API for uptime.
Rate Limits: API calls may be throttled; plan for asynchronous data fetching.
Mitigate by:
Testing integrations on BSC Testnet.
Monitoring contract events and API responses for errors.
Limiting exposure in early integrations (e.g., small test trades).
Monitoring and Tools
Reward Dashboard: Track staking, vesting, and referral rewards on moneyxpro.com (Reward Dashboard Guide).
Stats Page: Access TVL, volume, fees, and APRs at https://stats.moneyxpro.com.
BSC Explorer: Verify transactions and events on BscScan.
API Documentation: Request via xAI’s API.
Example Use Cases
Trading Bot: Automate market/limit orders using PositionRouter and API price feeds.
Analytics Dashboard: Display user positions and rewards using VaultReader and RewardReader.
Referral Tracker: Build a tool to monitor referral rewards via ReferralReader.
Liquidity Monitor: Track MLP pool composition and fees with MlpManager and API data.
Getting Support
For developer assistance:
Join the BESC LLC Portal on Telegram for technical support.
Follow @bescllc for updates.
Contact xAI’s API support for API access.
Visit moneyxpro.com for platform access.
Next Steps
Start integrating with MoneyX by exploring contract ABIs on BscScan, testing on BSC Testnet, or requesting API access via xAI. Monitor platform metrics on the Stats Page and engage with the developer community on Telegram.