{"openapi":"3.0.0","paths":{"/health":{"get":{"description":"Checks if the indexer is up and running, and returns which protocols are available for quote requests on each network (mainnet/testnet)","operationId":"AppController_checkHealth","parameters":[],"responses":{"200":{"description":"Health check result - Shows indexer status and available protocols per network","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"object","properties":{"indexer":{"type":"object","properties":{"mainnet":{"type":"array","items":{"type":"string"},"example":["soroswap","phoenix","aqua"],"description":"Available protocols on mainnet"},"testnet":{"type":"array","items":{"type":"string"},"example":["soroswap","aqua"],"description":"Available protocols on testnet"}}},"reachable":{"type":"boolean","example":true,"description":"Whether the indexer service is reachable"}}},"aggregator":{"type":"object","properties":{"mainnet":{"type":"object","properties":{"enabled":{"type":"boolean"},"reachable":{"type":"boolean"},"paused":{"type":"boolean","nullable":true},"protocolBps":{"type":"number","nullable":true},"minPartnerBps":{"type":"number","nullable":true},"treasury":{"type":"string","nullable":true},"keeper":{"type":"string","nullable":true},"payout":{"type":"string","nullable":true},"checks":{"type":"object","properties":{"protocolBpsMatches":{"type":"boolean","nullable":true},"minPartnerBpsMatches":{"type":"boolean","nullable":true},"treasuryMatches":{"type":"boolean","nullable":true},"payoutMatches":{"type":"boolean","nullable":true},"keeperMatches":{"type":"boolean","nullable":true},"aggregatorAllowed":{"type":"boolean","nullable":true}}},"degraded":{"type":"boolean"},"errors":{"type":"array","items":{"type":"string"}}}}}}}}}}}},"summary":"Health","tags":["App"],"security":[]}},"/api/tokens":{"get":{"description":"These tokens are for using in testnet, they have already pools created on soroswap and you can mint them on the soroswap frontend while connected on testnet","operationId":"AppController_getTokens","parameters":[],"responses":{"200":{"description":"List of tokens available by network","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"network":{"type":"string","example":"testnet","description":"Network name"},"assets":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","example":"Stellar Lumens"},"contract":{"type":"string","example":"CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC"},"code":{"type":"string","example":"XLM"},"icon":{"type":"string","example":"https://assets.coingecko.com/coins/images/100/standard/Stellar_symbol_black_RGB.png"},"decimals":{"type":"number","example":7},"issuer":{"type":"string","example":"GCPJFNZAARY3Z2AM7RVXDZDLPOEBT4QHTQXFOFKMZHLV7PPDKE2M67Q6","description":"Optional issuer address"}}}}}},"example":[{"network":"mainnet","assets":[]},{"network":"testnet","assets":[{"name":"Stellar Lumens","contract":"CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC","code":"XLM","icon":"https://assets.coingecko.com/coins/images/100/standard/Stellar_symbol_black_RGB.png","decimals":7},{"name":"USDCoin","contract":"CBBHRKEP5M3NUDRISGLJKGHDHX3DA2CN2AZBQY6WLVUJ7VNLGSKBDUCM","code":"USDC","icon":"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png","decimals":7},{"name":"Aquarius","contract":"CCXQWO33QBEUDVTWDDOYLD2SYEJSWUM6DIJUX6NDAOSXNCGK3PSIWQJG","code":"AQUA","icon":"https://static.ultrastellar.com/media/assets/img/1878ee2d-2fd1-4e31-89a7-5a430f1596f8.png","decimals":7}]},{"network":"standalone","assets":[]}]}}}}},"summary":"Testnet tokens","tags":["App"],"security":[]}},"/api/{network}/{contractName}":{"get":{"description":"Returns the actual contract address for Soroswap contracts on the specified network. Available contracts: factory, router, aggregator. Available networks: mainnet, testnet","operationId":"AppController_getContractAddress","parameters":[{"name":"network","required":true,"in":"path","schema":{"type":"string"}},{"name":"contractName","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Soroswap contract address for the specified network and contract type","content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","example":"CA4HEQTL2WPEUYKYKCDOHCDNIV4QHNJ7EL4J4NQ6VADP7SYHVRYZ7AW2","description":"The contract address on the specified network"}}}}}}},"summary":"Soroswap contracts","tags":["App"],"security":[]}},"/api/faucet":{"post":{"operationId":"AppController_faucet","parameters":[{"name":"address","required":true,"in":"query","schema":{"type":"string"}},{"name":"contract","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"201":{"description":""}},"tags":["App"],"security":[]}},"/auth/config":{"get":{"description":"What a sign-in form needs to know: the Cloudflare Turnstile site key (null when no token is required) and whether /login needs a token too. A token goes in the `turnstileToken` field of the /register and /login body. `google` is null when Google sign-in is off; otherwise it has the public `clientId` and `origins`, the page origins the OAuth client allows (empty when not configured here).","operationId":"AuthController_authConfig","parameters":[],"responses":{"200":{"description":"Public configuration","content":{"application/json":{"schema":{"type":"object","properties":{"turnstileSiteKey":{"type":"string","nullable":true},"turnstileOnLogin":{"type":"boolean"},"google":{"type":"object","nullable":true,"properties":{"clientId":{"type":"string"},"origins":{"type":"array","items":{"type":"string"}}}}}}}}}},"summary":"Sign-in configuration","tags":["Auth"],"security":[]}},"/register":{"post":{"description":"[Creates a new user account](https://console.soroswap.finance/register) in the system. `acceptTerms: true` is required and accepts the [terms](https://app.soroswap.finance/terms). The email is stored trimmed and lowercased, and disposable domains are refused. When `GET /auth/config` has a Turnstile site key, `turnstileToken` is required too. Only `username`, `email`, `password`, `acceptTerms` and `turnstileToken` are read; any other field is ignored. The account is created enabled, with role USER, and a 6-digit PIN is emailed to verify the address (POST /auth/email/verify).","operationId":"AuthController_register","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthRegisterDto"},"examples":{"example1":{"summary":"Register a new user","value":{"username":"user","password":"StrongPassword123!","email":"user@example.com","acceptTerms":true}}}}}},"responses":{"201":{"description":"User registered successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"User test@example.com registered"}}}}}},"400":{"description":"Invalid input: malformed or disposable email, username outside its rules, a password under 15 characters or over 72 bytes (UTF-8), acceptTerms missing or not true, or a missing or refused Turnstile token"},"409":{"description":"The email address is already registered in the system"},"429":{"description":"Too many sign-ups from this address. See Retry-After."},"503":{"description":"The security check could not run. Try again."}},"summary":"Register a new user","tags":["Auth"],"security":[]}},"/login":{"post":{"description":"Authenticates the user and returns access and refresh tokens","operationId":"AuthController_login","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthLoginDto"},"examples":{"example1":{"summary":"Login with email and password","value":{"email":"test@example.com","password":"StrongPassword123!"}}}}}},"responses":{"200":{"description":"Login successful","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","example":"test@example.com"},"role":{"type":"string","example":"USER"},"access_token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"refresh_token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"emailVerified":{"type":"boolean","example":true,"description":"Whether the account has verified its email address"}}}}}},"400":{"description":"Invalid input, or a missing or refused Turnstile token where GET /auth/config requires one"},"401":{"description":"Invalid email or password, or \"Account disabled\" with the right password"},"429":{"description":"Too many failed attempts from this address. See Retry-After."},"503":{"description":"The security check could not run. Try again."}},"summary":"Login","tags":["Auth"],"security":[]}},"/auth/google":{"post":{"description":"Takes an ID token from Google Identity Services and returns the same tokens as /login. It signs in to the account connected to that Google account. With none connected, and only when the address is Gmail or the token has a Workspace domain, it connects an account on the same address or creates a verified one, which needs `acceptTerms: true`. Any other address answers 409: register or sign in with a password, then connect Google. Passwords keep working, and a password reset ends the connection.","operationId":"AuthController_signInWithGoogle","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthGoogleDto"}}}},"responses":{"200":{"description":"Signed in; the same tokens as /login"},"400":{"description":"Malformed body, an invalid Google credential (forged, expired, for another client, another issuer, or an unverified email), a disposable address, or the terms not accepted (`code: TERMS_REQUIRED`)"},"401":{"description":"Account disabled"},"404":{"description":"Google sign-in is not enabled"},"409":{"description":"Use a password for this address: sign in or register, then connect Google from Settings, or the address is connected to another Google account"},"429":{"description":"Too many attempts. See Retry-After."},"503":{"description":"Google's keys could not be fetched. Try again."}},"summary":"Sign in with Google","tags":["Auth"],"security":[]}},"/refresh":{"post":{"description":"Generates a new pair of tokens using the refresh token. Pass the refresh token in the Authorization header as Bearer token. The console may instead send no Authorization header and the __Secure-soroswap_rt cookie, with `x-soroswap-session: cookie` and its own Origin, or the answer is 403 and nothing rotates; then the new refresh token comes back in the cookie, not the body. An Authorization header always wins over the cookie.","operationId":"AuthController_refreshTokens","parameters":[],"responses":{"200":{"description":"Tokens refreshed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","example":"test@example.com"},"role":{"type":"string","example":"USER"},"access_token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"refresh_token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"emailVerified":{"type":"boolean","example":true,"description":"Whether the account has verified its email address"}}}}}},"401":{"description":"Account disabled, or a missing, malformed or expired refresh token"},"403":{"description":"Invalid or expired refresh token"}},"security":[{"bearer":[]}],"summary":"Refresh access token","tags":["Auth"]}},"/auth/email/verify":{"post":{"description":"Verifies the address with the 6-digit PIN emailed at sign-up. A PIN works once, lasts 10 minutes and allows 5 attempts. Every failure gets the same answer, so it does not reveal whether an account exists.","operationId":"AuthController_verifyEmail","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthEmailVerifyDto"}}}},"responses":{"200":{"description":"Address verified","content":{"application/json":{"schema":{"example":{"verified":true}}}}},"400":{"description":"Malformed body, or: Invalid or expired PIN"},"429":{"description":"Too many attempts; see the Retry-After header"}},"summary":"Verify an email address","tags":["Auth"],"security":[]}},"/auth/email/resend":{"post":{"description":"Sends a new PIN and cancels the previous one, if the address has an account waiting for verification and the last PIN is at least 60 seconds old. Always gives the same answer, so it does not reveal whether an account exists.","operationId":"AuthController_resendEmailPin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthEmailResendDto"}}}},"responses":{"200":{"description":"Accepted","content":{"application/json":{"schema":{"example":{"message":"If this address has an account waiting for verification, a new PIN is on its way."}}}}},"400":{"description":"Malformed email"},"429":{"description":"Too many requests; see the Retry-After header"}},"summary":"Resend the verification PIN","tags":["Auth"],"security":[]}},"/auth/password/forgot":{"post":{"description":"Emails a 6-digit PIN if the address has an enabled account and its last reset PIN is at least 60 seconds old; a new PIN cancels the previous one. Gives the same answer, in about the same time, for any address, so it does not reveal whether an account exists.","operationId":"AuthController_forgotPassword","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthPasswordForgotDto"}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"example":{"message":"If this address has an account, a PIN to reset its password is on its way."}}}}},"400":{"description":"Malformed email"},"429":{"description":"Too many requests; see the Retry-After header"}},"summary":"Request a password reset PIN","tags":["Auth"],"security":[]}},"/auth/password/reset":{"post":{"description":"Sets a new password with the PIN from POST /auth/password/forgot. A PIN works once, lasts 10 minutes and allows 5 attempts. Ends the refresh session and the link to a Google account, refuses every access token already issued and marks the email verified. API keys and the payout address stay, unless the email was not verified yet: then both are removed, because whoever set them had not proved they own the address. Every PIN failure gets the same answer, so it does not reveal whether an account exists.","operationId":"AuthController_resetPassword","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthPasswordResetDto"}}}},"responses":{"200":{"description":"Password changed","content":{"application/json":{"schema":{"example":{"reset":true}}}}},"400":{"description":"Malformed body, a new password outside the rules, or: Invalid or expired PIN"},"429":{"description":"Too many attempts; see the Retry-After header"}},"summary":"Reset a password with an emailed PIN","tags":["Auth"],"security":[]}},"/api-keys":{"post":{"description":"Adds a named API key and leaves your other keys working. Requires a verified email. An account can have up to 10 keys, revoked ones not counted. The full key is returned only here.","operationId":"ApiKeysController_createApiKey","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateDto"}}}},"responses":{"201":{"description":"API key created","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","example":"sk_1234567890abcdef..."},"id":{"type":"number","example":1}}}}}},"400":{"description":"Invalid name"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"Verify your email first"},"409":{"description":"The name is taken, or the account has 10 keys"}},"security":[{"bearer":[]}],"summary":"Create API Key","tags":["API Keys"]},"get":{"description":"Retrieves all API keys for the authenticated user, revoked ones last, without the keys themselves: each row carries only keyPrefix. The full key is returned only once, when it is created.","operationId":"ApiKeysController_getUserApiKeys","parameters":[],"responses":{"200":{"description":"API keys retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"keyPrefix":{"type":"string","nullable":true,"description":"The first 11 characters of the key, to tell keys apart","example":"sk_1a2b3c4d"},"status":{"type":"string","enum":["active","disabled","revoked"]},"createdAt":{"type":"string"},"lastUsedAt":{"type":"string","nullable":true},"disabledAt":{"type":"string","nullable":true},"revokedAt":{"type":"string","nullable":true}}}}}}},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"security":[{"bearer":[]}],"summary":"Get API Keys","tags":["API Keys"]}},"/api-keys/generate":{"post":{"description":"Generates a new API key and replaces the key this route generated before, which stops working at once. Keys made with POST /api-keys are not touched. Requires a verified email. To add a key without replacing one, use POST /api-keys.","operationId":"ApiKeysController_generateApiKey","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Optional name for the API key","example":"My Server API Key"}}}}}},"responses":{"201":{"description":"API key generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","example":"sk_1234567890abcdef..."},"id":{"type":"number","example":1}}}}}},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"Verify your email first: the account has not verified its address (POST /auth/email/verify). Keys it already has keep working."}},"security":[{"bearer":[]}],"summary":"Generate API Key","tags":["API Keys"]}},"/api-keys/{keyId}/disable":{"post":{"description":"Switches a key off until it is enabled again. Requests with it answer 401. Disabling a disabled key changes nothing.","operationId":"ApiKeysController_disableApiKey","parameters":[{"name":"keyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."},"404":{"description":"API key not found"},"409":{"description":"API key revoked"}},"security":[{"bearer":[]}],"summary":"Disable API Key","tags":["API Keys"]}},"/api-keys/{keyId}/enable":{"post":{"description":"Switches a disabled key back on. Enabling an active key changes nothing.","operationId":"ApiKeysController_enableApiKey","parameters":[{"name":"keyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."},"404":{"description":"API key not found"},"409":{"description":"API key revoked"}},"security":[{"bearer":[]}],"summary":"Enable API Key","tags":["API Keys"]}},"/api-keys/{keyId}":{"delete":{"description":"Removes the key and its row, in any state. It stops working at once.","operationId":"ApiKeysController_deleteApiKey","parameters":[{"name":"keyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}}}}}},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."},"404":{"description":"API key not found"}},"security":[{"bearer":[]}],"summary":"Delete API Key","tags":["API Keys"]}},"/api-keys/{keyId}/revoke":{"post":{"description":"Ends a key for good. It stops working at once and stays listed as revoked. A keyId in the JSON body takes precedence over the one in the path.","operationId":"ApiKeysController_revokeApiKey","parameters":[{"name":"keyId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"API key revoked successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"security":[{"bearer":[]}],"summary":"Revoke API Key","tags":["API Keys"]}},"/auth/google/connect":{"post":{"description":"For Settings, and for the address /auth/google will not connect by itself. Send the access token (JWT from /login or /refresh) as Bearer; API keys are not accepted. Needs a verified account, `currentPassword`, and an ID token from a Google account on the same address. Connecting again with the same Google account answers 200. The password keeps working.","operationId":"SessionController_connectGoogle","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthGoogleConnectDto"}}}},"responses":{"200":{"description":"Connected","content":{"application/json":{"schema":{"example":{"connected":true}}}}},"400":{"description":"Malformed body, an invalid Google credential, a Google account on another address, or a missing or wrong currentPassword"},"401":{"description":"No credential, or an API key: this route takes a console session only"},"403":{"description":"Verify your email first, or an invalid access token"},"404":{"description":"Google sign-in is not enabled"},"409":{"description":"This account, or this Google account, is already connected to another; or the password changed while this request ran, and nothing was written"},"429":{"description":"Too many wrong passwords. See Retry-After."},"503":{"description":"Google's keys could not be fetched. Try again."}},"security":[{"bearer":[]}],"summary":"Connect Google to this account","tags":["Auth"]}},"/logout":{"post":{"description":"Ends the console session: the refresh token stops working at once. Send the access token (JWT from /login or /refresh) as Bearer; API keys are not accepted. The access token itself stays valid until it expires (15 minutes). Idempotent: calling it again answers 204. The console may instead send no Authorization header and the __Secure-soroswap_rt cookie, with `x-soroswap-session: cookie` and its own Origin (else 403): that ends the session only if the cookie holds its current refresh token, and always clears the cookie.","operationId":"LogoutController_logout","parameters":[],"responses":{"204":{"description":"Logged out (also when already logged out)"},"401":{"description":"No credential, or an API key: this route takes a console session only"},"403":{"description":"Invalid or expired access token, or a cookie request without the CSRF header or a console Origin"}},"security":[{"bearer":[]}],"summary":"Log out","tags":["Auth"]}},"/users/me/password":{"post":{"description":"Takes a console session (JWT from /login or /refresh); API keys are refused. Ends every session, including the one that made this call, and returns a new token pair to continue with. Also ends the link to a Google account. API keys keep working. Wrong answers count toward the same lock as /login.","operationId":"PasswordController_changePassword","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthPasswordChangeDto"}}}},"responses":{"200":{"description":"Password changed; use the new tokens from here on"},"400":{"description":"Malformed body, a new password outside the rules or equal to the current one, or: Current password is incorrect"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An API key, an expired or invalid JWT, or: This account has no password to change. Set one with Forgot password on the sign-in page"},"409":{"description":"The password changed while this request ran; nothing was written. Sign in again."},"429":{"description":"Too many attempts; see the Retry-After header"}},"security":[{"bearer":[]}],"summary":"Change your password","tags":["Auth"]}},"/users/me/profile":{"get":{"description":"Takes a console session (JWT from /login or /refresh); API keys are refused. Fields never set are null.","operationId":"ProfileController_get","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"example":{"email":"ops@acme.com","username":"acme","createdAt":"2026-11-10T12:00:00.000Z","accountType":"COMPANY","companyName":"Acme","legalName":"Acme S.A.","country":"CL","website":"https://acme.com","segment":"WALLET","telegram":"acme_ops"}}}}},"401":{"description":"No credential, or a valid JWT of a disabled account"},"403":{"description":"An API key, or an expired or invalid JWT"}},"security":[{"bearer":[]}],"summary":"Your profile","tags":["Auth"]},"put":{"description":"Takes a console session (JWT from /login or /refresh); API keys are refused. Replaces the whole profile: a field left out, null or blank is cleared. Unknown fields are ignored. Answers the profile as stored.","operationId":"ProfileController_replace","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"example":{"email":"ops@acme.com","username":"acme","createdAt":"2026-11-10T12:00:00.000Z","accountType":"COMPANY","companyName":"Acme","legalName":"Acme S.A.","country":"CL","website":"https://acme.com","segment":"WALLET","telegram":"acme_ops"}}}}},"400":{"description":"A field outside its rules"},"401":{"description":"No credential, or a valid JWT of a disabled account"},"403":{"description":"An API key, or an expired or invalid JWT"}},"security":[{"bearer":[]}],"summary":"Replace your profile","tags":["Auth"]}},"/partner":{"get":{"description":"Your partner id, the muxed receiver address you can watch, the rate in force (null until you set one: you pay the protocol fee and charge none), your payout address, the legacy feeBps/referralId values your integration last sent, defaultFeeShareBps (your share of the fee when you set your first rate, unless Soroswap agreed another with you), and hasPassword: false means the account has no password, so changing the payout address with a JWT takes a PIN (POST /partner/payout-address/pin) instead of currentPassword.","operationId":"PartnerController_getProfile","parameters":[],"responses":{"200":{"description":""},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Partner profile","tags":["Partner"],"security":[{"bearer":[]}]}},"/partner/rate":{"put":{"description":"Inserts a rate effective now. 0 turns your fee off; otherwise 25..300 bps. Your first rate gets the default fee share (defaultFeeShareBps on GET /partner); later ones keep your current share. 0 on an account that never set a rate stores nothing. The account must have verified its email first: otherwise 403, with a JWT or an API key.","operationId":"PartnerController_setRate","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutPartnerRateDto"}}}},"responses":{"200":{"description":""},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Set the fee your users pay","tags":["Partner"],"security":[{"bearer":[]}]}},"/partner/payout-address":{"put":{"description":"A funded G account holding a USDC trustline, verified on Horizon before it is stored. The account must have verified its email first: otherwise 403, with a JWT or an API key. With a JWT, currentPassword is required: missing or wrong answers 400, and repeated wrong answers from one address answer 429 with Retry-After. An account that signs in with Google and has no password sends `pin` instead, from POST /partner/payout-address/pin for this same address. With an API key neither is needed. 503 when the check cannot run right now; retry later.","operationId":"PartnerController_setPayoutAddress","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutPayoutAddressDto"}}}},"responses":{"200":{"description":""},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Set the USDC payout address","tags":["Partner"],"security":[{"bearer":[]}]}},"/partner/payout-address/pin":{"post":{"description":"For an account that signs in with Google and has no password; any other account answers 400 and confirms with currentPassword. Emails a PIN that works once, for this address only, for 10 minutes. 400 unless the address is a funded G account holding a USDC trustline; 429 with Retry-After within 60 seconds of the last PIN or past the budget; 503 when the address cannot be checked right now.","operationId":"PartnerController_requestPayoutPin","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostPayoutPinDto"}}}},"responses":{"200":{"description":""},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Email a PIN to confirm a payout address","tags":["Partner"],"security":[{"bearer":[]}]}},"/asset-list":{"get":{"description":"Get all available asset lists or a specific list by name. If no name is provided, returns metadata for all available lists. If a name is provided, returns the complete asset list with all assets.","operationId":"AssetListController_getAssetList","parameters":[{"name":"name","required":false,"in":"query","description":"Name of the specific asset list to retrieve. Use \"ALL\" to get all tokens from the database.","schema":{"enum":["SOROSWAP","STELLAR_EXPERT","LOBSTR","AQUA","ALL"],"type":"string"}}],"responses":{"200":{"description":"Asset list metadata (when no name provided) or complete asset list (when name provided)","content":{"application/json":{"schema":{"oneOf":[{"type":"array","description":"Array of asset list metadata when no name parameter is provided","items":{"type":"object","properties":{"name":{"type":"string","example":"SOROSWAP"},"url":{"type":"string","example":"https://api.soroswap.finance/asset-list/soroswap.json"}}},"example":[{"name":"SOROSWAP","url":"https://api.soroswap.finance/asset-list/soroswap.json"},{"name":"AQUA","url":"https://api.aqua.network/asset-list.json"}]},{"type":"object","description":"Complete asset list when name parameter is provided","properties":{"name":{"type":"string","example":"SOROSWAP Asset List"},"provider":{"type":"string","example":"Soroswap"},"description":{"type":"string","example":"Official Soroswap asset list"},"assets":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","example":"USDC"},"issuer":{"type":"string","example":"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"},"contract":{"type":"string","example":"CB64D3G7SM2RTH6JSGG34DDTFTQ5CFDKVDZJZSODMCX4NJ2HV2KN7OHT"},"name":{"type":"string","example":"USD Coin"},"decimals":{"type":"number","example":6}}}}},"example":{"name":"SOROSWAP Asset List","provider":"Soroswap","description":"Official Soroswap asset list","assets":[{"code":"USDC","issuer":"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN","contract":"CB64D3G7SM2RTH6JSGG34DDTFTQ5CFDKVDZJZSODMCX4NJ2HV2KN7OHT","name":"USD Coin","decimals":6}]}}]}}}},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."},"404":{"description":"Asset list not found"}},"summary":"Get asset lists","tags":["AssetList"],"security":[{"bearer":[]}]}},"/protocols":{"get":{"description":"Returns the list of protocols available to get quotes on the specified network","operationId":"SwapController_getProtocols","parameters":[{"name":"network","required":false,"in":"query","description":"Network on which the operation will be performed","schema":{"enum":["testnet","mainnet"],"type":"string"}}],"responses":{"200":{"description":"List of available protocols","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"example":["soroswap","phoenix","aqua","sdex"]}}}},"400":{"description":"Error getting protocols"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Available protocols","tags":["Quote"],"security":[{"bearer":[]}]}},"/quote":{"post":{"description":"\nCalculates the best price for a given swap by aggregating liquidity from multiple protocols on the Stellar blockchain.  \n\nIt finds the optimal path to execute the swap through the Soroswap Aggregator, splitting the trade across several routes to secure the best rate.  \n\n#### ⚡ Gasless Trustline Feature:\nThis feature lets your users open a trustline without needing to understand what a trustline is or how much it costs. Then, the /build endpoint will create the transaction with all the needed operations.\n\nWhen enabled, the Soroswap API will return a quote that includes an additional swap to purchase 0.5 XLM to cover the trustline creation cost. \n\nThe quote will also include the trustline cost expressed in both assetIn and assetOut, so you can display this information to the user if desired (see the response schema for details).\n\nOn mainnet, an EXACT_OUT quote against the Soroswap Aggregator sizes a fixed spend rather than an exact output: `amountIn` and `otherAmountThreshold` both become the amount that will actually be spent, and `amountOut` is the minimum you will receive, with any surplus delivered on top. SDEX quotes and every testnet quote are unaffected — EXACT_OUT there still means an exact output behind a slipped maximum input.\n","operationId":"SwapController_quote","parameters":[{"name":"network","required":false,"in":"query","description":"Network on which the operation will be performed","schema":{"enum":["testnet","mainnet"],"type":"string"}}],"requestBody":{"required":true,"description":"Data required to perform the swap","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteDto"},"examples":{"exactIn":{"value":{"assetIn":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amount":"10000000","tradeType":"EXACT_IN","protocols":["soroswap","aqua"],"slippageBps":"50","parts":10,"maxHops":2,"assetList":["SOROSWAP","STELLAR_EXPERT"],"gaslessTrustline":"create"}}}}}},"responses":{"200":{"description":"Found quote","content":{"application/json":{"schema":{"oneOf":[{"title":"Regular Quote Response","type":"object","properties":{"assetIn":{"type":"string","example":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","description":"Input asset contract address"},"assetOut":{"type":"string","example":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","description":"Output asset contract address"},"amountIn":{"type":"string","example":"10000000","description":"Expected input amount in stroops"},"amountOut":{"type":"string","example":9067253,"description":"Expected output amount in stroops"},"otherAmountThreshold":{"type":"number","example":9067253,"description":"Minimum output (exact_in) or maximum input (exact_out) considering slippage protection"},"tradeType":{"type":"string","enum":["EXACT_IN","EXACT_OUT"],"example":"EXACT_IN","description":"Type of trade: EXACT_IN = input fixed; EXACT_OUT = output fixed"},"priceImpactPct":{"type":"string","example":"0.50","description":"Estimated price impact of the trade, as a percentage string"},"platform":{"type":"string","enum":["router","aggregator","sdex"],"example":"aggregator","description":"Indicates where the trade is routed: \"router\" (only Soroswap), \"aggregator\" (aggregating more DEXes on Soroban), or \"sdex\" (The Stellar Classic DEX"},"rawTrade":{"type":"object","description":"Data needed to execute the trade; structure varies by platform. For \"aggregator\" quotes on mainnet, `amountIn` is the post-fee amount that gets routed and each `distribution` entry carries its `share` of it (shares add up to `amountIn`) plus `hops`, the venue, pool, tokens and amounts of every hop (`poolHash` on Aquarius hops). `protocol_id` names only the first hop's venue, so read venues from `hops`.","example":{"amountIn":"9990000","amountOutMin":"963312902408200487","distribution":[{"protocol_id":"sushi","path":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CBI7UCH5KGSVQRO5H4SUCZUTZABCITZLRHQQZTWL2TK4RZ72TAR6IHRV"],"parts":10,"is_exact_in":true,"poolIds":["CDMJRRH5MAJLB7T5SQAWQOOL7UJ3BABGTURSVKIE6AEDSXESDDJIBVCT"],"share":"9990000","hops":[{"poolId":"CDMJRRH5MAJLB7T5SQAWQOOL7UJ3BABGTURSVKIE6AEDSXESDDJIBVCT","protocol":"sushi","tokenIn":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","tokenOut":"CBI7UCH5KGSVQRO5H4SUCZUTZABCITZLRHQQZTWL2TK4RZ72TAR6IHRV","amountIn":"9990000","amountOut":"973043293419438491","feeBps":5}]}]}},"routePlan":{"type":"array","description":"Array of route steps (e.g., AMMs, pools) with associated splits and paths. The sum of the percentages should be 100.","items":{"type":"object","properties":{"swapInfo":{"type":"object","properties":{"protocol":{"type":"string","example":"soroswap"},"path":{"type":"array","items":{"type":"string"},"example":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY","CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"]}}},"percent":{"type":"string","example":"100"}}}},"platformFee":{"type":"object","properties":{"feeBps":{"type":"number","example":50},"feeAmount":{"type":"number","example":50000}},"description":"Platform fee details. Present only when your partner rate applies (see GET /partner); absent for protocol-only swaps."}}},{"title":"Gasless Trustline Swap Quote Response","type":"object","properties":{"assetIn":{"type":"string","example":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","description":"Input asset contract address"},"assetOut":{"type":"string","example":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","description":"Output asset contract address"},"amountIn":{"type":"string","example":"10000000","description":"Expected input amount in stroops, including trustline costs"},"amountOut":{"type":"string","example":"8567253","description":"Expected amount user receives after trustline costs"},"otherAmountThreshold":{"type":"string","example":"8467253","description":"Minimum output (exact_in) or maximum input (exact_out) considering slippage protection and trustline costs"},"tradeType":{"type":"string","example":"EXACT_IN","description":"Type of trade: EXACT_IN = input fixed; EXACT_OUT = output fixed"},"priceImpactPct":{"type":"string","example":"0.50","description":"Estimated price impact of the trade, as a percentage string"},"platform":{"type":"string","example":"sdex","description":"Indicates where the trade is routed, for gasless trustline swaps, it will always be \"sdex\" (The Stellar Classic DEX)"},"gaslessTrustline":{"type":"string","enum":["create"],"example":"create","description":"Indicates if this is a gasless trustline swap quote. Only use this if you are sure that the user does not have a trustline for the output asset and if you have an sponsor account."},"rawTrade":{"type":"object","description":"SDEX horizon path with trustline operation details","properties":{"source_asset_type":{"type":"string","example":"credit_alphanum12"},"source_amount":{"type":"string","example":"10000000"},"destination_asset_type":{"type":"string","example":"credit_alphanum12"},"destination_amount":{"type":"string","example":"9067253"},"path":{"type":"array","items":{"type":"object"}},"trustlineOperation":{"type":"object","description":"Details for trustline repayment operation"},"netAmount":{"type":"string","example":"8567253","description":"Net amount after trustline costs"},"otherNetAmountThreshold":{"type":"string","example":"8467253","description":"Minimum net amount with slippage"}}},"trustlineInfo":{"type":"object","properties":{"trustlineCostAssetIn":{"type":"string","example":"0.5000000","description":"Trustline cost in input asset terms"},"trustlineCostAssetOut":{"type":"string","example":"0.5000000","description":"Trustline cost in output asset terms"}},"description":"Trustline cost breakdown for UI display"},"routePlan":{"type":"array","description":"Array of route steps with associated splits and paths. ","items":{"type":"object","properties":{"swapInfo":{"type":"object","properties":{"protocol":{"type":"string","example":"sdex"},"path":{"type":"array","items":{"type":"string"}}}},"percent":{"type":"string","example":"100"}}}}}}]}}}},"400":{"description":"Error in input parameters or route not found"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Quote","tags":["Quote"],"security":[{"bearer":[]}]}},"/quote/build":{"post":{"description":"\nBuilds an **unsigned XDR** for a quote.\n\nIf **Gasless Trustline Swap** is enabled, the XDR must be signed by both the user and the sponsor.\n\n#### ⚡ Gasless Trustline Flow\nWhen enabled, the transaction will include **all the operations required to perform the swap**, plus extra operations to:\n- 💰 **Buy 0.5 XLM** — The user purchases 0.5 XLM and sends it to the sponsor wallet.\n- 🛡 **Sponsor Trustline Reserve** — The sponsor wallet covers the reserve required to open the user’s trustline.\n\n> **Note:** The `gaslessTrustline` feature only works with a swap on the **Stellar Classic DEX**, and will be applied **only to the first swap for a specific user**.\n\nOn mainnet, an EXACT_OUT quote against the Soroswap Aggregator sizes a fixed spend rather than an exact output: `amountIn` and `otherAmountThreshold` both become the amount that will actually be spent, and `amountOut` is the minimum you will receive, with any surplus delivered on top. SDEX quotes and every testnet quote are unaffected — EXACT_OUT there still means an exact output behind a slipped maximum input.\n","operationId":"SwapController_buildQuote","parameters":[{"name":"network","required":false,"in":"query","description":"Network on which the operation will be performed","schema":{"enum":["testnet","mainnet"],"type":"string"}}],"requestBody":{"required":true,"description":"Data required to build the quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildQuoteDto"},"examples":{"regularExactIn":{"value":{"quote":{"assetIn":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amountIn":"10000000","amountOut":"9067253","otherAmountThreshold":"9067253","tradeType":"EXACT_IN","priceImpactPct":"0.50","platform":"aggregator","rawTrade":{"amountIn":"10000000","amountOutMin":"9067253","distribution":[{"protocol_id":"soroswap","path":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY","CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"],"parts":10,"is_exact_in":true}]},"routePlan":[{"swapInfo":{"protocol":"soroswap","path":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY","CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"]},"percent":"100"}]},"to":"GCSQJ7TCEVWXK2JZPTTTCJCVZZNMQXEJWVHIOCUAQHWNJSXKHX7OHVUW","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK"},"summary":"Data required to build the XDR for a regular EXACT_IN aggregator swap"},"sdexExactOut":{"value":{"quote":{"assetIn":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amountIn":"10500000","amountOut":"10000000","otherAmountThreshold":"10500000","tradeType":"EXACT_OUT","priceImpactPct":"0.30","platform":"sdex","rawTrade":{"source_asset_type":"credit_alphanum12","source_amount":"10000000","max_source_amount":"10500000","destination_asset_type":"credit_alphanum12","destination_amount":"10000000","path":[]},"routePlan":[{"swapInfo":{"protocol":"sdex","path":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"]},"percent":"100"}]},"to":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK"},"summary":"Data required to build the XDR for a SDEX EXACT_OUT swap"},"gaslessTrustlineExactIn":{"value":{"quote":{"assetIn":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amountIn":"10000000","amountOut":"8567253","otherAmountThreshold":"8467253","tradeType":"EXACT_IN","priceImpactPct":"0.50","platform":"sdex","gaslessTrustline":"create","rawTrade":{"source_asset_type":"credit_alphanum12","source_amount":"10000000","destination_asset_type":"credit_alphanum12","destination_amount":"9067253","min_destination_amount":"9000000","path":[],"trustlineOperation":{"source_asset_type":"credit_alphanum12","source_amount":"0.5000000","max_source_amount":"0.5100000","destination_asset_type":"native","destination_amount":"0.5000000","path":[]},"netAmount":"8567253","otherNetAmountThreshold":"8467253"},"trustlineInfo":{"trustlineCostAssetIn":"0.5000000","trustlineCostAssetOut":"0.5000000"},"routePlan":[{"swapInfo":{"protocol":"sdex","path":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"]},"percent":"100"}]},"to":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","sponsor":"GDFRQKZH2F6QPZDW7YNWCV3H6FGUQZ3XAJS7XEZQVYZSQYB4SVPQXVYB"},"summary":"Data required to build the XDR for a gasless trustline EXACT_IN swap - sponsor lends 0.5 XLM for the trustline and user repays via output asset"},"gaslessTrustlineExactOut":{"value":{"quote":{"assetIn":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amountIn":"10500000","amountOut":"10000000","otherAmountThreshold":"10700000","tradeType":"EXACT_OUT","priceImpactPct":"0.50","platform":"sdex","gaslessTrustline":"create","rawTrade":{"source_asset_type":"credit_alphanum12","source_amount":"10000000","max_source_amount":"10200000","destination_asset_type":"credit_alphanum12","destination_amount":"10000000","path":[],"trustlineOperation":{"source_asset_type":"credit_alphanum12","source_amount":"0.5000000","max_source_amount":"0.5100000","destination_asset_type":"native","destination_amount":"0.5000000","path":[]},"netAmount":"10500000","otherNetAmountThreshold":"10700000"},"trustlineInfo":{"trustlineCostAssetIn":"0.5000000","trustlineCostAssetOut":"0.0500000"},"routePlan":[{"swapInfo":{"protocol":"sdex","path":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"]},"percent":"100"}]},"to":"GCSQJ7TCEVWXK2JZPTTTCJCVZZNMQXEJWVHIOCUAQHWNJSXKHX7OHVUW","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","sponsor":"GDFRQKZH2F6QPZDW7YNWCV3H6FGUQZ3XAJS7XEZQVYZSQYB4SVPQXVYB"},"summary":"Data required to build the XDR for a gasless trustline EXACT_OUT swap - total input includes trustline setup cost"},"sorobanSponsoredStep1":{"value":{"quote":{"assetIn":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amountIn":"10000000","amountOut":"9067253","otherAmountThreshold":"9067253","tradeType":"EXACT_IN","priceImpactPct":"0.50","platform":"aggregator","rawTrade":{"amountIn":"10000000","amountOutMin":"9067253","distribution":[{"protocol_id":"soroswap","path":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"],"parts":10,"is_exact_in":true}]}},"to":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","sponsor":"GDFRQKZH2F6QPZDW7YNWCV3H6FGUQZ3XAJS7XEZQVYZSQYB4SVPQXVYB"},"summary":"Step 1: Soroban sponsored transaction - API returns unsigned XDR for user to sign"},"sorobanSponsoredStep2":{"value":{"quote":{"assetIn":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amountIn":"10000000","amountOut":"9067253","otherAmountThreshold":"9067253","tradeType":"EXACT_IN","priceImpactPct":"0.50","platform":"aggregator","rawTrade":{"amountIn":"10000000","amountOutMin":"9067253","distribution":[{"protocol_id":"soroswap","path":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"],"parts":10,"is_exact_in":true}]}},"to":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","sponsor":"GDFRQKZH2F6QPZDW7YNWCV3H6FGUQZ3XAJS7XEZQVYZSQYB4SVPQXVYB","signedUserXdr":"AAAAAgAAAABiSu3MsKtQvDuQO5i2b..."},"summary":"Step 2: Soroban sponsored transaction - Send user-signed XDR, API returns fee bump XDR for sponsor to sign"},"withPlatformFee":{"value":{"quote":{"assetIn":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amountIn":"10000000","amountOut":"9067253","otherAmountThreshold":"9067253","tradeType":"EXACT_IN","priceImpactPct":"0.50","platform":"aggregator","platformFee":{"feeBps":50,"feeAmount":50000},"rawTrade":{"amountIn":"10000000","amountOutMin":"9067253","distribution":[{"protocol_id":"soroswap","path":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"],"parts":10,"is_exact_in":true}]},"routePlan":[{"swapInfo":{"protocol":"soroswap","path":["CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"]},"percent":"100"}]},"to":"GCSQJ7TCEVWXK2JZPTTTCJCVZZNMQXEJWVHIOCUAQHWNJSXKHX7OHVUW","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK"},"summary":"Data required to build the XDR for a quote whose platform fee came from the partner rate"}}}}},"responses":{"200":{"description":"XDR built successfully","content":{"application/json":{"schema":{"type":"object","properties":{"xdr":{"type":"string","example":"AAAAAgAAAAB8shYDi1JO9x2/3jMeVzK2IGtrsFVWLCL4uHRJf+YPyAAAA+gCzi7HAAAApgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABc12cL...","description":"Transaction XDR ready for signing and execution"}}}}}},"400":{"description":"Invalid quote data or missing required fields"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."},"409":{"description":"The fee rate changed since the quote was issued; request a new quote"},"428":{"description":"Precondition Required - Multi-step action needed","content":{"application/json":{"schema":{"oneOf":[{"title":"Step 1: User Signature Required","type":"object","properties":{"message":{"type":"string","example":"User signature required for sponsored transaction"},"action":{"type":"string","example":"SIGN_USER_TRANSACTION"},"actionData":{"type":"object","properties":{"xdr":{"type":"string","example":"AAAAAgAAAAB8shYDi1JO9x2..."},"step":{"type":"number","example":1},"totalSteps":{"type":"number","example":2},"description":{"type":"string","example":"Sign the transaction with the user wallet and send back the signed XDR"}}}}},{"title":"Step 2: Sponsor Signature Required","type":"object","properties":{"message":{"type":"string","example":"Sponsor signature required for fee bump transaction"},"action":{"type":"string","example":"SIGN_SPONSOR_TRANSACTION"},"actionData":{"type":"object","properties":{"xdr":{"type":"string","example":"AAAABQAAAABiSu3MsKtQvDuQO5i2b..."},"step":{"type":"number","example":2},"totalSteps":{"type":"number","example":2},"description":{"type":"string","example":"Sign the fee bump transaction with the sponsor wallet"}}}}}]}}}}},"summary":"Build","tags":["Quote"],"security":[{"bearer":[]}]}},"/swap":{"post":{"description":"\nQuotes, builds and simulates a swap in a **single call**: the equivalent of calling /quote and then /quote/build.\n\nSend the same parameters as /quote plus the wallet address (`from`, a G account or C contract). The response always includes the quote, plus an `action` field telling you what to do next:\n\n- **SIGN_TRANSACTION** — `xdr` is the simulated swap transaction, ready to be signed and sent to /send or your own rpc.\n- **CREATE_TRUSTLINE** — the account is missing a trustline for the output asset. `xdr` is a changeTrust transaction: sign it, submit it, then call this endpoint again to get the swap XDR. Details (signer, assetCode, assetIssuer) come in `actionData`.\n- Other actions (e.g. **RESTORE_BALANCE**) follow the same pattern: `xdr` is the transaction that resolves the action.\n\n#### 📦 Inline prerequisites\nPass `inlinePrerequisites: true` to always receive the swap XDR in a single call, even when a trustline is missing. Instead of a **CREATE_TRUSTLINE** action, the trustline transaction comes in a `prerequisites` array: sign and submit each prerequisite in order, then handle the swap XDR according to `simulated`:\n\n- `simulated: true` (no prerequisite needed, or an SDEX route) — the swap XDR is complete; sign it and send it as is. Re-simulating it drops the footprint and budget margins the API adds for Aqua and Sushi routes.\n- `simulated: false` (Soroban routes) — simulation cannot succeed until the trustline exists, so the swap XDR has no footprint, resource fees or auth entries. Re-simulate and assemble it (footprint, resources and auth entries are regenerated automatically), or override sequence and Soroban resources yourself, before signing and sending. Submitting it as-is will fail.\n\nThe swap XDR's sequence number already accounts for the prerequisite transactions when they share the same source account. Only the missing-trustline case becomes a prerequisite; other actions (e.g. **RESTORE_BALANCE**) keep the action flow described above.\n\n#### ⚡ Gasless Trustline\nPass `gaslessTrustline: \"create\"` together with a `sponsor` address to get a single SDEX transaction that opens the trustline and swaps. The returned XDR must be signed by **both** the user and the sponsor.\n\n> **Note:** The two-step Soroban sponsored flow (user signature + fee bump) is not supported here — use /quote and /quote/build for that.\n\n#### 💰 Fees\n`feeBps` and `referralId` are accepted for compatibility and ignored: the fee comes from your authenticated principal's partner rate, and fee destinations are no longer caller-supplied. The values you send are recorded so Soroswap can seed your profile and propose your payout address. The quote includes `platformFee` only when a partner rate applies.\n","operationId":"SwapController_swap","parameters":[{"name":"network","required":false,"in":"query","description":"Network on which the operation will be performed","schema":{"enum":["testnet","mainnet"],"type":"string"}}],"requestBody":{"required":true,"description":"Data required to quote and build the swap","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapDto"},"examples":{"exactIn":{"value":{"assetIn":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amount":"10000000","tradeType":"EXACT_IN","protocols":["soroswap","aqua","sdex"],"slippageBps":"50","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK"},"summary":"One-call EXACT_IN swap: quote + ready-to-sign XDR"},"withPlatformFee":{"value":{"assetIn":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amount":"10000000","tradeType":"EXACT_IN","protocols":["soroswap","aqua"],"slippageBps":"50","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK"},"summary":"Swap for a caller with a partner rate: the platform fee is resolved from the profile, not the body"},"gaslessTrustline":{"value":{"assetIn":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amount":"10000000","tradeType":"EXACT_IN","protocols":["sdex"],"slippageBps":"50","gaslessTrustline":"create","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","sponsor":"GDFRQKZH2F6QPZDW7YNWCV3H6FGUQZ3XAJS7XEZQVYZSQYB4SVPQXVYB"},"summary":"Gasless trustline swap: single XDR signed by user and sponsor"},"inlinePrerequisites":{"value":{"assetIn":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","assetOut":"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV","amount":"10000000","tradeType":"EXACT_IN","protocols":["soroswap","aqua","sdex"],"slippageBps":"50","from":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","inlinePrerequisites":true},"summary":"Always get the swap XDR: a missing trustline is returned in prerequisites instead of replacing the swap"}}}}},"responses":{"200":{"description":"Quote and transaction (or required action) returned successfully","content":{"application/json":{"schema":{"type":"object","properties":{"quote":{"type":"object","description":"The quote for the swap, same schema as the /quote response"},"xdr":{"type":"string","example":"AAAAAgAAAAB8shYDi1JO9x2/3jMeVzK2IGtrsFVWLCL4uHRJf+YPyAAAA+gCzi7H...","description":"Unsigned transaction XDR: the swap when action is SIGN_TRANSACTION, or the transaction that resolves the required action (e.g. a changeTrust for CREATE_TRUSTLINE)"},"action":{"type":"string","enum":["SIGN_TRANSACTION","CREATE_TRUSTLINE","RESTORE_BALANCE","RESTORE_CONTRACT"],"example":"SIGN_TRANSACTION","description":"What to do next with the returned XDR"},"message":{"type":"string","example":"Sign the transaction with the user wallet and send the signed XDR to /send endpoint or your own rpc","description":"Human-readable explanation of the required action"},"actionData":{"type":"object","description":"Extra details when action is not SIGN_TRANSACTION (e.g. signer, assetCode, assetIssuer for CREATE_TRUSTLINE)"},"simulated":{"type":"boolean","example":false,"description":"Present on every response when inlinePrerequisites is true, absent otherwise. true means the swap XDR is simulated and ready to sign; false means the swap XDR was built without simulation (no footprint, resource fees or auth entries) and must be re-simulated and assembled before submission"},"prerequisites":{"type":"array","description":"Only present in inline-prerequisites mode: transactions to sign and submit, in order, before the swap XDR","items":{"type":"object","properties":{"action":{"type":"string","example":"CREATE_TRUSTLINE"},"xdr":{"type":"string","example":"AAAAAgAAAABiSu3MsKtQvDuQO5i2b...","description":"Unsigned transaction XDR for this prerequisite"},"signer":{"type":"string","example":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","description":"The account that must sign and submit this transaction"},"assetCode":{"type":"string","example":"USDC"},"assetIssuer":{"type":"string","example":"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"},"description":{"type":"string"}}}}}}}}},"400":{"description":"Error in input parameters, route not found, or simulation failed"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."},"409":{"description":"The fee rate changed since the quote was issued; request a new quote"}},"summary":"Swap (all-in-one)","tags":["Quote"],"security":[{"bearer":[]}]}},"/send":{"post":{"description":"This endpoint allows users to send pre-signed Soroswap transactions to the Stellar Blockchain using Soroban RPC or Horizon.","operationId":"SwapController_sendTransaction","parameters":[{"name":"network","required":false,"in":"query","description":"Network on which the operation will be performed","schema":{"enum":["testnet","mainnet"],"type":"string"}}],"requestBody":{"required":true,"description":"Data of the signed transaction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendXdrDto"},"examples":{"sendTransaction":{"value":{"xdr":"AAAAAgAAAABiSu3MsKtQvDuQO5i2b..."}}}}}},"responses":{"200":{"description":"Transaction submitted and confirmed. Normalized SendTransactionResponse, the same shape for soroban and horizon submissions.","content":{"application/json":{"schema":{"type":"object","properties":{"txHash":{"type":"string","example":"a1b2c3d4e5f6...","description":"Transaction hash"},"success":{"type":"boolean","example":true,"description":"true when the network reports the transaction as successful (RPC status SUCCESS, Horizon successful). A failed Soroban transaction is an error response, not success: false"},"result":{"type":"object","nullable":true,"description":"Parsed return value, discriminated on `type`: swap {amountIn, amountOut, intermediateAmounts?}, add_liquidity {amountA, amountB, shares}, remove_liquidity {amountA, amountB}, unknown {value}. null when it could not be parsed.","properties":{"type":{"type":"string","enum":["swap","add_liquidity","remove_liquidity","unknown"],"example":"swap"},"amountIn":{"type":"string","example":"10000000"},"amountOut":{"type":"string","example":"5000000"},"intermediateAmounts":{"type":"array","items":{"type":"string"}},"amountA":{"type":"string"},"amountB":{"type":"string"},"shares":{"type":"string"},"value":{"description":"Raw native value, only for type unknown"}}},"ledger":{"type":"number","example":12345,"description":"Ledger the transaction was included in"},"createdAt":{"type":"string","example":"1793711685","description":"Time the transaction closed. Unix seconds as a string for soroban submissions (passed through from RPC getTransaction), ISO 8601 for horizon submissions"},"latestLedger":{"type":"number","example":12350,"description":"Latest known ledger; for horizon submissions it repeats ledger"},"latestLedgerCloseTime":{"type":"string","example":"1793711710","description":"Close time of the latest known ledger. Unix seconds as a string for soroban submissions; for horizon submissions it repeats createdAt (ISO 8601)"},"feeBump":{"type":"boolean","example":false,"description":"Whether the envelope was a fee bump (always false for Horizon submissions)"},"feeCharged":{"type":"string","example":"0","description":"Fee charged, in stroops, from Horizon fee_charged. Always \"0\" for soroban submissions, because RPC getTransaction does not report a fee"},"protocol":{"type":"string","enum":["router","aggregator","sdex","unknown"],"example":"router","description":"router for the Soroswap router, aggregator for every other whitelisted Soroban target, sdex for Horizon submissions"},"submissionMethod":{"type":"string","enum":["soroban","horizon"],"example":"soroban","description":"soroban for invokeHostFunction transactions, horizon for everything else"}}}}}},"400":{"description":"The transaction was rejected or did not succeed. Returned when: the XDR cannot be parsed; the first operation invokes a contract that is not on the Soroswap whitelist; Soroban RPC sendTransaction returns status ERROR (body: title ERROR, detail = result code, extra.resultXdr); the transaction lands on chain with status FAILED (body title FAILED, detail = the operation result code when it can be parsed); Horizon rejects a horizon submission. Known bug: a DUPLICATE or TRY_AGAIN_LATER status from the RPC currently surfaces as a 400 with an empty {} body instead of being retried or reported, so resubmitting an already-sent transaction looks like a generic 400. A FAILED transaction caused by an archived ledger entry returns 428 with a restore action instead, when the restore transaction can be built."},"401":{"description":"A valid JWT of a disabled account."},"403":{"description":"Missing or invalid credential."}},"summary":"Send","tags":["Quote"],"security":[{"bearer":[]}]}},"/pools":{"get":{"description":"Retrieves the pools available for a specific network and protocol.\n    \n    GET /pools?network=MAINNET&protocol=SOROSWAP&assetList=SOROSWAP,AQUA","operationId":"PoolsController_getPairs","parameters":[{"name":"network","required":true,"in":"query","description":"Network in which the pairs will be searched","schema":{"enum":["testnet","mainnet"],"type":"string"}},{"name":"protocol","required":true,"in":"query","description":"Protocol in which the pairs will be searched","schema":{"type":"array","items":{"type":"string"}}},{"name":"assetList","required":false,"in":"query","description":"Filter pairs by asset lists (e.g. SOROSWAP, AQUA, STELLAR_EXPERT, LOBSTR)","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Returns an array of pools","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"protocol":{"type":"string","example":"soroswap","description":"Protocol name"},"address":{"type":"string","example":"CAM7DY53G63XA4AJRS24Z6VFYAFSSF76C3RZ45BE5YU3FQS5255OOABP","description":"Pool contract address"},"tokenA":{"type":"string","example":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","description":"First token contract address"},"tokenB":{"type":"string","example":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","description":"Second token contract address"},"reserveA":{"type":"string","example":"4286614183151","description":"Reserve amount for token A"},"reserveB":{"type":"string","example":"1009473414112","description":"Reserve amount for token B"},"ledger":{"type":"number","example":57727251,"description":"Ledger number when data was last updated"}}},"example":[{"protocol":"soroswap","address":"CAM7DY53G63XA4AJRS24Z6VFYAFSSF76C3RZ45BE5YU3FQS5255OOABP","tokenA":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","tokenB":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","reserveA":"4286614183151","reserveB":"1009473414112","ledger":57727251}]}}}},"400":{"description":"Bad Request"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."},"502":{"description":"Invalid request"}},"summary":"Pools","tags":["Pools"],"security":[{"bearer":[]}]}},"/pools/{tokenA}/{tokenB}":{"get":{"description":"Retrieves the pool for the given tokens","operationId":"PoolsController_getPairByTokens","parameters":[{"name":"tokenA","required":true,"in":"path","schema":{"type":"string"}},{"name":"tokenB","required":true,"in":"path","schema":{"type":"string"}},{"name":"network","required":true,"in":"query","schema":{"enum":["testnet","mainnet"],"type":"string"}},{"name":"protocol","required":true,"in":"query","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Returns an array of pools","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"protocol":{"type":"string","example":"soroswap","description":"Protocol name"},"address":{"type":"string","example":"CAM7DY53G63XA4AJRS24Z6VFYAFSSF76C3RZ45BE5YU3FQS5255OOABP","description":"Pool contract address"},"tokenA":{"type":"string","example":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","description":"First token contract address"},"tokenB":{"type":"string","example":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","description":"Second token contract address"},"reserveA":{"type":"string","example":"4286614183151","description":"Reserve amount for token A"},"reserveB":{"type":"string","example":"1009473414112","description":"Reserve amount for token B"},"ledger":{"type":"number","example":57727251,"description":"Ledger number when data was last updated"}}},"example":[{"protocol":"soroswap","address":"CAM7DY53G63XA4AJRS24Z6VFYAFSSF76C3RZ45BE5YU3FQS5255OOABP","tokenA":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","tokenB":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","reserveA":"4286614183151","reserveB":"1009473414112","ledger":57727251}]}}}},"400":{"description":"Bad Request"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Pool for two tokens","tags":["Pools"],"security":[{"bearer":[]}]}},"/price":{"get":{"description":"Retrieves the price of one or more assets in relation to a reference currency.\n    \n    Example of query: GET /price?network=MAINNET&asset=CB64D3G7SM2RTH6JSGG34DDTFTQ5CFDKVDZJZSODMCX4NJ2HV2KN7OHT&referenceCurrency=USD","operationId":"PriceController_getPrice","parameters":[{"name":"network","required":true,"in":"query","description":"Network in which the price will be searched","schema":{"enum":["testnet","mainnet"],"type":"string"}},{"name":"asset","required":true,"in":"query","description":"Asset contract address or list separated by commas","schema":{"example":"CB64D3G7SM2RTH6JSGG34DDTFTQ5CFDKVDZJZSODMCX4NJ2HV2KN7OHT","type":"array","items":{"type":"string"}}},{"name":"referenceCurrency","required":false,"in":"query","description":"Reference currency (default USD)","schema":{"example":"USD"}}],"responses":{"200":{"description":"Returns the price data. Always uses the asset contract address.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"asset":{"type":"string","example":"CB64D3G7SM2RTH6JSGG34DDTFTQ5CFDKVDZJZSODMCX4NJ2HV2KN7OHT"},"referenceCurrency":{"type":"string","example":"USD"},"price":{"type":"string","example":"1.000000"}}}}}}},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Price information","tags":["Price"],"security":[{"bearer":[]}]}},"/balances/{walletAddress}":{"get":{"description":"Retrieves all token balances from the asset list for a specific address.\n\nSupports both wallet addresses (G-prefixed) and smart contracts/accounts (C-prefixed).\n\nExample: GET /balances/GALAXYVOIDAOPZTDLHILAJQKCVVFMD4IKLXLSZV5YHO7VY74IWZILUTO?network=mainnet","operationId":"BalancesController_getAllBalances","parameters":[{"name":"walletAddress","required":true,"in":"path","description":"Stellar address - wallet (G-prefixed) or contract (C-prefixed)","schema":{"example":"GALAXYVOIDAOPZTDLHILAJQKCVVFMD4IKLXLSZV5YHO7VY74IWZILUTO","type":"string"}},{"name":"network","required":true,"in":"query","description":"Network to query balances on","schema":{"enum":["mainnet","testnet"],"type":"string"}}],"responses":{"200":{"description":"Returns balances for all tokens in the asset list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalancesResponseDto"}}}},"400":{"description":"Bad Request - Invalid address"},"401":{"description":"Unauthorized - Missing or invalid authentication"},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."},"503":{"description":"Service Unavailable - Database connection unavailable"}},"summary":"Get all token balances for an address","tags":["Balances"],"security":[{"bearer":[]}]}},"/balances/{walletAddress}/{tokenAddress}":{"get":{"description":"Retrieves the balance of a specific token for an address.\n\nSupports both wallet addresses (G-prefixed) and smart contracts/accounts (C-prefixed).\n\nToken address can be:\n- Contract ID (C-prefixed, 56 characters)\n- CODE:ISSUER format (e.g., USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN)\n\nExample: GET /balances/GALAXYVOIDAOPZTDLHILAJQKCVVFMD4IKLXLSZV5YHO7VY74IWZILUTO/CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA?network=mainnet","operationId":"BalancesController_getTokenBalance","parameters":[{"name":"walletAddress","required":true,"in":"path","description":"Stellar address - wallet (G-prefixed) or contract (C-prefixed)","schema":{"example":"GALAXYVOIDAOPZTDLHILAJQKCVVFMD4IKLXLSZV5YHO7VY74IWZILUTO","type":"string"}},{"name":"tokenAddress","required":true,"in":"path","description":"Token address - either contract ID (C...) or CODE:ISSUER format","schema":{"example":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","type":"string"}},{"name":"network","required":true,"in":"query","description":"Network to query balance on","schema":{"enum":["mainnet","testnet"],"type":"string"}}],"responses":{"200":{"description":"Returns the token balance. If the token is not in the asset list, code is 'UNKNOWN' and decimals are read from the contract's decimals() (7 for a CODE:ISSUER classic asset, or when that read fails)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleBalanceResponseDto"}}}},"400":{"description":"Bad Request - Invalid address or token address format"},"401":{"description":"Unauthorized - Missing or invalid authentication"},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."},"503":{"description":"Service Unavailable - Database connection unavailable"}},"summary":"Get balance for a specific token","tags":["Balances"],"security":[{"bearer":[]}]}},"/users/me/requests":{"get":{"description":"Requests made with your API keys or your session, newest first, with the error each failed one was answered with. Takes a console session (JWT from /login or /refresh); API keys are refused. Requests refused before authentication (401, 403) are not listed, and 429s are a sample of at most one per second. Page with `cursor` from `nextCursor`.","operationId":"MyRequestsController_list","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"`nextCursor` from the previous page.","schema":{"minimum":1,"type":"number"}},{"name":"network","required":false,"in":"query","description":"Only this network. Omit for both.","schema":{"type":"string","enum":["mainnet","testnet"]}},{"name":"status","required":false,"in":"query","description":"`ok`: status below 400. `error`: 400 and above. Omit for both.","schema":{"type":"string","enum":["ok","error"]}},{"name":"apiKeyId","required":false,"in":"query","description":"Only requests made with this API key of yours.","schema":{"minimum":1,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestPageDto"}}}},"400":{"description":"Malformed query, or: Invalid cursor"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An API key, or an expired or invalid JWT"}},"security":[{"bearer":[]}],"summary":"Your recent requests","tags":["Users"]}},"/users/me/usage/summary":{"get":{"description":"Requests, 2xx/3xx, 4xx, 5xx and p50/p90 latency in ms over the range and over the range before it. Takes a console session (JWT from /login or /refresh); API keys are refused. Counts the calls this account made over the range, with any of its keys or a session, except its own /users/me/* calls. Rate-limited calls (429) are a sampled lower bound. Cached per filter: 1 minute for 24h, 5 for 7d, 15 for 30d.","operationId":"UsageController_summary","parameters":[{"name":"range","required":false,"in":"query","schema":{"default":"24h","type":"string","enum":["24h","7d","30d"]}},{"name":"network","required":false,"in":"query","schema":{"default":"mainnet","type":"string","enum":["mainnet","testnet","all"]}},{"name":"apiKeyId","required":false,"in":"query","description":"Only calls made with this API key (an `id` from GET /api-keys). Calls before 2026-11-08 carry no key and are left out.","schema":{"minimum":1,"type":"number"}}],"responses":{"200":{"description":"Totals for the range and the previous one"},"400":{"description":"A query parameter outside its allowed values"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An API key, or an expired or invalid JWT"},"503":{"description":"Usage took too long to load (the query ran past its 5s limit). Try a shorter range."}},"security":[{"bearer":[]}],"summary":"Your usage totals","tags":["Usage"]}},"/users/me/usage/timeseries":{"get":{"description":"Hourly points for 24h, daily for 7d and 30d (UTC), with zeros where there were no calls. Takes a console session (JWT from /login or /refresh); API keys are refused. Counts the calls this account made over the range, with any of its keys or a session, except its own /users/me/* calls. Rate-limited calls (429) are a sampled lower bound. Cached per filter: 1 minute for 24h, 5 for 7d, 15 for 30d.","operationId":"UsageController_timeseries","parameters":[{"name":"range","required":false,"in":"query","schema":{"default":"24h","type":"string","enum":["24h","7d","30d"]}},{"name":"network","required":false,"in":"query","schema":{"default":"mainnet","type":"string","enum":["mainnet","testnet","all"]}},{"name":"apiKeyId","required":false,"in":"query","description":"Only calls made with this API key (an `id` from GET /api-keys). Calls before 2026-11-08 carry no key and are left out.","schema":{"minimum":1,"type":"number"}}],"responses":{"200":{"description":"One point per bucket"},"400":{"description":"A query parameter outside its allowed values"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An API key, or an expired or invalid JWT"},"503":{"description":"Usage took too long to load (the query ran past its 5s limit). Try a shorter range."}},"security":[{"bearer":[]}],"summary":"Your usage over time","tags":["Usage"]}},"/users/me/usage/endpoints":{"get":{"description":"The 50 busiest method and path pairs, busiest first. Paths keep their parameters, so /balances/{wallet} shows once per wallet. Takes a console session (JWT from /login or /refresh); API keys are refused. Counts the calls this account made over the range, with any of its keys or a session, except its own /users/me/* calls. Rate-limited calls (429) are a sampled lower bound. Cached per filter: 1 minute for 24h, 5 for 7d, 15 for 30d.","operationId":"UsageController_endpoints","parameters":[{"name":"range","required":false,"in":"query","schema":{"default":"24h","type":"string","enum":["24h","7d","30d"]}},{"name":"network","required":false,"in":"query","schema":{"default":"mainnet","type":"string","enum":["mainnet","testnet","all"]}},{"name":"apiKeyId","required":false,"in":"query","description":"Only calls made with this API key (an `id` from GET /api-keys). Calls before 2026-11-08 carry no key and are left out.","schema":{"minimum":1,"type":"number"}}],"responses":{"200":{"description":"Up to 50 endpoints"},"400":{"description":"A query parameter outside its allowed values"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An API key, or an expired or invalid JWT"},"503":{"description":"Usage took too long to load (the query ran past its 5s limit). Try a shorter range."}},"security":[{"bearer":[]}],"summary":"Your usage by endpoint","tags":["Usage"]}},"/liquidity/add":{"post":{"operationId":"LiquidityController_addLiquidity","parameters":[{"name":"network","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddLiquidityDto"}}}},"responses":{"200":{"description":"Returns the transaction xdr and information about the pool"},"400":{"description":"Bad Request"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Add liquidity to a pool","tags":["Liquidity"],"security":[{"bearer":[]}]}},"/liquidity/remove":{"post":{"operationId":"LiquidityController_removeLiquidity","parameters":[{"name":"network","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveLiquidityDto"}}}},"responses":{"200":{"description":"Returns the transaction xdr and information about the pool"},"400":{"description":"Bad Request"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Remove liquidity from a pool","tags":["Liquidity"],"security":[{"bearer":[]}]}},"/liquidity/positions/{address}":{"get":{"description":"Retrieves all liquidity positions for a specific user address with detailed pool information and calculations.\n\nExample: GET /liquidity/positions/GALAXYVOIDAOPZTDLHILAJQKCVVFMD4IKLXLSZV5YHO7VY74IWZILUTO?network=mainnet","operationId":"LiquidityController_getUserPosition","parameters":[{"name":"address","required":true,"in":"path","schema":{"type":"string"}},{"name":"network","required":true,"in":"query","description":"Network to query positions on","schema":{"enum":["mainnet","testnet"],"type":"string"}}],"responses":{"200":{"description":"Returns an array of user positions with enriched pool information including token details and position metrics","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"poolInfo":{"type":"object","properties":{"protocol":{"type":"string","example":"soroswap","description":"Protocol name"},"address":{"type":"string","example":"CAM7DY53G63XA4AJRS24Z6VFYAFSSF76C3RZ45BE5YU3FQS5255OOABP","description":"Pool contract address"},"tokenA":{"type":"object","properties":{"address":{"type":"string","example":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","description":"Token A contract address"},"name":{"type":"string","example":"USD Coin","description":"Token A name"},"symbol":{"type":"string","example":"USDC","description":"Token A symbol"}},"description":"First token information"},"tokenB":{"type":"object","properties":{"address":{"type":"string","example":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","description":"Token B contract address"},"name":{"type":"string","example":"Stellar Lumens","description":"Token B name"},"symbol":{"type":"string","example":"XLM","description":"Token B symbol"}},"description":"Second token information"},"reserveA":{"type":"string","example":"4286614183151","description":"Reserve amount for token A"},"reserveB":{"type":"string","example":"1009473414112","description":"Reserve amount for token B"},"totalSupply":{"type":"string","example":"200000000","description":"Total supply of LP tokens"},"ledger":{"type":"number","example":57727251,"description":"Ledger number when data was last updated"},"userShares":{"type":"number","example":0.15,"description":"User share of the pool as percentage"},"tokenAAmountEquivalent":{"type":"string","example":"642992127472","description":"Equivalent amount of token A based on user position"},"tokenBAmountEquivalent":{"type":"string","example":"151421012116","description":"Equivalent amount of token B based on user position"}}},"userPosition":{"type":"string","example":"18305475","description":"User liquidity position amount (LP tokens)"}}},"example":[{"poolInfo":{"protocol":"soroswap","address":"CAM7DY53G63XA4AJRS24Z6VFYAFSSF76C3RZ45BE5YU3FQS5255OOABP","tokenA":{"address":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","name":"USD Coin","symbol":"USDC"},"tokenB":{"address":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","name":"Stellar Lumens","symbol":"XLM"},"reserveA":"4286614183151","reserveB":"1009473414112","totalSupply":"200000000","ledger":57727251},"userPosition":"18305475","userShares":0.15,"tokenAAmountEquivalent":"642992127472","tokenBAmountEquivalent":"151421012116"}]}}}},"400":{"description":"Bad Request"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."},"503":{"description":"Service Unavailable - Error fetching pool details"}},"summary":"Get user positions in pools","tags":["Liquidity"],"security":[{"bearer":[]}]}},"/partner/statements":{"get":{"description":"Every payout for your partner id, newest first — id, status, amount, paidAt and heldReason only. Call GET /partner/statements/:payoutId for the full statement.","operationId":"StatementsController_listStatements","parameters":[],"responses":{"200":{"description":""},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"List your payouts","tags":["Partner"],"security":[{"bearer":[]}]}},"/partner/statements/{payoutId}":{"get":{"description":"Invoice-grade detail for one of your payouts: every line it covers, the withdraw and payment transaction hashes, and how to verify your gross independently on chain.","operationId":"StatementsController_getStatement","parameters":[{"name":"payoutId","required":true,"in":"path","schema":{"type":"number"}}],"responses":{"200":{"description":""},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Statement for one payout","tags":["Partner"],"security":[{"bearer":[]}]}},"/partner/swaps":{"get":{"description":"Aggregator swaps routed with your partner id, newest first, in token amounts: the fee and your share of it are in the token sold, as raw stroop strings. SDEX path payments are not included, and testnet is always empty. Page with `cursor` from `nextCursor`.","operationId":"PartnerAnalyticsController_getSwaps","parameters":[{"name":"network","required":false,"in":"query","schema":{"enum":["testnet","mainnet"],"type":"string"}},{"name":"limit","required":false,"in":"query","description":"Page size.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"`nextCursor` from the previous page.","schema":{"minimum":1,"type":"number"}},{"name":"from","required":false,"in":"query","description":"Earliest ledger close time, inclusive (ISO 8601).","schema":{"example":"2026-11-01T00:00:00Z","type":"string"}},{"name":"to","required":false,"in":"query","description":"Latest ledger close time, inclusive (ISO 8601).","schema":{"example":"2026-11-30T23:59:59Z","type":"string"}},{"name":"txHash","required":false,"in":"query","description":"Finds one transaction: 64 hex characters.","schema":{"type":"string"}}],"responses":{"200":{"description":""},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Your swaps","tags":["Partner"],"security":[{"bearer":[]}]}},"/partner/analytics":{"get":{"description":"Over the range: swap count, unique wallets, swaps per day, volume, fees and your share per token (raw stroop strings), top pairs, your earnings in real USDC from conversions, and your payouts with status, tx hashes and heldReason. Cached for a minute. Testnet is always empty.","operationId":"PartnerAnalyticsController_getAnalytics","parameters":[{"name":"network","required":false,"in":"query","schema":{"enum":["testnet","mainnet"],"type":"string"}},{"name":"range","required":false,"in":"query","schema":{"default":"30d","type":"string","enum":["7d","30d","90d"]}}],"responses":{"200":{"description":""},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An expired or invalid JWT, or a valid credential without the required role."}},"summary":"Your swap analytics and earnings","tags":["Partner"],"security":[{"bearer":[]}]}},"/users/me/audit":{"get":{"description":"Sign-ins, sign-outs, password changes and resets, Google connections, API key changes and payout address changes on your account, newest first. Takes a console session (JWT from /login or /refresh); API keys are refused. Never contains a password, PIN, token or full API key: keys appear by id and prefix.","operationId":"AuditController_getOwn","parameters":[{"name":"limit","required":false,"in":"query","description":"Page size.","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}},{"name":"offset","required":false,"in":"query","description":"Rows to skip.","schema":{"minimum":0,"maximum":10000,"default":0,"type":"number"}},{"name":"action","required":false,"in":"query","description":"Only this event.","schema":{"type":"string","enum":["login","auth.logout","password.change","password.reset","auth.google.connect","auth.google.link","api_key.create","api_key.disable","api_key.enable","api_key.revoke","api_key.delete","partner.payout_address.update","admin.account_view","admin.earnings_view"]}},{"name":"resourceType","required":false,"in":"query","schema":{"type":"string","enum":["api_key","user","auth"]}},{"name":"from","required":false,"in":"query","description":"Earliest time, inclusive (ISO 8601).","schema":{"example":"2026-11-01T00:00:00Z","type":"string"}},{"name":"to","required":false,"in":"query","description":"Latest time, inclusive (ISO 8601).","schema":{"example":"2026-11-30T23:59:59Z","type":"string"}}],"responses":{"200":{"description":"One page of entries","content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"},"total":{"type":"number"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"createdAt":{"type":"string"},"userId":{"type":"number"},"action":{"type":"string","example":"api_key.create"},"resourceType":{"type":"string","enum":["api_key","user","auth"]},"resourceId":{"type":"string","nullable":true},"statusCode":{"type":"number","description":"400 and up is a failure"},"ipAddress":{"type":"string","nullable":true},"userAgent":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true}}}}}}}}},"400":{"description":"Invalid filter or page"},"401":{"description":"No credential, an invalid API key, or a valid JWT of a disabled account. Except for the disabled account, the answer carries `WWW-Authenticate` and a `registerUrl`."},"403":{"description":"An API key, or an expired or invalid JWT"}},"security":[{"bearer":[]}],"summary":"Your audit log","tags":["Audit"]}}},"info":{"title":"Soroswap API","description":"\n# 🚀 Soroswap API\n\n**Soroswap.Finance** is both an **Automated Market Maker (AMM)** and a **DEX Aggregator** on the Stellar blockchain.\n\nIt aggregates liquidity from Soroban DEXes (**Soroswap, Phoenix, Aqua and Comet(TBA)**), and the **Stellar Classic DEX** — giving you **the best trade routes, liquidity tools, and real-time market data**.\n\n---\n\n## 📋 What You Can Do\n\n- 🔄 **Quote** – Get the best trade route between two assets with split-routing logic across AMMs and SDEX.  \n- 🧱 **Build** – Generate and simulate unsigned transactions (XDR) for swaps or liquidity actions.  \n- 🚀 **Send** – Submit signed transactions via Soroban RPC or Horizon.\n- ⚡ **Gasless Trustlines** – Use `gaslessTrustline` in `/quote` to open trustlines for users without requiring them to hold XLM or deal with trustline setup themselves.\n- 💰 **Platform Fees** – Add your own fee to user swaps with `platformFee`.  \n- 💧 **Liquidity** – Create LPs, add liquidity, remove liquidity.  \n- 💲 **Price** – Get real-time token prices.  \n- 🧠 **Pools** – View detailed pool information for Soroswap AMM.\n\n📮 **[Downnload the Postman Collection here](https://drive.google.com/drive/folders/1G-LQYE2EojPWP1CSuuS_tDb9vjYbFR6E?usp=drive_link)**\n\n---\n\n## 🔑 Authentication\n\nSend `Authorization: Bearer <credential>`: an API key (`sk_...`) or the JWT access token from `POST /login`. Each operation's `security` says whether it needs one; `security: []` means it is public.\n\n- **401**: no credential, or an invalid API key. The body says where to get a key, and `WWW-Authenticate` is set.\n- **403**: an expired or invalid JWT, or a valid credential without the required role.\n- `POST /send` answers **403** for any missing or invalid credential.\n\n","version":"1.0","contact":{},"x-logo":{"url":"https://links.paltalabs.io/soroswap-full.svg","backgroundColor":"#0e0e0e","altText":"Soroswap Logo","href":"https://soroswap.finance"}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"AuthRegisterDto":{"type":"object","properties":{"accountType":{"type":"string","enum":["COMPANY","INDIVIDUAL"],"nullable":true,"example":"COMPANY"},"companyName":{"type":"string","maxLength":120,"nullable":true,"example":"Acme"},"legalName":{"type":"string","description":"As on invoices","maxLength":160,"nullable":true,"example":"Acme S.A."},"country":{"type":"string","description":"ISO 3166-1 alpha-2 code, stored uppercase","nullable":true,"example":"CL"},"website":{"type":"string","description":"An http or https URL, scheme included","maxLength":255,"nullable":true,"example":"https://acme.com"},"segment":{"type":"string","enum":["WALLET","EXCHANGE","FINTECH","PAYMENTS","DEFI","TRADING_BOT","AI_AGENT","OTHER"],"nullable":true,"example":"WALLET"},"telegram":{"type":"string","description":"Telegram username, with or without the leading @ (stored without it): 5 to 32 letters, digits or `_`, starting with a letter","nullable":true,"example":"acme_ops"},"username":{"type":"string","description":"Username: 3 to 32 letters, digits, `.`, `_` or `-`, with single spaces between words","example":"user","minLength":3,"maxLength":32},"password":{"type":"string","description":"Password: at least 15 characters and at most 72 bytes in UTF-8","example":"StrongPassword123!","minLength":15},"email":{"type":"string","description":"Email address. Stored trimmed and lowercased; disposable domains are refused.","example":"user@example.com","maxLength":254},"acceptTerms":{"type":"boolean","description":"Must be true: the new account accepts the terms at https://app.soroswap.finance/terms","example":true},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token. Required when GET /auth/config has a site key."}},"required":["username","password","email","acceptTerms"]},"AuthLoginDto":{"type":"object","properties":{"email":{"type":"string","example":"test@example.com"},"password":{"type":"string","example":"strongpassword123"},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token. Required only when GET /auth/config says so."}},"required":["email","password"]},"AuthGoogleDto":{"type":"object","properties":{"credential":{"type":"string","description":"The ID token from Google Identity Services"},"acceptTerms":{"type":"boolean","description":"Must be true to accept the [terms](https://app.soroswap.finance/terms) when this sign-in creates an account."}},"required":["credential"]},"AuthEmailVerifyDto":{"type":"object","properties":{"email":{"type":"string","description":"Email address of the account","example":"user@example.com"},"pin":{"type":"string","description":"The 6-digit PIN from the email","example":"012345"}},"required":["email","pin"]},"AuthEmailResendDto":{"type":"object","properties":{"email":{"type":"string","description":"Email address of the account","example":"user@example.com"}},"required":["email"]},"AuthPasswordForgotDto":{"type":"object","properties":{"email":{"type":"string","description":"Email address of the account","example":"user@example.com"}},"required":["email"]},"AuthPasswordResetDto":{"type":"object","properties":{"email":{"type":"string","description":"Email address of the account","example":"user@example.com"},"pin":{"type":"string","description":"The 6-digit PIN from the email","example":"012345"},"newPassword":{"type":"string","description":"The new password: at least 15 characters and at most 72 bytes in UTF-8","example":"a long and memorable passphrase","minLength":15}},"required":["email","pin","newPassword"]},"ApiKeyCreateDto":{"type":"object","properties":{"name":{"type":"string","description":"Unique among your keys that are not revoked, in any casing","example":"prod-backend","minLength":1,"maxLength":40}},"required":["name"]},"AuthGoogleConnectDto":{"type":"object","properties":{"credential":{"type":"string","description":"The ID token from Google Identity Services"},"currentPassword":{"type":"string","description":"Your current password"}},"required":["credential","currentPassword"]},"AuthPasswordChangeDto":{"type":"object","properties":{"newPassword":{"type":"string","description":"The new password: at least 15 characters and at most 72 bytes in UTF-8","example":"a long and memorable passphrase","minLength":15},"currentPassword":{"type":"string","description":"The password in use now","example":"the password in use now"}},"required":["newPassword","currentPassword"]},"ProfileDto":{"type":"object","properties":{"accountType":{"type":"string","enum":["COMPANY","INDIVIDUAL"],"nullable":true,"example":"COMPANY"},"companyName":{"type":"string","maxLength":120,"nullable":true,"example":"Acme"},"legalName":{"type":"string","description":"As on invoices","maxLength":160,"nullable":true,"example":"Acme S.A."},"country":{"type":"string","description":"ISO 3166-1 alpha-2 code, stored uppercase","nullable":true,"example":"CL"},"website":{"type":"string","description":"An http or https URL, scheme included","maxLength":255,"nullable":true,"example":"https://acme.com"},"segment":{"type":"string","enum":["WALLET","EXCHANGE","FINTECH","PAYMENTS","DEFI","TRADING_BOT","AI_AGENT","OTHER"],"nullable":true,"example":"WALLET"},"telegram":{"type":"string","description":"Telegram username, with or without the leading @ (stored without it): 5 to 32 letters, digits or `_`, starting with a letter","nullable":true,"example":"acme_ops"}}},"PutPartnerRateDto":{"type":"object","properties":{"partnerBps":{"type":"number","example":25,"description":"The whole fee your users pay, in bps: 0 turns attribution off; otherwise 25..300"}},"required":["partnerBps"]},"PutPayoutAddressDto":{"type":"object","properties":{"address":{"type":"string","example":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","description":"A funded G account holding a USDC trustline. Monthly USDC payouts go here."},"currentPassword":{"type":"string","description":"Your current password. Required when calling with a JWT, unless the account has no password; ignored with an API key. Missing or wrong answers 400."},"pin":{"type":"string","description":"For an account that signs in with Google and has no password, with a JWT: the PIN from POST /partner/payout-address/pin, for this same address. Ignored otherwise."}},"required":["address"]},"PostPayoutPinDto":{"type":"object","properties":{"address":{"type":"string","example":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","description":"The address the PIN will confirm. It works for this address only."}},"required":["address"]},"QuoteDto":{"type":"object","properties":{"assetIn":{"type":"string","example":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","description":"Input asset contract address"},"assetOut":{"type":"string","example":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","description":"Output asset contract address"},"amount":{"format":"int64","type":"integer","example":"10000000","description":"Expected input amount in stroops"},"tradeType":{"type":"string","example":"EXACT_IN","enum":["EXACT_IN","EXACT_OUT"],"description":"Type of trade: EXACT_IN = input fixed; EXACT_OUT = output fixed"},"protocols":{"example":["soroswap","aqua"],"description":"Array of protocols to aggregate liquidity from","type":"array","items":{"type":"array"}},"parts":{"type":"number","example":10,"description":"Number of route splits for optimization. Higher values improve price discovery but increase latency. Max: 1000.."},"slippageBps":{"type":"number","example":"50","description":"Slippage tolerance in basis points (bps). 10000 = 100%, 100 = 1%, 50 = 0.5%. Default is 50 bps (0.5%)"},"maxHops":{"type":"number","example":2,"description":"Maximum number of hops to aggregate liquidity from"},"assetList":{"example":["SOROSWAP","STELLAR_EXPERT","AQUA","LOBSTR"],"description":"Restricts intermediate tokens to a specific list. Only useful for Soroban transactions (Router and Aggregator). Not useful for SDEX.","type":"array","items":{"type":"string"}},"feeBps":{"type":"number","example":50,"description":"Ignored. Your fee rate lives in your partner profile (see GET /partner). Kept for wire compatibility; the value you send is recorded so Soroswap can seed your profile."},"gaslessTrustline":{"type":"string","example":true,"description":"Whether to use gasless trustline swap. Only use this if you are sure that the user does not have a trustline for the output asset and if you have an sponsor account."}},"required":["assetIn","assetOut","amount","tradeType","protocols"]},"BuildQuoteDto":{"type":"object","properties":{"quote":{"type":"object","description":"The quote to build the XDR for"},"from":{"type":"string","description":"The wallet address that will send the funds"},"to":{"type":"string","description":"The wallet address that will receive the funds. If Gasless Trustline Swap is enabled, this is the wallet address must be the same as the from address (hence, don't provide this parameter)"},"referralId":{"type":"string","description":"Ignored. Fee destinations are no longer caller-supplied; the value you send is recorded so Soroswap can propose your payout address."},"sponsor":{"type":"string","description":"The wallet address that will sponsor the transaction. Only required for Gasless Trustline Swap and Soroban sponsored transactions"},"signedUserXdr":{"type":"string","description":"The signed transaction XDR from Step 1 of Soroban sponsored transactions. Required for Step 2 when sponsor is provided for non-SDEX platforms."}},"required":["quote"]},"SwapDto":{"type":"object","properties":{"assetIn":{"type":"string","example":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","description":"Input asset contract address"},"assetOut":{"type":"string","example":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75","description":"Output asset contract address"},"amount":{"format":"int64","type":"integer","example":"10000000","description":"Expected input amount in stroops"},"tradeType":{"type":"string","example":"EXACT_IN","enum":["EXACT_IN","EXACT_OUT"],"description":"Type of trade: EXACT_IN = input fixed; EXACT_OUT = output fixed"},"protocols":{"example":["soroswap","aqua"],"description":"Array of protocols to aggregate liquidity from","type":"array","items":{"type":"array"}},"parts":{"type":"number","example":10,"description":"Number of route splits for optimization. Higher values improve price discovery but increase latency. Max: 1000.."},"slippageBps":{"type":"number","example":"50","description":"Slippage tolerance in basis points (bps). 10000 = 100%, 100 = 1%, 50 = 0.5%. Default is 50 bps (0.5%)"},"maxHops":{"type":"number","example":2,"description":"Maximum number of hops to aggregate liquidity from"},"assetList":{"example":["SOROSWAP","STELLAR_EXPERT","AQUA","LOBSTR"],"description":"Restricts intermediate tokens to a specific list. Only useful for Soroban transactions (Router and Aggregator). Not useful for SDEX.","type":"array","items":{"type":"string"}},"feeBps":{"type":"number","example":50,"description":"Ignored. Your fee rate lives in your partner profile (see GET /partner). Kept for wire compatibility; the value you send is recorded so Soroswap can seed your profile."},"gaslessTrustline":{"type":"string","example":true,"description":"Whether to use gasless trustline swap. Only use this if you are sure that the user does not have a trustline for the output asset and if you have an sponsor account."},"from":{"type":"string","example":"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK","description":"The wallet address (G account or C contract) that will send the funds and sign the transaction"},"to":{"type":"string","description":"The wallet address that will receive the funds. Defaults to the from address. Must equal from when gaslessTrustline is enabled"},"referralId":{"type":"string","description":"Ignored. Fee destinations are no longer caller-supplied; the value you send is recorded so Soroswap can propose your payout address."},"sponsor":{"type":"string","description":"The wallet address that will sponsor the trustline. Only supported for the Gasless Trustline (SDEX) flow"},"inlinePrerequisites":{"type":"boolean","example":true,"description":"When true and a trustline is missing, the response still contains the swap XDR: the trustline transaction is returned in a `prerequisites` array instead of replacing the swap. Prerequisites must be signed and submitted in order first. For Soroban routes the swap XDR is returned unsimulated (`simulated: false`) since simulation cannot succeed until the trustline exists — re-simulate it (or override sequence and Soroban resources) before submitting. Every response in this mode carries `simulated`, so a missing field never has to be read as true"}},"required":["assetIn","assetOut","amount","tradeType","protocols","from"]},"SendXdrDto":{"type":"object","properties":{"xdr":{"type":"string","description":"The signed transaction in XDR format"}},"required":["xdr"]},"AssetInfoDto":{"type":"object","properties":{"code":{"type":"string","example":"XLM","description":"Token code/symbol"},"issuer":{"type":"string","example":"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN","description":"Asset issuer (null for native XLM and pure Soroban tokens)","nullable":true},"contract":{"type":"string","example":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA","description":"Soroban contract address"},"name":{"type":"string","example":"Stellar Lumens","description":"Human-readable asset name","nullable":true},"icon":{"type":"string","example":"https://example.com/xlm-icon.png","description":"Asset icon URL","nullable":true},"decimals":{"type":"number","example":7,"description":"Token decimals"}},"required":["code","issuer","contract","name","icon","decimals"]},"TokenBalanceDto":{"type":"object","properties":{"asset":{"description":"Asset information","allOf":[{"$ref":"#/components/schemas/AssetInfoDto"}]},"amount":{"type":"string","example":"100.0000000","description":"Human-readable balance with decimals"},"rawAmount":{"type":"string","example":"1000000000","description":"Raw balance in smallest unit (stroops for XLM, token decimals for others)"},"available":{"type":"string","example":"97.5000000","description":"Available/spendable amount (for XLM on G-accounts: balance minus reserves)"},"availableRaw":{"type":"string","example":"975000000","description":"Raw available/spendable amount in smallest unit"}},"required":["asset","amount","rawAmount","available","availableRaw"]},"BalancesResponseDto":{"type":"object","properties":{"wallet":{"type":"string","example":"GDMTVHLWJTHSUDMZVVMXXH6VJHA2ZV3HNG5LYNAZ6RTWB7GISM6PGTUV","description":"Wallet address"},"network":{"type":"string","example":"mainnet","description":"Network"},"balances":{"description":"Array of token balances","type":"array","items":{"$ref":"#/components/schemas/TokenBalanceDto"}},"updatedAt":{"type":"number","example":1702483200000,"description":"Timestamp when balances were fetched (ms since epoch)"}},"required":["wallet","network","balances","updatedAt"]},"SingleBalanceResponseDto":{"type":"object","properties":{"wallet":{"type":"string","example":"GDMTVHLWJTHSUDMZVVMXXH6VJHA2ZV3HNG5LYNAZ6RTWB7GISM6PGTUV","description":"Wallet address"},"network":{"type":"string","example":"mainnet","description":"Network"},"balance":{"description":"Token balance information","allOf":[{"$ref":"#/components/schemas/TokenBalanceDto"}]},"updatedAt":{"type":"number","example":1702483200000,"description":"Timestamp when balance was fetched (ms since epoch)"}},"required":["wallet","network","balance","updatedAt"]},"RequestRowDto":{"type":"object","properties":{"id":{"type":"number","example":912345},"timestamp":{"format":"date-time","type":"string","example":"2026-11-10T12:00:00.000Z"},"method":{"type":"string","example":"POST"},"path":{"type":"string","example":"/quote","description":"Without the query string."},"network":{"type":"string","enum":["mainnet","testnet","unknown"],"description":"A request without `network` counts as mainnet; an unsupported value is `unknown`."},"status":{"type":"number","example":400},"durationMs":{"type":"number","nullable":true,"description":"Null when the request never reached a handler, such as a 429."},"apiKeyId":{"type":"number","nullable":true,"description":"The API key that made the request. Null for a signed-in session."},"errorMessage":{"type":"string","nullable":true,"example":"payout address must be a G account","description":"What the request was answered with when it failed. A server error reads \"Internal server error\". Null on success and on requests before this field existed."}},"required":["id","timestamp","method","path","network","status","durationMs","apiKeyId","errorMessage"]},"RequestPageDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/RequestRowDto"}},"nextCursor":{"type":"number","nullable":true,"description":"Pass as `cursor` for the next page. Null on the last page."}},"required":["items","nextCursor"]},"AddLiquidityDto":{"type":"object","properties":{"assetA":{"type":"string","example":"CAS3J7GY..."},"assetB":{"type":"string","example":"CCW67TSZ..."},"amountA":{"format":"int64","type":"integer","example":"10000000"},"amountB":{"format":"int64","type":"integer","example":"10000000"},"to":{"type":"string","example":"GALAXYVOID..."},"slippageBps":{"type":"string","example":"50","description":"Slippage tolerance in basis points (bps). 10000 = 100%, 100 = 1%, 50 = 0.5%. Default is 100 bps (1%)"}},"required":["assetA","assetB","amountA","amountB","to"]},"RemoveLiquidityDto":{"type":"object","properties":{"assetA":{"type":"string","example":"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA"},"assetB":{"type":"string","example":"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75"},"liquidity":{"format":"int64","type":"integer","example":"10000000"},"amountA":{"format":"int64","type":"integer","example":"10000000"},"amountB":{"format":"int64","type":"integer","example":"10000000"},"to":{"type":"string","example":"GALAXYVOIDAOPZTDLHILAJQKCVVFMD4IKLXLSZV5YHO7VY74IWZILUTO"},"slippageBps":{"type":"string","example":"50","description":"Slippage tolerance in basis points (bps). 10000 = 100%, 100 = 1%, 50 = 0.5%. Default is 100 bps (1%)"}},"required":["assetA","assetB","liquidity","amountA","amountB","to"]}}}}