Sigil Wallet LogoSigil Wallet

DeFi Tools

Token swaps and portfolio management using Orca and Mock Swaps on Solana Devnet.

Sigil Wallet agents can execute token swaps and monitor portfolios on Solana Devnet. Because standard liquidity aggregators are often limited on Devnet, Sigil uses a tiered swap execution strategy.

Swap Execution Strategy

Sigil employs a hybrid swap engine to ensure agents can always test their logic, even when liquidity is sparse:

  1. Orca Whirlpools: The engine first attempts to find a valid Orca Whirlpool for the requested pair on Devnet.
  2. Mock Swap (Fallback): If no Orca pool is found, the engine falls back to a Mock Swap. This generates a valid, signable transaction that simulates the exchange of tokens, allowing for end-to-end testing of agent reasoning without requiring real liquidity.

Trading Tools

ToolDescription
swap_tokensExecute a token swap using Orca (with Mock fallback) on Solana Devnet

Portfolio Tools

ToolDescription
get_portfolio_snapshotFull breakdown of holdings with percentages of total portfolio value

Supported Pairs (Devnet)

Currently, swap operations are restricted to the following pairs to ensure stability:

  • SOL ↔ devUSDC
  • Input Mint: So11111111111111111111111111111111111111112
  • Output Mint: 3KBZiL2g8C7tiJ32hTv5v3KM7aK9htpqTw4cTXz1HvPt

Swap Parameters

The swap_tokens tool accepts:

  • inputMint — Input token mint address or symbol ("SOL", "USDC")
  • outputMint — Output token mint address or symbol ("SOL", "USDC")
  • amount — Amount of input token to swap (in UI units)
  • slippageBps — Slippage tolerance in basis points (default 100 = 1%)

Example Scenarios

"Swap 0.5 SOL to USDC"
"Swap 10 USDC to SOL with 0.5% slippage"
"Check portfolio allocation every 5 minutes"

Slippage Protection

All swap operations are subject to slippage guardrails:

  • Default maximum slippage: 1%
  • If market conditions (or mock parameters) would cause price deviation beyond the cap, the swap is blocked
  • The agent logs the block reason and retries on the next loop cycle

Swap Execution Process

Each swap follows this secure flow:

  1. Quote Discovery: Agent attempts to build an Orca swap transaction.
  2. Mock Fallback: If Orca discovery fails, a MockSwap transaction is generated.
  3. Instruction Decoding: The transaction is sent to the Guardrails Layer.
  4. Validation: Guardrails evaluate the trade value and slippage against user-defined directives.
  5. Sign & Submit: If approved, the agent retrieves the private key from the OS Keychain and broadcasts the transaction.

See Safety & Guardrails for configuration options.

On this page