nearswaps agent kit

Let an agent trade for you. Funds only you can withdraw.

Give an AI agent, a bot or a script one limited key. It can trade your 1-click balance and send it back to your wallet, and nothing else: the contract allows three methods, its own pools and its own caps. Your policy (a score floor from the token check, a per-trade maximum, a daily budget) runs where the agent runs.

How it works

  1. 1 · you

    Deposit

    Put NEAR or a token in your 1-click balance in the Terminal. The agent can't deposit.

  2. 2 · you

    Add a key

    Paste the public key the kit printed. One wallet approval adds it to your account.

  3. 3 · the agent

    Trade

    It buys and sells from that balance, within the hard limits on chain and your policy.

agent key

Add an agent key

Connect the wallet the agent will trade for.

What this key can do

  • Call trade, withdraw and recover_trade on nekoorders.near, and nothing else.
  • Buy and sell from your 1-click balance, only through the pools and venues the contract allows, under its per-trade and per-balance caps.
  • Withdraw that balance to your wallet only. The contract has no recipient argument.
  • Settle a trade that stopped part way. It only ever lands back in your balance.

What it cannot do

  • Deposit, attach NEAR or send NEAR or tokens anywhere: a function-call key can't attach a deposit.
  • Spend more than 5 NEAR of your NEAR on network fees: it is added with a 5 NEAR gas cap, about 5 to 15 trades. When that is used up, remove the key here and add it again.
  • Place auto orders (stops and limits stay a step for you in the Terminal).
  • Make a cross-chain transfer. The kit can prepare one for you to sign.
  • Touch any other contract, token or account, or your other keys.

Keys on your account

1-click balance

What the agent trades

Deposit and withdraw in the Terminal

policy

The policy the agent runs with

The kit checks this file before every buy and sell, on the machine where the agent runs. This page never stores or enforces it. Example from the kit's README:


          
          
min_score
The lowest token-check score (0 to 100) a token needs for a buy. Tokens on trusted skip only this rule.
max_trade_near
The most NEAR one buy may spend.
daily_budget_near
The most NEAR traded per UTC day.
deny
Tokens the agent never buys.
cooldown_sec
Seconds after a trade in a token before the next one in it.
paused
Stops every buy and sell; withdrawals still work.

activity

1-click activity

Fine print

  • Network fees (gas) for every agent trade come out of your wallet's NEAR, not the 1-click balance. The key is added with a 5 NEAR gas cap, like the Terminal's own 1-click key: about 5 to 15 trades, then remove it here and add it again (two wallet approvals). The cap limits what a stolen key could burn on gas; what it can trade is limited on chain.
  • Every agent trade pays the normal 1-click fee, taken from what you receive, as in the Terminal.
  • The token check is a list of things checked, not a promise. A token can pass every check and still go to zero.
  • Agent trades don't earn nearswaps points yet.
  • Remove the key here at any time (one wallet approval). Your 1-click balance stays yours to withdraw in the Terminal.
  • More on how the balance is held: How 1-click trading works.

Trading carries risk: token prices move and you can lose money. Not financial advice.