Skip to content

POST /build/launch

An unsigned, simulated token launch.

POST https://marketmayhem.co/api/v1/build/launch
FieldTypeRequiredMeaning
walletstringyesA 0x address
namestringyesUp to 64 bytes
symbolstringyesUp to 32 bytes
marketCapUsdstringA decimal amount in whole units, as a string: “0.05”
marketCapPairstringA decimal amount in whole units, as a string: “0.05”
supplystringWhole tokens, 1 to 1,000,000,000,000; default 1,000,000,000
pairstring“BNB” (default), a listed symbol, or any BEP20 address
firstBuystringA buy in the pair currency, inside the launch transaction
firstBuyToobject[]Split the first buy; must add to 100. The dead address burns.
firstBuyTo[].walletstringyesA 0x address
firstBuyTo[].pctnumberyesIts share of the first buy, in percent
slippagePctnumber
imagestringThe logo: an https:// link to a PNG, JPG, GIF or WebP, up to 5 MB. Required unless metadataURI is sent (and its metadata must have an image).
descriptionstring
websitestring
xstring
telegramstring
metadataURIstring
burnPctnumberShare of the creator royalty that buys back and burns, for ever
royaltyTostringA 0x address
shapeflat · stepped · steep or object[]How the supply is laid across prices: “flat” (default), “stepped”, “steep”, or 1 to 4 ranges
shape[].fromPctnumberyesWhere the range starts, as a percent of 46,000 ticks (about 100x in price) above where the shape begins
shape[].toPctnumberyesWhere it ends, on the same scale. The last range always runs to the top price, so no shape caps the price
shape[].bpsintegeryesIts share of the shaped supply; all ranges add to 10,000
feeTier100 · 500 · 2500 · 10000
FieldTypeRequiredMeaning
walletstringyesA 0x address
tokenstringyesThe new token’s address, known before sending
namestringyes
symbolstringyes
supplyobjectyesThe total supply
supply.amountstringyesA decimal amount in whole units, as a string: “0.05”
supply.weistringyesThe same amount in the smallest unit, an integer as a string
pairobjectyesThe pair currency
pair.addressstringyesThe pair currency’s contract (WBNB for BNB)
pair.decimalsintegeryesIts decimals
pair.symbolstringyesIts symbol, e.g. BNB
pair.pricedbooleanyesWhether it has a dollar price
pair.notestring
openingobjectyes
opening.marketCapPairnumberyesA number, not a string: the opening cap the chosen tick gives
opening.marketCapUsdnumber or nullyes
opening.driftFromAskedPctnumberyesTicks are ~2% apart on the 1% tier, so the cap opens near, not at, what was asked
feeTierintegeryesThe pool fee tier (10000 = 1%)
firstBuyobject or nullyesThe first buy: what it spends and the fewest tokens it accepts; null without one
firstBuy.spendobjectyes
firstBuy.spend.amountstringyesA decimal amount in whole units, as a string: “0.05”
firstBuy.spend.weistringyesThe same amount in the smallest unit, an integer as a string
firstBuy.minTokensobjectyes
firstBuy.minTokens.amountstringyesA decimal amount in whole units, as a string: “0.05”
firstBuy.minTokens.weistringyesThe same amount in the smallest unit, an integer as a string
launchFeeobjectyesThe launch fee (0: free)
launchFee.amountstringyesA decimal amount in whole units, as a string: “0.05”
launchFee.weistringyesThe same amount in the smallest unit, an integer as a string
creatorFeeRecipientstringyesWhere the royalty is paid
royaltyobjectyesThe royalty choice, and one sentence saying it
royalty.kindkeep · split · holdersyes
royalty.burnPctnumberyes
royalty.tostringyesA 0x address
royalty.explainstringyes
shapestringyesThe supply shape
firstBuyToobject[] or nullyesHow the first buy is split, or null
firstBuyTo[].walletstringyesA 0x address
firstBuyTo[].pctnumberyes
saltstringyesThe salt that fixes the token’s address
metadataobject or nullyesThe stored logo and details, or null
metadata.uristringyes
requiresobject[]yesOne-time steps to send and wait for first, in order. Empty when the wallet is ready.
requires[].stepstringyese.g. “approve-permit2”, “approve-router”, “approve-factory”
requires[].explainstringyes
requires[].txobjectyesAn unsigned transaction: sign it with the wallet and send it.
requires[].tx.chainIdintegeryes56 BSC mainnet, 97 BSC testnet
requires[].tx.tostringyesA 0x address
requires[].tx.datastringyesThe call data: send it exactly as it is
requires[].tx.valuestringyesBNB to send with it, in wei
requires[].tx.gasstringThe simulated gas plus a margin. Absent while a step in requires is still needed.
txobjectyesAn unsigned transaction: sign it with the wallet and send it.
tx.chainIdintegeryes56 BSC mainnet, 97 BSC testnet
tx.tostringyesA 0x address
tx.datastringyesThe call data: send it exactly as it is
tx.valuestringyesBNB to send with it, in wei
tx.gasstringThe simulated gas plus a margin. Absent while a step in requires is still needed.
simulationobjectyesThe simulation against the chain, from the wallet
simulation.ranbooleanyesWhether it was simulated: not while a step in requires is still needed
simulation.okbooleanyesIt would succeed if sent now
costobjectyesThe most the transaction can cost in gas, in BNB.
cost.gasPriceWeistringyesThe same amount in the smallest unit, an integer as a string
cost.maxWeistringyesThe same amount in the smallest unit, an integer as a string
cost.maxstringyesA decimal amount in whole units, as a string: “0.05”
explainstringyes

