ponk (Python)
A thin client for the ponk public API: create and drive liquidity agents on Solana, Ethereum, Arbitrum, Base, BNB Chain and Robinhood Chain, read their live positions, PnL and fees, and move funds home.
Standard library only. No dependencies, no code generation, one method per endpoint. It never computes a number the server did not send.
Install
pip install ponk
0.16.0 puts every chain on the boards and trackers (see Chains on the boards and trackers), adds liquidity shapes to EVM agents (see Shapes) and states the exit fee. 0.15.0 adds the five EVM chains (see Agents on EVM chains). 0.7.0 brings everything the site does to a key: Jupiter limit, trailing, TP/SL and DCA orders (a sign link, or self-sign with your own signer callback), copy and live follow, Copy LP, the self-custody prepare and mark loop, calls, push, card looks, referral codes, privacy, and preset ranking in one call (see Changes in 0.7.0). To install from this repository instead:
git clone https://github.com/ponkexchange/ponk-sdk
pip install ./ponk-sdk/python
or put the python directory on PYTHONPATH and import ponk.
Python 3.8 or newer.
Webhooks
ponk POSTs a signed JSON body to a URL you register. Verify it before you act on it:
from ponk import verify, InvalidSignature
@app.post("/ponk")
def receive(request):
try:
event = verify(
raw_body=request.get_data(), # BYTES, as received
signature_header=request.headers["X-Ponk-Signature"],
secret=MY_WEBHOOK_SECRET,
)
except InvalidSignature:
return "", 400
if event.event == "agent_out_of_range":
page_someone(event.agent_id)
return "", 200 # anything but 2xx is a failure, and ponk retries
Verify the raw bytes you received. The signature covers the exact body on
the wire, and json.dumps(json.loads(body)) is not guaranteed to reproduce
it, so verifying a re-serialized dict fails for reasons that look like a ponk
bug and are not.
verify checks the HMAC and the age of the delivery, and raises
InvalidSignature with a message saying which of the two failed. The
timestamp is inside the MAC, so a captured delivery cannot be aged forward.
Registering endpoints is not in this client, and that is deliberate: the API scopes it to a signed-in session rather than to an API key, exactly as it does for minting keys. Register them in the app, under Settings, then verify here.
Get a key
Open Settings, API keys in the app with your
wallet. Name the key, pick Read only (read) or Read and act
(trade), and copy the secret. It is shown once: the server stores only a hash
of it, so it genuinely cannot be shown again. Lost keys get revoked and
replaced, not recovered.
A key carries exactly the authority of the wallet that minted it. It can never see or touch another account, and it cannot mint or revoke keys, so a leaked key cannot extend or outlive its own revocation.
Quickstart
import os
from ponk import PonkClient
ponk = PonkClient(api_key=os.environ["PONK_API_KEY"])
me = ponk.whoami()
print("acting as", me.wallet_address, "with scope", me.scope)
for agent in ponk.list_agents():
print(agent.name, agent.status, agent.strategy, "dry_run" if agent.dry_run else "live")
perf = ponk.agent_performance(agent.id)
# Every USD field is a string or None. None means "could not be priced",
# never zero, so print a dash rather than a number you do not have.
print(" value", perf.current_value_usd or "-", "pnl", perf.pnl_usd or "-")
pos = ponk.agent_position(agent.id)
if pos.position_address:
print(" range", pos.lower_price or "-", "to", pos.upper_price or "-",
"in range" if pos.in_range else "OUT OF RANGE")
for log in ponk.list_logs(limit=20):
print(log.created_at, log.action_type, log.status, log.tx_signature or "")
Create an agent, watch it think, then let it trade:
agent = ponk.create_agent(
name="sol-usdc runner",
wallet_address=me.wallet_address, # must be the key's own wallet
dex="meteora_dlmm", # meteora_dlmm | meteora_damm_v2 | orca | raydium
pool_address="POOL_ADDRESS",
strategy="bin_rebalancer",
config={"kind": "bin_rebalancer", "bin_range_width": 20, "rebalance_threshold_bins": 5},
dry_run=True, # required: True simulates, False is live
)
# A dry-run agent runs its whole strategy loop and logs every decision to
# list_logs without sending a transaction. Read those logs before going live.
ponk.set_dry_run(agent.id, False)
dry_run is required by this client even though the server accepts it
omitted, because on POST /v1/agents an omitted dry_run creates a live
agent, the opposite of the app's default. A non-boolean raises TypeError
before anything is sent. A live agent created here is still non-custodial: it
recommends, and cannot sign for funds until a mandate signed in the app makes
it autonomous.
For Degen Mode, strategy="entry_agent": the agent starts with no pool, so
pool_address and position_address are ignored, and its config's venues
must include one where ponk can discover pools, which today is only
meteora_dlmm.
Price a wide Meteora range before you ask for one. The quote separates the rent you get back from the rent you do not:
q = ponk.range_cost("meteora_dlmm", "POOL_ADDRESS", bins=400) # TOTAL bins
print(q.total_bins, "bins,", q.down_pct, "% to", q.up_pct, "%")
print("hold", q.total_upfront_lamports, "lamports;",
q.non_refundable_lamports, "of it does not come back")
if q.clamped:
print("the venue caps a position at", q.max_total_bins, "bins")
Move funds home:
wallet = ponk.agent_wallet(agent.id)
print(wallet.pubkey, wallet.lamports, "lamports")
ponk.withdraw(agent.id, lamports=500_000_000) # 0.5 SOL, or omit to sweep
result = ponk.exit_agent(agent.id) # stop, close, sweep everything
print("swept to", result.destination, "sig", result.signature)
Agents on EVM chains
Agents run on Solana and on Ethereum, Arbitrum, Base, BNB Chain and Robinhood
Chain. The chain words are solana, ethereum, arbitrum, base, bsc and
robinhood; the EVM venues are uniswap_v2, uniswap_v3, uniswap_v4
(Ethereum, Arbitrum, Robinhood Chain), pancakeswap_v2, pancakeswap_v3,
pancakeswap_infinity_cl (BNB Chain) and aerodrome_slipstream,
aerodrome_classic (Base). ponk.evm holds those tables and the id helpers.
from ponk import PonkClient, evm, fund_link
ponk = PonkClient(api_key="ponk_live_...")
# 1. Pools on BNB Chain. No key needed for this read.
board = ponk.evm_pools("bsc", venue="pancakeswap_v3")
pools = [p for p in board.pools if p.fees.h24 and not p.flags()]
pool = max(pools, key=lambda p: p.fees.h24)
print(pool.pair, pool.fee_pct, pool.tvl, pool.farm) # farm: CAKE, live, apr_pct
# 2. What the first open costs, and the rates this key's agents pay.
cost = ponk.evm_open_cost("bsc", pool.dex, pool=pool.address)
print(evm.wei_to_native(cost.min_open_wei), cost.native_symbol)
# 3. Create. The range is fractions: 0.05 is 5% either side of the price.
agent = ponk.create_evm_agent(
name="bnb " + pool.pair,
wallet_address=ponk.whoami().wallet_address, # your Solana login wallet
chain="bsc", dex=pool.dex, pool_address=pool.address,
down_pct=0.05, up_pct=0.05,
stake=True, # farm CAKE
dry_run=False,
)
# 4. Fund it and sign for it, with your own wallets.
print("send BNB to", ponk.create_agent_wallet(agent.id).address)
print("then sign:", fund_link(agent.id, chain="bsc"))
examples/evm.py is that flow, creating nothing unless PONK_CREATE=1.
Shapes on EVM agents
An agent on a range venue takes a liquidity shape: spot (one even range,
the default), curve (heaviest at the price), bid_ask (heaviest at the
edges) or spot_bid_ask (half of each). On Uniswap v3 on Arbitrum, Ethereum
and Robinhood Chain, Uniswap v4 on Arbitrum and Ethereum, PancakeSwap v3 and
Infinity CL on BNB Chain and Aerodrome Slipstream on Base
(evm.SHAPE_VENUES) a shape other than Spot opens as several ranges managed
as one position; shape_ranges is "auto" (chosen from live gas so opening
and later closing stays within 3% of the deposit) or 1 to 7. On any other
range venue the agent keeps the shape and opens one range. A one-sided range
is one side at 0.
# What a Curve position of $1,000 opens as on Arbitrum right now.
cost = ponk.evm_open_cost("arbitrum", "uniswap_v3", pool=POOL, shape="curve", amount_usd=1000)
print(cost.shape["ranges"], cost.shape["entry_cost"], cost.shape["note"])
agent = ponk.create_evm_agent(
name="weth usdc curve", wallet_address=ME, chain="arbitrum",
dex="uniswap_v3", pool_address=POOL,
down_pct=0.05, up_pct=0, # one sided, below the price
shape="curve", shape_ranges="auto", dry_run=False,
)
plan = ponk.copilot_evm_plan("$1000 in an arbitrum pool", shape="bid_ask", one_sided="below")
print(plan.legs[0].shape.sentence)
evm.with_shape(config, shape, shape_ranges=...) writes the same keys into a
config of your own (knobs.liquidity_shape, or the top-level
liquidity_shape on adaptive_range_recovery, and evm.shape_ranges).
Per-side shapes are the config keys shape_below, shape_above and
ratio_below_pct.
| Method | Route | What it does |
|---|---|---|
evm_chains() |
GET /public/evm/chains |
Every chain, its gas coin and its venues. |
evm_pools(chain, venue=None) |
GET /public/evm/{chain}/board |
The pool board: fee tier, dynamic_fee, TVL, volume and LP fees per window, farm, flags(). |
evm_pool(pool_id) |
GET /public/evm/pools/{id} |
One pool by its CAIP id. |
evm_token(token_id) |
GET /public/evm/tokens/{id} |
One token; the zero address is the gas coin with its price. |
evm_open_cost(chain, dex, pool=, stake=, shape=, ...) |
GET /v1/evm/{chain}/open-cost |
Gas of the first open, the exit reserve, the least to hold, the fee rates, and with shape the ranges it opens as. |
create_evm_agent(...) |
POST /v1/agents |
An agent on an EVM chain: down_pct, up_pct, stake, withdrawal_address, shape, shape_ranges. |
set_stake_rewards(id, stake) |
PATCH /v1/agents/{id}/config |
Stake for CAKE or AERO from the next open. |
copilot_evm_plan(text, shape=, one_sided=) |
POST /copilot/evm/plans |
Plan one sentence in dollars: "$200 in the top 5 bnb pools". |
copilot_evm_get_plan(id) |
GET /copilot/evm/plans/{id} |
The plan again. |
copilot_evm_start(id) |
POST /copilot/evm/plans/{id}/start |
One agent per pool, plus sign_urls and fleet_id. Moves no money. |
evm_fleet() |
GET /agents/evm/fleet |
Every EVM agent and what it still needs from you. |
Pass public=False to the four pool reads for their /v1 twins, on the key's
budget instead of the per-IP limit.
An EVM agent is read and driven by id with the methods every agent uses:
get_agent (chain), agent_wallet (address, native_symbol,
balance_wei, min_open_wei, withdrawable_wei, balance_usd,
withdrawal_address, mandate_status), agent_position (ticks, bin_step,
staked), agent_performance (farm_rewards with apr_basis, pnl_note,
figures_unavailable), agent_decisions, agent_value_history,
agent_mandate, list_positions, pause_agent, resume_agent,
update_config, withdraw and exit_agent, which return tx_hashes,
amount_wei, received, status and sentence.
Units: wei amounts are decimal strings and evm.wei_to_native reads one
exactly; USD amounts are decimal strings; pnl_pct and drawdown_pct on
agent_performance are fractions on every chain (0.05 is 5%); a figure the
server could not read is None, never 0.
The mandate of an EVM agent takes two signatures, your Solana login wallet and
the EVM wallet that will receive withdrawals, and both are made on
ponk.exchange. fund_link(agent_id, chain=...) and fund_links([...]) build
that page's link, 40 agents to a link; this client reads the mandate's status
and never signs. Revoking a mandate and the exit card are on ponk.exchange too.
An agent created with a key pays 1.5% of its first open, once, and 15% of the
fees it earns (0.75% and 13.5% for a wallet holding 1,000,000 $PONK), and 1%
of what it sends you once it has opened a position (0.5% for a holder).
agent.activation_fee_bps, agent.managed_fee_bps, agent.exit_fee_bps and
evm_open_cost state the rates for you; withdraw and exit_agent list what
the exit fee took in exit_fees.
Chains on the boards and trackers
The agents leaderboard, Calls, the X Tracker and the Wallet Tracker cover
Solana, BNB Chain, Base, Ethereum, Arbitrum and Robinhood Chain. chains on
leaderboard, calls_feed, top_calls, callers_board, x_feed,
x_trending, x_callers, wallets_feed and wallet_activity is a list of
chain ids or "all"; left out, a public read covers every chain and a
signed-in read your saved filter. Every answer carries chains, the ids it
covers. A token is a Solana mint or an EVM token id
(evm.token_id("bsc", "0x...")), a wallet a Solana or an EVM address.
board = ponk.leaderboard("7d", chains=["bsc"]) # ranks from 1 on BNB Chain
for row in board.ranked:
print(row.rank, row.chain, row.dex, row.pnl_usd)
cake = evm.token_id("bsc", "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82")
t = ponk.x_token(cake) # chain, price_source
for call in ponk.calls_feed(mint=cake).calls:
print(call.chain, call.price_source, call.multiple_now)
ponk.set_feed_prefs("all") # the saved filter, trade key
print(ponk.feed_prefs().chains)
What a key cannot do
Three limits are structural. They are properties of how custody works in ponk, not settings that can be turned off.
- It cannot sign with your connected wallet. Non-custodial actions still need your signature in the app. This client can read their state, not produce the signature.
- It cannot create a custody mandate. A mandate is a signature from your
wallet, so it is granted in the app with your wallet connected. Once an
agent has one, a
tradekey can use it:set_autonomous(id, True)turns autonomous signing on under that existing, unexpired mandate, andset_autonomous(id, False)turns it off, which is always allowed. This client never sends agrant, and the server refuses a key request that carries one. - It cannot act on an agent that holds no wallet of its own.
compound,withdraw,exitandagent_walletoperate on the isolated wallet an autonomous agent owns. A self-custody agent has no such wallet, so those four do not apply to it. Reads, pause, resume, dry-run and mode do.
withdraw and exit have no destination parameter and cannot be given one.
The server locks the destination to the wallet that owns the agent. A stolen
key can move your funds home. It cannot move them anywhere else.
The mandate expires
A mandate carries a hard expiry, 365 days by default in the app (30, 90 or 180 when you pick them). Lapsing is a clock fact with nothing on chain to mark it: the agent keeps running and every signature it asks for is denied, so it quietly stops compounding, claiming and recentering with its funds still deployed. Read the expiry instead of waiting for the silence:
from ponk import PonkNotFoundError
try:
m = ponk.agent_mandate(agent.id)
except PonkNotFoundError:
m = None # no mandate: this agent is not autonomous
if m is not None:
# seconds_remaining is computed by the server and goes negative once the
# mandate has lapsed, so it does not depend on your clock.
if m.status == "expired":
print("expired", m.expires_at, "- renew it in the app")
elif m.seconds_remaining < 3 * 86400:
print("expires", m.expires_at, "- renew it in the app soon")
max_action_value_usdisNonewhen there is no per-action ceiling. That means unlimited, not zero.set_autonomous(id, False)does not revoke the mandate. A laterset_autonomous(id, True)re-arms the agent while the mandate is unexpired. Enabling also sets the agent live, but it does not restart an agent a previous exit leftstopped: readstatuson the result and callresume_agentif you need the loop running.set_autonomous(id, True)needs the agent's own managed wallet with an active, unexpired mandate that still pays out to this account's wallet. Otherwise it raisesPonkUnprocessableErrorwith a sentence saying which.compoundcan return a receipt and still have done nothing. A mandate denial is recorded on the action, not raised, so readsignature is Noneas "nothing reached the chain" anderror_messagefor why.- A lapsed mandate never traps funds.
withdrawandexitdeliberately bypass it and keep working after expiry. mandates()reads every autonomous agent's mandate at once, the most urgent first, withrenew_all_url: one page where your wallet signs every renewal in turn.- ponk also reminds at 7 days, 2 days and on expiry (
mandate_expiringandmandate_expirednotifications). A webhook registered from a signed-in session receives them; see Webhooks.
Methods
| Method | Endpoint | Needs |
|---|---|---|
health() |
GET /health |
nothing |
pool(dex, address) |
GET /pools/{dex}/{address} |
nothing |
range_cost(dex, address, bins) |
GET /pools/{dex}/{address}/range-cost?bins=N |
nothing |
ponk_perks(wallet_address) |
GET /public/ponk/perks/{address} |
nothing |
leaderboard(window=None, chains=None) |
GET /public/agents-leaderboard?window=24h|7d|30d|all&chains= |
nothing |
public_agent(slug) |
GET /public/agents/{slug} |
nothing |
public_agent_value_history(slug, range=None) |
GET /public/agents/{slug}/value-history |
nothing |
public_points_leaderboard(limit, offset) |
GET /public/points/leaderboard |
nothing |
resolve_referral(code) |
GET /public/referral/{code} |
nothing |
agents_activity() |
GET /public/agents-activity |
nothing |
ponkillionaires_week() |
GET /public/ponkillionaires/week |
nothing |
x_feed(before=, since=, limit=, category=, ca_only=, min_followers=, account=, q=, first_calls=, chains=) |
GET /public/x/feed |
nothing |
x_trending(window=None, limit=None, chains=None) |
GET /public/x/trending?window=1h|24h |
nothing |
x_callers(days=None, chains=None) |
GET /public/x/callers |
nothing |
x_token(mint) (a Solana mint or an EVM token id) |
GET /public/x/token/{mint} |
nothing |
x_accounts() |
GET /public/x/accounts |
nothing |
x_status() |
GET /public/x/status |
nothing |
wallets_feed(before=, limit=, kind=, min_usd=, token=, wallet=, chains=) |
GET /public/wallets/feed |
nothing |
wallets_defaults() |
GET /public/wallets/defaults |
nothing |
wallets_status() |
GET /public/wallets/status |
nothing |
wallet_activity(address, before=, limit=, kind=, min_usd=, token=, chains=) |
GET /public/wallets/{address}/activity |
nothing |
feed_prefs() |
GET /v1/feed-prefs |
read |
set_feed_prefs(chains) |
PATCH /v1/feed-prefs |
trade |
whoami() |
GET /v1/me |
read |
list_agents() |
GET /v1/agents |
read |
get_agent(id) |
GET /v1/agents/{id} |
read |
agent_performance(id) |
GET /v1/agents/{id}/performance |
read |
agent_position(id) |
GET /v1/agents/{id}/position |
read |
agent_value_history(id, range=None) |
GET /v1/agents/{id}/value-history |
read |
agent_decisions(id, hours=None, limit=None) |
GET /v1/agents/{id}/decisions, raw JSON |
read |
agent_wallet(id) |
GET /v1/agents/{id}/wallet |
read |
agent_mandate(id) |
GET /v1/agents/{id}/mandate |
read |
mandates() |
GET /v1/agents/mandates |
read |
list_positions() |
GET /v1/positions |
read |
list_logs(limit) |
GET /v1/logs (limit 1 to 500, default 100) |
read |
get_public_link(id) |
GET /v1/agents/{id}/public-link |
read |
list_follows() |
GET /v1/follows |
read |
points() |
GET /v1/points |
read |
points_leaderboard(limit, offset) |
GET /v1/points/leaderboard |
read |
referral() |
GET /v1/referral |
read |
creator_dashboard(days=None) |
GET /v1/referral/creator |
read |
check_handle(handle) |
GET /v1/referral/handle/check |
read |
get_json(path, params) |
any GET, raw JSON |
depends on the route |
create_agent(...) |
POST /v1/agents |
trade |
copy_agent(source, name=, wallet_address=, dry_run=) |
public_agent then POST /v1/agents from its copy block |
trade |
optimize_draft(draft) |
POST /v1/agents/optimize-draft, raw JSON |
trade |
pause_agent(id) |
POST /v1/agents/{id}/pause |
trade |
resume_agent(id) |
POST /v1/agents/{id}/resume |
trade |
set_autonomous(id, enabled) |
POST /v1/agents/{id}/autonomous |
trade |
set_dry_run(id, dry_run) |
POST /v1/agents/{id}/dry-run |
trade |
set_mode(id, mode) |
POST /v1/agents/{id}/mode |
trade |
update_config(id, patch) |
PATCH /v1/agents/{id}/config |
trade |
update_exits(id, tp_sl=None, automation=None) |
POST /v1/agents/{id}/exits |
trade |
set_auto_compound(id, auto_compound, min_claimable_base_units=None, min_claimable_usd=None) |
POST /v1/agents/{id}/auto-compound |
trade |
share_agent(id, hide_usd=False, show_onchain=None) |
POST /v1/agents/{id}/public-link |
trade |
unshare_agent(id) |
DELETE /v1/agents/{id}/public-link |
trade |
follow(slug) / unfollow(slug) |
POST / DELETE /v1/follows/{slug} |
trade |
claim_handle(handle) |
POST /v1/referral/handle |
trade |
compound(id) |
POST /v1/agents/{id}/compound |
trade |
withdraw(id, lamports) |
POST /v1/agents/{id}/withdraw |
trade |
exit_agent(id) |
POST /v1/agents/{id}/exit |
trade |
create_agents(agents, create_wallets=True) |
POST /v1/agents/batch |
trade |
fund_prepare(transfers) |
POST /v1/agents/fund/prepare, unsigned transactions |
trade |
exit_agents(agent_ids, all_agents=False) |
POST /v1/agents/batch/exit |
trade |
withdraw_agents(agent_ids, all_agents=False) |
POST /v1/agents/batch/withdraw |
trade |
get_batch(batch_id) |
GET /v1/agents/batch/{batch_id} |
read |
fleet(offset=None, limit=None) / iter_fleet(limit) / fleet_all(limit) |
GET /v1/agents/fleet |
read |
create_agent_wallet(id) |
POST /v1/agents/{id}/wallet |
trade |
rebalance(id, new_lower_bin_id=, new_upper_bin_id=, strategy=, max_slippage_bps=None) |
POST /v1/agents/{id}/rebalance |
trade |
collect_fees(id, destination=None) |
POST /v1/agents/{id}/collect-fees |
trade |
rename_agent(id, name) |
PATCH /v1/agents/{id} |
trade |
delete_agent(id) |
DELETE /v1/agents/{id} |
trade |
agent_proof(id, hours=None) |
GET /v1/agents/{id}/proof |
read |
agent_range_history(id, range=None) |
GET /v1/agents/{id}/range-history |
read |
custody_withdraw(lamports=None) |
POST /v1/custody/withdraw |
trade |
custody_exit() |
POST /v1/custody/exit |
trade |
portfolio() |
GET /v1/portfolio |
read |
portfolio_history(range=None) |
GET /v1/portfolio/history |
read |
list_transactions(limit) |
GET /v1/transactions |
read |
list_risk_events(limit) |
GET /v1/risk-events |
read |
list_fees(limit) / fee_summary() |
GET /v1/fees, GET /v1/fees/summary |
read |
list_notifications(status, limit) / unread_notifications() |
GET /v1/notifications, /unread-count |
read |
mark_all_notifications_read() / mark_notification_read(id) / dismiss_notification(id) |
POST /v1/notifications/read-all, /{id}/read, /{id}/dismiss |
trade |
list_recommendations(status, limit) / get_recommendation(id) |
GET /v1/recommendations, /{id} |
read |
review_recommendation / approve_recommendation / dismiss_recommendation / snooze_recommendation(id, minutes) |
POST /v1/recommendations/{id}/{review,approve,dismiss,snooze} |
trade |
notify_settings() / update_notify_settings(...) |
GET / PUT /v1/notify-settings |
read / trade |
list_presets() / create_preset / update_preset / delete_preset |
GET / POST /v1/presets, PUT / DELETE /v1/presets/{id} |
read / trade |
Receiver-side, needing no key and no network:
| Function | Purpose |
|---|---|
verify(raw_body, signature_header, secret) |
Check a webhook delivery and parse it |
parse_signature_header(header) |
Split t=/v1= out of the header |
EVENT_KINDS |
Every kind ponk sends, for recognition, never for rejection |
The first four need no key at all. PonkClient() with no api_key reaches
them and nothing else. pool and range_cost are rate limited per IP. health() returns its report even when the API answers
503, because which component is down is the whole point of that call.
This client covers the key-authenticated /v1 API plus those four public
reads. The rest of the server's surface, the session-authenticated app routes
and the wallet-signed Meteora transaction builders under /public/meteora,
needs a wallet signature rather than a key, so it is out of scope here.
Errors
Every error carries the same envelope, and this client maps it by status:
{"error": {"code": "conflict", "message": "exit already running", "request_id": "..."}}
| Status | Exception | What to do |
|---|---|---|
| 400 | PonkBadRequestError |
Fix the request. code is invalid_strategy_config when the config did not match the strategy, and message names the field. |
| 401 | PonkAuthError |
Missing, malformed, unknown or revoked key. The last two are deliberately indistinguishable. Do not retry. |
| 403 | PonkForbiddenError |
The key is valid but read-only. Mint a trade key. Do not retry. |
| 404 | PonkNotFoundError |
No such object, or it belongs to another account. Also deliberately indistinguishable. |
| 409 | PonkConflictError |
Conflicts with in-flight work, for example an exit already running. Retry after a pause. |
| 422 | PonkUnprocessableError |
Understood but cannot apply, for example compounding an agent with no open position. code carries the risk code when there is one. |
| 429 | PonkRateLimitedError |
Back off and retry. Only the public per-IP routes (pool, range_cost, ponk_perks) are rate limited; /v1 is not. |
| 5xx | PonkServerError |
Quote request_id to support. |
| no response | PonkTransportError |
DNS, connection, TLS or timeout. |
All of them subclass PonkError. PonkAPIError carries status, code,
message, request_id and the decoded body.
from ponk import PonkAPIError, PonkConflictError, PonkTransportError
try:
ponk.exit_agent(agent_id)
except PonkConflictError:
pass # an exit is already running; it will finish
except PonkTransportError:
# A fund call that times out has NOT necessarily failed: the work keeps
# running on the server. Exit is idempotent, so call it again and it
# continues rather than double-sending.
ponk.exit_agent(agent_id)
except PonkAPIError as e:
print(e.status, e.code, e.message, e.request_id)
compound, withdraw and exit send several transactions and wait for each
confirmation, so they can take a minute. They get their own timeout,
fund_timeout (180s), separate from timeout (30s) for everything else.
Reading the numbers
- A null USD figure means unknown, not zero. An unpriceable pool returns
nullrather than a fabricated 0. Render it as a dash. Treating it as zero silently understates a position. - USD amounts on the agent and position endpoints are strings. Feed them to
decimal.Decimalbefore doing arithmetic. They are strings precisely so a float cannot round them. claimable_fees_usdandfee_pnl_usdare different numbers. The first is the unclaimed fees sitting on the position right now, the second is lifetime fees earned, claimed plus unclaimed. Do not add them.- PnL decomposes as Total = Price + Fee:
pnl_usd,price_pnl_usd,fee_pnl_usd.pnl_sourcesays whether the figures are Meteora's own (meteora_datapi) or ponk's on-chain valuation (oracle_estimate). cost_basis_estimatedmarks a position ponk did not open. The basis is then a first-observation stamp, so lifetime PnL staysNoneinstead of asserting a gain that contradicts your real numbers.- Every object keeps
raw_json, the exact decoded payload, so a field added to the API after this client was written is still reachable.
Fees
Autonomous agents charge a performance fee on realized yield, and a one-time
activation fee of 1% of the capital of an agent's first open (0.5% for a wallet
holding 1,000,000 $PONK), paid inside the transaction that opens it: a failed
open pays nothing, and recenters, re-opens, compounds and top-ups never pay it
again. A referrer earns 0.25% of that capital out of the fee. A withdrawal or
an exit from an agent that has opened a position pays an exit fee of 1% of
what leaves (0.5% for a wallet holding 1,000,000 $PONK), taken in kind in the
same run, on every chain, for agents created in the app and through the API
alike; an agent that never opened a position pays none
(ponk.EXIT_FEE_BPS, ponk.EXIT_FEE_HOLDER_BPS, agent.exit_fee_bps,
perks.exit_fee). There is no charge for a key, for a call or for
depositing.
An agent created through this API pays the API rate, not the app rate. The rate is fixed when the agent is created and follows that agent for its whole life, including after you enable autonomous mode for it in the app. Read both rates live rather than hardcoding them:
perks = ponk.ponk_perks(me.wallet_address)
print("app agents", perks.managed_agent_fee.effective_percent, "%")
print("api agents", perks.api_agent_fee.effective_percent, "%")
print("holding $PONK would make that", perks.api_agent_fee.holder_percent, "%")
agent.managed_fee_bps is the rate that specific agent's skim actually
charges, before any $PONK holder discount.
The activation rate is on the same perks read, and ponk.ACTIVATION_FEE_BPS,
ACTIVATION_FEE_HOLDER_BPS and ACTIVATION_REFERRER_BPS name the published
rates. A fee event charged on an activation carries source == "activation":
print("activation", perks.activation_fee.effective_percent, "%")
for e in ponk.list_fees():
if e.source == "activation":
print(e.fee_token_mint, e.platform_fee_amount)
People: profiles, follows and the Following feed
Every claimed @handle and every /r/ code opens a public profile. Follow a person and their agent, LP, call and (when they share them) swap activity lands in your Following feed, with a Copy action on each row. Every account is public.
p = ponk.profile("@kader") # no key needed
print(p.label, p.social)
for pos in ponk.person_positions("kader").positions:
print(pos.venue, pos.pool, pos.pnl_pct, pos.copy.mode)
ponk.follow_person("kader") # trade key
for row in ponk.following_feed(kinds="agents").rows:
print(row.actor.name, row.verb, row.pool, row.size_usd, row.copy.mode)
for r in ponk.people_board(window="7d").rows: # the people board, no key
print(r.rank, r.person.name, r.pnl_usd, r.roi_pct, r.vs_hodl_pct)
page = ponk.people_search("ch") # @handle, /r/ code or name, from
while page.people: # the first letter, 20 a page
for hit in page.people:
print(hit.display_name, hit.handle, hit.followers)
if not page.next_cursor:
break
page = ponk.people_search("ch", cursor=page.next_cursor)
for r in ponk.recommended_people(limit=5).people: # who to follow, no key
print(r.name, r.reason)
for r in ponk.similar_people("kader").people: # traders like this one
print(r.name, r.reason)
for r in ponk.my_recommended().people: # for your account
print(r.name, r.reasons)
ponk.dismiss_recommended(r.key) # never suggest again
Privacy
Every Ponk account is public since 0.11.0's server release (2026-10-29).
privacy, set_privacy and answer_privacy_prompt still answer, with the
public state, so older code keeps running; writes are accepted and ignored.
Wallet Tracker P&L, tracked LPs, X caller cards and Top calls
pnl = ponk.wallet_pnl(WALLET) # trading P&L per token, no key
for row in ponk.tracked_lps().rows: # curated wallets' open LPs
print(row.wallet["label"], row.position["pool_address"], row.position["pnl_usd"])
card = ponk.x_account("solana", days=30)
print(card.hit_rate, card.x2_rate, card.first_calls)
print(ponk.x_feed(first_calls=True).raw_json["items"][:1])
for call in ponk.top_calls(days=7, source="all").calls:
print(call)
The copilot (unreleased)
One sentence to a fleet plan, read by ponk's own closed grammar (no language
model anywhere). The copilot routes take a WALLET SESSION ONLY and refuse an
API key, so these methods need session_token= and never send api_key:
ponk = PonkClient(session_token="...") # from POST /auth/nonce + /auth/verify
plan = ponk.copilot_plan("put 2 sol into 4 agents on sol pools, stop all if down 10%")
plan = ponk.copilot_wait(plan.plan_id) # builds, then replays 30 days
totals = plan.replay.result["totals"]
print(totals["net_pnl_usd"], totals["hold_pnl_usd"], totals["net_vs_hold_usd"])
if plan.can_start:
start = ponk.copilot_start(plan.plan_id) # agents in dry run, UNSIGNED funding
print(start.sign_url) # your wallet signs there; nothing moves before
fleet = ponk.copilot_fleet(start.fleet_id)
ponk.copilot_stop_fleet(start.fleet_id) # managed exit of this fleet's agents only
copilot_parse, copilot_plan, copilot_get_plan, copilot_replay,
copilot_wait, copilot_start, copilot_fleets, copilot_fleet,
copilot_stop_fleet and copilot_tighten_stop (tighter only).
Amounts are SOL, exactly as typed: "$500", "half my sol" or "20% of my wallet"
are refused, never converted. A fleet is 1 to 8 agents on Meteora DLMM pools
only. Name a token by symbol ("jup pools") or by its mint; a symbol is
resolved to a mint. An ambiguous or unverified symbol is refused with
refusal["suggestions"], the tokens carrying it with their mints, most liquid
first, so you can put the one you mean into the sentence. plan.can_start turns true once the replay is done, and
plan.plan["totals"]["ponk_fee_bps"] is the Ponk fee on fees earned for this
wallet. After a start, copilot_fleet(...).funding lists what is left to fund
or approve with a fresh sign_url, and .exit names any agent whose exit
failed; copilot_stop_fleet on a stopping fleet retries only those. The replay is
one past window beside holding, not a forecast.
Changes in 0.11.0
- People search.
people_search(q, cursor=None)(PeopleSearch,SearchHit), no key. - Who to follow.
recommended_people,similar_people(no key),my_recommended,dismiss_recommended(Recommendations,RecommendedPerson). - Mandates.
mandates()(Mandates,MandateRow) withrenew_all_url. - Pool checks are advice.
create_agent(..., accept_pool_risk=True). - Copilot. Leg
warningsand refusalsuggestionsfor new tokens. - Every account is public: the privacy methods answer the public state.
Changes in 0.10.0
- People.
profile,followers,following,person_activity,person_positions,people_boardandlive_feed(no key);follow_person,unfollow_person,my_followingandfollowing_feed(API key). ModelsPerson,Profile,PeopleList,FollowState,MyFollowing,SocialFeed,ActivityRow,CopyAction,OpenPosition,PersonPositions,PeopleBoard. - Privacy.
privacy,set_privacyandanswer_privacy_promptover/v1/me/privacy(Privacy,PrivacySettings); the leaderboard-privacy names stay as aliases. - Activation fee.
PonkPerks.activation_fee,FeeEvent.source(activation), and the constantsACTIVATION_FEE_BPS,ACTIVATION_FEE_HOLDER_BPSandACTIVATION_REFERRER_BPS. - Trackers and calls.
wallet_pnl,tracked_lps,x_account,top_calls, andx_feed(first_calls=True).
Changes in 0.7.0
- Swap orders.
plan_orders([limit_order(...), tp_sl_order(...), dca_order(...)])validates up to ten orders and returns one link (plan.sign_url) where your wallet signs them. For a program that holds its own key:orders_sign_in(sign_message), thenplace_order(token, family, body, sign_transaction), or the single stepscraft_order_deposit,create_price_order,create_dca_order,cancel_order,confirm_order_cancel,list_orders,cancel_orders(token, all_orders=True)andconfirm_order_cancels. The Jupiter token is a per-call argument (X-Jupiter-Session), never stored. A 504outcome_unknownon a create or confirm is never retried. - Copy and follow.
copy_source,follow_status,follow_leader,update_follow,unfollow_leader,answer_follow_offer,list_copy_follows,follow_leadersandfollow_many(batches), and Copy LP:wallet_follow,unfollow_wallet,answer_wallet_offer,copy_log,copy_referral,attach_copy_referral. - Self-custody loop. Every prepare returns a
Prepared(an UNSIGNED build for your own wallet) and every mark aMarkedTx: the agent rebalance (prepare, prepare-split, prepare-open, mark), the fee claim (prepare, mark, confirm), the position builders,lp_withdraw_prepare, wSOL reclaim, stranded positions and cleanup,positions_sync. - Account. Calls, Web Push, card looks, referral codes, the Creator
application, leaderboard privacy and per-agent visibility,
clear_logs,weekly_recap,my_ponkillionaires,telegram_status,share_position_telegram, andrank_presets.
Still app only: minting a custody mandate, API keys, webhooks and linking Telegram.
Changes in 0.6.0
- Agent fleets.
create_agents([...])creates many agents in one call, each with its own wallet.fund_prepare(agent_ids)returns the UNSIGNED transfers that fund them all from your wallet, packed into as few transactions as fit: ten agents, one signature.iter_fleet()reads every agent with its wallet balance, mandate expiry and value, page by page.exit_agents(ids)andwithdraw_agents(ids)(orall_agents=True) close them all at once. A batch keeps running on the server after the response;get_batch(batch_id)collects what was stillrunning. - The client never signs. Your wallet signs the funding transfers, on
ponk.exchange (
plan.sign_urls, which also queues each custody mandate an agent still needs) or in wallet software you control (plan.transactions[i].unsigned_tx_b64). The SDK holds no key and asks for none. /v1parity with the app:rebalance,collect_fees,rename_agent,delete_agent,create_agent_wallet,agent_proof,agent_range_history,custody_withdraw,custody_exit,portfolio,portfolio_history,list_transactions,list_risk_events,list_fees,fee_summary, the notifications, the recommendations,notify_settingsand the saved presets.AgentWalletgainedwithdrawable_lamportsandtoken_accounts_with_value(Nonemeans the token read failed, never zero tokens).
batch = ponk.create_agents([
{"name": "fleet %d" % i, "dex": "meteora_dlmm", "pool_address": POOL,
"strategy": "bin_rebalancer", "dry_run": True,
"config": {"kind": "bin_rebalancer", "bin_range_width": 20, "rebalance_threshold_bins": 5}}
for i in range(10)
])
ids = [it.agent_id for it in batch.items if it.ok]
plan = ponk.fund_prepare(ids) # unsigned; sign at plan.sign_urls
for row in ponk.iter_fleet():
print(row.agent.name, row.wallet and row.wallet.lamports, row.mandate and row.mandate.status)
ponk.exit_agents(ids)
The whole flow, with polling, is examples/fleet.py.
Still app only: minting a custody mandate, API keys and webhooks. A key cannot produce a wallet signature, so these stay behind a wallet sign-in.
Changes in 0.5.0
- Live agents activity, no key:
agents_activity()returns the board agents' confirmed actions of the last 24 hours and every live hold, with no identity on any event. - Weekly Ponkillionaires, no key:
ponkillionaires_week()returns this week's standings, the prizes (next week's agent fee rate plus points) and last week's winners. - X Tracker, no key:
x_feed,x_trending,x_callers,x_token,x_accounts,x_status. - Wallet Tracker, no key:
wallets_feed,wallets_defaults,wallets_status, andwallet_activity(address)for any wallet. - Referral tiers:
referral()now carriestier(current,share_bps,referred_fees_usd,window_days,next) andprogramme(ladder,window_days). One level only: 20%, 25% from $1,000 and 30% from $5,000 of referred platform fees over 30 days. - The tracker and weekly race responses are camelCase on the wire; the models
expose snake_case attributes (
accounts_1hreadsaccounts1h). PublicLink.pathis documented as/ponkillionaires/<slug>, the path the server sends.
Not in the client, by design: following X accounts, tracked wallets, live copy
follow, mandate reminder settings and the PnL and referral card settings are
app session routes (/me/*, /agents/{id}/follow) that need a wallet
sign-in, not an API key.
ponk = PonkClient()
hot = ponk.x_trending(window="24h", limit=10)
week = ponk.ponkillionaires_week()
tier = PonkClient(api_key=KEY).referral().tier
print(tier.current, tier.share_bps / 100, "%", tier.next.min_fees_usd if tier.next else "top")
Changes in 0.4.0
- Top Ponkillionaires, no key:
leaderboard(window),public_agent(slug),public_agent_value_history(slug, range). - Copy an agent:
copy_agent(slug_or_row, name=, wallet_address=, dry_run=, config_overrides=None)creates an agent on your wallet from a shared agent'scopyblock. - Share and follow:
share_agent,unshare_agent,get_public_link,follow,unfollow,list_follows. - Points and referrals:
points,points_leaderboard,public_points_leaderboard,referral,creator_dashboard,check_handle,claim_handle,resolve_referral. - Agent reads:
agent_value_historyandagent_decisions. - Settings edits:
update_config,update_exits,set_auto_compound, andoptimize_draft. The docstrings list the new keys: keep side, reshape, cooldown and daily cap, the market cap, value and value plus fees take profits, and the Degen Mode bin step filter.
board = ponk.leaderboard(window="7d")
row = board.ranked[0]
mine = ponk.copy_agent(row, name="copy", wallet_address=me.wallet_address, dry_run=True)
standing = ponk.points()
print(standing.season.name if standing.season else "off-season", standing.total_points, standing.rank)
r = ponk.referral()
print("earned", r.total_earned_usd, "owed", r.owed_usd, "unproven", r.unproven_usd) # never add these
Changes in 0.3.0
- Breaking:
create_agentrequiresdry_run. 0.2.0 documented an omitteddry_runas a dry run. On/v1it is the opposite: an omitteddry_runcreates a live agent. Code that relied on the old wording was creating live agents, so 0.3.0 makes the choice explicit and raisesTypeErrorif it is missing or not abool. agent_mandate(id)reads the live custody mandate, including its expiry.set_autonomous(id, enabled)turns autonomous signing on under an existing mandate, or off. It never creates a mandate.range_cost(dex, address, bins)quotes what a Meteora range costs to open.get_json(path, params)reaches any GET this client does not name.- The User-Agent now carries the real package version (it said 0.1.0).
Tests
Offline, no network, no fixtures to refresh:
cd python && python3 -m pytest
python3 -m unittest discover -s tests -v runs the same suite without
pytest.
Metadata
Release files for ponk 0.16.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ponk-0.16.0.tar.gz | 208.3 kB | Without provenance | Details for ponk-0.16.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ponk-0.16.0-py3-none-any.whl | Python 3 | none | any | Details for ponk-0.16.0-py3-none-any.whl |
Total release size: 325.6 kB
Release files / ponk-0.16.0.tar.gz
| Download URL | ponk-0.16.0.tar.gz |
|---|---|
| Size | 208.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14f9963e7caf9474d3c3e01bc4feab39362b809b1ee29217f8d648ba6ca4f612
|
|
BLAKE2b-256 checksum How to use checksums |
294a08d2cfdc0d1ddcee6ff628b41eca449f4ec13de7c2d7d85611e3538eb0d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ponk-0.16.0-py3-none-any.whl
| Download URL | ponk-0.16.0-py3-none-any.whl |
|---|---|
| Size | 117.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d58ca2de0e7d5b8aea8a3d90bb35741102ba439aacbb08bca2cb683431ad2815
|
|
BLAKE2b-256 checksum How to use checksums |
618a721e00df28d191438509b91814141a677ed4696675de55fad8669c9eb01d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for ponk 0.16.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.