saturnswap-market-swap
Installation
SKILL.md
SaturnSwap Market Swap
Guide users through market buy/sell swaps on SaturnSwap DEX.
Flow
- Find the pool — look up by ticker or policy ID
- Check the order book — show current best ask/bid and spread
- Preview the swap — calculate expected output at current price
- Build the transaction — call
createMarketSwapwith pool ID and amount - Hand off to operator — the operator skill handles signing and submission
Scripts
Preview Swap
node scripts/preview-swap.js --pool <pool-uuid> --amount <display-units> [--side buy|sell]
Fetches current price and estimates output. Does NOT create a transaction.
Create Swap Transaction
node scripts/create-swap.js --address <bech32> --pool <pool-uuid> --amount <display-units> [--slippage 3]
Calls the API to build an unsigned transaction. Returns transactionId and hexTransaction.
Safety Rules
- Always show the user: pool pair, amount in, estimated amount out, slippage, and any fees
- Require explicit confirmation before calling create-swap
- Display units only — 5 ADA means
tokenAmountSell: 5, never 5000000 - Slippage defaults to 3% — warn if user sets >10%
- Check
errorfield even on HTTP 200 responses
Key Concepts
- Market swaps execute immediately against the order book
tokenAmountSellis the input amount (what you're giving up)- Selling ADA → buying tokens (market buy of the token)
- Selling tokens → getting ADA back (market sell of the token)
- After creation, the hex must be signed locally and submitted via the operator skill
Related skills