Connect an app or agent
You can let an AI assistant (Claude, ChatGPT and others that support MCP), a chat integration (Telegram or X, for example) or your own script use Edge for you. You approve it once, in your own wallet, on an Edge page; after that it calls Edge with a token and needs no private key and no signing code.
Edge offers the same operations through two doors: an MCP server at https://edge.polytrade.app/mcp for AI apps, and an HTTP API at https://edge.polytrade.app/api/v1 for scripts. The OpenAPI document is at https://edge.polytrade.app/api/v1/openapi.json.
In this release, connected apps can read your account and, if you allow creator actions below, act on all your baskets on their own, without asking you each time, and claim your earnings to your own wallet. They cannot start agents, exit agents or move money anywhere else.
Connect once
Claude and other MCP apps
Add https://edge.polytrade.app/mcp as a remote MCP server. The app opens Edge's consent page in your browser; you connect your wallet there, choose what the app may do, and sign. The app then holds the token, not you.
A script on a server, or a chat integration
Use device login, which needs no browser on the machine running the script:
- Register a client once:
POST https://edge.polytrade.app/oauth/registerwith a JSON body ofclient_nameand"grant_types": ["urn:ietf:params:oauth:grant-type:device_code", "refresh_token"]. Keep theclient_idit answers. - Start a login:
POST https://edge.polytrade.app/oauth/devicewithclient_idandscope=read creator. It answers auser_codeand a link. - Approve it yourself: open
https://edge.polytrade.app/link, enter the code, connect your wallet and sign. - Collect the tokens: poll
POST https://edge.polytrade.app/oauth/tokenwithgrant_type=urn:ietf:params:oauth:grant-type:device_code, yourclient_idand thedevice_code, every 5 seconds, until it answers your tokens. Polling faster answersslow_down.
An access token lasts 15 minutes. Get a new one with grant_type=refresh_token on the same endpoint; keep the refresh token as you would a password.
What you approve
The consent page lists each permission in these words. You tick the ones the app may have:
- read: See your baskets, agents and balances.
- creator: Publish baskets, change and reshuffle all your baskets, and claim your earnings to your own wallet.
With the creator permission ticked, the page also says:
This app can change the tokens in all your baskets, publish new ones and claim your earnings to your own wallet. Anyone copying your baskets still gets 24 hours' notice before a change takes effect. Publishing, editing and reshuffling all count toward the daily limit below, and you can switch publishing off.
and you set two limits:
- Most changes a day, from 1 to 200 (default 20). Publishes, changes and reshuffles that succeed count toward it over the last 24 hours, counted by the hour; claims and pre-checks do not. A call over the limit answers
429 creator_daily_cap. - May publish new baskets, on by default. When it is off, publishing answers
403 publish_not_allowed.
A permission lasts at most 30 days. You can see and revoke every connection on the Connected agents page; a revoked app is cut off within 30 seconds. A permission given before the creator tools existed cannot use them (they answer 403 grant_outdated): connect the app again.
Money only goes to you. No operation takes a recipient or an address. A claim always pays the wallet that signed the permission, whoever makes the call. While an agent wallet is funded, Edge holds its key, as it does for agents you start in the app.
Operations
This is the list this deployment serves right now. Each one is the same operation through either door: the HTTP path is /api/v1/ plus its name with dots as slashes, and the MCP tool is edge_ plus its name with dots as underscores. The OpenAPI document has every input and answer in full.
GET /api/v1/grant/get · MCP edge_grant_get · read permissionWhat the owner allowed this connection to do: scopes, chains, the spending envelope, what it has used, and when it expires.
GET /api/v1/baskets/list · MCP edge_baskets_list · no connection neededPublished baskets, newest and most-copied first, up to 60. Page with cursor and limit.
GET /api/v1/baskets/get · MCP edge_baskets_get · no connection neededA basket's composition, any pending change (with when it takes effect), its risk settings and its stats.
GET /api/v1/agents/list · MCP edge_agents_list · read permissionEvery agent the owner has, open and closed, newest first. Page with cursor and limit. Use agents.get for live balances.
GET /api/v1/agents/get · MCP edge_agents_get · read permissionOne agent's policy and live balances. status.stale is true when the chain could not be read; figures are then null.
GET /api/v1/operations/get · MCP edge_operations_get · read permissionPoll an operation an earlier call answered with 202. status is pending, succeeded or failed.
POST /api/v1/baskets/create · MCP edge_baskets_create · creator permissionPublish a new basket under the owner's wallet, manual or AI-managed, with the same rules as the Edge app: the token screen, the identity check and the risk ranges. A single-chain basket sends tokens; a cross-chain one sends tier "cross" and two or more legs, each with its chain, its weightPct (a whole percent of the budget, all legs adding up to 100) and its tokens. A token's weight is a fraction of its basket or leg, adding up to 1 (0.25 is 25%). Send chain: "hyperliquid" and tokens named by Hyperliquid market (ETH, SOL) with side: "short" to publish a short basket. Answers the new basket's id.
POST /api/v1/baskets/update · MCP edge_baskets_update · creator permissionReplace the full composition of one of the owner's baskets: tokens for a single-chain basket, or every leg for a cross-chain one (each leg's chain and tokens; a leg's weightPct may be left out or sent as it is, since the split between chains cannot change). A token's weight is a fraction adding up to 1 within its basket or leg. What baskets.get answers can be sent back as it is: each row takes dec or decimals, and an optional emoji. If anyone copies it, the change waits 24 hours so copiers can see it and exit; the answer gives effectiveAt. The same token screen and identity checks as publishing apply. A short basket is edited the same way, with every row a Hyperliquid market and side: "short".
POST /api/v1/baskets/withdraw · MCP edge_baskets_withdraw · creator permissionTake one of the owner's baskets off Edge: it leaves the public list and its link stops working, and the owner still sees it, marked withdrawn. Only while nobody copies it and nothing has been put into it; otherwise it answers has_copiers and nothing changes. It cannot be undone through the API.
POST /api/v1/baskets/reshuffle · MCP edge_baskets_reshuffle · creator permissionRe-derive one of the owner's baskets now: an auto basket picks again from the live feed, a managed one re-affirms its tokens. A cross-chain basket is left as it is. A short basket answers not_supported: it is changed with baskets.update.
POST /api/v1/baskets/suggest · MCP edge_baskets_suggest · creator permissionDescribe a basket in a sentence; Edge suggests candidate tokens and screens each one, and creates nothing. Limited to 3 a minute and 30 a day per wallet, shared with the Edge app.
GET /api/v1/creator/earnings · MCP edge_creator_earnings · read permissionThe owner's earnings from people copying their baskets and from referrals, in USD: total earned, total paid, the creator and referral parts, and how many wallets they referred.
POST /api/v1/creator/claim · MCP edge_creator_claim · creator permissionPay the owner's unpaid earnings to the owner's own wallet. Takes no input: the payout can go nowhere else. Answers paidUsd 0.00 when there is nothing to claim, and pending true when the payout was sent but is not confirmed yet.
Calling the API
- Authorization. Send
Authorization: Bearer <access token>on every call. - Inputs. A
GETtakes its input as query parameters; aPOSTtakes a JSON body. - Retries are safe with a key. Every operation that changes something needs an
Idempotency-Keyheader of 1 to 64 characters (letters, digits and_ . : -). A retry with the same key gets the first answer back instead of running twice. An answer markedretryablefrees the key, so you can try again with it. Use a new key for a change you mean to make again. - Over MCP, most apps cannot send a key. Without one, the same write with the same input within about 10 minutes is treated as one and the repeat gets the first answer. Changing a basket's tokens always runs, since running it again is safe: it answers unchanged or withdrawn. An app that can set
_meta.idempotencyKeyon the tool call gets the same rules as the header. - Errors come back as
{ "error": { "code", "message", "retryable", "details"? } }. Over MCP an error is a result withisError: true, with the same body instructuredContent.error. - Long operations may answer
202with an operation id; poll it with the operation check above.
Example (Node, a connected script)
const EDGE = "https://edge.polytrade.app";
const token = process.env.EDGE_ACCESS_TOKEN; // from device login; refresh it with /oauth/token
export async function call(path, body) {
const res = await fetch(`${EDGE}/api/v1/${path}`, {
method: "POST",
headers: {
authorization: `Bearer ${token}`,
"content-type": "application/json",
"idempotency-key": `${path.replace(/\//g, "-")}-${Date.now()}`,
},
body: JSON.stringify(body),
});
return { status: res.status, body: await res.json() };
}
// Replace the tokens of one of your baskets:
// await call("baskets/update", { id: "my-basket", tokens: [...] });
Weights and cross-chain baskets
- A token's weight is a fraction of its basket, and the weights add up to 1:
0.25is 25%. Weights that add up to about 100 are refused with a message saying so. - A cross-chain basket splits the budget between chains in legs. A leg's
weightPctis a whole percent from 1 to 99, and the legs add up to 100. Inside each leg, the token weights add up to 1 again. - To publish one, send
"tier": "cross"and two or more legs; you can leavetokensout. Legs withouttierare refused rather than published as a single-chain basket. - To change one, send
legsand notokens, with every chain the basket has and the tokens each will hold. The split between chains and the list of chains cannot change, because copiers are already funded on each; leaveweightPctout or send it as it is. A single-chain basket is changed withtokensalone. - Read, change, send back. What the basket read answers is in the same shape and units, so you can edit it and send it back.
Publishing a cross-chain basket (the body of the publish call):
{
"name": "Two chain memes",
"tier": "cross",
"legs": [
{ "chain": "base", "weightPct": 60, "tokens": [
{ "addr": "0x…", "symbol": "AAA", "dec": 18, "weight": 0.5 },
{ "addr": "0x…", "symbol": "BBB", "dec": 18, "weight": 0.5 } ] },
{ "chain": "solana", "weightPct": 40, "tokens": [
{ "addr": "…pump", "symbol": "CCC", "dec": 6, "weight": 1 } ] }
]
}Which tokens a basket can hold
Every publish, change and reshuffle checks each token on Edge's servers, the same way the app does. If any token fails, the call answers 400 rug_filtered, nothing is changed, and details.rejected lists each token that failed with the check, what Edge measured (got) and what it needs (need). Drop those tokens and try again. A token Edge could not check right now answers 503 vetting_unavailable; retry it later.
- quote_liquidity: at least $50,000 of liquidity on the USDC, ETH or SOL side of its pools. This is often about half of the total pool liquidity most sites show, so a token showing $75,000 in total can still fail.
- pool_age: its oldest market is at least 72 hours old.
- volume: at least $25,000 traded in the last 24 hours against USDC, ETH or SOL.
- buy_failed, sell_failed, unverifiable: a test buy and sell must go through.
- buy_tax, transfer_tax: the token itself may take at most 1% on a trade.
- sell_tax: a test round trip may lose at most 10%, pool fees included.
- freezable, seizable (Solana): the token's issuer must not be able to freeze holders or move their tokens.
The checks run in this order and only the first failure is reported for each token. Well known tokens Edge already lists, and the quote assets themselves, are not checked.
What does not change for people copying your baskets
A change made through an app is treated exactly like one made in the Edge app:
- 24 hours' notice. If anyone copies a basket, a change to its tokens waits 24 hours before it takes effect, so copiers can see it and exit. The answer gives
effectiveAt. - Screening. Every change goes through the same token screen and identity checks as a new basket.
- No turning a basket AI-managed. An update cannot add or change an AI prompt.
- Copiers' agents pace the rebalance. Each run moves only part of the basket.
- A copied basket stays up. You can withdraw a basket only while nobody copies it and nothing has been put into it; otherwise the withdraw answers
409 has_copiersand nothing changes.
Change a basket only when you have something to say: every change restarts the 24-hour notice your copiers see.
How copying, fees and risks work is on the main docs page. The Terms cover the apps you connect, and are drafts pending legal review.