# Introduction to Mosaic

Mosaic envisions a world where anyone can trade their funds freely, reliably, and effortlessly on their own terms. Built natively on Movement and grounded in DeFi principles of open access, Mosaic is a DEX Aggregator and DeFi hub that empowers users with the insights and tools to trade without intermediaries. It offers a fast, secure, and user-friendly platform. No matter your path to financial autonomy, Mosaic has you covered.

Whether you are a developer looking to integrate with our platform, a trader seeking to understand our features, or a new user curious about decentralized exchange, you’ve come to the right place. This documentation provides comprehensive guides, detailed API references, and all the resources you need to effectively utilize Mosaic.

### Jump right in

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>User Guides</strong></td><td></td><td><a href="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2FGJsxyJHMIPLlvN16rswg%2FUser.png?alt=media&amp;token=a32c87d4-501a-4863-a83e-1abcee0abf29">User.png</a></td><td></td><td><a href="/user-guides/quickstart">User Guides</a></td></tr><tr><td>Products</td><td></td><td><a href="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2FAJgh9eD4FzAIRg1IcP8S%2FBanner.png?alt=media&amp;token=450a0154-36cc-45d3-a7c4-f84d3b89de6f">Banner.png</a></td><td></td><td><a href="/products/publish-your-docs">PRODUCTS</a></td></tr><tr><td><strong>Swap Integration</strong></td><td></td><td><a href="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2FrTa414xazDKyynHUWrIp%2FSwap-Integration.png?alt=media&amp;token=4e4a8318-98e2-4a57-bf2b-675dcd1a6e07">Swap-Integration.png</a></td><td></td><td><a href="/swap-integration/api">Swap Integration</a></td></tr><tr><td><strong>Security and License</strong></td><td></td><td><a href="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2F0zI3RDSVcLMA68f8ZoBd%2FSecurity-and-License.png?alt=media&amp;token=a2e26362-b3d5-4c37-8f4f-9b1836de971c">Security-and-License.png</a></td><td></td><td><a href="/security-and-license/audits">SECURITY AND LICENSE</a></td></tr></tbody></table>


# New to Movement? Install your wallet

