Search by name, SuiNS, address, digest, object ID, coin type or checkpoint.

API
buildTransaction

buildTransaction

Build an unsigned transaction for stake, liquid staking, lending or a swap, gassed and checked on current mainnet state.

Details

Endpoint
POST buildTransaction (JSON-RPC)
Credits
15
Rate class
Heavy. Counts against your heavy requests per second.

Build an unsigned Sui transaction for an action and get it back with the pre-sign check already run on it. With pass (an Agent Pass id) it builds for the pass's agent within the owner's rules and returns a signed receipt with the bytes. tide adds the protocol's own Move calls (packages resolved to their newest version from tide's package lineage index), resolves every object, picks the sender's gas coins, measures the gas budget and adds 20%, then dry-runs the exact bytes on current mainnet state and judges every recipient, coin and package. If the dry run fails the call returns would_fail, and on a danger verdict it returns unsafe, each with the check in the error data and no bytes. Amounts are in whole coins (1.5 means 1.5 USDC); decimals are resolved for you. Swaps go through the Aftermath router with the minimum output enforced on chain (slippage_pct, default 0.5). Pass several actions as steps to run them in one transaction: a step without amount takes the previous step's output (swap USDC to SUI, then stake it). tide never signs; sign tx_bytes with the sender's wallet. Actions: stake: Stake SUI with a validator (native staking). tide picks the validator from its yield data unless you name one. Fields: amount (SUI to stake, in whole SUI (at least 1), or "all" (keeps 0.2 SUI for gas).); validator (Validator address or name. Left out, tide picks the best realized rate over 30 epochs among large validators with commission at most 10%.) | unstake: Withdraw native stakes: one StakedSui by id, every stake with one validator, or all of them. Optional amount splits one stake. Fields: staked_sui_id (The StakedSui object to withdraw. Left out: every stake (or every stake with validator).); validator (Only stakes with this validator (address or name).); amount (With staked_sui_id: withdraw only this much principal (whole SUI, at least 1, leaving at least 1). Default all.) | lst_mint: Stake SUI for a liquid staking coin (afSUI, haSUI, vSUI, sSUI, stSUI or any SpringSui coin) through the protocol itself. Fields: lst (The liquid staking coin: afSUI (Aftermath), haSUI (Haedal), vSUI (Volo), sSUI (SpringSui), stSUI (AlphaFi), another SpringSui coin's symbol, or a full coin type.); amount (SUI to stake, in whole SUI, or "all" (keeps 0.2 SUI for gas). Left out when chained: the previous step's SUI.) | lst_redeem: Redeem a liquid staking coin for SUI through its protocol: instant where the protocol allows it (Aftermath falls back to a queued unstake when its instant reserve is short). Fields: lst (The liquid staking coin: afSUI (Aftermath), haSUI (Haedal), vSUI (Volo), sSUI (SpringSui), stSUI (AlphaFi), another SpringSui coin's symbol, or a full coin type.); amount (LST to redeem, in whole coins, or "all". Left out when chained: the previous step's coin.) | swap: Swap one coin for another through the Aftermath router, best route at this size, with the minimum output enforced on chain. Fields: from (Coin to sell: symbol (SUI, USDC, ...) or coin type.); to (Coin to buy: symbol or coin type.); amount (Amount of `from` to sell in whole coins, or "all" (for SUI it keeps 0.2 for gas).); slippage_pct (Most the output may fall below the quote, in percent. Default 0.5. The router aborts the transaction on chain below it.) | supply: Supply a coin to a lending market (Suilend, NAVI, Scallop) to earn its supply rate. Fields: protocol (The lending protocol.); asset (The coin: symbol (USDC, SUI, ...) or coin type.); amount (Amount in whole coins.) | withdraw: Withdraw a supplied coin from a lending market (Suilend, NAVI, Scallop), part or "all". Fields: protocol (The lending protocol.); asset (The coin: symbol (USDC, SUI, ...) or coin type.); amount (Amount in whole coins, or "all".) Pass one params object.

Parameters

NameTypeDescription
senderstringAddress of the wallet that will sign. Its coins pay and its gas coins are picked. Required unless pass is given (then the pass's agent signs).
passstringAgent Pass object id. The agent builds under the owner's pass: coins are drawn from the owner's allowance through the pass's own calls, only the venues, caps and price floor the pass allows, every step prechecked against the live pass (a step the pass would refuse returns unsafe with the precheck), and a signed receipt comes back with the bytes. Actions: swap, supply (NAVI), stake (validator address), transfer (recipient name the owner listed); each step needs its own amount. swap takes min_out (whole coins) or sizes it from a dry run less slippage_pct (default 1).
actionstringWhat to do. Its fields go next to it (amount, asset, protocol, lst, from, to, validator, slippage_pct...).One of "stake", "unstake", "lst_mint", "lst_redeem", "swap", "supply", "withdraw".
stepsarray of objectInstead of action: up to 6 actions run in order in one transaction, each { action, ...fields }. A step without amount takes the previous step's output coin.
amountnumber or stringWhole coins, or "all" where the action allows it.
assetstringsupply and withdraw: the coin, symbol (USDC, SUI) or coin type.
protocolstringsupply and withdraw: suilend, navi or scallop.
lststringlst_mint and lst_redeem: afSUI, haSUI, vSUI, sSUI, stSUI or a liquid staking coin type.
fromstringswap: the coin to sell.
tostringswap: the coin to buy.
slippage_pctnumberswap: most the output may fall below the quote, percent. Default 0.5; enforced on chain.
validatorstringstake and unstake: validator address or name. stake picks one from tide's yield data when left out.
staked_sui_idstringunstake: one StakedSui object.

Request

Send your key in the x-api-key header, or leave it out to use the keyless tier.

curl
curl -X POST "https://api.tide.ad/" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "buildTransaction",
  "params": {
    "sender": "0xa0c417e4fe1de367e8171b12a2960ddd865aff87be58ea1bb4e06f60d631a49f",
    "action": "swap",
    "from": "SUI",
    "to": "USDC",
    "amount": 5
  }
}'
TypeScript
const res = await fetch("https://api.tide.ad/", {
  method: "POST",
  headers: {
    "x-api-key": process.env.TIDE_API_KEY!,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "jsonrpc": "2.0",
    "id": 1,
    "method": "buildTransaction",
    "params": {
      "sender": "0xa0c417e4fe1de367e8171b12a2960ddd865aff87be58ea1bb4e06f60d631a49f",
      "action": "swap",
      "from": "SUI",
      "to": "USDC",
      "amount": 5
    }
  }),
});
const data = await res.json();

