Trading

Core trading endpoints for getting quotes and executing trades.

Flow: quote → sign → execute

Get trade quote with unsigned transaction

get
/api/v1/quote

Returns a quote with an unsigned transaction ready to sign. This is the main endpoint for preparing trades.

What you get:

  • Serialized unsigned transaction (hex for EVM, base64 for Solana)

  • Expected output amount

  • Minimum output with slippage protection

  • Routing information

  • Gas estimates

  • Quote ID for execution

  • Optional: Approval transaction (EVM only, if needed)

Quote expiration: 30 seconds

Approval Mechanics (EVM Only):

BUY trades:

  • Returns trade transaction (nonce n)

  • May return post-buy approval transaction (nonce n+1)

  • Approval enables immediate selling after buy completes

SELL trades:

  • May return approval transaction (nonce n) if token not yet approved

  • Returns trade transaction (nonce n+1)

  • Approval must execute before trade

How to check if approval is needed: - Check if response contains approve field

  • If present, sign and include both transactions in execute request

  • Nonces are pre-calculated, do not modify

Transaction format:

  • EVM chains: Hex string (0x...)

  • Solana: Base64 encoded string

Authorizations
AuthorizationstringRequired

API key authentication. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Contact [email protected] to obtain an API key.

Query parameters
tokenstringRequired

Token contract address

  • For BUY: Token you want to receive (destination)
  • For SELL: Token you want to sell (source)

Example: 0x08978686e93859c41e9f8983c1c8523df98c2bf5

Example: 0x08978686e93859c41e9f8983c1c8523df98c2bf5
amountnumberRequired

Trade amount:

  • For BUY: Amount in native token (ETH, BNB, SOL, etc.)
  • For SELL: Amount in token units (with decimals)

Examples:

  • BUY 0.1 ETH worth: 0.1
  • SELL 1000 tokens (18 decimals): 1000000000000000000000
Example: 0.1
sidestring · enumRequired

Trade direction

Example: BUYPossible values:
slippageinteger · min: 1 · max: 10000Required

Slippage tolerance in basis points (1 bps = 0.01%)

Recommended values:

  • High liquidity: 50-100 bps (0.5-1%)
  • Normal liquidity: 100-200 bps (1-2%)
  • Low liquidity: 200-500 bps (2-5%)

Example: 200 = 2% slippage

Example: 200
traderstringRequired

Wallet address that will sign and execute the transaction.

Must be a valid address for the network:

  • EVM: 0x... format
  • Solana: Base58 format
Example: 0xE64E104caaF2947f816C13889D031f0DE1b1e9EC
chainstring · enumOptional

Blockchain network. Auto-detected from token address if not provided.

Available networks: BASE, ETH, BSC, ARB, AVAX, ABSTRACT, HYPEREVM, INK, STORY, XLAYER, PLASMA, UNICHAIN, SOL

Example: BASEPossible values:
prioritystring · enumOptional

Gas priority level:

  • LOW: Cheapest, slower confirmation
  • MEDIUM: Standard speed and cost (default)
  • HIGH: Faster, higher cost
  • INSTANT: Fastest, highest cost (for sniping)
Default: MEDIUMExample: MEDIUMPossible values:
simulationbooleanOptional

Run transaction simulation (default: false)

  • true: Simulate transaction before returning quote
  • false: Skip simulation for faster response

Recommended: true in production to catch errors

Default: falseExample: false
integratorstringOptional

Integrator fee recipient address. Defaults to trader if not provided.

Used in combination with fee to earn fees on trades.

Example: 0xYourIntegratorWallet
feeinteger · max: 10000Optional

Integrator fee in basis points (0-10000 bps = 0-100%)

Fee split:

  • 70% to integrator
  • 30% to protocol

Example: 100 bps (1%) → Integrator gets 0.7%, Protocol gets 0.3% + 0.15% base = 0.45%

Default: 0Example: 100
Responses
200

Quote generated successfully

