Orblivion AI agent (TypeScript) =============================== An AI trading agent that runs on Orblivion's servers. You write its strategy in plain words; on every tick a model on Orbio's gateway decides, and Orblivion checks every answer before anything trades. Orblivion's own Orbio credits pay for the model, so you need no LLM key. The full guide: https://orblivion.com/docs/ai-agent.html Files strategy.txt YOUR STRATEGY, in plain words. The file to edit. Lines starting with # aren't sent. agent.ts the script: keys, options, paper, watch, live, status, off. Its settings are at the top (SETTINGS). package.json @orblivion/sdk, viem and tsx; the npm scripts below tsconfig.json for your editor, and for npm run typecheck Needs Node.js 20 or later. Quick start npm install npm run keys make the wallet's key (never printed) npm run options the templates and models, and who pays for this wallet's model calls npm run paper create the agent on paper (no money) and watch it think ... edit strategy.txt, watch again (npm run watch) ... npm run live after SEND: the session, its setup and the executor's gas; then it trades live npm run off after SEND: stop it, end its session, get the executor's gas back npm run off -- --chain-only after SEND: end the live session on chain from agent.json alone (nothing asked of Orblivion); a later off stops the agent and gets the gas back npm run status the agents, today's model spend, and the executor's gas npm run watch -- 60 watch for 60 minutes (paper and live take a number the same way) Who pays for the model Orblivion's own Orbio credits (funding "orblivion"): a daily pool, one share per wallet, for the cheap models and an agent that thinks every 15 minutes or slower. A wallet that owns an Orbio agent (or is one's agent wallet) gets a trial share for 7 days from its first AI agent, paper or live. After that, a live agent's share is backed by the trading fees the wallet paid through Orblivion over 14 days (it takes at least $5 of trades). Without a share the agent keeps ticking but doesn't think, or trade, until 00:00 UTC. `npm run options` shows where this wallet stands. How it keeps you safe - Paper first: a paper agent trades a paper book against live prices, and no money moves. - The model's answer is checked field by field: one JSON object, only the agent's own tokens, at most the per-trade limit. Anything else means no trade that tick. - Every order then passes the agent's limits (per trade, per day, the largest position) and Orblivion's guards. - Live, the agent trades only inside the session the wallet signs: these tokens, these caps, until it expires. Orblivion's co-signer and the chain enforce them on every trade. Its executor key never leaves Orblivion's signing service, and the SDK checks the co-signer's attestation of it before the wallet signs anything. - Nothing that moves money happens unless you type SEND. `off` ends the session at Orblivion at once, then on chain. agent.json keeps the live session's revocation record (no secret), so `off` builds the on-chain revocation (the session's delegation disabled, its approvals back to 0) here and sends it straight to Robinhood Chain, even when Orblivion doesn't answer, then reads it back. That needs an SDK with revocationRecord (npm install @orblivion/sdk@latest); with an older one `off` takes its on-chain steps from Orblivion's answer. The key lives in ~/.orblivion-ai-agent (SETTINGS.keyDir), outside this folder, with agent.json (the agents the script made). Anyone with wallet.json controls the wallet: don't share or commit it, and use a wallet that holds only what the agent trades. The Python version uses the same folder and files. Going live sets a plain wallet's code to MetaMask's EIP7702StatelessDeleGator (EIP-7702), which sessions run on. The key stays the owner, and the wallet works as before; an authorization to address 0 undoes it. This is example code, not financial advice. You bear the outcome of every trade it makes: https://orblivion.com/docs/terms.html MIT License: ../LICENSE.txt