Deploy and Mint a Fund via API

Step-by-step guide for creating and minting fund tokens using the ATK REST API

PREREQUISITES

  1. Platform URLhttps://your-platform.example.com
  2. Running ATK instance – DALP services + Portal
  3. Account with PINCODE enabled/account/profile
  4. Admin access – needed to grant system roles
  5. Fund prospectus finalized – share class, NAV currency, management fee, redemption rules from the fund issuance guide
  6. Compliance configuration – know the initial module pairs (KYC tiers, jurisdiction gates, redemption controls)

You'll need:

  • Wallet address (Step 2)
  • managementFeeBps (basis points; 150 = 1.5% per year)
  • Fund class (ABSOLUTE_RETURN, LONG_SHORT_EQUITY, etc.) and category (MULTI_STRATEGY, VENTURE_CAPITAL, etc.)
  • Optional ISIN (uniqueIdentifier) if the fund is registered

Quick reference

StepWhatEndpoint
1Sign inPOST /api/auth/sign-in/email
2Get user infoGET /api/user/me
3Grant system rolesSet Up Roles guide
4Create fund tokenPOST /api/token/create (type: "fund")
5Grant token rolesPOST /api/token/grant-role (Set Up Roles Step 4)
6Unpause tokenPOST /api/token/{contract}/unpause
7Mint fund unitsPOST /api/token/{contract}/mint
8Verify balances & NAV claimsGET /api/token/{contract}/holders

STEP-BY-STEP COMMANDS

Step 1: sign in

curl -v -X POST YOUR_PLATFORM_URL/api/auth/sign-in/email \
  -H "Content-Type: application/json" \
  -c cookies.txt \
  -d '{
    "email": "YOUR_EMAIL",
    "password": "YOUR_PASSWORD"
  }'

Step 2: fetch wallet + org context

curl -s YOUR_PLATFORM_URL/api/user/me \
  -b cookies.txt | jq '.'

Copy the wallet—it must appear in every grant call and script.


Step 3: grant system roles

Fund deployments require the tokenManager system role. If you will register claim topics for NAV attestations or redemption controls, also grant claimPolicyManager or complianceManager.

Use Set Up Roles Step 2 for system roles (admin only).


Step 4: create the fund

curl -v -X POST YOUR_PLATFORM_URL/api/token/create \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "type": "fund",
    "name": "Global Growth Fund Class A",
    "symbol": "GGFA",
    "decimals": 18,
    "countryCode": "056",
    "priceCurrency": "USD",
    "basePrice": "100.00",
    "class": "LONG_SHORT_EQUITY",
    "category": "MULTI_STRATEGY",
    "managementFeeBps": 150,
    "uniqueIdentifier": "BE0003796134",
    "initialModulePairs": [],
    "walletVerification": {
      "secretVerificationCode": "YOUR_PINCODE",
      "verificationType": "PINCODE"
    }
  }'

Key fields:

  • decimals: 18 enables fractional units (recommended per fund guide). Use 0 only if your prospectus forbids fractional subscriptions.
  • priceCurrency / basePrice: Encodes initial NAV in the dashboard (e.g., USD 100.00).
  • class: Value from fundClasses (strategy style such as ABSOLUTE_RETURN, LONG_SHORT_EQUITY, REGIONAL).
  • category: Value from fundCategories (e.g., VENTURE_CAPITAL, EQUITY_HEDGE, MULTI_STRATEGY).
  • managementFeeBps: Integer between 0 and 10,000 (0%–100%) per basisPoints schema. 150 = 1.5% annual management fee with daily accrual, matching the user guide’s fee automation.
  • uniqueIdentifier: Optional ISIN for regulated funds.
  • initialModulePairs: Compliance modules you selected during onboarding (leave [] to adopt defaults and configure later).

Expected: 200 OK with id for the fund contract and metadata containing NAV claims.


Step 5: grant token roles

Same pattern as other assets—supply management for subscriptions/redemptions and emergency for pause control:

curl -v -X POST YOUR_PLATFORM_URL/api/token/grant-role \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "contract": "YOUR_FUND_CONTRACT",
    "address": "YOUR_WALLET_ADDRESS",
    "roles": ["supplyManagement", "emergency"],
    "walletVerification": {
      "secretVerificationCode": "YOUR_PINCODE",
      "verificationType": "PINCODE"
    }
  }'

Add governance if you plan to update valuation or redemption parameters via server functions.


Step 6: unpause

curl -v -X POST YOUR_PLATFORM_URL/api/token/YOUR_FUND_CONTRACT/unpause \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "contract": "YOUR_FUND_CONTRACT",
    "walletVerification": {
      "secretVerificationCode": "YOUR_PINCODE",
      "verificationType": "PINCODE"
    }
  }'

Step 7: mint fund units

