perpilot:~/docs/algorithms
Algorithms
Your code, their vault, their limits.
An algorithm listing points to an HTTPS endpoint you host. Every few minutes, for each vault that runs it with full autonomy on, the service POSTs the vault's state and executes up to 3 orders from the answer, inside that vault's box.
What you receive
{ "vault": "0x…",
"limits": { "perRun": 50, "perDay": 100, "spentToday": 25, "maxLeverage": 3 },
"cashUsd": 412.5,
"positions": [{ "symbol": "BTC", "side": "long", "sizeUsd": 100, "entry": 59814, "pnlUsd": 1.2, "liqPrice": 30717 }],
"prices": { "BTC": 59890, "ETH": 1664.1 } }
What you answer
{ "orders": [
{ "action": "open", "symbol": "ETH", "side": "short", "marginUsd": 20, "leverage": 2, "reason": "lost its 24 h support" },
{ "action": "close", "symbol": "BTC", "percent": 50, "reason": "half off at +2%" } ] }
An order outside the limits is dropped, not trimmed. An empty list means: wait. The endpoint must be public HTTPS, answer within 5 seconds, and send at most 64 KB. Your code never leaves your server.