Non-custodial by design
- No custody. Olympex never takes custody of user or integrator funds. A swap moves assets from
account, through the Olympex aggregator contract atswap.to, in a transaction your wallet signs. An order execution moves them from the maker’s wallet, through the Olympex order contract, and sends the output back to the maker. - No keys. No endpoint accepts, generates or stores a wallet private key or seed phrase.
- No broadcasting of your swaps.
POST /swapreturns calldata and never sends it. Single-chain requests accept adryRunflag for compatibility, and it has no effect. - Allowances you control. The contracts in the swap path can spend your tokens only up to the allowance you grant to
contractToApprove. The order contract can spend a maker’s tokens only up to the allowance the maker grants it, and only for pairs the maker has signed.
Calldata is bound and short-lived
The calldata fromPOST /swap is built for one sender and one moment:
- Bound to
account. Send it from theaccountyou passed to/swap. Another Olympex swap from the same account can invalidate earlier calldata, so build and send one swap at a time per account. - Expiring. The calldata carries an on-chain expiry, 5 minutes on most routes, and some routes include a market maker’s firm quote that expires within seconds. Don’t store or queue it: request it right before you send.
- Protected by a minimum. Single-chain calldata reverts if the swap would deliver less than
minOutAmount.
Check before you sign
Before a wallet signs a swap transaction, check that:fromis theaccountyou sent to/swap.tomatchesswap.to, the Olympex aggregator contract, exactly as/swapreturned it. Record the address you see for each chain; if it changes unexpectedly, stop and confirm with partners@olympex.io before signing.valueis"0"for ERC-20 input. For native-token input,valueis the native amount the transaction sends, in wei: compare it with the amount the user agreed to.- For single-chain swaps,
minOutAmountis within your slippage ofoutAmount. - Any approval goes to
contractToApprove. It isn’t always the same address asto. eth_estimateGasfor the transaction succeeds. A200from/swapdoesn’t guarantee that the calldata executes, and a transaction that reverts still costs gas. See Falling back withaggregatorOrder.
Approvals
- For ERC-20 input to a swap, check the current allowance of
contractToApprovefirst. If it is lower than the input amount, approve the exact input amount, in base units. Never approve an unlimited amount: an open allowance outlives the swap and exposes your whole balance of that token if the spender is ever compromised. - Some tokens, such as USDT, require you to set the allowance to 0 before setting a new non-zero value.
- Native-token input needs no approval.
- Set allowances you no longer need back to 0.
Order signatures and allowances
A limit order or a DCA strategy needs two authorizations from the maker’s wallet: a signature over the token pair, and an allowance to the Olympex order contract. This is what each one allows:- The signature authorizes one pair. It lets the Olympex order contract execute swaps of the token sold for the token bought from the maker’s wallet.
- It doesn’t bind the terms. It covers no amount, price, expiry, chain or specific order. Olympex enforces the amounts, prices and expiry of your orders when it executes them.
- It outlives your orders. It stays valid after you cancel an order, and the same signature serves limit orders and DCA for that pair.
- The allowance is the on-chain limit. The order contract can’t spend more of a token than the maker’s allowance to it. That limit applies whatever an order says, including an order changed through a leaked credential.
- The order contract is an upgradeable proxy operated by Olympex.
- Approve only what the maker’s open orders need, never an unlimited amount. The allowance is shared by every open limit order and active DCA strategy that sells the same token on the same chain, so approve their sum.
- Lower the allowance when you cancel orders or strategies. Cancelling through the API doesn’t change it.
- To stop every order that sells a token, set the allowance to 0. Do it immediately if you suspect a credential leak.
- Approve only the order contract address published for the chain. It isn’t the
contractToApprovethatPOST /swapreturns.
How requests are authenticated
An API account has three credentials:
Every signed request carries four headers:
timestamp is the current Unix time in seconds, nonce is 24 new random hexadecimal characters, and bodyHash is the unpadded base64url SHA-256 of the exact body you send: the empty string for a GET or DELETE, which has no body. The method is uppercase. The path is the URL path you call, starting with /api/v1, without the query string. The canonical query is the query string with its parameters decoded, sorted by key and then by value, and percent-encoded again per RFC 3986, or the empty string when there is none. Headers signed for one request don’t work on another, and each nonce works once. Sign requests has the full algorithm and reference code.
These checks run on every signed request:
The signature proves the request was made with your secret key and binds it to its method, path, query and body, so any change to them is detectable.
GET and DELETE requests have no body, so their signature covers the hash of the empty string. The timestamp and nonce checks limit how long, and how often, a signed request is accepted.
The signature covers the method, the path, the canonical query, the timestamp, the nonce and the body hash. It doesn’t cover the other headers. Headers signed for one request are rejected on any other method, path or query, and each set is accepted once, until its timestamp is more than 300 seconds old. Treat signed headers as single-use credentials for the one request you signed them for:
- Sign each request right before you send it.
- Never log, store or share signed headers.
- Use a new nonce for every request. The nonce makes each set of headers usable once, within 5 minutes.
Credential lifecycle
New accounts can call signed endpoints immediately; there is no activation step. Credentials don’t expire. The API has no rotation, revocation, deletion or scoping feature, and requests aren’t restricted by source IP address. Because credentials can’t be replaced in place, keep them in one secrets manager so that replacing them is a single change. Choose a passphrase of at least 24 random characters from a password manager, in printable ASCII with no leading or trailing spaces. Credentials explains why other values can create an account you can’t use. If a credential leaks:1
Stop open orders (if you use limit orders or DCA)
Set each maker’s allowance to the order contract to 0 for every token its open orders sell: that stops execution on-chain. Then list the limit orders and DCA strategies created with the leaked credentials, record their IDs and cancel them. Do it before the account is deactivated: a new account can’t see orders created with another API key.
2
Deactivate the account
Email partners@olympex.io with your API key ID and ask for the account to be deactivated. Never send the secret key or the passphrase.
3
Create a new account
Create new credentials with
POST /accounts, for example from a terminal as shown in Create a test API key, and store them in your secrets manager.4
Replace and verify
Deploy the new credentials, confirm that signed requests succeed, then delete the old credentials from every system that held them. Create again, under the new account, any orders you still want, and set the allowances to what they need.
Transport and handling
- HTTPS only. The API is served over HTTPS; plain HTTP connections to the API host are refused.
- Server-side only. Call signed endpoints from your server. Never ship the secret key or passphrase in a browser, mobile or desktop app.
- Out of logs. Redact
x-passphraseandx-signaturein HTTP client logs, error reports and traces, and never commit credentials to a repository. - Accurate clocks. Keep your server clock synchronized, for example with NTP. Timestamps more than 300 seconds from server time are rejected.
Shared responsibility
Security reviews and reports
For security questionnaires, or to report a suspected vulnerability, contact partners@olympex.io. Include themeta.requestId, or the apigw-requestid response header for gateway responses, of any request your report concerns. The privacy notice describes how Olympex handles data.
What this means for your integration
- Treat the passphrase exactly like the secret key: both stay on your server, in a secrets manager, out of logs. Treat signed headers as single-use, and never log them.
- Verify every transaction before it is signed, and approve exact amounts only.
- For limit orders and DCA, keep the allowance to the order contract at what open orders need, and set it to 0 to stop them all.
- Prepare your leak response before you need it: stop open orders, deactivate through partners@olympex.io, create a new account, redeploy.
Related
Sign requests
The signing algorithm and reference code.
Order signatures and allowances
The pair signature, the allowance and the order contract.
Execute a swap
Approve, estimate gas and send safely.
Going to production
The checklist before real volume.