curl -v -X POST YOUR_PLATFORM_URL/api/token/YOUR_FUND_CONTRACT/mint \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
    "contract": "YOUR_FUND_CONTRACT",
    "recipients": ["RECIPIENT_WALLET"],
    "amounts": ["100000000000000000000"],
    "walletVerification": {
      "secretVerificationCode": "YOUR_PINCODE",
      "verificationType": "PINCODE"
    }
  }'

With 18 decimals, "100000000000000000000" = 100 fund units (matching subscription allotments described in the user guide).


Step 8: verify holders + NAV claims

curl -s YOUR_PLATFORM_URL/api/token/YOUR_FUND_CONTRACT/holders?tokenAddress=YOUR_FUND_CONTRACT \
  -b cookies.txt | jq '.'

The response lists holder balances plus identity claims (NAV, management fee, optional ISIN), mirroring the dashboard view.


FULL SCRIPT

#!/bin/bash

EMAIL="YOUR_EMAIL"
PASSWORD="YOUR_PASSWORD"
PINCODE="YOUR_PINCODE"
RECIPIENT="RECIPIENT_WALLET"
BASE_URL="YOUR_PLATFORM_URL"

curl -s -X POST $BASE_URL/api/auth/sign-in/email \
  -H "Content-Type: application/json" \
  -c cookies.txt \
  -d "{\"email\":\"$EMAIL\",\"password\":\"$PASSWORD\"}" > /dev/null

USER=$(curl -s $BASE_URL/api/user/me -b cookies.txt)
WALLET=$(echo $USER | jq -r '.wallet')
echo "Wallet: $WALLET"

echo "Create fund..."
CREATE=$(curl -s -X POST $BASE_URL/api/token/create \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d "{\"type\":\"fund\",\"name\":\"Global Growth Fund Class A\",\"symbol\":\"GGFA\",\"decimals\":18,\"countryCode\":\"056\",\"priceCurrency\":\"USD\",\"basePrice\":\"100.00\",\"class\":\"LONG_SHORT_EQUITY\",\"category\":\"MULTI_STRATEGY\",\"managementFeeBps\":150,\"uniqueIdentifier\":\"BE0003796134\",\"initialModulePairs\":[],\"walletVerification\":{\"secretVerificationCode\":\"$PINCODE\",\"verificationType\":\"PINCODE\"}}")

CONTRACT=$(echo $CREATE | jq -r '.id')
echo "Fund contract: $CONTRACT"

echo "Grant roles..."
curl -s -X POST $BASE_URL/api/token/grant-role \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d "{\"contract\":\"$CONTRACT\",\"address\":\"$WALLET\",\"roles\":[\"supplyManagement\",\"emergency\"],\"walletVerification\":{\"secretVerificationCode\":\"$PINCODE\",\"verificationType\":\"PINCODE\"}}" > /dev/null

echo "Unpause..."
curl -s -X POST $BASE_URL/api/token/$CONTRACT/unpause \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d "{\"contract\":\"$CONTRACT\",\"walletVerification\":{\"secretVerificationCode\":\"$PINCODE\",\"verificationType\":\"PINCODE\"}}" > /dev/null

echo "Mint 100 units..."
MINT=$(curl -s -X POST $BASE_URL/api/token/$CONTRACT/mint \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d "{\"contract\":\"$CONTRACT\",\"recipients\":[\"$RECIPIENT\"],\"amounts\":[\"100000000000000000000\"],\"walletVerification\":{\"secretVerificationCode\":\"$PINCODE\",\"verificationType\":\"PINCODE\"}}")
echo $MINT | jq '.'

echo "Holder snapshot..."
curl -s $BASE_URL/api/token/$CONTRACT/holders?tokenAddress=$CONTRACT -b cookies.txt | jq '.token.balances'

Amount calculations

  • With 18 decimals (default for funds), multiply by 10^18.
    • 1 unit → 1000000000000000000
    • 10 units → 10000000000000000000
    • 100 units → 100000000000000000000
  • With 0 decimals (whole units only), the amount is the literal unit count.

Formula: on-chain amount = desired_units * 10^decimals.


Troubleshooting

  • "tokenManager required" → Grant via Set Up Roles Step 2.
  • "Basis points cannot exceed 10000" → Keep managementFeeBps between 0 and 10,000.
  • "Invalid enum value" for class/category → Use values from fundClasses/fundCategories (e.g., LONG_SHORT_EQUITY, VENTURE_CAPITAL).
  • "Token is paused" → Run Step 6 and ensure emergency role is assigned.
  • "Permission denied" during mint → Confirm supplyManagement role.
  • "PINCODE_INVALID" → Reset or re-enter PINCODE.
  • Need jq?brew install jq (macOS) or apt install jq (Debian/Ubuntu).