Captured from BSC testnet, exactly as the API sent it (long calldata shortened).

{
"wallet": "0x2bf842241129be12f3a0e4f21e25d2fd43d9e6da",
"token": "0x8fbb86493b27fe77f70fb87b78967e894946950b",
"name": "Fixture",
"symbol": "FIX",
"supply": {
"amount": "1000000000.0",
"wei": "1000000000000000000000000000"
},
"pair": {
"address": "0xae13d989dac2f0debff460ac112a837c89baa7cd",
"symbol": "BNB",
"decimals": 18,
"priced": true
},
"opening": {
"marketCapPair": 0.019149086912313856,
"marketCapUsd": 14.810286799721782,
"driftFromAskedPct": -1.2647546685214617
},
"feeTier": 10000,
"firstBuy": {
"spend": {
"amount": "0.0003",
"wei": "300000000000000"
},
"minTokens": {
"amount": "14128715.241459207609295845",
"wei": "14128715241459207609295845"
}
},
"launchFee": {
"amount": "0.0",
"wei": "0"
},
"creatorFeeRecipient": "0xe007fff1396b1d0f5293b2e589ad2d35e878b300",
"royalty": {
"kind": "holders",
"burnPct": 100,
"to": "0xe007fff1396b1d0f5293b2e589ad2d35e878b300",
"explain": "All of the royalty buys back and burns the token, for ever."
},
"shape": "flat",
"firstBuyTo": [
{
"wallet": "0x000000000000000000000000000000000000dead",
"pct": 60
},
{
"wallet": "0x2bf842241129be12f3a0e4f21e25d2fd43d9e6da",
"pct": 40
}
],
"salt": "0xe59d7f75aa908d7ec895fbb622f09249b59f48a1344c36acc582db9d1084b956",
"metadata": null,
"requires": [],
"tx": {
"chainId": 97,
"to": "0x5d96cbf410468950F92A1f544Ef924B24a23fe66",
"data": "0x2d7d962e0000000000000000000000000000000000000000000000000000000000000020…",
"value": "300000000000000",
"gas": "16777216"
},
"simulation": {
"ran": true,
"ok": true
},
"cost": {
"gasPriceWei": "100000000",
"maxWei": "1977721600000000",
"max": "0.0019777216"
},
"explain": "Launch Fixture ($FIX), 1,000,000,000 tokens, opening at about $14.8103 market cap, with a first buy of 0.0003 BNB. Royalty: all bought back and burned, for ever."
}

Every error is { "error": { "code", "message", "fix"? } }. This endpoint can answer:

  • MISSING_MARKET_CAP: A launch needs its opening market cap.
  • NO_PRICE: The pair currency has no live dollar price, so a dollar market cap cannot be converted.
  • INVALID_SUPPLY: The supply is outside 1 to 1,000,000,000,000 whole tokens.
  • INVALID_LAUNCH: A launch field breaks one of the launch rules.
  • INVALID_SHAPE: The supply shape is not one of the presets or a valid list of ranges.
  • SHAPE_BELOW_LADDER: The shape no longer fits this launch: its price layout moved with the dollar price since the launch was built.
  • INVALID_BURN: burnPct is not 0, 1–99 (with at most two decimals) or 100.
  • CONFLICTING_ROYALTY: royaltyTo and a burnPct above 0 were both sent.
  • CONFLICTING_METADATA: metadataURI and the details (image, description, …) were both sent.
  • INVALID_METADATA_URI: metadataURI is not an https:// or ipfs:// link.
  • INVALID_IMAGE: The image link could not be used.
  • IMAGE_TOO_LARGE: The image is larger than 5 MB.
  • UNSUPPORTED_IMAGE: The image is not PNG, JPG, GIF or WebP, or the upload body is not the image itself.
  • UPLOADS_BUSY: Uploads are busy right now.
  • STORAGE_UNAVAILABLE: The image could not be stored just now. Nothing was launched.
  • UNSUPPORTED_PAIR: The pair is not BNB, a listed symbol, or a readable BEP20 token.
  • LAUNCHES_PAUSED: Launches are paused on the factory right now.
  • INSUFFICIENT_BALANCE: The wallet cannot pay for this: the amount, or the gas, or both.
  • TOO_MUCH_GAS: This launch needs more gas than one BSC transaction may use.
  • SIMULATION_FAILED: The transaction would revert on chain, so it was not returned. Nothing was sent.
  • RATE_LIMITED: Too many requests from this address in the last minute.