Skip to main content
POST
/
order
curl --request POST \
  --url https://builder.snek.fun/order \
  --header 'Content-Type: application/json' \
  --data '{
    "assetId": "abc123...",
    "amount": "1000000",
    "side": "BUY",
    "slippage": "15",
    "changeAddress": "addr1...",
    "utxos": "splash-wallet"
  }'
{
  "id": "order-01...",
  "cbor": "84a500...",
  "beacon": "order-beacon-...",
  "price": { "numerator": "123", "denominator": "456" },
  "priceQuote": ".",
  "priceBase": "fbd4d3c334063ac19566f6ba39b6ec707ea91fa81d0c09201575c10b.44415645",
  "outputAmount": "23750",
  "inputAmount": "1000000",
  "outputAsset": "fbd4d3c334063ac19566f6ba39b6ec707ea91fa81d0c09201575c10b.44415645",
  "inputAsset": "."
}
Builds an unsigned buy or sell order for any Snekfun token. The endpoint automatically detects where the token is trading and routes the order accordingly — to the bonding curve pre-graduation, or to the Splash DEX AMM pool once the token has graduated. Callers don’t need to know which venue the token lives on. Sign via /sign, sign and submit via /sign-and-submit, or submit an already signed transaction via /submit. Auth: Public

Request body

assetId
string
required
Token asset ID in {policyId}.{hexAssetName} format.
amount
string
required
Trade amount. For BUY this is the lovelace input. For BUY_WITH_OUTPUT this is the token amount you want to receive. For SELL this is the token amount you want to sell.
side
string
required
One of BUY, BUY_WITH_OUTPUT, or SELL.
slippage
string
required
Slippage bucket. One of 15, 30, 50, 75, or infinity.
changeAddress
string
required
Bech32 change address.

Response

cbor
string
Hex-encoded unsigned transaction CBOR.
id
string
Builder transaction ID.
beacon
string
Optional order beacon emitted by the builder.
price
object
Optional execution price ratio.
priceQuote
string
Quote asset ID used for the computed price.
priceBase
string
Base asset ID used for the computed price.
outputAmount
string
Output amount as a bigint-safe string.
inputAmount
string
Input amount as a bigint-safe string.
outputAsset
string
Output asset ID.
inputAsset
string
Input asset ID.
curl --request POST \
  --url https://builder.snek.fun/order \
  --header 'Content-Type: application/json' \
  --data '{
    "assetId": "abc123...",
    "amount": "1000000",
    "side": "BUY",
    "slippage": "15",
    "changeAddress": "addr1...",
    "utxos": "splash-wallet"
  }'
{
  "id": "order-01...",
  "cbor": "84a500...",
  "beacon": "order-beacon-...",
  "price": { "numerator": "123", "denominator": "456" },
  "priceQuote": ".",
  "priceBase": "fbd4d3c334063ac19566f6ba39b6ec707ea91fa81d0c09201575c10b.44415645",
  "outputAmount": "23750",
  "inputAmount": "1000000",
  "outputAsset": "fbd4d3c334063ac19566f6ba39b6ec707ea91fa81d0c09201575c10b.44415645",
  "inputAsset": "."
}

Error response

cause
string
Machine-readable error code.
message
string
Human-readable error message.
Possible errors:
  • 400 INVALID_PARAMS — one or more required fields are missing, malformed, or outside the allowed enum values.
  • 500 ASSET_NOT_FOUND — the requested token could not be found.
  • 500 MIN_TRADE_AMOUNT — the trade amount is below the minimum allowed amount.
  • 500 MAX_TRADE_AMOUNT — the trade amount exceeds the maximum allowed amount.
  • 500 PROTOCOL_CONFIG — protocol config loading or validation failed.
  • 500 OPERATIONS_CONFIG — operations config loading or validation failed.
  • 500 UNKNOWN — unexpected builder failure.
{
  "cause": "MIN_TRADE_AMOUNT",
  "message": "Trade amount is below the minimum allowed"
}