# Deploy Token (v4.0.0)

<mark style="color:green;">`POST`</mark> `https://www.clanker.world/api/tokens/deploy`&#x20;

#### **Headers**

| Name         | Value              |
| ------------ | ------------------ |
| x-api-key    | `your_api_key`     |
| Content-Type | `application/json` |

#### **Body**

<table><thead><tr><th width="284.203125">Parameter</th><th width="118.25390625">Type</th><th width="110.046875">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>token.name</code></td><td>string</td><td>Required</td><td>The name of your token</td></tr><tr><td><code>token.symbol</code></td><td>string</td><td>Required</td><td>Token symbol (usually 3-5 characters)</td></tr><tr><td><code>token.image</code></td><td>string</td><td>Optional</td><td>URL to the token's image</td></tr><tr><td><code>token.tokenAdmin</code></td><td>0x${string}</td><td>Required</td><td>Token admin address with control over vaulted tokens and updating token metadata</td></tr><tr><td><code>token.description</code></td><td>string</td><td>Optional</td><td>Description of token for creators to provide</td></tr><tr><td><code>token.socialMediaUrls</code></td><td>array of <code>{ platform: string, url: string }</code></td><td>Optional</td><td>URLs for external pages related to the token</td></tr><tr><td><code>token.auditUrls</code></td><td>array</td><td>Optional</td><td>Links to any audits, reports, etc.</td></tr><tr><td><code>token.requestKey</code></td><td>string</td><td>Required</td><td>Unique 32 character unique request identifier</td></tr><tr><td><code>rewards</code></td><td>array</td><td>Required</td><td>Array of reward configuration objects (at least one required)</td></tr><tr><td><code>rewards.admin</code></td><td>0x${string}</td><td>Required</td><td>Address that can change the paired recipient</td></tr><tr><td><code>rewards.recipient</code></td><td>0x${string}</td><td>Required</td><td>Address that will receive the rewards once claimed</td></tr><tr><td><code>rewards.allocation</code></td><td>number</td><td>Required</td><td>Percentage of rewards (total across all recipients should sum to 100)</td></tr><tr><td><code>rewards.rewardsToken</code></td><td>string</td><td>Optional</td><td>Token(s) in which the recipient will accrue rewards. Either "Both", "Clanker", or "Paired"</td></tr><tr><td><code>pool.type</code></td><td>strings</td><td>Optional</td><td>Either "standard" or "project"</td></tr><tr><td><code>pool.pairedToken</code></td><td>0x${string}</td><td>Optional</td><td>Token address to pair the new token with (typically WETH). Only for standard <code>pool.type</code></td></tr><tr><td><code>pool.initialMarketCap</code></td><td>number</td><td>Optional</td><td>Starting market cap denominated in pairedToken. Only for standard <code>pool.type</code></td></tr><tr><td><code>fees.type</code></td><td>string</td><td>Optional</td><td>Fee type: either "static" or "dynamic"</td></tr><tr><td><code>fees.clankerFee</code></td><td>number</td><td>Optional</td><td>Fee percentage on Clanker token inputs, max 5 (5%). Only for static <code>fees.type</code></td></tr><tr><td><code>fees.pairedFee</code></td><td>number</td><td>Optional</td><td>Fee percentage on pairedToken inputs, max 5 (5%). Only for static <code>fees.type</code></td></tr><tr><td><code>fees.baseFee</code></td><td>number</td><td>Optional</td><td>Base fee charged on every swap, minimum 0.25 (0.25%). Only for dynamic <code>fees.type</code></td></tr><tr><td><code>fees.maxLpFee</code></td><td>number</td><td>Optional</td><td>Maximum LP fee including base + variable fee, maximum 5 (5%). Only for dynamic <code>fees.type</code></td></tr><tr><td><code>vault.percentage</code></td><td>number</td><td>Optional</td><td>Percentage of tokens to vault (max 90% total across all extensions)</td></tr><tr><td><code>vault.lockupDuration</code></td><td>number</td><td>Conditional</td><td>Lockup duration in days, minimum 7. Required if <code>vault.percentage</code> is provided</td></tr><tr><td><code>vault.vestingDuration</code></td><td>number</td><td>Conditional</td><td>Vesting duration in days, can be 0 for instant vesting. Required if <code>vault.percentage</code> is provided</td></tr><tr><td><code>airdrop.entries</code></td><td><p>array of  <br><code>{ account: 0x...,</code></p><p><code>amount: number }</code></p></td><td>Conditional</td><td>Airdrop participants list of address and amount of tokens allocated</td></tr><tr><td><code>airdrop.lockupDuration</code></td><td>number</td><td>Conditional</td><td>Amount of days until the airdrop is claimable, minimum of 1 day</td></tr><tr><td><code>airdrop.vestingDuration</code></td><td>number</td><td>Conditional</td><td>Amount of days for the airdrop to to fully vest on a linear schedule </td></tr><tr><td><code>chainId</code></td><td>number</td><td>optional</td><td>chain to deploy the clanker token on. Options:<br>8453: Base (default)<br>130: Unichain<br>42161: Arbitrum One</td></tr></tbody></table>

