API base URL:
https://api.orderly.org (mainnet) or
https://testnet-api.orderly.org (testnet)New-order tag format: enum:<owning_broker_id>:<enum_id>Authentication: Public discovery endpoints are unauthenticated. Broker admin endpoints require
Orderly Ed25519 signature headers.Overview
A custom trading fee configuration is a broker-owned order classification with an additional fee rate. A DEX can attach the configuration to an order for strategy, vault, campaign, bot, or other product-specific flows. The current tag format separates two identities:
The configuration key is
{fee-owning broker, enum_id}. enum_id is not globally unique. For example, these tags select different fee configurations:
order_enum_fee is always separated from builder and affiliate fee-share calculations, including when the fee owner and executing broker are the same.
Legacy and current tag formats
Quick Start
1
Discover the owner's fee configuration
Query the public list with the fee owner’s broker ID:Select an active configuration from the response. API objects contain an unprefixed
enum_id, such as
GRID_PRO.See GET /v1/public/broker/order_enums.2
Build the order tag
Combine the owner from the query with the returned Do not use the executing broker’s ID unless it also owns the selected configuration.
enum_id:3
Submit the order
4
Verify the execution
Read the order and trade records after execution:
- Confirm the order returns the full
order_tagwithout truncation. - Confirm each trade exposes
order_enum_feeseparately. - Use trade-level values, not order estimates, for statements and reconciliation.
Order Tag Contract
Syntax
All new custom-fee-tagged orders use exactly three colon-separated segments:
Valid examples:
Build tags defensively
The following TypeScript helper enforces the current client-side contract:Referral-code behavior
A plainorder_tag, such as REFERRAL2026, remains a referral-code flow. An enum: tag identifies a custom trading fee configuration and does not replace the account’s existing referral relationship.
The custom trading fee is not part of referral-eligible fee revenue. Do not add order_enum_fee to an affiliate or executing-builder commission base.
Legacy tags
Do not sendenum:<enum_id> on a new order after the current format is enabled. The platform retains legacy parsing only so orders accepted before cutover can continue to fill, charge, and update owner statistics.
When reading historical legacy records, resolve the fee owner to the executing broker. Do not rewrite stored legacy tags.
Discover Custom Fee Configurations
Discovery APIs return unprefixedenum_id values. The caller combines the queried owner broker ID and returned enum_id to construct the full order_tag.
List configurations for an owner
Use GET/v1/public/broker/order_enums. This endpoint is unauthenticated and limited to 10 requests per second per IP address.
default_fee_rate for fee disclosure.
Cache public responses briefly, but treat order acceptance and trade results as authoritative. Do not use an archived configuration for new orders.
Get one configuration
Use GET/v1/public/broker/order_enum. This endpoint is unauthenticated.
Apply a Custom Fee to an Order
Set the optionalorder_tag field to the complete current-format tag.
order_tag has a 128-character transport and storage capacity. It cannot be changed after order acceptance. Cancel and replace the order if the tag must change.
Single order
Batch order
Algo order
Submission behavior
Before submitting, verify that:- The configuration was discovered under the same owner encoded in the tag.
- The configuration is active.
- The symbol and fee configuration are suitable for the order.
- The full tag passes the validation rules above and is not truncated by an SDK, database, queue, or log field.
Fee and Settlement Behavior
The custom trading fee is an additional per-execution fee:Economic ownership
Do not calculate builder, partner, or affiliate payouts from raw
fee or total_fee. Start from explicit eligible components or subtract order_enum_fee as defined by the settlement contract.
Signed maker settlement
Financial reconciliation must use the signed fee rate after subtracting the custom fee for the maker branch:baseMakerFee from effectiveTradeFee to manufacture positive builder or affiliate revenue.
Read and Reconcile Results
Order-level data
Order query APIs return the fullorder_tag. Use it for attribution and UI display.
Order-level
total_fee includes custom trading fees accumulated across executed trades. It is an aggregate display value, not a payout basis.
Trade-level data
Trade query APIs return per-executionfee, order_enum_fee, and order_enum_fee_rate.
Resolve attribution
For a trade using the current tag format:- Read the executing broker from the order or execution context.
- Parse the fee-owning broker and
enum_idfrom the fullorder_tag. - Classify the fill as same-builder when the two broker IDs match, otherwise cross-builder.
Usage statistics
The broker admin APIs aggregate usage by{fee-owning broker, enum_id}. Cross-builder activity therefore appears in the owner’s totals.
The aggregate does not split statistics by executing broker. Use durable order and trade data when a report needs executing-broker, same-builder, or cross-builder dimensions.
Manage Custom Fee Configurations
Call admin endpoints only from secured broker backend or admin tooling. Never expose signing keys in a DEX frontend. All configuration management APIs use an unprefixedenum_id. They do not accept the full enum:<broker_id>:<enum_id> tag.
Create a configuration
Use POST/v1/broker/order_enum. This authenticated endpoint is limited to one request per second.
Update a configuration
Use PUT/v1/broker/order_enum/{enum_id}. This authenticated endpoint is limited to one request per second. The configuration must be active, and enum_id cannot change.
pair_overrides:
- Omit it or send
nullto leave existing overrides unchanged. - Send an empty object to remove every override.
- Send a non-empty object to replace the existing override set.
List or get owned configurations
Use GET/v1/broker/order_enums or GET /v1/broker/order_enum/{enum_id}.
The authenticated responses include the fee configuration and owner-aggregated usage statistics:
Archive a configuration
Use POST/v1/broker/order_enum/archive. This authenticated endpoint is limited to one request per second.
Unarchive a configuration
Use POST/v1/broker/order_enum/unarchive. This authenticated endpoint is limited to one request per second.
PURGED and it cannot be restored.
Authentication and Rate Limits
Admin request headers
Public discovery endpoints do not require these headers.
Documented limits
Apply exponential backoff for
429 responses and cache public discovery results to avoid unnecessary requests.
Migrate a Legacy Integration
The current format reuses existing fee configurations. Migration changes the tag that clients send; it does not duplicate configuration rows.Before cutover
- Change tag construction from
enum:<enum_id>toenum:<owning_broker_id>:<enum_id>. - Update all client, server, SDK, schema, event, log, and analytics fields that carry a full
order_tagfrom 36 to 128 characters. - Update
enum_idvalidation from 31 to 36 characters. - Continue reading both legacy and current tags in order history and execution consumers.
- Resolve historical legacy ownership to the executing broker and current ownership from the tag.
- Update reconciliation so every
order_enum_feeis excluded from affiliate and executing-builder fee-share bases. - Test one same-builder and one cross-builder fill end to end.
At cutover
- Stop submitting V1 tags on new orders.
- Monitor rejection rates for malformed or truncated current-format tags.
- Verify
order_enum_feeandorder_enum_fee_rateare populated on actual trades. - Verify the full tag survives order, execution, settlement, archive, and reporting paths.
Historical behavior
Orders accepted with V1 tags before cutover continue to fill under V1 tag parsing. Do not rewrite those tags. Fees already settled before the current settlement behavior was enabled are not recalculated or redistributed. Reports should preserve the rule that applied at execution time.Troubleshooting
New orders fail after cutover
Check whether the integration still sendsenum:<enum_id>. New orders require the owner segment:
A fee configuration cannot be resolved
Confirm that the tag’s owner matches thebroker_id used to discover the configuration. The same enum_id under another broker identifies a different configuration.
The tag is truncated
Search every hop for the old 36-character limit. The source order field must be widened before downstream widening can preserve the value. Validate the returned order tag byte-for-byte against the submitted value.The custom fee differs from the displayed estimate
Check the pair override for the executed symbol and use per-trade values for final reconciliation. Partial fills can produce multiple fee records.Usage totals do not split by executing broker
This is expected. Admin usage statistics aggregate by fee owner andenum_id. Build executing-broker reports from order and trade facts.
Admin API returns a configuration error
Order-submission validation errors may use a different order API error contract. Preserve and log the complete response rather than mapping every failure to “configuration not found.”
Integration Checklist
- Public discovery queries the fee-owning broker, not automatically the executing broker.
- New tags use
enum:<owning_broker_id>:<enum_id>. - Prefix, segment, character, and length rules are validated server-side.
- Every full-tag field supports 128 characters.
- Public API
enum_idvalues remain unprefixed in application state. - The DEX shows the custom trading fee separately from the standard trading fee when estimating charges.
- Order rejection is handled without silently retrying with a different tag.
- Order responses preserve the submitted full tag.
- Trade reconciliation uses
feeandorder_enum_feeper execution. - Affiliate and builder payout calculations exclude the full custom trading fee.
- Historical readers support legacy and current tags without rewriting legacy data.
- Admin endpoints and signing keys remain backend-only.
- Same-builder, cross-builder, partial-fill, malformed-tag, archived-configuration, and maximum-length cases are tested.