Response

JSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tx_bytes": "AAAUAAgA8gUqAQAAAAAIGoZGAAAAAAAACACA4Dd5wxEAAQFy+8k6RRkjV8h1V/5z6mL+WWjvtUgoNOkkP4UDdyUVNGUWoQ0AAAAAAAEBfYTCmpbWapWl33HlnlhZE67wv1hyIhYA3YdtnWC5ls5lFqENAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAIANA9ffErGgsBAfx0lxSI4RLKNiEouMmq3aRMNXNIisM5pZZG2TKQ7JXcBpYKGgAAAAABAQHgX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DC through the Aftermath router over DeepBookV3, Cetus, Bluefin. It aborts on chain if it would get less than 4.5987 USDC (0.5% slippage).",
    "sender": "0xa0c417e4fe1de367e8171b12a2960ddd865aff87be58ea1bb4e06f60d631a49f",
    "verdict": "safe",
    "steps": [
      {
        "action": "swap",
        "description": "Swaps 5 SUI for about 4.6219 USDC through the Aftermath router over DeepBookV3, Cetus, Bluefin. It aborts on chain if it would get less than 4.5987 USDC (0.5% slippage).",
        "venue": {
          "id": "aftermath",
          "name": "Aftermath router",
          "url": "https://aftermath.finance/trade"
        },
        "spends": [
          {
            "type": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
            "symbol": "SUI",
            "amount": 5,
            "amountRaw": "5000000000"
          }
        ],
        "receives": [
          {
            "type": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
            "symbol": "USDC",
            "amount": 4.59874,
            "amountRaw": "4598740",
            "minimum": true
          },
          {
            "type": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
            "symbol": "USDC",
            "amount": 4.62185,
            "amountRaw": "4621850",
            "estimate": true
          }
        ],
        "notes": [
          "Quoted 4.6219 USDC, route fees about 0.011%. Quotes move with the market; sign soon."
        ]
      }
    ],
    "spends": [
      {
        "type": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
        "symbol": "SUI",
        "amount": 5,
        "amountRaw": "5000000000"
      }
    ],
    "receives": [
      {
        "type": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
        "symbol": "USDC",
        "amount": 4.59874,
        "amountRaw": "4598740",
        "minimum": true
      },
      {
        "type": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
        "symbol": "USDC",
        "amount": 4.62185,
        "amountRaw": "4621850",
        "estimate": true
      }
    ],
    "packages": [
      "0x7de5de8d75a8f4e42cdd3c018f788bc9b9ebf2d3d61dcfe9d2136f17f077afd5",
      "0xd5bd38b8f7b472876ff803814a1c62082c122b77944b0f6da7f2bf2d4888426e"
    ],
    "gas": {
      "budget_mist": "8791293",
      "price_mist": "100",
      "payment": [
        {
          "object_id": "0x3729e319ce7af1e2f794d99715ffe4cdd7374eb015e5f618a4dbf73ddc92aed8",
          "version": "1058730124",
          "digest": "B34iRWVF1anvcW1DyeoLZib2JCJfy4mQ9PE723mJxrCi"
        },
        {
          "object_id": "0x1cac8a290d2227f5010ec039d1cf77bfea5630b4084f1e9a1b2f57d1a14d0b59",
          "version": "1058730124",
          "digest": "D8ACGmdruyYEC9dFFedaptVV6dpi9XimJcJ33rH9Kb6y"
        }
      ],
      "owner": "0xa0c417e4fe1de367e8171b12a2960ddd865aff87be58ea1bb4e06f60d631a49f",
      "estimate_sui": 0.005050374
    },
    "check": {
      "verdict": "safe",
      "headline": "No red flags found in the 1 address, 2 coins, 4 packages this transaction touches.",
      "summary": "Swapped 5 SUI for 4.6219 USDC ($4.62) on DeepBook, Cetus and Bluefin, through the Aftermath Router.",
      "status": "ok",
      "error": null,
      "findings": [
        {
          "code": "PRICE_OK",
          "severity": "info",
          "text": "You pay about $4.62 and get about $4.62 back at tide's current prices, 0.1% less than you put in.",
          "evidence": [
            {
              "label": "Coin on tide",
              "url": "https://tide.ad/coin/0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC"
            }
          ]
        }
      ],
      "balance_changes": [
        {
          "address": "0xa0c417e4fe1de367e8171b12a2960ddd865aff87be58ea1bb4e06f60d631a49f",
          "name": null,
          "coin_type": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
          "symbol": "SUI",
          "amount": -5.005049374,
          "amount_raw": "-5005049374",
          "usd": -4.63
        },
        {
          "address": "0xa0c417e4fe1de367e8171b12a2960ddd865aff87be58ea1bb4e06f60d631a49f",
          "name": null,
          "coin_type": "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",
          "symbol": "USDC",
          "amount": 4.621902,
          "amount_raw": "4621902",
          "usd": 4.62
        }
      ],
      "gas": {
        "total_sui": 0.005050374,
        "computation_sui": 0.0001,
        "storage_sui": 0.10868,
        "rebate_sui": 0.103729626,
        "budget_sui": 0.008791293,
        "price_mist": 100,
        "reference_price_mist": 100,
        "payer": "0xa0c417e4fe1de367e8171b12a2960ddd865aff87be58ea1bb4e06f60d631a49f",
        "usd": 0.004671
      },
      "simulated_at_checkpoint": 341900741
    },
    "sign": "Unsigned. Sign tx_bytes with the sender's own wallet (signTransaction) and submit it; tide never signs and never holds keys. Gas coins and price are set; build again if the wallet's coins change before signing.",
    "asOf": {
      "checkpoint": 341900580,
      "timestamp": "2026-11-05T11:38:30.147Z",
      "lagMs": 1824
    }
  }
}

Long lists are cut to a few items here.