Selected API Endpoints for Integrations
Full documentation with API explorer is available at Mach API Explorer.Ingesting Mach Config
Get Configuration
/get_config
Method: GETReturns a JSON object that defines the chains and tokens that Mach supports. All chain IDs, token contracts, swap contracts and necessary information for routing transactions to Mach can be retrieved from this endpoint.
Response Format
Gas Estimation
Get Gas Estimate
/v1/orders/gas
Method: GETEstimates the gas price on the given chain.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| chain | string | Chain identifier (e.g., “avalanche”, “ethereum”) |
Example Request
Example Response
Quote Endpoints
Request Quote
/v1/quotes
Method: POSTReturns a price quote for a cross-chain swap based on the provided parameters.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
| wallet_address | string | User’s wallet address (optional, defaults to zero address) |
| target_address | string | Optional recipient address if different from wallet |
| src_chain | string | Source chain identifier (e.g., “arbitrum”, “optimism”) |
| dst_chain | string | Destination chain identifier |
| src_asset_address | string | Source token contract address |
| dst_asset_address | string | Destination token contract address |
| src_amount | integer | Amount to swap in the smallest unit of the source token |
Example Request
Response Format
Order Endpoints
Submit Order
/v1/orders
Method: POSTAfter receiving a confirmed transaction calling the PlaceTrade function on our Optimistic Swap smart contract, you can send the transaction data to our service to fulfill the order for the user.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
| chain | string | The chain where the transaction was submitted |
| place_taker_tx | string | The transaction hash of the PlaceTrade call |
| referral_code | string | Optional referral code |
Example Request
Example Response
Get User Orders
/v1/orders
Method: GETRetrieve orders that were submitted by a wallet.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| wallet | string | The wallet address to retrieve orders for |
Example Request
Example Response
Get Order Status
/v1/orders/{order_id}
Method: GETRetrieve the current status of an order.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| order_id | string | The ID of the order to retrieve |
Example Request
Example Response
CCTP Endpoints
/v1/orders/cctp
Method: POSTSubmit a Circle Cross-Chain Transfer Protocol (CCTP) transaction.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
| chain | string | Source chain of the CCTP transaction |
| burn_tx | string | Transaction hash of the CCTP burn transaction |
| solana_token_owner_address | string | (Optional) Solana token owner address, if applicable |
Example Request
Example Response
Token Endpoints
/v1/tokens/token_info
Method: GETFetches token information based on the provided blockchain chain and token address.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| chain | string | Blockchain chain identifier |
| token_address | string | Ethereum token contract address |
Example Request
Example Response
/v1/tokens/get_all_tokens_from_db
Method: GETFetches all tokens. If a chain is provided, it fetches tokens for that specific chain.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| chain | string | (Optional) Blockchain chain identifier |
Example Request
Example Response
Points Endpoints
/v1/points
Method: GETReturns the top wallets by points.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| limit | integer | (Optional) Number of top wallets to return (default: 10, max: 100) |
Example Request
Example Response
/v1/points/{wallet}
Method: GETReturns points for a specific wallet address.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| wallet | string | The wallet address to retrieve points for |
Example Request
Example Response
/v1/points/referral_code/{referral_code}
Method: POSTGets information about a referral code.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| referral_code | string | The referral code to look up |
Example Request
Example Response
Twitter Integration Endpoints
/v1/twitter/recent_tweet_id
Method: GETReturns the ID of the most recent tweet for Twitter engagement tasks.
Example Request
Example Response
/v1/twitter/verify_retweet
Method: POSTVerifies if a user has retweeted a specific tweet.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
| wallet | string | The wallet address of the user |
| username | string | The Twitter username |
| tweet_id | string | The ID of the tweet to verify |
Example Request
Example Response
/v1/twitter/submit_user_data
Method: POSTSubmits user data for Twitter integration.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
| wallet | string | The wallet address of the user |
| twitter_handle | string | The Twitter handle |
| telegram_handle | string | (Optional) The Telegram handle |
| string | (Optional) The user’s email |
Example Request
Example Response
Utility Endpoints
/tokenBalances
Method: GETReturns token balances for a wallet address.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| wallet_address | string | Wallet address (supports Ethereum and Solana addresses) |
Example Request
/gas_token_prices
Method: GETReturns current gas token prices.
Example Request
/ping
Method: GETSimple ping endpoint to check if the API is up.
Example Request
Error Handling
The API uses standard HTTP status codes to indicate the success or failure of requests. Common status codes include:| Status Code | Description |
|---|---|
| 200 | OK - The request succeeded |
| 400 | Bad Request - The request could not be processed due to client error |
| 404 | Not Found - The requested resource was not found |
| 422 | Unprocessable Entity - The request was well-formed but could not be processed |
| 500 | Internal Server Error - Something went wrong on the server |