#### **Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "message": "Token deployment enqueued. Expected address: [contract_address]",
  "expectedAddress": "[contract_address]",
  "success": true
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "data": [
    {
      "code": "validation_error",
      "path": ["field_name"],
      "message": "Description of the validation error"
    }
  ],
  "error": "Invalid input. See data for details."
}
```

{% endtab %}
{% endtabs %}

#### **Example Request**

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST 'https://www.clanker.world/api/tokens/deploy/v4' \
-H 'Content-Type: application/json' \
-H 'x-api-key: your_api_key_here' \
-d '{
  "token": {
    "name": "DemoToken",
    "symbol": "DEMO",
    "image": "https://example.com/demo-token-logo.png",
    "tokenAdmin": "0x742d35Cc6634C0532925a3b8D4C9db7cd4b5b31D",
    "description": "Clanker v4.0.0",
    "socialMediaUrls": [
      "https://x.com/demotoken",
      "https://t.me/demotoken"
    ],
    "auditUrls": [
      "https://example.com/audit-report-1.pdf",
      "https://example.com/security-review.pdf"
    ],
    "requestKey": "abcdef1234567890abcdef1234567890"
  },
  "rewards": [
    {
      "admin": "0x742d35Cc6634C0532925a3b8D4C9db7cd4b5b31D",
      "recipient": "0x742d35Cc6634C0532925a3b8D4C9db7cd4b5b31D",
      "allocation": 50,
      "rewardsToken": "Both"
    },
    {
      "admin": "0x8ba1f109551bD432803012645Hac136c3c89d97c",
      "recipient": "0x8ba1f109551bD432803012645Hac136c3c89d97c",
      "allocation": 30,
      "rewardsToken": "Clanker"
    },
    {
      "admin": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
      "recipient": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
      "allocation": 20,
      "rewardsToken": "Paired"
    }
  ],
  "pool": {
    "type": "standard",
    "pairedToken": "0x4200000000000000000000000000000000000006",
    "initialMarketCap": 10
  },
  "fees": {
    "type": "static",
    "clankerFee": 1,
    "pairedFee": 1
  },
  "vault": {
    "percentage": 15,
    "lockupDuration": 30,
    "vestingDuration": 0
  },
  "airdrop": {
    "entries": [
      {
        "account": "0xD98124a9Fb88fC61E84575448C853d530a872674",
        "amount": 250000000
      }
    ],
    "lockupDuration": 30,
    "vestingDuration": 30
  },
  "chainId": 8453
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const deployToken = async () => {
 try {
   const response = await fetch('https://www.clanker.world/api/tokens/deploy/v4', {
     method: 'POST',
     headers: {
       'Content-Type': 'application/json',
       'x-api-key': 'your_api_key_here'
     },
     body: JSON.stringify({
       token: {
         name: "DemoToken",
         symbol: "DEMO",
         image: "https://example.com/demo-token-logo.png",
         tokenAdmin: "0x742d35Cc6634C0532925a3b8D4C9db7cd4b5b31D",
         description: "Clanker v4.0.0",
         socialMediaUrls: [
           "https://x.com/demotoken",
           "https://t.me/demotoken"
         ],
         auditUrls: [
           "https://example.com/audit-report-1.pdf",
           "https://example.com/security-review.pdf"
         ],
         requestKey: "abcdef1234567890abcdef1234567890"
       },
       rewards: [
         {
           admin: "0x742d35Cc6634C0532925a3b8D4C9db7cd4b5b31D",
           recipient: "0x742d35Cc6634C0532925a3b8D4C9db7cd4b5b31D",
           allocation: 50,
           rewardsToken: "Both"
         },
         {
           admin: "0x8ba1f109551bD432803012645Hac136c3c89d97c",
           recipient: "0x8ba1f109551bD432803012645Hac136c3c89d97c",
           allocation: 30,
           rewardsToken: "Clanker"
         },
         {
           admin: "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
           recipient: "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
           allocation: 20,
           rewardsToken: "Paired"
         }
       ],
       pool: {
         type: "standard",
         pairedToken: "0x4200000000000000000000000000000000000006",
         initialMarketCap: 10
       },
       fees: {
         type: "static",
         clankerFee: 1,
         pairedFee: 1
       },
       vault: {
         percentage: 15,
         lockupDuration: 30,
         vestingDuration: 0
       }
     })
   });

   if (!response.ok) {
     const errorData = await response.json();
     throw new Error(errorData.error || `HTTP error! status: ${response.status}`);
   }

   const data = await response.json();
   console.log('Token deployment successful:', data);
   return data;
   
 } catch (error) {
   console.error('Token deployment failed:', error);
   throw error;
 }
};

deployToken()
 .then(result => {
   console.log('Expected address:', result.expectedAddress);
 })
 .catch(error => {
   console.error('Error:', error);
 });
```

