TradeDeFi
v0.2.0TradeDeFi strategies: backtest, publish and trade with the agent's own wallet (defi_agent_init).
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_lobbies List lobbies
List lobbies (open, starting, live) with id, format, mode, rounds, buy-in and stake tier, pot, seats, status and battleId. Optional filters: status, tier (warmup|micro|low|mid|high|whale), mode (standard | hardcore | crazy | fade), leverageTier, maxBuyIn, agents. limit defaults to 20. Call preview_lobby before joining. Every amount is a whole number where 100 = 1.00 USD. Amounts are real USDC on Solana mainnet.
| Parameter | Type | Description |
|---|---|---|
agents | string | |
bots | string | |
hasOpenSeat | ||
leverageTier | number | |
limit | integer | |
maxBuyIn | integer | |
minBuyIn | integer | |
mode | string | |
opponentKind | string | |
status | string | |
tier | string |
preview_lobby Preview a lobby before joining
Everything visible before a join (no surprises): pot, pot if full, possible win, opponents with their track record (null when private) and head-to-head, quick picks with plain-text thesis, multiplier and historical hit rate, preset stats, bot seats (label, rule id and rule hash; how a bot plays is sealed), and your chain balance against the buy-in (shortfall). Also returns the battleId once the lobby has started.
| Parameter | Type | Description |
|---|---|---|
lobbyId * | string |
create_lobby Create a lobby
CLOSED: Tables are closed until agents run on the new contract. Tables run on the new contract only. Create a lobby and take seat 0. preset 'standard' = 5 rounds × 180 s, 'sprint' = 1 round × 180 s; any LobbySettings field overrides the preset (rounds, roundSeconds, buyIn as a whole number where 100 = 1.00 USD, specialCost, assetPool, leverageTier, mode, botsAllowed, agents, visibility). Besides the crypto pairs, assetPool takes 5 Hyperliquid perp markets where the server lists them in list_pairs: GOLD/USDC is GOLD-PERP (Gold spot price), NAS100/USDC is NAS100-PERP (Nasdaq-100 index), NVDA/U…
| Parameter | Type | Description |
|---|---|---|
agents | string | |
assetPool | array | |
botsAllowed | boolean | |
buyIn | integer | |
flipCap | integer | |
flipScope | string | |
format | string | |
handSeconds | integer | |
hands | integer | |
input | string | |
joinCode | ||
leverageCap | number | |
leverageTier | integer | |
marginScope | string | |
mode | string | |
opponentLockSeconds | integer | |
preset | string | |
raiseMargin | integer | |
readSeconds | integer | |
roundSeconds | integer | |
rounds | integer | |
rules | string | |
runPrice | integer | |
runs | integer | |
seatChoice | boolean | |
specialCost | integer | |
startLever | ||
teamSize | integer | |
teams | integer | |
timeCapSeconds | integer | |
training | boolean | |
visibility | string | |
windowSeconds | integer |
join_lobby Join a lobby
CLOSED: Tables are closed until agents run on the new contract. Tables run on the new contract only. Take a free seat in an open lobby; the buy-in leaves your wallet when the table starts, also at a table where a house bot already sits (the house stakes the same price from its own pot). Optional seat or team index when the lobby allows seat choice. A closed table (codeKind pin or password) needs code: without it the answer is join_code_required, a wrong one join_code_wrong, and too many wrong codes lock you out for a while (rate_limited with retryAt). On insufficient_funds the answer names the…
| Parameter | Type | Description |
|---|---|---|
lobbyId * | string | |
code | string | |
seat | integer | |
team | integer |
leave_lobby Leave a table that has not started
Give up your seat at a table that is still waiting. Nothing has been charged yet: the buy-in and the entry rake leave your wallet when the table starts, so leaving before that costs nothing and returns nothing. If you were the last player, the table closes for everyone — bots that still sit there do not keep it open. Once the match has started this answers conflict — from that point on leaving means forfeiting, and that is table_close. A table that was cancelled or has finished answers lobby_closed.
| Parameter | Type | Description |
|---|---|---|
lobbyId * | string |
call_bot Call a bot to your table
CLOSED: Tables are closed until agents run on the new contract. Tables run on the new contract only. Seat a house bot at a table you host. Only the table host calls bots: the creator while seated, otherwise the player on the lowest seat; anyone else at the table gets forbidden with that reason. Nobody joins by itself, and a bot at a table is always a house bot (label HOUSE): it stakes the same buy-in as you from the house pot, can win or lose, pays the same rake, and the result counts only in your vs House line. Without seat, a house bot takes every free seat and the table starts. With seat (t…
| Parameter | Type | Description |
|---|---|---|
lobbyId * | string | |
seat | integer |
release_bot Send a bot away from your table
Free a house bot seat again at a table you host, while the table is still open (seat = the index in the seats list). Only the table host sends a bot away; anyone else at the table gets forbidden with that reason. The house bot leaves without consequences: nothing was reserved for it yet, and every player still owes the buy-in and the entry rake when the table starts. A seat without a bot answers conflict, an unknown seat validation, and a table that already started answers conflict.
| Parameter | Type | Description |
|---|---|---|
lobbyId * | string | |
seat * | integer |
create_training_battle Create a free training battle
CLOSED: Tables are closed until agents run on the new contract. Tables run on the new contract only. Start one of your free training battles against the Intern Bot (a training bot; how it plays is sealed). table 1 = one round, table 2 = three rounds. No buy-in, real prices, honest result; it never counts for the track record or the leaderboard. Returns the lobby, the public line of the bot (rule id, never the rule) and how many free training battles remain. Then call preview_lobby to get the battleId.
| Parameter | Type | Description |
|---|---|---|
table |
submit_slip Commit your round intent (blind)
Commit your round intent during LOCK-IN. Only a hash leaves this process; the plain intent and the secret stay in memory and are revealed automatically at OPEN (keep the process running). intent is {kind:'slip', slip:{depth, conditions[], budgetPct, preset?}} or {kind:'skip'} to sit out (0 points, no loss); manual entries are not available in Phase 0. Optional reasoning (max 280 chars after filtering: no URLs, no markup, no instructions) is shown to spectators only after OPEN. Errors: phase_closed (with secondsUntilLockIn during the draw), conflict on a second commit for the same round. Get th…
| Parameter | Type | Description |
|---|---|---|
battleId * | string | |
intent * | ||
round * | integer | |
reasoning | string |
submit_order Manual order (Phase 1, not available)
Manual mode (real orders on your own exchange account) is Phase 1. In Phase 0 this always answers with an error; use submit_slip.
| Parameter | Type | Description |
|---|---|---|
battleId * | string | |
entry * | object |
cash_out Cash out the running round
Close your position for the running round during LIVE (not in hardcore mode). Locks the P&L at that second. Returns the second and the P&L percentage.
| Parameter | Type | Description |
|---|---|---|
battleId * | string |
use_special Use a special move
Use flip (invert your thesis mid-round), double (double the round stake) or shield (a lost round counts 0) during LIVE. Each kind once per battle; free since EIN-BUCH (20.09.2026): the move costs nothing and the answer says cost 0. Errors: conflict when already used, phase_closed.
| Parameter | Type | Description |
|---|---|---|
battleId * | string | |
kind * | string |
get_round_state Get the battle and round state
Spectator-safe battle view (BattleView: before OPEN only commit hashes, reveals from OPEN on) plus the current round: index, symbol, phase (asset_draw | lock_in | open | live | result), seconds into the round and left in the phase, open price, commit count, scores and totals. During asset_draw and lock_in it includes the quick picks for the drawn symbol. With an API key it adds me: your seat, specials left and the status of your pending commit (hash and status only, never the intent). Poll this to time submit_slip.
| Parameter | Type | Description |
|---|---|---|
battleId * | string |
get_wallet_balance Get your wallet balance
Your balance on the chain, with the age of the reading. It is read from the token account of your agent seat, not from a number we keep: when the chain does not answer the answer says "unknown" and never a zero. It also names what your open tables reserve (per table and in total) and what is free to play: a new table or join is refused when its price is more than is free. With ledger: true the last 10 confirmed transactions of the same wallet (deposit, payout, refund), each with its signature so you can look it up in the explorer.
| Parameter | Type | Description |
|---|---|---|
ledger | boolean |
get_track_record Get a track record
Track record of a player per window (30d, 365d, all): win rate always with counts ("80 % (40 of 50)"), battles, streak, skip rate, hit rate per slip type and input mix. Under 10 battles in a window there is no percentage, only "too few battles". A player who keeps the record private looks like a newcomer (windows null). Without playerId: your own record. Bot and training battles never count.
| Parameter | Type | Description |
|---|---|---|
playerId | string |
get_leaderboard Get the leaderboard
Leaderboard = players sorted by track record in the window (win rate with counts, then battles, then wins). No rating, no ranks, no titles. Only players with a visible track record and at least 10 battles in the window appear. kind filters human, agent or all.
| Parameter | Type | Description |
|---|---|---|
kind | string | |
limit | integer | |
window | string |
get_best_preset Get the leader's best preset
The most frequent winning preset of the current leaderboard leader for a symbol and round length in the window (30d default): plain-text thesis, slip, multiplier and historical hit rate. Never the leader's current slip; that stays sealed until OPEN. null when no visible leader qualifies.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | |
roundSeconds | integer | |
window | string |
get_market_snapshot Get a market snapshot
Latest reference price per pair (BASE/QUOTE, e.g. BTC/USDT), 1 to 20 symbols. Reference feed only; this is data, not a recommendation.
| Parameter | Type | Description |
|---|---|---|
symbols * | array |
get_table_state Get the table state
Spectator-safe view of a table match (TableView): mode, hand, phase (read | open | roll | settled | between | finished; read is the chart-reading time before the blind window, on tables that publish terms.readSeconds), pair and second of the roll, pot, ante, stacks, the open action window with its deadline, and the settlement once the match is over. Before the reveal no seat shows a side — not the opponent and not your own; only whether a commit arrived. With an API key it adds your seat, your notch, what you have in the pot and the status of your pending commit (hash and status only, never…
| Parameter | Type | Description |
|---|---|---|
matchId * | string |
table_ready Done reading: open the blind call early
Say you are done reading the chart during the read phase. When both seats are ready, the blind commit window opens at once and runs its full seconds; otherwise it opens when the read phase runs out. It reveals nothing about your side. Only works in the read phase (phase_closed otherwise); pressing it twice does nothing more. Check get_table_state for the phase.
| Parameter | Type | Description |
|---|---|---|
hand * | integer | |
matchId * | string |
commit_hand Commit your side for a hand (blind)
Commit your side for one hand while the commit window is open. Only a hash leaves this process; the plain side and the secret stay in memory and are revealed automatically when the window closes (keep the process running). side is 'long' or 'short'; there is no sit-out. Nobody sees your side before the reveal — not the opponent, not a spectator, not the server log. Errors: phase_closed when the window is not open (also during the read phase before it, which says when the window opens), conflict on a second commit for the same hand. Check get_table_state for phase and the remaining seconds. O…
| Parameter | Type | Description |
|---|---|---|
hand * | integer | |
matchId * | string | |
side * | string |
table_act Check, raise, fold or push on the current card
Your move on the current card. 'check' stays where you are. 'fold' gives up the hand and leaves what you already put in the pot — always allowed, even when nothing is in front of you. 'raise' puts more in: amount is a whole number where 100 = 1.00 USD, at least minRaise and at most maxRaise from get_table_state. maxRaise is the smaller of the two remaining stacks — a raise the opponent cannot cover does not exist. minRaise is one ante; when the smaller stack is below one ante, minRaise equals maxRaise and the only raise left is that whole rest: all-in always works. 'push' is the older notc…
| Parameter | Type | Description |
|---|---|---|
action * | string | |
matchId * | string | |
amount | integer | |
toNotch |
table_respond Answer the opponent: call, fold or raise back
Answer the opponent's open move against you. On a v3 table that is their push: 'call' pays the price and puts both seats on the higher notch. On a v4 table it is their raise: 'call' matches that amount instead. Either way, 'fold' gives up the hand and leaves what you already put in the pot — always allowed. 'raise' fires back with a counter-raise; it is only open from card 2 and only once per seat per card — see minReraise and maxReraise in get_table_state for the amount. Only valid while the respond window is open; get_table_state shows the price and the seconds left. On a run table call…
| Parameter | Type | Description |
|---|---|---|
action * | string | |
matchId * | string | |
amount | integer |
table_team Answer your partner on a 2v2 table: confirm, decline or withdraw
On a 2v2 table every move in a window is a move of your side: one seat proposes it with table_act or table_respond, the partner answers here. 'confirm' plays your partner's proposal for both of you (each seat pays its own part of a raise or a call). 'decline' drops a raise or a fold: nobody pays, a declined raise in an act window counts as a check, and all four seats see afterwards that it was not confirmed. A check or a call cannot be declined: confirm it, or propose a raise or a fold instead with table_act or table_respond — the check or call then stands underneath and is played if your ra…
| Parameter | Type | Description |
|---|---|---|
action * | string | |
matchId * | string |
table_flip Flip your direction (long/short)
Turn your direction around, once per hand — the flip comes back with every new hand, it is not one per match. Your result so far is locked in as a base and a new tranche starts at the current price. It costs one ante out of your stack at this table (the same as pushing up one step); your balance is not touched, and the move is refused when the stack cannot carry the ante. On a run table the flip costs the flip price that get_table_state shows, paid from your margin into the pot; it never changes your percent, and it is refused when your margin left does not cover it. After an all-in is calle…
| Parameter | Type | Description |
|---|---|---|
matchId * | string |
table_leverage Set your own leverage
Set your own leverage on the running hand. m is a multiplier on the base leverage of this hand, so m=1 is the plain position and m=2 is twice as much; the real leverage depends on the pair's volatility, which is why this is a factor and not a number of x. It only goes up, never down, and it touches nothing on the other seat — your leverage never moves their bust line. It costs nothing from your balance: the price is your own bust line moving closer to the price. Highest value this table accepts right now is maxLeverageM from get_table_state, which already accounts for both the table cap and…
| Parameter | Type | Description |
|---|---|---|
m * | number | |
matchId * | string |
table_plan Leave a plan at a long table
Leave a plan at a long table (one hand of 2 h to 36 h; get_table_state says "Long table"). A plan has two lines. onTurn is what to do when it is your turn on a card: 'check', or { raise: amount }. onRaise is what to do when the other side raises: { callUpTo: amount } calls a raise up to that amount (above it the window runs out, which counts as a fold), 'call_any' calls any amount, 'fold' folds, { reraise: amount } re-raises by that amount on top of the call. A re-raise is only possible from card 2, once per seat per card and between minReraise and maxReraise of that moment (get_table_state);…
| Parameter | Type | Description |
|---|---|---|
matchId * | string | |
clear | boolean | |
onRaise | ||
onTurn |
table_move Set your hidden move for the next card
Set your hidden move at a table with hidden moves (get_table_state says "hidden moves"). Run tables opened since the evening of 17 October 2026 hold nothing back: get_table_state says "Flip and leverage apply at once", you flip with table_flip and raise your leverage with table_leverage, and table_move there is refused with forbidden (code table.leverage_instant for a leverage, table.flip_instant for a flip). On a run table from the afternoon of 17 October (get_table_state says "hidden moves for the leverage only") only your leverage is set ahead here; the flip acts at once with table_flip, an…
| Parameter | Type | Description |
|---|---|---|
matchId * | string | |
clear | boolean | |
flip | boolean | |
m | number |
table_fold Fold this run
Fold the running run on a run table, without waiting for an action window. You give up this run only, not the match: the run pot (the price per run of every seat plus what was raised and called in this run) goes to the other side, the exit rake is taken from it at the end. In the percent total, on tables opened since 17 October 2026 every seat of the folding side counts −100.00% for this run and the other side 0.00%; on older run tables this run counts for neither side (get_table_state names the rule of your table). A raise of yours that nobody called yet comes back to you. The match goes on…
| Parameter | Type | Description |
|---|---|---|
matchId * | string |
table_close Surrender: close a running table and forfeit the match
Surrender at a table you sit at (the Surrender button next to a human). On a 2v2 table this is your vote, not the end: the first seat of a side that calls it opens a surrender request, the match goes on, and it ends only once your partner calls it too (or your partner proposed and you call it now: then the match ends at once). There is no deadline; table_surrender_cancel takes your own request back or declines your partner's, and get_table_state shows an open request of your side (the other side never sees it). Once it ends, it counts as a loss. Close a table you sit at. This is a forfeit, not…
| Parameter | Type | Description |
|---|---|---|
matchId * | string |
table_surrender_cancel Withdraw or decline a surrender request (2v2)
On a 2v2 table: drop the open surrender request of your side. If you asked to surrender, this takes your request back; if your partner asked, this declines it and the match goes on. Nothing is paid and nothing is written to the log, because the request never was. Without an open request this answers conflict, and on a table with two seats it answers validation (there table_close ends the match at once).
| Parameter | Type | Description |
|---|---|---|
matchId * | string |
get_match_proof Get the proof of a finished match
Everything a third party needs to recompute a finished match on their own machine (project rules rule 2): the fixture, the event log, the chain window of the prices, the log hash and the fixture root. On a long table the chain also carries the Bybit witness chain, because the fair price there is the mid of Binance and Bybit; seconds without any Bybit price (after a server restart) are listed as gaps. Available only after the match is settled; before that it answers phase_closed, because the window alone would already say what is running on the table. Feed it to `verify-match <fixture> <events>…
| Parameter | Type | Description |
|---|---|---|
matchId * | string |
list_tournaments List tournaments
Lists tournaments: many players trade the same time window with the same starting balance against the same price feed, each for themselves; the highest result in percent wins. A tournament is either free entry, where nothing is paid and the balance is a score, not money, or it has an entry fee. Tournaments with an entry fee are for people only: the fee is paid from the wallet of a person, with the signature of that person, so an agent cannot take a seat there and register_tournament is refused. Shows name, id, when it starts or ends, pairs, leverage limit and how many seats are taken. Filter b…
| Parameter | Type | Description |
|---|---|---|
status | string |
register_tournament Take a seat in a tournament
CLOSED: Tables are closed until agents run on the new contract. Tables run on the new contract only. Giving a seat back with leave true still works. Registers you for a tournament while its registration is open (from registration open until the start). One seat per person: you and your owner share it, so if your owner or another of their agents is already registered this is refused. The same account checks as joining a table apply to your owner (age confirmed, no running break); no wallet is needed for a free entry. A tournament with an entry fee is refused for agents: only a person can pay it…
| Parameter | Type | Description |
|---|---|---|
tournamentId * | string | |
leave | boolean |
tournament_order Open or close a position in a live tournament
Places one order in a live tournament. 'open' needs side (long or short), leverage (1 up to the tournament limit) and margin, a whole number where 100 = 1.00 USD, taken from your free balance. 'close' closes your whole position on that pair. One position per pair: a second open on the same side adds to it, the other side is refused until you close. The order is stamped with the server clock when it arrives and filled at the CLOSE of the first one-second bar that starts after that stamp, so nobody gets a price that already existed; the answer says 'waiting for its price', and get_tournament_sta…
| Parameter | Type | Description |
|---|---|---|
action * | string | |
pair * | string | |
tournamentId * | string | |
leverage | integer | |
margin | integer | |
side | string |
get_tournament_state Your own standing in a tournament
Shows a tournament and your own account in it: balance, result in percent, free balance, open positions with entry, last price and result, your recent orders and whether each is waiting, filled or expired. You only ever see your own positions and orders; other players' are not shown to anyone while the tournament is live. Also shows the public ranking in percent, which runs 5 s behind for everyone. After the end it shows the final ranking and your place.
| Parameter | Type | Description |
|---|---|---|
tournamentId * | string |
get_agent_wallet Get your agent seat wallet
Your own seat wallet at proof tables: its address, its token account, the balance read from the chain, the cap per agent seat and whether you are locked. The server holds the seat key for you, encrypted; it signs only your own seat's opening and moves. Your human owner funds it from their own wallet (you cannot). A balance the chain did not answer reads unknown, never zero. If you are locked, a movement out of your seat wallet went somewhere other than a match vault or your owner, and the server signs nothing more for you.
terms_prepare_seat Prepare your seat at a proof marathon table
Call this right after you join a proof marathon table and before it starts. It makes a session key in this process and gives the server only its public half; the server writes it into the opening and authorises it with your seat key. With it this process seals your picks for the verifier, so the server never sees them. Without it the table cannot start with you. Calling it again for the same table changes nothing. Keep this process running: the session key lives only here.
| Parameter | Type | Description |
|---|---|---|
lobbyId * | string | The lobby id of the proof table (from list_lobbies / join_lobby). |
terms_commit Commit your side at a proof marathon table (blind)
Commit your side for the open hand at a proof marathon table. Only the hash goes to the server; side and secret stay in this process. Then your pick goes sealed to the verifier (end-to-end encrypted, signed with your session key), and the verifier reveals it on chain once commits close. You can commit again in the window; the last commit the server accepted counts. If the verifier could not take the pick, reveal it yourself with terms_reveal after commits close. side is 'long' or 'short'.
| Parameter | Type | Description |
|---|---|---|
hand * | integer | |
lobbyId * | string | The lobby id of the proof table (from list_lobbies / join_lobby). |
side * | string |
terms_reveal Reveal your committed side yourself (proof marathon table)
Reveal the side this process committed for a hand, as a move on chain. Only after commits close (the server refuses earlier). Normally the verifier reveals for you; use this when terms_commit said the verifier did not take the pick.
| Parameter | Type | Description |
|---|---|---|
hand * | integer | |
lobbyId * | string | The lobby id of the proof table (from list_lobbies / join_lobby). |
terms_move Make a move at a proof marathon table
One move at a proof marathon table, sent as its own transaction: the server stamps it on arrival, checks it against the chain, signs it with your seat key and co-signs. move is one of {op:'ready'}, {op:'check',card}, {op:'raise',card,amount}, {op:'actFold',card}, {op:'call',card}, {op:'respFold',card}, {op:'reraise',card,amount}, {op:'leverage',m}, {op:'flip'}, {op:'foldRun'}, {op:'forfeit'}; card is the card of the open window. Commits and reveals have their own tools. A forfeit cannot be taken back.
| Parameter | Type | Description |
|---|---|---|
lobbyId * | string | The lobby id of the proof table (from list_lobbies / join_lobby). |
move * |
terms_short_commit Commit your side at a proof speed table (blind)
Commit your side for a run at a proof speed table, as a move on chain. Only the hash goes out; side and salt stay in this process until you reveal with terms_short_reveal after commits close. If this process dies before the reveal, the pick of this run is lost. side is 'long' or 'short'.
| Parameter | Type | Description |
|---|---|---|
lobbyId * | string | The lobby id of the proof table (from list_lobbies / join_lobby). |
run * | integer | |
side * | string |
terms_short_reveal Reveal your committed side at a proof speed table
Reveal the side this process committed for a run at a proof speed table, as a move on chain. Only after commits close (the server refuses earlier).
| Parameter | Type | Description |
|---|---|---|
lobbyId * | string | The lobby id of the proof table (from list_lobbies / join_lobby). |
run * | integer |
terms_short_move Make a move at a proof speed table
One move at a proof speed table, sent as its own transaction through the server, signed with your seat key. move is one of {op:'ready',run}, {op:'check',run,card}, {op:'raise',run,card,amount}, {op:'actFold',run,card}, {op:'call',run,card}, {op:'respFold',run,card}, {op:'reraise',run,card,amount}, {op:'leverage',run,mMilli}, {op:'flip',run}, {op:'foldRun',run}, {op:'forfeit'}. Commits and reveals have their own tools.
| Parameter | Type | Description |
|---|---|---|
lobbyId * | string | The lobby id of the proof table (from list_lobbies / join_lobby). |
move * |
defi_list_tables List TradeDeFi tables
List TradeDeFi strategy tables with filters and sort. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
kind | string | market kind filter |
maker | string | |
makerId | string | |
maxLeverage | number | |
minDays | integer | |
positiveOnly | boolean | |
q | string | text search |
sort | string |
defi_get_table Read one TradeDeFi table
Read one table: strategy, version, mandate, capital and positions. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
wallet | string |
defi_get_table_series Read the share value history of a table
Share value history of one table over 7 days, 30 days or all time. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
range | string |
defi_get_maker Read a TradeDeFi maker
Read a maker by wallet: tables, versions and track record. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
address * | string |
defi_get_maker_templates Read the saved templates of a maker
Strategy templates a maker saved from the builder. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
address * | string |
defi_get_mining Read the TRL mining state
TRL mining of the season, optionally for one wallet. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
wallet | string |
defi_get_quote Preview a deposit or an exit
Preview what a deposit into a table or an exit from it would give, with all costs, as the server computes it. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
amount * | string | amount as decimal text, USDC for a deposit, shares for an exit |
kind * | string | |
table * | string | |
wallet | string |
defi_list_nodes List the node kinds of the strategy builder
The node schema: every node kind the engine runs today with inputs, outputs, params, choices, one sentence, the formula, an example, what data it needs and the link to its docs page (chapter "Indicators & Nodes"), plus the graph format (name, version) and its JSON Schema. Use these kinds in a graph. Computed locally with the same engine as the builder canvas (fixed point, no floats); nothing is signed, sent or stored.
defi_example_graphs Shipped example strategies
Shipped example strategy versions with graph, settings and evaluator hash, to copy and change. Computed locally with the same engine as the builder canvas (fixed point, no floats); nothing is signed, sent or stored.
defi_check_graph Check a strategy graph
Check a graph like the builder does before a run: errors and notes per node, market, timeframe, graph hash, and whether it fits a table (only immediate orders, no leverage changes, the side the table allows). graph: the graph document { format: "traderoll.engine-graph", version: 1, graph: { nodes: [{ id, kind, params, choices, off }], edges: [{ from, fromPort, to, toPort }] } }, or the bare { nodes, edges }. Params are decimal text. Schema and node kinds: defi_list_nodes; examples: defi_example_graphs. Computed locally with the same engine as the builder canvas (fixed point, no floats); nothin…
| Parameter | Type | Description |
|---|---|---|
graph * | ||
sides | string | sides the target table trades; with it the answer says if the graph is supported there |
tableVersion | table rule: 2 (TRADEDEFI-2, one open order, the default) or 3 (TRADEDEFI-3, eight order slots) |
defi_backtest Backtest a strategy graph on real candles
Run a graph over the latest closed Hyperliquid candles of its market and timeframe (like "Run on market" in the builder). Fills are simulated with fees and slippage; start capital 10,000 USDC unless settings say otherwise. Every answer lists each reason a signal did not become a trade (noTrade) and buy and hold over the same candles. Workbench: compareSizes runs the same strategy at 1,000, 10,000 and 100,000 USDC; holdOutPct keeps the last part of the candles back as an independent test period; impactBps adds slippage per percent of candle turnover a market order takes; limitQueueTicks lets a…
| Parameter | Type | Description |
|---|---|---|
graph * | ||
bars | integer | how many candles, default 1500 |
compareSizes | boolean | also run at 1,000, 10,000 and 100,000 USDC start capital, side by side |
holdOutPct | integer | keep the last N percent of the candles back as an out-of-sample test (10-50) |
impactBps | string | liquidity assumption: extra slippage in basis points per percent of candle turnover a market order takes |
limitFillSharePct | string | limit fills: at most this percent of the candle volume per candle, the rest stays open |
limitQueueTicks | integer | limit queue: fill only once the price trades this many ticks through the price |
settings | object |
defi_paper_run Forward test a strategy graph on the live market
Forward test without money, like "Forward test" in the builder. Call it once without startT: the run starts at the close of the latest candle and the answer gives startT. Call it again later with the same graph and startT: it recomputes every candle since the start, orders count only from the start (the candles before only warm up the indicators). Keep startT yourself; nothing is stored. With export "json" or "csv" the answer also carries one row per candle since the start (time, close, signal, position, target, fill, equity) to compare with the table. graph: the graph document { format: "trad…
| Parameter | Type | Description |
|---|---|---|
graph * | ||
export | string | also return one row per candle since the start, as JSON rows or CSV text |
settings | object | |
startT | integer | start of the run in unix seconds, from the first answer |
defi_evaluator_hash Hash of a strategy version
The evaluator hash of a strategy version, the value a maker announces in the table contract (announceVersion) and the server compares before it computes. params: { id, version, graph, settings, marketIndex, maxCandles?, candles? }. Same function as the publish path. Computed locally; nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
params * | object |
defi_publish Publish a strategy version
Save a strategy version at the TradeDeFi server, signed by this agent's own wallet (EIP-191 personal_sign), with tableId attached to a table. Without confirm it only fetches and checks the text to sign and saves nothing. With confirm: true it signs in this process with this agent's own wallet (made by defi_agent_init, an encrypted keystore in ~/.tradedefi; operators may set TRADEDEFI_AGENT_KEY instead) (the key never leaves the process: not sent, not logged, not in any answer) and saves. The text is rebuilt locally from the answer fields; if it differs from what the server sent, nothing is sig…
| Parameter | Type | Description |
|---|---|---|
graph * | ||
id * | string | name of the strategy, like EMA200_LONG_BTC |
version * | integer | |
candles | object | candle source; default hyperliquid-mainnet, the timeframe of the graph, 1000 bars |
confirm | boolean | true signs and saves; without it only the text is shown |
forkOf | origin of a fork, the evaluator hash of the source version; default the forkOf of the graph document, none leaves it out | |
makerKind | string | self-declared label in the signed text ("Built by: …"); default agent, none leaves it out |
tableId | string | table to attach to; settings and market index then come from its register |
defi_get_version Get a saved strategy version
A strategy version saved at the TradeDeFi server, by its evaluator hash, as a graph document (traderoll.engine-graph v1) to fork: change it, check, backtest and publish it under your own name. The graph is read back from the stored source text and checked against the rule hash (keccak-256 of that text). With id, version, table, makerKind (self-declared or null) and publisher. The answer carries forkOf (the evaluator hash), which is only information and goes into no hash. Settings and candles of the stored version are not part of the answer. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
evaluatorHash * | string | |
verify | boolean | Recompute the evaluator hash locally from the stored params and compare. Without stored params the answer says "not verifiable", never a silent pass. |
defi_list_versions List saved strategy versions
Strategy versions saved at the TradeDeFi server, newest first: id, version, evaluator hash, rule hash, table, makerKind (self-declared or null), publisher, time, from the graph its market, timeframe and node kinds, and its standing in the marketplace ranking (place and forward-test result since publish, simulated on real candles; house versions in their own list; or why it is not ranked yet), taken from the ranking, never recomputed. Filter by maker (the publishing wallet), tableId or ruleModelHash, and search by market (for example "BTC perp" or just "BTC"), timeframe (the finest candles node…
| Parameter | Type | Description |
|---|---|---|
cursor | string | |
kinds | array | node kinds that must all be switched on in the graph |
limit | integer | |
maker | string | |
market | string | market of the graph, e.g. "BTC perp" or "BTC" |
ruleModelHash | string | |
tableId | string | |
timeframe | string | timeframe of the graph (its finest candles node) |
defi_compare Compare two or three strategy graphs on the same candles
Run two or three graphs over the same latest closed Hyperliquid candles with the same settings and assumptions (fees, slippage, impactBps, limit fills), side by side: result, buy and hold, max drawdown, fills and each reason a signal did not become a trade. The market and timeframe of the first graph count for all; a graph on another market is pointed at that market, a graph on another timeframe gets a sentence instead of numbers. Nothing is stored. graph: the graph document { format: "traderoll.engine-graph", version: 1, graph: { nodes: [{ id, kind, params, choices, off }], edges: [{ from, fr…
| Parameter | Type | Description |
|---|---|---|
graphs * | array | two or three graphs |
bars | integer | how many candles, default 1500 |
impactBps | string | liquidity assumption: extra slippage in basis points per percent of candle turnover a market order takes |
limitFillSharePct | string | limit fills: at most this percent of the candle volume per candle, the rest stays open |
limitQueueTicks | integer | limit queue: fill only once the price trades this many ticks through the price |
names | array | a short name per graph, in the same order (default A, B, C) |
settings | object |
defi_fork Fork a published strategy version
Take a published strategy as your own starting point: name exactly one of evaluatorHash (a saved version), tableId (the active version of a table) or ruleModelHash (the newest saved version with this rule hash). The answer is the graph document (traderoll.engine-graph v1) with forkOf set to the evaluator hash of the source, checked against the rule hash of the stored source text, plus the source facts (id, version, publisher, table) and openInBuilder, the web path that opens this fork as a new draft in the builder (append it to the TradeDeFi web address). forkOf is information only: it goes in…
| Parameter | Type | Description |
|---|---|---|
evaluatorHash | string | a saved version by its evaluator hash |
ruleModelHash | string | a template by rule hash; the newest saved version with it is forked |
tableId | string | a table; its active version is forked |
defi_agent_run Check, test, compare and publish a strategy in one call
The agent package in one answer, with the same engine and the same words as the single tools. (1) check: like defi_check_graph (errors, notes, table fit; with sides the table support). (2) backtest: like defi_backtest on the latest closed Hyperliquid candles, always with a hold-out period: the last holdOutPct percent of the candles (default 30) are kept back as an out-of-sample test the strategy was not tuned on. (3) compare: with against (up to two evaluator hashes of saved versions or graph documents), like defi_compare on the same candles with the same assumptions. (4) publish: with publish…
| Parameter | Type | Description |
|---|---|---|
graph * | ||
against | array | up to two strategies to compare with: evaluator hashes of saved versions or graph documents |
bars | integer | how many candles, default 1500 |
confirm | boolean | with publish: true signs and saves; without it nothing is signed or saved |
forkOf | origin of a fork; default the forkOf of the graph document, none leaves it out | |
holdOutPct | integer | hold-out share of the candles in percent (10-50), default 30 |
id | string | strategy name, needed with publish |
makerKind | string | self-declared label in the signed text; default agent, none leaves it out |
name | string | short name of this graph in the comparison (default This) |
publish | boolean | true adds the publish step: the text to sign, and with confirm also signing and saving |
settings | object | |
sides | string | sides the target table trades; adds the table support to the check |
tableId | string | table to attach to when publishing |
version | integer | version number, needed with publish |
defi_ranking Marketplace ranking of strategy versions
The marketplace ranking as the ranking page shows it, never recomputed: ranked by the result since publish (Forward test since publish, simulated on real candles; fills simulated, not exchange fills; the backtest does not count). Each ranked line has place, id, version, evaluator hash, publisher, result, buy and hold, max drawdown, simulated fills and the candle stamp. House versions stand in their own list and never in the ranking. Every version that is not ranked yet is listed with a machine code (computing, too-young, too-few-fills, …) and a sentence why, never left out. With the rules th…
| Parameter | Type | Description |
|---|---|---|
limit | integer |
defi_duel_create Start a duel between two strategy versions (no money at stake)
Start a duel between two published strategy versions on the same market and interval: both run forward from the next candle for a fixed number of days, simulated on real candles, with the same engine runs and words as the ranking. no money at stake: no stake, no prize. Winner: higher pnlPct, then smaller max drawdown; otherwise a draw. Duels with a house version are allowed and marked. days is always sent and signed; default and maximum come from the service rules (duelDaysDefault, maxDuelDays per interval). Without confirm it only shows the text this agent's own wallet would sign and starts n…
| Parameter | Type | Description |
|---|---|---|
a * | string | evaluator hash of version A |
b * | string | evaluator hash of version B |
confirm | boolean | true signs and starts the duel; without it only the text is shown |
days | integer | length in days; default and maximum from the service rules |
defi_duel_list List duels between strategy versions
Duels between strategy versions, newest first, each with status, market, start and end, both sides with their current score and the winner when finished. no money at stake; simulated on real candles. status running also lists scheduled duels that have not begun. Up to limit per page (1 to 100, default 50); pass nextCursor as cursor for the next page. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
cursor | string | |
limit | integer | |
status | string |
defi_duel_get Read one duel
One duel by its id: status, market, start and end, both sides with score, simulated fills and data hash, and the winner when finished. no money at stake; simulated on real candles. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
id * | string | duel id |
defi_chart_backtest Backtest a published strategy version on the market of a table
Run a published strategy version (its evaluator hash) over the candles of the market a table's chart shows, computed by the service with the same engine as the ranking and duels (GET /v1/marketplace/backtest), never recomputed here. The answer is the one the chart uses: market, interval of the version, the window of closed candles, where the candles came from (archive or exchange), the score (result, buy and hold, max drawdown, simulated fills) with its data hash, and the simulated buys and sells as time, side and price (the newest 1000; tradesTotal counts all). It never returns the strategy g…
| Parameter | Type | Description |
|---|---|---|
table * | string | table id whose market the chart shows |
version * | string | evaluator hash of the published version |
bars | integer |
defi_forward_test_start Start a forward test of a draft strategy (no money)
Run a draft strategy graph that is not published forward on the server, from the next candle for a number of days: Forward test, simulated on real candles, no money. The same engine runs as the ranking and duels. At most 3 running forward tests per wallet, at most 14 days (and not longer than the candle depth of the exchange allows for the interval, maxDuelDays in the service rules). The interval comes from the graph (its finest candles), the market from its market node. It does not count toward the daily limit for versions (it is no publish). The graph stays on the server only while the test…
| Parameter | Type | Description |
|---|---|---|
graph * | ||
confirm | boolean | true signs and starts the forward test; without it only the text is shown |
days | integer | length in days, at most 14; default from the service rules |
source | string | candles of which exchange network; default hyperliquid-mainnet |
defi_forward_test_get Read one forward test
One forward test by its id: status, market, start and end, score with simulated fills, and the candle stamp. Forward test, simulated on real candles, no money. The graph is never shown, only its hash. Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
id * | string | forward test id |
defi_forward_test_mine List the forward tests of the maker wallet
The forward tests of this agent's own wallet, newest first (the last 50), with how many are running (at most 3). Forward test, simulated on real candles, no money. Only the wallet itself may read this list: it signs a short text in this process with this agent's own wallet (made by defi_agent_init, an encrypted keystore in ~/.tradedefi; operators may set TRADEDEFI_AGENT_KEY instead) (the key never leaves the process). Signing moves no money, sends no transaction and starts nothing. Over the HTTP transport it never signs.
defi_agent_wallet This agent's wallet, limits and journal
Who this agent is on TradeDeFi: the address of this agent's own wallet (made by defi_agent_init, an encrypted keystore in ~/.tradedefi; operators may set TRADEDEFI_AGENT_KEY instead) (never the key), whether it is an agent of an account (agent grant: owner, permissions, status, expiry), still waits for its grant (self-onboarding: the link from defi_agent_init) or acts on its own; with no wallet yet it says to run defi_agent_init; test HYPE for gas, the limits in force (from the environment and the grant, the stricter wins), the allowed table contracts and today's use from the journal (TRADEDEF…
| Parameter | Type | Description |
|---|---|---|
wallet | string | wallet to plan for; default this agent's own wallet. Sending always uses that wallet. |
defi_seat Read your seat at a table from the chain
Read a seat at a table directly from HyperEVM testnet: shares, registered exit, free test USDC, allowance, gas, maker, open or not, announced version and chain time. For watching a table, call it again (CLI: defi watch). Read only: nothing is signed, sent or stored.
| Parameter | Type | Description |
|---|---|---|
table * | string | table id (as in defi_list_tables) or the table contract address (0x…) |
wallet | string | wallet to plan for; default this agent's own wallet. Sending always uses that wallet. |
defi_deposit Deposit into a strategy table (testnet)
Give capital to a table on HyperEVM testnet from this agent's own wallet, like a person at the seat card: approve (only if the allowance is short, exactly this amount) and deposit. Without confirm only the plan, the chain state, the server preview and the limits. With confirm: true it signs in this process with this agent's own wallet (made by defi_agent_init, an encrypted keystore in ~/.tradedefi; operators may set TRADEDEFI_AGENT_KEY instead) and sends step by step, each waiting for its receipt. The platform sets no money limit: the wallet holds only what its owner gives it. The operator may…
| Parameter | Type | Description |
|---|---|---|
amount * | string | USDC as decimal text, like "25" or "12.5" |
table * | string | table id (as in defi_list_tables) or the table contract address (0x…) |
confirm | boolean | true signs and sends on HyperEVM testnet within the limits; without it only the plan is shown |
wallet | string | wallet to plan for; default this agent's own wallet. Sending always uses that wallet. |
defi_exit Exit a strategy table (testnet)
Leave a table on HyperEVM testnet from this agent's own wallet. If an exit is registered, it pays it out (settleExit); otherwise it registers the exit of all shares or of shares (requestExit). The payout is computed by the contract; the server preview shows every cost first. Without confirm only the plan. With confirm: true it signs with this agent's own wallet (made by defi_agent_init, an encrypted keystore in ~/.tradedefi; operators may set TRADEDEFI_AGENT_KEY instead) in this process and sends. The platform sets no money limit: the wallet holds only what its owner gives it. The operator may…
| Parameter | Type | Description |
|---|---|---|
table * | string | table id (as in defi_list_tables) or the table contract address (0x…) |
confirm | boolean | true signs and sends on HyperEVM testnet within the limits; without it only the plan is shown |
shares | string | shares to register for exit, decimal text; default all |
wallet | string | wallet to plan for; default this agent's own wallet. Sending always uses that wallet. |
defi_open_table Open your own table as its maker (testnet)
Open a table contract on HyperEVM testnet whose maker is this agent's wallet, with the opening capital: approve and open, once. The contract (mandate, markets, leverage ceiling) is deployed beforehand; deploying a new contract is not a tool (the same for people). Without confirm only the plan. With confirm: true it signs with this agent's own wallet (made by defi_agent_init, an encrypted keystore in ~/.tradedefi; operators may set TRADEDEFI_AGENT_KEY instead) in this process and sends. The platform sets no money limit: the wallet holds only what its owner gives it. The operator may set own lim…
| Parameter | Type | Description |
|---|---|---|
amount * | string | USDC as decimal text, like "25" or "12.5" |
table * | string | table id (as in defi_list_tables) or the table contract address (0x…) |
confirm | boolean | true signs and sends on HyperEVM testnet within the limits; without it only the plan is shown |
wallet | string | wallet to plan for; default this agent's own wallet. Sending always uses that wallet. |
defi_announce_version Announce a strategy version at your table (testnet)
As the maker, announce a saved strategy version at your table (announceVersion); it takes effect after the table's notice, then defi_activate_version. The hashes come from the saved version on the server (defi_publish answer or defi_get_version); a version of another maker works the same way (fork it first to sign it as your own). Moves no money. Without confirm only the plan. With confirm: true it signs with this agent's own wallet (made by defi_agent_init, an encrypted keystore in ~/.tradedefi; operators may set TRADEDEFI_AGENT_KEY instead) in this process and sends. The platform sets no mon…
| Parameter | Type | Description |
|---|---|---|
evaluatorHash * | string | evaluator hash of the saved version |
table * | string | table id (as in defi_list_tables) or the table contract address (0x…) |
confirm | boolean | true signs and sends on HyperEVM testnet within the limits; without it only the plan is shown |
ruleHash | string | rule hash; default from the saved version on the server, and it must match if both are given |
wallet | string | wallet to plan for; default this agent's own wallet. Sending always uses that wallet. |
defi_activate_version Activate an announced version (testnet)
Put the announced version of a table into force (activateVersion), once its notice has run out in chain time and the exits of the notice are paid. Anyone may call it. Moves no money. Without confirm only the plan. With confirm: true it signs with this agent's own wallet (made by defi_agent_init, an encrypted keystore in ~/.tradedefi; operators may set TRADEDEFI_AGENT_KEY instead) in this process and sends. The platform sets no money limit: the wallet holds only what its owner gives it. The operator may set own limits in the agent's environment (TRADEDEFI_AGENT_TABLES, TRADEDEFI_AGENT_MAX_USDC,…
| Parameter | Type | Description |
|---|---|---|
table * | string | table id (as in defi_list_tables) or the table contract address (0x…) |
confirm | boolean | true signs and sends on HyperEVM testnet within the limits; without it only the plan is shown |
wallet | string | wallet to plan for; default this agent's own wallet. Sending always uses that wallet. |
defi_deploy_plan Plan the deployment of your own table contract (dry run only)
Check the mandate of a new table contract (TRADEDEFI-2 on HyperEVM testnet, chain 998) against the same limits as the contract and the deploy script, with this agent's wallet as maker, and return the exact settings for a dry run of the deploy. Never signs or sends: the platform operator runs the deploy with these settings and a sender holding test HYPE. Hashes come from defi_backtest or defi_evaluator_hash; no API needed. After the deploy (and, if you set TRADEDEFI_AGENT_TABLES, after adding the contract there): defi_open_table with at least the minimum deposit.
| Parameter | Type | Description |
|---|---|---|
evaluatorHash * | string | evaluator hash of the strategy (defi_evaluator_hash) |
ruleHash * | string | rule hash of the strategy (defi_backtest or defi_check_graph) |
bandBps | integer | price band in bps; default 100 |
maker | string | maker of the table; default this agent's own wallet |
markets | array | markets of the mandate; default BTC on testnet (asset 3, szDecimals 5) |
maxLeverageBps | integer | leverage ceiling in bps; default 30000 (3x) |
minDeposit | string | minimum deposit in USDC; default "1" |
noticeSeconds | integer | notice before a new version takes effect; default 86400 |
perfFeeBps | integer | performance fee in bps; default 0 |
sides | string | directions it may open; default both |
defi_agent_init Make this agent its own wallet (self-onboarding)
Make a fresh EVM wallet for this agent in this process: the key is encrypted with TRADEDEFI_AGENT_KEYSTORE_PASSWORD (set in the env of the MCP config) into ~/.tradedefi/agent-<address>.json, next to a pairing code. Answers with the address, the file path and a link: the person opens it in the browser of their account wallet, ticks permissions, signs and funds the agent; then this agent accepts by itself. Never shows the key or the password, never overwrites a file, sends nothing to any server. If this session already has a wallet, it answers with that one (fresh: true makes a new one). Never p…
| Parameter | Type | Description |
|---|---|---|
fresh | boolean | true makes a new wallet even if this session already has one |
name | string | local label to pick this wallet later with TRADEDEFI_AGENT_NAME; never sent anywhere |
defi_agent_accept Accept the grant your account signed for this agent
Read the open offers to this agent's wallet and accept exactly one: an offer with this session's pairing code (from defi_agent_init), or an offer without code from the account that already holds this agent's active grant (changed permissions). The agent rebuilds both texts itself and signs only if they match byte for byte. More than one fitting offer: accepts none and says so. Answers with the account, the permissions and the expiry. Runs by itself before any tool that signs, so calling it is optional. Never paste a private key into a chat.
defi_create_table Create and open your own Strat-Table (testnet)
Set up a Strat-Table on HyperEVM testnet with one of this agent's own published versions and open it with the opening capital, like a maker with "Sign and start" in the browser. You choose the version (defi_list_versions / defi_get_version, published by this agent's wallet), the market (default the market of the version), the direction, the leverage ceiling (1x to 10x in steps of 0.5x, at most what Hyperliquid testnet allows on that market), the profit share (0 to 30 %) and the notice (24 h, 48 h or 7 days); the minimum deposit of new tables is 10 USDC (never below the floor of the Strat-Table…
| Parameter | Type | Description |
|---|---|---|
amount * | string | opening capital in USDC as decimal text, at least the minimum deposit (10) |
evaluatorHash * | string | evaluator hash of one of this agent's own published versions (defi_list_versions with maker = this wallet) |
confirm | boolean | true signs and sends on HyperEVM testnet within the limits; without it only the preview is shown |
direction | string | both = long and short (default), long = long only, short = short only |
market | string | Hyperliquid testnet market, like "BTC"; default the market of the version |
maxLeverage | number | leverage ceiling, 1 to 10 in steps of 0.5; default 3 |
notice | string | notice before a new version takes effect: "24 h" (default), "48 h" or "7 days" |
profitShare | integer | profit share of the maker in %, 0 to 30; default 20 |
wallet | string | wallet to plan for; default this agent's own wallet. Sending always uses that wallet. |