πŸ”΅Agentic Starknet Trading

β—† Guide: Agentic Starknet Trading

Build AI agents that trade on Starknet via AVNU β€” with high throughput, low fees, and access to the deepest liquidity pools in the Bitcoin L2 ecosystem. Starknet processes $400M+ in monthly DEX volume, making it the strongest venue for agentic trading on Bitcoin rails.

What you'll build

An agent that can:

  1. Get swap quotes across Starknet DEX pairs (AVNU)

  2. Execute spot trades between WBTC, STRK, USDC, and any ERC-20 token

  3. Run DCA strategies β€” accumulate WBTC over time from stablecoins

  4. Rebalance across multiple Starknet assets

  5. Harvest staking rewards β€” claim STRK from WBTC staking and compound or convert

  6. Cross-chain arbitrage β€” compare prices across Starknet and other chains

Prerequisites

  • Xverse Agentic Wallet CLI installed (npm i -g @secretkeylabs/xverse-wallet-cli)

  • A funded wallet with assets on Starknet (see Getting Startedarrow-up-right)

Why Starknet?

For agentic trading, Starknet offers the best mix of speed, cost, and liquidity in the Bitcoin ecosystem:

  • High throughput, low fees β€” instant finality, fraction-of-a-cent gas

  • Deep DEX liquidity β€” $400M+ monthly volume via AVNU and integrated pools

  • BTC-native assets β€” WBTC is the primary BTC representation, stakeable for STRK rewards

  • Stablecoin access β€” USDC on Starknet for stable trading pairs

  • Programmable β€” smart contracts enable complex DeFi strategies


Step 1: Get assets onto Starknet

Bridge BTC to Starknet as WBTC, or buy USDC/STRK directly:

Check your Starknet balances:

Step 2: Get swap quotes

Use swap quote to get pricing from AVNU and other integrated providers:

Starknet-to-Starknet swaps settle instantly β€” no block confirmations needed.

Step 3: Execute a swap

Options

Option
Description

--from <token>

Source token (e.g. starknet:USDC)

--to <token>

Destination token (e.g. starknet:WBTC)

--amount <value>

Amount of the source token

--provider <code>

Use a specific provider

--slippage <pct>

Slippage tolerance (percentage)

--yes

Execute (omit for dry run)

Step 4: DCA into WBTC

A DCA agent that accumulates WBTC from USDC at regular intervals:

Agent pseudocode:

Step 5: Harvest staking rewards

If your agent has staked WBTC, periodically claim STRK rewards and compound or convert:

Step 6: Portfolio rebalancing

An agent that maintains a target allocation (e.g. 60% WBTC / 30% USDC / 10% STRK):

Step 7: Cross-chain arbitrage

Compare prices across chains and execute where the rate is best:


Putting it all together: Starknet trading agent

Available Starknet trading pairs

All Starknet-to-Starknet swaps settle instantly. Common pairs:

From
To
Settlement

starknet:USDC

starknet:WBTC

Instant

starknet:WBTC

starknet:STRK

Instant

starknet:STRK

starknet:USDC

Instant

starknet:USDC

starknet:STRK

Instant

Any Starknet ERC-20

Any Starknet ERC-20

Instant

Cross-chain routes (BTC L1 ↔ Starknet) take ~10-30 minutes due to Bitcoin block confirmations.

What's next

Last updated