API keys for bots
An agent key is a separate trading key of an account. A bot or a service signs orders with it on the account's behalf, while the wallet's main key stays with the owner.
What a key can do
- Orders and short-term orders: placing, cancelling, replacing, chase.
- TWAP and POV, stop-loss, take-profit, trailing stop, brackets, conditional entry.
- Closing a position and position margin within the subaccount.
An agent key cannot withdraw or transfer funds, vote or manage keys. The network itself enforces this: if a bot's key leaks, the funds stay on the account.
Permissions and limits
- Markets, subaccounts and action types are set when the key is created. An empty list means no restriction within trading actions.
- Validity: up to 180 days.
- Up to 4 keys per account.
- Name: up to 32 characters: Latin letters, digits,
-and_.
Lifecycle
- The account's main key signs creating, changing and revoking a key.
- Validity and permissions change without replacing the key. The key's orders stay, except those outside the new markets or subaccounts: they are cancelled.
- Revoking is always available. On revocation or expiry, everything the key opened is cancelled: orders, chase, TWAP, POV, conditional entry. Protective stop-loss, take-profit, trailing stop and brackets stay.
- An expired key cannot be renewed, a new one has to be created.
Fees
- The account's wallet pays gas for the key's transactions, in USDC or NTX.
- Short-term orders need no gas.
- Trading fees are the usual ones, from the subaccount.
Transparency
- Every order, algorithm and trade on the network carries the number of the key that placed it.
- Key numbers are counted separately in each account.
- The key does not touch the account's sequence, so the bot and the owner can send transactions at the same time.