Currently, Mosaic supports [Razor Wallet](https://razorwallet.xyz/) and [Nightly Wallet](https://nightly.app/), 2 wallets for Movement Network. All transactions on Mosaic are securely executed through Web3 Wallets, allowing you to fully leverage Mosaic's on-chain features without compromising your privacy.

<figure><img src="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2FZJO0xGcrSr0N7Tnmq8te%2Fimage.png?alt=media&amp;token=a8741d4e-3515-4289-8b3d-033ddcf8791d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2FVmfOU8TeAzfH2b3l92YQ%2Fimage.png?alt=media&amp;token=6657e494-cf64-46a0-936c-19295a1cb7f9" alt=""><figcaption></figcaption></figure>


# Swap

### Mosaic Swap: DEX Aggregator on Movement

Mosaic is the default DEX Aggregator on the Movement network, designed to consolidate fragmented liquidity and optimize token swaps. Through its smart routing engine, Mosaic finds the most efficient trade paths across Movement’s top decentralized exchanges and AMM protocols, ensuring users receive the best execution with minimal slippage.

#### Overview

* **Function**: Aggregates on-chain liquidity and routes trades to the most favorable execution path
* **Scope**: Connects with all major DEXs and AMM pools on Movement, including Mosaic’s native pools
* **Interface**: User-facing Swap UI + routing SDK/contract interface for integrators

***

#### Why Use a DEX Aggregator?

DEXs allow users to trade assets directly from wallets via liquidity pools. However, liquidity is often fragmented across multiple DEXs, leading to:

* Higher price impact on single pools
* Poor execution prices, especially for large trades
* Time-consuming manual price comparisons

A DEX aggregator solves this by routing trades through the most efficient combination of pools, hops, and protocols — abstracting complexity while improving outcomes.

***

#### Supported DEXs and Pools

Mosaic currently aggregates liquidity across:

* **Mosaic v2 Pools** (Uniswap v2 model)
* **Mosaic Stable Pools** (Curve-style StableSwap AMM)
* **Yuzu Finance (CLMM)**
* **Meridian**
* **RazorDEX**
* **Interest Protocol**
* **Interest Protocol (CLMM)**
* **WarpGate**
* **Liquidswap**

More integrations will be added as the Movement DeFi ecosystem grows.

***

#### Routing Engine: How It Works

Mosaic’s routing engine runs on-chain and executes each trade atomically. It operates through the following core stages:

**1. Quote Aggregation**

* Queries all integrated DEXs for current prices, liquidity, and slippage on the token pair (or intermediary pairs)
* Builds a real-time snapshot of available liquidity across all pools

**2. Route Construction**

* Constructs possible swap paths (direct and multi-hop)
* Scores each route based on:
  * **Net output** (accounting for slippage)
  * **Gas efficiency**
  * **Hop count**
  * **Liquidity robustness**

**3. Trade Execution**

* A single on-chain transaction executes the chosen path
* Powered by Mosaic’s routing contracts:
  * **Atomic execution**: Trade reverts if any leg fails
  * **Modular architecture**: Easily extensible for new DEXs
  * **Gas-optimized**: Batching, pre-approvals, route compression

***

#### Features

| Feature                     | Description                                                                |
| --------------------------- | -------------------------------------------------------------------------- |
| **Best Price Execution**    | Aggregates across all Movement DEXs to find optimal route                  |
| **Reduced Slippage**        | Splits orders across multiple pools for lower price impact                 |
| **Multi-Hop Support**       | Enables complex routes via intermediary tokens to unlock deeper liquidity  |
| **On-Chain, Non-Custodial** | Fully decentralized swap execution from user wallet                        |
| **Composability**           | Contracts and SDKs can be integrated into wallets, yield optimizers, dApps |

***

#### Upcoming Features

| Feature                 | Description                                                                     |
| ----------------------- | ------------------------------------------------------------------------------- |
| **Limit Orders**        | Allows users to set target prices and execute trades only when conditions match |
| **DCA**                 | Automate periodic token buys with optimized routing per interval                |
| **Cross-Chain Routing** | Future upgrade to bring in liquidity from outside Movement (via bridges)        |

#### Developer & Integrator Use Cases

* **Wallets** can integrate Mosaic’s routing API for better swap outcomes
* **Yield Protocols** can use it to rebalance or auto-swap rewards efficiently
* **New dApps** launching on Movement can instantly access deep liquidity by tapping into Mosaic routes

***

#### Contract Access

Mosaic exposes its router and swap logic via verified smart contracts. Integrators can:

* Query route suggestions via off-chain SDK
* Call router contracts with custom token pairs
* Use routing contracts as backend swap engines in their own interfaces

***

#### Conclusion

Mosaic is the trading backbone of the Movement DeFi stack. Whether you're a trader, builder, or liquidity protocol, Mosaic enables efficient, composable, and trustless trade execution — unlocking the full potential of the Movement ecosystem.

For API keys, SDK usage, and integration support, contact the Mosaic team or visit [the developer portal](/swap-integration/api).


# Liquidity Protocol

Mosaic’s Liquidity Protocol is a dual-model AMM system built to support both uncorrelated and correlated asset pairs. Designed for simplicity, composability, and capital efficiency, it forms the foundation of Mosaic’s DEX and farming infrastructure on the Movement Network.

#### AMM Architecture

**Uncorrelated Pairs (Constant Product Model)**\
Mosaic supports uncorrelated token pairs using the classic Uniswap v2-style constant product formula (x \* y = k). This model allows passive liquidity provision without active management or complex range settings.

* **Benefits**: Simple LP experience, broad price coverage, proven market model
* **Drawbacks**: Lower capital efficiency, liquidity is spread across the entire price curve, requiring higher TVL to match the depth and slippage performance of concentrated models.

**Correlated Pairs (StableSwap Model)**

For stablecoin pairs and tightly correlated assets (e.g., LSTs), Mosaic implements a **Curve-like StableSwap AMM**. This model reduces slippage in the narrow price ranges where such assets typically trade, making it ideal for efficient swaps between like-valued tokens.

* **Benefits**: Low slippage, improved capital efficiency, ideal for stable or pegged assets
* **Drawbacks**: Not optimal for volatile pairs

Together, these two models create a flexible liquidity layer that adapts to various market needs and asset dynamics on Movement.

***

#### Farming Protocol

Mosaic’s farming module incentivizes LP participation through reward emissions on selected pools. By staking LP tokens, users can earn additional yield in the form of MOVE or other ecosystem incentives.

* **Eligibility**: Only supported pools listed on Mosaic’s farming dashboard
* **Mechanism**: LP tokens are staked into a farming contract, and rewards accumulate over time based on TVL and allocation points
* **Harvesting**: Users can claim rewards at any time, with no lockups or penalties unless otherwise specified

This reward mechanism is designed to bootstrap liquidity and drive deeper market depth across Mosaic’s ecosystem of trading pairs.

***

#### Why Mosaic on Movement?

Mosaic is purpose-built for the Movement Network, inheriting its core advantages:

* **Low Fees**: Movement’s architecture enables near-zero transaction costs, maximizing LP and trader value
* **Non-Custodial & Secure**: All interactions are fully on-chain and self-custodied
* **Composable Ecosystem**: Mosaic’s AMM and farming contracts are modular, enabling future integrations with aggregators, lending protocols, and yield strategies


# API

This section will walk you through the required steps to get quote and submit a swap using Mosaic Aggregator.

## Swagger <a href="#swagger" id="swagger"></a>

{% openapi src="/files/tN2c0XH9icoXTz2KjluX" path="/v1/quote" method="get" %}
[mosaic-api.yaml](https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2Fgit-blob-ec8d66f05c7703d3f56c6d028a3841287c62271b%2Fmosaic-api.yaml?alt=media)
{% endopenapi %}

{% openapi src="/files/tN2c0XH9icoXTz2KjluX" path="/v1/tokens" method="get" %}
[mosaic-api.yaml](https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2Fgit-blob-ec8d66f05c7703d3f56c6d028a3841287c62271b%2Fmosaic-api.yaml?alt=media)
{% endopenapi %}

## Setup Authentication

{% hint style="info" %}
**All requests to Mosaic’s API must include an `X-API-Key` header for authentication. The API key is used to track your usage and ensure secure access. To obtain an API key, please contact the Mosaic team via** [***Discord***](https://discord.gg/mosaicagg) ***or*** [***Telegram***](http://t.me/mosaicaggchat)***.***
{% endhint %}

## Get quote

To retrieve the best swap rate, send the following HTTP request to get a quote:

```bash
curl 'https://api.mosaic.ag/v1/quote?srcAsset=0x1%3A%3Aaptos_coin%3A%3AAptosCoin&dstAsset=0x275f508689de8756169d1ee02d889c777de1cebda3a7bbcce63ba8a27c563c6f%3A%3Atokens%3A%3AUSDC&amount=1000000000&sender=0x0000000000000000000000000000000000000000000000000000000000000000&slippage=10' \
--header 'x-api-key: xxx'
```

This will return the best available quote for swapping the source asset (AptosCoin) into the destination asset (USDC) based on current market conditions.

Here is a detailed guide using Typescript:

### 1. Setup Environment

Import the required libraries and initialize your connection to the Aptos testnet using the `AptosConfig` and `Aptos` objects from the `@aptos-labs/ts-sdk`. This sets up your environment for making requests to the Mosaic Aggregator API and interacting with Aptos.

```javascript
import {
  Account,
  Aptos,
  APTOS_COIN,
  AptosConfig,
  Ed25519PrivateKey,
} from "@aptos-labs/ts-sdk";
import axios from "axios";

// Initialize Aptos config to connect to the testnet
const aptos = new Aptos(
  new AptosConfig({
    fullnode: "https://aptos.testnet.suzuka.movementlabs.xyz/v1",
  })
);
```

### 2. Setup User Account

Here, you will create an Aptos account using the user's private key. You need to fill in your own private key when initializing the account.

```javascript
// Create user account from private key
const user = Account.fromPrivateKey({
  privateKey: new Ed25519PrivateKey(), // TODO: Fill your private key here.
});
```

### 3. Define Assets and Amount

Specify the assets to swap and the amount (in APTOS decimals):

```javascript
const srcAsset = APTOS_COIN; // Source: APTOS Coin
const dstAsset =
  "0x275f508689de8756169d1ee02d889c777de1cebda3a7bbcce63ba8a27c563c6f::tokens::USDC"; // Destination: USDC
const amount = 1_00000000; // Amount: 1 APT (APTOS uses 8 decimals)
```

### 4. Get a Quote from Mosaic Aggregator API

Retrieve the best swap rate by making a GET request to the Mosaic API.

```javascript
// Get a quote from Mosaic Aggregator API
const mosaicResponse = await axios({
  method: "GET",
  url: "https://api.mosaic.ag/v1/quote",
  params: {
    srcAsset,
    dstAsset,
    amount,
    sender: user.accountAddress.toString(),
    slippage: 100, // 100 = 1%
  },
  headers: {
    "X-API-KEY": "xxx", // TODO: Fill the API key in here.
  },
});
```

### 5. Build the transaction

Once you have the quote, you use the returned data (function, type arguments, and function arguments) to build a transaction that will perform the swap.

```javascript
// Build the transaction based on the Mosaic response
const transaction = await aptos.transaction.build.simple({
  sender: user.accountAddress,
  data: {
    function: mosaicResponse.data.data.tx.function,
    typeArguments: mosaicResponse.data.data.tx.typeArguments,
    functionArguments: mosaicResponse.data.data.tx.functionArguments,
  },
});
```

### 6. Sign and submit the transaction

After building the transaction, you sign it using the user's private key and submit the transaction to the Aptos blockchain. The transaction hash will be logged, which can be used to check the transaction status on the explorer.

```javascript
// Sign and submit the transaction
const pendingTransactionResponse =
  await aptos.transaction.signAndSubmitTransaction({
    signer: user,
    transaction: transaction,
  });

// Output transaction URL to the console
console.log(
  `Tx = https://explorer.movementnetwork.xyz/txn/${pendingTransactionResponse.hash}?network=testnet`
);
```

*By following this guide, you will be able to integrate the Mosaic Aggregator API for performing token swaps on the Aptos network. For further assistance or inquiries, feel free to reach out to the Mosaic support team on* [*Discord*](https://discord.gg/mosaicagg) *or* [*Telegram*](http://t.me/mosaicaggchat)*.*\
\\


# Swap Widget

This guide walks you through the steps to embed the swap widget in your website in a few minutes.

The Swap Widget bundles the whole swapping experience into a single React component that developers can easily embed in their app with a few lines of code.

[Here](https://swap-widget-demo.vercel.app/) is a live preview of the swap widget.

<div data-full-width="false"><figure><img src="https://swap-widget-demo.vercel.app/widget.png" alt="" width="500"><figcaption></figcaption></figure></div>

### Installing the Widgets Library

Install the widgets library via `npm` ,`pnpm` or `yarn`.

```js
yarn add @mosaicag/swap-widget
```

or

```js
npm i --save @mosaicag/swap-widget
```

### Adding the Swap Widget to Your App

* Register for an new `API key` with the Mosaic Team, [see here](https://docs.mosaic.ag/swap-integration/integration-partners#note-api-key-requirement)
* Import `@mosaicag/swap-widget/style.css` in the root component in react, (ex: main.tsx/App.tsx)

```js
import '@mosaicag/swap-widget/style.css' 
import SwapWidget from '@mosaicag/swap-widget'

function App() {
  <div className="Mosaic">
    ...
    <SwapWidget wallet={wallet} apiKey='...'/>
    ...
  </div>
}
```

### Wallet Interaction

* A lot of wallets are coming to Movement. You are free to use any wallet you want.
* The swap widget uses a `wallet` prop to allow users to sign and submit transactions ([details here](https://www.npmjs.com/package/@mosaicag/swap-widget))

### Customize theme

```js
<SwapWidget 
  wallet={wallet}
  apiKey="your api key"
  theme={{
    background: 'white',
    baseContent: 'black',
    border: 'gray',
    error: '#f6465d',
    neutralContent: 'black',
    primary: 'rgb(49, 203, 158)',
    secondary: 'rgba(49, 203, 158, 0.3)',
    secondaryBackground: '#f3f5fa'
  }}
/>

```

<figure><img src="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2Fgit-blob-6c80a8f26de06dda9ff94e29c579dbfadd50040c%2Ftheme1.jpg?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2Fgit-blob-3778cc5ef5b5988ae61dbe645e73440c2261cb77%2Ftheme2.jpg?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2Fgit-blob-e6e2dc09b12ecad5b4218660bd1edc6691f488ab%2Ftheme3.jpg?alt=media" alt=""><figcaption></figcaption></figure>

### [List of configurations](https://www.npmjs.com/package/@mosaicag/swap-widget)

### [Demo & example](https://swap-widget-demo.vercel.app/)

### Feature request & Report issue

* Feel free to contact us to request new config/report bug if you think it might be helpful.
* Please reach out to us via Discord or email us directly at **<huy@mosaic.ag>** for assistance and further details.


# Iframe

This guide walks you through the steps to embed the Mosaic iframe in your website in a few minutes.

Mosaic can be used within other sites as an iframe. An iframe shows an exact version of the Mosaic frontend site and can have custom prefilled settings.

One benefit of an iframe integration is that the your site will automatically keep up with any improvements/additions to the site. After the initital integration is setup no further work is needed to pull in updates as the exchange site is updated over time.

<figure><img src="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2Fgit-blob-831a0c2bfe715d78a2957d541b59d107f2886283%2Fiframe.jpg?alt=media" alt=""><figcaption></figcaption></figure>

## Url format:

```js
https://app.mosaic.ag/swap/tokenA-tokenB?param1=value1&param2=value2&...
```

* tokenA, tokenB: fa address (recommended) or coinType, ex: `0xe161897670a0ee5a0e3c79c3b894a0c46e4ba54c6d2ca32e285ab4b01eb74b66` or `0x275f508689de8756169d1ee02d889c777de1cebda3a7bbcce63ba8a27c563c6f::tokens::USDT`

### Parameters

| **Params**  | **Required** | **Description**                                                                                        | **Default Value** |
| ----------- | ------------ | ------------------------------------------------------------------------------------------------------ | ----------------- |
| apiKey      | Yes          | Register to get a new one, [detail here](https://docs.mosaic.ag/swap-integration/integration-partners) |                   |
| amount      | No           | Default input amount                                                                                   | 1                 |
| isFeeIn     | No           | Charge fee by token in, default is token out                                                           | false             |
| feeInBps    | No           | Fee amount to be collected. (i.e. feeAmount = 10 then fee = 0.1%)                                      |                   |
| feeReceiver | No           | Fee receiver address                                                                                   |                   |

### Adding the iFrame to your site

Example code:

```js
    <iframe
      style={{ margin: 'auto' }}
      width="500px"
      height="800px"
      src="https://app.mosaic.ag/swap/0xa-0xe161897670a0ee5a0e3c79c3b894a0c46e4ba54c6d2ca32e285ab4b01eb74b66?amount=2&isFeeIn=true&feeInBps=30&feeReceiver=0xb9309aedd0dca69145c51003e32d097b9f8795d0045e26d9bc924dd4c199ec92&apiKey=key"
    />
```

### Feature request & Report issue

* Feel free to contact us to request new config/report bug if you think it might be helpful.
* Please reach out to us via Discord or email us directly at **<huy@mosaic.ag>** for assistance and further details.


# Typescript SDK

### <https://www.npmjs.com/package/@mosaic-ag/ts-sdk>

### 1. Importing Required Modules

First, we need to import the necessary modules and dependencies for the Aptos Movement blockchain transactions and swap data retrieval:

```javascript
import { getSwapData } from '@mosaic-ag/ts-sdk';
import { Aptos, AptosConfig, Network, APTOS_COIN, Ed25519PublicKey, Ed25519PrivateKey, Account } from '@aptos-labs/ts-sdk';
import invariant from 'tiny-invariant';
```

#### 2. Setting Up Constants

Next, define the constants that will be used throughout the script. These include wallet addresses, keys, and asset identifiers:

```javascript
export const TEST_WALLET_ADDRESS = ''; // change me
export const TEST_PRIVATE_KEY = ''; // change me
export const TEST_PUBLIC_KEY = ''; // change me
export const USDC = '0x275f508689de8756169d1ee02d889c777de1cebda3a7bbcce63ba8a27c563c6f::tokens::USDC';
export const SLIPPAGE_BPS = 50;
```

#### 3. Configuring Aptos Movement

Set up the configuration for the Aptos Movement blockchain network:

```javascript
const aptosConfig = new AptosConfig({ network: Network.CUSTOM, fullnode: "https://aptos.testnet.suzuka.movementlabs.xyz/v1" })
export const aptos = new Aptos(aptosConfig);
```

#### 4. Retrieving Swap Data

Retrieve the necessary swap data for the transaction using the `getSwapData` function:

```javascript
const swapData = await getSwapData({
  tokenIn: APTOS_COIN,
  tokenOut: USDC,
  amountIn: '1000000',
  slippageBps: 50, // 0.5%
  feeRecipient: '0x24570782d195e458b6e67c52e373ad1c54e18b4ac41e7b4cd2cddec255e42ffb',
  feeBps: 50, // 0.5%
  chargeFeeBy: 'token_in', // token_in
});
```

#### 5. Building the Transaction

Build a simple transaction with the swap data retrieved:

```javascript
const transaction = await aptos.transaction.build.simple({
  sender: TEST_WALLET_ADDRESS,
  data: {
    function: swapData.function,
    functionArguments: swapData.functionArguments,
    typeArguments: swapData.typeArguments,
  },
});
```

#### 6. Simulating the Transaction

Simulate the transaction to ensure it will succeed:

```javascript
const simulateResponse = await aptos.transaction.simulate.simple({
  signerPublicKey: new Ed25519PublicKey(TEST_PUBLIC_KEY),
  transaction,
});

invariant(simulateResponse.length === 1, `unexpected error, simulateResponse = ${JSON.stringify(simulateResponse)}`);
invariant(simulateResponse[0].success, 'simulate failed');
```

#### 7. Signing and Submitting the Transaction

Sign and submit the transaction using the private key:

```javascript
const pendingTxResponse = await aptos.transaction.signAndSubmitTransaction({
  signer: Account.fromPrivateKey({ privateKey: new Ed25519PrivateKey(TEST_PRIVATE_KEY) }),
  transaction,
});
```

#### 8. Waiting for Transaction Confirmation

Wait for the transaction to be confirmed on the blockchain:

```javascript
const committedTxResponse = await aptos.transaction.waitForTransaction({ transactionHash: pendingTxResponse.hash });
invariant(committedTxResponse.success, 'transaction failed');
```

#### 9. Logging the Transaction Result

Finally, log the success message with the transaction details:

```javascript
console.log(`Success. https://explorer.movementnetwork.xyz/txn/${committedTxResponse.version}?network=testnet`);
```

Each block of code corresponds to a specific step in the process of setting up, building, simulating, signing, submitting, and confirming a transaction on the Aptos blockchain. This structure helps in understanding the flow and individual responsibilities of each part of the script.


# Integration Partners

For API and Widget Integration inquiries, please contact huy\@mosaic.ag for further details.

### **Fee Structure:**

Mosaic operates with no default protocol fees. However, integration partners have the option to charge a fee on swaps facilitated through their integration. If a platform fee is applied, Mosaic retains **15% of the platform fee** charged by the integrators by default.

<div data-full-width="false"><figure><img src="https://2052832733-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8Xc6SWICSNHJsYKexJR%2Fuploads%2Fbb8h0t4cQdw1754o10NO%2Fimage.png?alt=media&amp;token=d9215c3c-1fab-47ca-90ef-a101c64340fc" alt="" width="563"><figcaption></figcaption></figure></div>

|                 | Integration Partner | Mosaic  |
| --------------- | ------------------- | ------- |
| **Swap**        | **85%**             | **15%** |
| **Limit Order** | TBD                 | TBD     |

{% hint style="info" %}

### [**Note: API Key Requirement**](/swap-integration/api)

To access Mosaic APIs, integration partners must obtain an API key provided by the Mosaic team. Please reach out to us via Discord or email us directly at **<huy@mosaic.ag>** for assistance and further details.
{% endhint %}

### **Fee Claiming Process:**

For partners opting to use the Fee Claimer feature, fees can be claimed through the **Mosaic Fee Claim Portal**. Fees will be credited to the wallet address specified in the API call under the `partnerAddress` parameter.

*For more information about API parameters setup, please refer to the* [*Mosaic Swap Integration API*](/swap-integration/api)


# Page


# Protocol Fees

Starting on Oct 15, 2025, swaps on Mosaic include a tiny protocol fee. The fee is set by the Mosaic aggregator and is tiered by pair type. Fees can be taken from either the input token (“token in”) or the output token (“token out”), depending on the route.

### What changes

* A small protocol fee applies to each successful swap on Mosaic.
* Fees are **tiered by pair type** and **fixed by the aggregator**.
* The router continues to optimize for the best executable price after fees.

### How the fee is applied

Mosaic may collect the fee from:

1. **Token in**: a small portion of the input amount is taken before execution, and the remainder is swapped.
2. **Token out**: the full input is swapped, then a small portion of the received output is taken.

The router chooses the collection method that preserves the best executable quote for the user and avoids dust issues.

### Protocol fee tiers

| Pair type        | Fee tier | Fee tier (bps) |
| ---------------- | -------- | -------------- |
| Stable           | 0.01%    | 1              |
| Correlated pairs | 0.03%    | 3              |
| Common pairs     | 0.05%    | 5              |
| Others           | 0.1%     | 10             |

## List of tokens:

### Stables:

<table><thead><tr><th width="98.96875">Token</th><th>Address</th></tr></thead><tbody><tr><td>USDT.e</td><td>0x447721a30109c662dde9c73a0c2c9c9c459fb5e5a9c92f03c50fa69737f5d08d</td></tr><tr><td>USDC.e</td><td>0x83121c9f9b0527d1f056e21a950d6bf3b9e9e2e8353d0e95ccea726713cbea39</td></tr><tr><td>USDa</td><td>0x48b904a97eafd065ced05168ec44638a63e1e3bcaec49699f6b8dabbd1424650</td></tr><tr><td>USDe</td><td>0x9d146a4c9472a7e7b0dbc72da0eafb02b54173a956ef22a9fba29756f8661c6c</td></tr></tbody></table>

### Correlated:

#### BTC

<table><thead><tr><th width="101.0546875">Token</th><th>Address</th></tr></thead><tbody><tr><td>WBTC.e</td><td>0xb06f29f24dde9c6daeec1f930f14a441a8d6c0fbea590725e88b340af3e1939c</td></tr><tr><td>solvBTC</td><td>0x527c43638a6c389a9ad702e7085f31c48223624d5102a5207dfab861f482c46d</td></tr><tr><td>LBTC</td><td>0x0658f4ef6f76c8eeffdc06a30946f3f06723a7f9532e2413312b2a612183759c</td></tr><tr><td>stBTC</td><td>0x95c0fd13373299ada1b9f09ff62473ab8b3908e6a30011730210c141dffdc990</td></tr><tr><td>enzoBTC</td><td>0xff91f0df99b217436229b85ae900a2b67970eda92a88b06eb305949ec9828ed6</td></tr></tbody></table>

#### ETH

<table><thead><tr><th width="104.2734375">Token</th><th>Address</th></tr></thead><tbody><tr><td>WETH.e</td><td>0x908828f4fb0213d4034c3ded1630bbd904e8a3a6bf3c63270887f0b06653a376</td></tr><tr><td>ezETH</td><td>0x2f6af255328fe11b88d840d1e367e946ccd16bd7ebddd6ee7e2ef9f7ae0c53ef</td></tr><tr><td>rsETH</td><td>0x51ffc9885233adf3dd411078cad57535ed1982013dc82d9d6c433a55f2e0035d</td></tr><tr><td>weETH</td><td>0xe956f5062c3b9cba00e82dc775d29acf739ffa1e612e619062423b58afdbf035</td></tr></tbody></table>

### Common

Pairs of MOVE with

<table><thead><tr><th width="101.51171875">Token</th><th>Address</th></tr></thead><tbody><tr><td>USDT.e</td><td>0x447721a30109c662dde9c73a0c2c9c9c459fb5e5a9c92f03c50fa69737f5d08d</td></tr><tr><td>USDC.e</td><td>0x83121c9f9b0527d1f056e21a950d6bf3b9e9e2e8353d0e95ccea726713cbea39</td></tr><tr><td>USDa</td><td>0x48b904a97eafd065ced05168ec44638a63e1e3bcaec49699f6b8dabbd1424650</td></tr><tr><td>USDe</td><td>0x9d146a4c9472a7e7b0dbc72da0eafb02b54173a956ef22a9fba29756f8661c6c</td></tr><tr><td>WBTC.e</td><td>0xb06f29f24dde9c6daeec1f930f14a441a8d6c0fbea590725e88b340af3e1939c</td></tr><tr><td>WETH.e</td><td>0x908828f4fb0213d4034c3ded1630bbd904e8a3a6bf3c63270887f0b06653a376</td></tr></tbody></table>


# Audits

The contracts on Mosaic have been audited by [MoveBit](https://www.movebit.xyz/).&#x20;

Please find the full audit report [here](https://github.com/MosaicAG/mosaic-audits).


# Terms of Use

Terms of Use Welcome to Mosaic, your trusted Dex Aggregator on the Movement blockchain platform. These Terms of Use ("Terms") govern your access to and use of our platform, services, and technology (collectively, the "Service"), which are provided by Mosaic Labs ("Mosaic," "we," "us," or "our").&#x20;

### Acceptance of Terms&#x20;

By accessing or using the Service, you confirm that you have read, understood, and agree to be bound by these Terms and our Privacy Policy, which is incorporated herein by reference. If you are using the Service on behalf of an organization, you represent that you have the authority to bind that organization to these Terms, in which case "you" and "your" will refer to that organization.&#x20;

### Eligibility&#x20;

The Service is intended solely for users who are eighteen (18) years of age or older. By using the Service, you represent and warrant that you meet this minimum age requirement.&#x20;

### Use of the Service

You agree to use the Service only for lawful purposes and in accordance with these Terms. Specifically, you agree not to:

1. Use the Service in any manner that could disable, overburden, damage, or impair the Service or interfere with any other party's use of the Service, including their ability to engage in real-time activities through the Service.
2. Use any robot, spider, or other automatic devices, process, or means to access the Service for any purpose, including monitoring or copying any of the material on the Service.
3. Use any manual process to monitor or copy any of the material on the Service or for any other unauthorized purpose without our prior written consent.
4. Use any device, software, or routine that interferes with the proper working of the Service.
5. Introduce any viruses, trojan horses, worms, logic bombs, or other material that is malicious or technologically harmful. Terms of Use 1
6. Attempt to gain unauthorized access to, interfere with, damage, or disrupt any parts of the Service, the server on which the Service is stored, or any server, computer, or database connected to the Service.
7. Attack the Service via a denial-of-service attack or a distributed denial-of- service attack.
8. Take any action that may damage or falsify Mosaic's rating.
9. Otherwise attempt to interfere with the proper working of the Service.

### Intellectual Property Rights

The Service and its original content, features, and functionality are and will remain the exclusive property of Mosaic and its licensors. Our trademarks and trade dress may not be used in connection with any product or service without the prior written consent of Mosaic.&#x20;

### Your Responsibilities

You are responsible for making all arrangements necessary for you to have access to the Service and ensuring that all persons who access the Service through your internet connection are aware of these Terms and comply with them.&#x20;

### Changes to the Service&#x20;

We reserve the right to withdraw or amend the Service, and any service or material we provide via the Service, in our sole discretion without notice. We will not be liable if, for any reason, all or any part of the Service is unavailable at any time or for any period.&#x20;

### Disclaimer of Warranties&#x20;

The Service is provided on an "as is" and "as available" basis, without any warranties of any kind, either express or implied. Neither Mosaic nor any person associated with Mosaic makes any warranty or representation with respect to the completeness, security, reliability, quality, accuracy, or availability of the Service.&#x20;

### Limitation of Liability&#x20;

In no event will Mosaic, its affiliates, or their licensors, service providers, employees, agents, officers, or directors be liable for damages of any kind, under any legal theory, arising out of or in connection with your use, or inability to use, the Service, any websites linked to it, any content on the Service or such other websites, including any direct, indirect, special, incidental, Terms of Use 2 consequential, or punitive damages, including but not limited to, personal injury, pain and suffering, emotional distress, loss of revenue, loss of profits, loss of business or anticipated savings, loss of use, loss of goodwill, loss of data, and whether caused by tort (including negligence), breach of contract, or otherwise, even if foreseeable. The foregoing does not affect any liability that cannot be excluded or limited under applicable law.&#x20;

### Arbitration and Dispute Resolution&#x20;

You agree to resolve any disputes arising from these Terms or the Service through final and binding arbitration, except as set forth under Exceptions to Agreement to Arbitrate below. The arbitration will be conducted in the English language in accordance with the Arbitration Rules and Procedures established by London Court of International Arbitration (LCIA) then in effect.&#x20;

### Exceptions to Agreement to Arbitrate

You may assert claims, if they qualify, in small claims court in London. Additionally, we both agree that either party may bring suit in court to enjoin infringement or other misuse of intellectual property rights.&#x20;

### Governing Law&#x20;

These Terms shall be governed and construed in accordance with the laws of United States without regard to its conflict of law provisions. Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights.&#x20;

### Changes to Terms&#x20;

We reserve the right, at our sole discretion, to modify or replace these Terms at any time. If a revision is material, we will provide at least \[30 days'] notice prior to any new terms taking effect. What constitutes a material change will be determined at our sole discretion.&#x20;

## Contact Us&#x20;

If you have any questions about these Terms, please contact us at <huy@mosaic.ag>


# Privacy Policy

### Privacy Policy&#x20;

Welcome to Mosaic, the premier Dex Aggregator on the Movement blockchain. Your privacy is critically important to us. This Privacy Policy outlines how we handle your personal information on our platform accessible at mosaic.ag.&#x20;

### Who We Are&#x20;

Mosaic is operated by Mosaic Labs. We are responsible for the processing of your personal data as outlined in this policy. Should you have any questions about our privacy practices, please contact us at <huy@mosaic.ag>

### Privacy at Mosaic&#x20;

Our platform is designed with your privacy in mind. We collect the least amount of personal data necessary for improving our services and providing a seamless user experience.

1. Personal Data We Collect:
   1. **Basic Interaction Data:** Includes IP addresses, device information, browser type, and logs that help us diagnose problems and optimize your experience.&#x20;
   2. **Blockchain Data:** We access public blockchain data such as wallet addresses and transactions to understand and improve user interactions with our platform. This data is processed collectively and is never used to identify individuals.&#x20;
   3. **Analytics Information:** We use tools like Google Analytics to gather data about how you use the platform, which helps us make informed enhancements.
2. How We Use Your Data
   1. To Improve Services: We analyze user interaction to enhance the usability and features of Mosaic.
   2. For Security: We monitor data to prevent fraud and address security issues.&#x20;
   3. Compliance and Enforcement: We use data to comply with legal obligations and enforce our agreements. Privacy and policy 1
3. Cookies and Tracking&#x20;

We use cookies to improve your experience, understand platform usage, and enhance site navigation and security. You can control cookie settings through your browser.

4. Data Sharing and Disclosure&#x20;

We only share your data with third parties when necessary for service provision, legal compliance, or with your explicit consent. Our third-party service providers are bound by confidentiality agreements and do not have permission to use your personal data for their own purposes.

5. Anti-Money Laundering (AML) Policy&#x20;

Mosaic, as a decentralized platform, is committed to maintaining high standards of compliance with anti-money laundering regulations where feasible. Recognizing the limitations inherent in a decentralized system, we focus on indirect measures to mitigate money laundering risks.&#x20;

#### AML Measures

1. Transaction Monitoring: We deploy algorithmic tools to analyze transaction patterns across the network that may suggest suspicious activity.
2. Smart Contract Audits: All smart contracts are rigorously audited by third- party security firms to prevent vulnerabilities that could facilitate illegal activities.
3. User Education: We provide guidance to our users on the importance of using Mosaic for legitimate transactions and the legal repercussions of illicit activities.
4. Community Reporting: Users are encouraged to report suspicious activities. While Mosaic  cannot freeze transactions or access user wallets, we take such reports seriously and investigate them to the best of our ability.&#x20;

#### Limitations Acknowledgment&#x20;

Due to the decentralized nature of blockchain, our ability to directly enforce AML protocols is limited. However, we are dedicated to upholding the principles of AML compliance by discouraging and mitigating risks through the measures listed above.

6. Data Security&#x20;

Privacy and policy 2 We implement industry-standard security measures to protect your data. However, no system can be entirely secure, and we cannot guarantee absolute security.

6. Your Rights&#x20;

You have the right to access, correct, or delete your personal data. Please contact us if you wish to make such a request.

6. Changes to This Policy&#x20;

We may update this policy periodically. We will notify you of significant changes and encourage you to review the policy regularly.

6. Contact Us&#x20;

For more information about our privacy practices, or if you have questions or concerns, please contact us via email at <huy@mosaic.ag>


# Links

Website: [https://mosaic.ag/ ](https://mosaic.ag/)

App: <https://app.mosaic.ag/>

Discord: <https://discord.gg/mosaicagg>

Twitter: <https://x.com/mosaicagg>

Substack: <https://mosaicag.substack.com/>

[Media Kit](https://drive.google.com/drive/folders/1ieuNerdB1YdzNqWfxLYS2bWyyxc_OUYN?usp=sharing)