{% endtab %}
{% endtabs %}

#### **Notes**

**Rewards Configuration**

* At least one reward configuration is required.
* Up to 7 total reward recipients are allowed.
* Total allocation across all recipients must sum to 100 (100%).
* Admin addresses can change the recipient address but allocation percentages are immutable.

{% hint style="warning" %}
With the v4.0.0 deployment endpoint, token creation interfaces must include their own reward configuration if they wish to receive any rewards for v4.0.0 tokens.
{% endhint %}

* Each reward recipient may have a designated `rewardsToken` set. This specifies the token in which the recipient will accrue rewards in, irrespective of how the fees are set to be collected via the Fee Configuration.
* Defaults
  * `rewardsToken` defaults to `Paired` , so rewards recipients will accrue rewards in only the paired token (typically WETH)

**Pool Configuration (optional)**

* Choose a paired token from the list of [Supported Quote Tokens](/documentation/references/supported-quote-tokens.md) along with the starting market cap of the token, denominated in the paired token.
* Defaults
  * "Standard" pool configuration with single LP position.
  * Quote token is set to WETH (0x4200000000000000000000000000000000000006) if no `pairedToken` is provided.
  * Starting market cap is set to the Approximate Starting Market Cap column in the [Supported Quote Tokens](/documentation/references/supported-quote-tokens.md) table if no `initialMarketCap` is provided.

**Fee Configuration (optional)**

* Choose either `static` or `dynamic` fee type, not both.
  * Static fees apply fixed percentages to specific token inputs (no min, 5% max).
  * Dynamic fees include a base fee plus variable fees based on volatility and are applied to equally to both token inputs (0.25% min, 5% max).
* Defaults
  * Fee configuration defaults to a 1% static fee on both token inputs if not provided.
  * If `static` is selected, the static fee configuration defaults to a 1% static fee on both token inputs if not specified.
  * If `dynamic` is selected, the dynamic fee configuration defaults to a 0.5% base fee and 5% max LP fee if not specified.

**Vault Extension (optional)**

* Optional feature for locking tokens with configurable lockup and vesting periods.
* Maximum 90% of total supply can be allocated across all extensions.
* Minimum `lockupDuration` is 7 days, no minimum vesting duration.
  * There is no minimum `vestingDuration`, as setting `vestingDuration` to 0 allows all vaulted tokens to be claimed once `lockupDuration` ends.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://clanker.gitbook.io/documentation/authenticated/deploy-token-v4.0.0.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