application/json
get
/api/v1/quote
GET /api/v1/quote?token=text&amount=1&side=BUY&slippage=1&trader=text HTTP/1.1
Host: api.naos.trade
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "success": true,
  "path": [
    {
      "step": {
        "input": "0x4200000000000000000000000000000000000006",
        "output": "0x08978686e93859c41e9f8983c1c8523df98c2bf5",
        "poolType": "UNISWAP V4",
        "fee": 3000
      }
    }
  ],
  "stats": {
    "valueAmountInUsd": 306.24,
    "amountOut": "121856096780647035442298880",
    "amountOutMin": "119418974845034084425531392",
    "gasCostUsd": 0.15,
    "txCostUsd": 1.15,
    "buyTax": 0,
    "sellTax": 0,
    "transferTax": 0
  },
  "transaction": {
    "trade": "0x02f8d282215180843b9aca008...",
    "approve": "0x02f86c82215181843b9aca00...",
    "quoteId": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Execute signed transaction

post
/api/v1/execute

Execute a signed transaction on the blockchain. This broadcasts the transaction and waits for confirmation.

Process:

  1. Validates signed transaction

  2. Simulates transaction (unless skipped)

  3. Broadcasts to blockchain

  4. Waits for confirmation

  5. Returns transaction hash and details

Approval Transaction Execution:

When approve is provided:

For BUY trades:

  1. Trade transaction broadcast and confirmed

  2. API returns success to user

  3. Approval transaction executed synchronously (background)

  4. Token ready for future sells

For SELL trades:

  1. Approval transaction broadcast and confirmed (if provided)

  2. If approval fails, request fails

  3. Trade transaction broadcast and confirmed

  4. API returns success

Nonce Ordering:

  • BUY: Trade (n) → Approval (n+1)

  • SELL: Approval (n) → Trade (n+1)

MEV Protection:

  • Available on ETH and BSC only

  • Protects against front-running and sandwich attacks

  • Recommended for trades > $10,000

Simulation:

  • Set simulation: true in production (recommended)

  • Catches errors before wasting gas

  • Only skip for time-critical trades

Solana Timing:

  • Wait 1-2 seconds after /quote before calling /execute

  • Ensures database synchronization of Jupiter quote IDs

Authorizations
AuthorizationstringRequired

API key authentication. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Contact [email protected] to obtain an API key.

Body
tradestringRequired

Signed trade transaction from user's wallet

  • EVM: Hex string (0x...)
  • Solana: Base64 encoded
Example: 0x02f8d282215180843b9aca008...
networkstring · enumRequired

Blockchain network to execute on

Example: BASEPossible values:
mevbooleanRequired

Enable MEV protection (ETH/BSC only)

When to use:

  • Trades > $10,000
  • Low liquidity tokens
  • High slippage trades

Trade-offs:

  • Pros: Protected from front-running
  • Cons: Slower confirmation, slightly higher gas
Example: false
simulationbooleanRequired

Run pre-broadcast transaction simulation

Recommended: true (always simulate in production)

Simulation catches:

  • Insufficient balance
  • Slippage exceeded
  • Token restrictions
  • Other revert scenarios
Example: true
quoteIdstringRequired

Quote ID from the /quote response. Required to match the quote.

Example: 550e8400-e29b-41d4-a716-446655440000
approvestringOptional

Signed approval transaction (optional, EVM only)

When to include:

  • If the /quote response contained approve
  • Sign the approval transaction with your wallet
  • Include in this field

Execution order:

  • BUY: Trade executes first, then approval (background)
  • SELL: Approval executes first, then trade

Important:

  • Do not modify nonces from the quote
  • Both transactions must be signed with provided nonces
  • Solana never requires this field
Example: 0x02f86c82215180843b9aca00...
Responses
200

Trade executed successfully

application/json
post
/api/v1/execute
POST /api/v1/execute HTTP/1.1
Host: api.naos.trade
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 180

{
  "trade": "0x02f8d282215180843b9aca008...",
  "approve": "0x02f86c82215181843b9aca00...",
  "network": "BASE",
  "mev": false,
  "simulation": true,
  "quoteId": "550e8400-e29b-41d4-a716-446655440000"
}
{
  "success": true,
  "status": "SUCCESS",
  "txRes": {
    "traderAddress": "0xE64E104caaF2947f816C13889D031f0DE1b1e9EC",
    "fromToken": "0x4200000000000000000000000000000000000006",
    "toToken": "0x08978686e93859c41e9f8983c1c8523df98c2bf5",
    "received": "121856096780647035442298880",
    "spent": "0.1",
    "txHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "network": "BASE"
  }
}

Last updated