Builder codes are attribution only. AGG never lets a builder profile charge
your users an extra fee — see Fees are always zero.
Configuring
Open the admin dashboard → select your app → Settings → Builder Codes. Each supported venue has its own card showing the current value, when it was last updated, and live usage counters.
Only the owner of an app can set, update, or remove a builder code. Other
members see the section but get a 403 on write.
Where to get each value
- Polymarket — create a builder profile at
polymarket.com/settings?tab=builder. Both the maker and taker fee rate on that profile must be0. - Hyperliquid — any EVM address you control. It’s the address HL credits for the order flow.
- Predict.fun — your 5-character referral code from your Predict.fun account.
Limitless is not supported. Limitless exposes no attribution field we can
set on your behalf: their order payload has no builder field, sub-account
creation takes only a display name, and their referral API is read-only.
Attribution there is established by a
via= link at signup on
limitless.exchange, which your users never visit when trading through AGG.
We’ll add it when Limitless ships a settable field.Polymarket is validated on save
Polymarket is the one venue where AGG verifies your input before storing it. On save, the API calls Polymarket’s CLOB atGET /fees/builder-fees/<builderCode>
and refuses the write unless:
- The endpoint returns 200 — a 404 means the code isn’t registered with Polymarket at all.
- Both
builder_taker_fee_rate_bpsandbuilder_maker_fee_rate_bpsare0.
Fees are always zero
AGG rejects any attempt to attach a builder fee to a builder code:- The upsert body rejects
builderFeeTenthsBpsandfeeRateBpsoutright. - Polymarket profiles with a non-zero maker or taker rate are rejected on save.
- On Hyperliquid, configuring an app builder address forces the order’s builder
fee to
0. Because the fee is zero, AGG also skips theapproveBuilderFeehandshake your users would otherwise have to sign — swapping in your own builder address costs your users nothing and adds no extra signature prompt.
How each venue applies it
Attribution works differently per venue, and the difference is worth knowing because it changes when your code takes effect.Polymarket and Hyperliquid — per order
The code rides every order. When a user of your app submits, the executor looks up the(appId, venue) row via the user’s owning app and stamps it on that
order. If there’s no row — or it’s disabled — the order falls back to AGG’s
platform-wide builder value for that venue, or to no attribution at all.
A lookup failure never blocks a trade. Every resolution path swallows its errors
and returns “no override”.
Predict.fun — once per trader
Predict.fun has no order-level attribution field. Instead, the referral code is attached to the trader’s Predict.fun account, once, on their first order through your app. AGG records that it has done so and never asks the venue again for that user. Two consequences worth planning around:- It’s one-shot per trader. Predict.fun only accepts a referral “if not already set”. A trader who already has a referral on their Predict.fun account keeps it — your code will not replace it.
- Rotating your code only affects new traders. Changing the value in admin lets the next order retry the write for traders who never had one land; it cannot re-attribute traders already referred.
Usage stats and auto-disable
Every submit that uses your code updates the row, which is what the dashboard card renders:
On Polymarket, a failure only counts against your code when the error looks like
it came from the code itself — the message mentions “builder”, or it’s a
rate-limit (429), 401, or 403. That order is then retried immediately with the
platform fallback code, so a bad builder code degrades attribution, not fills.
Balance, allowance, and liquidity errors are never blamed on the code.
After 5 consecutive attributable failures the row is auto-disabled with the
reason
auto: 5 consecutive failures. While disabled it is skipped entirely and
every order uses the fallback. The dashboard shows the disabled state and reason.
Auto-disable applies to Polymarket and Hyperliquid only. Predict.fun
rejections are counted and shown, but never disable your code: the most common
rejection is simply that the trader already had a referral on their account,
which says nothing about whether your code is valid. Each trader is asked at
most once either way.
Re-saving the code clears the disabled marker, resets consecutiveFailures to 0,
and clears the last error — for Polymarket that means it also re-runs the CLOB
validation, so a re-save doubles as a health check. There’s no separate
“re-enable” button.