> For the complete documentation index, see [llms.txt](https://docs.cielo.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cielo.finance/api-reference/trading/base-trading.md).

# Base Trading

Swap quotes and execution on Base.

## Get Base Chain Swap Quote

> Fetches a quote for buying or selling tokens on Base chain. Amount is human-readable. Collateral can be "usdc" (default) or "eth".\
> Plans Included = Builder, Architect, Enterprise Cost per request = 5 credits.<br>

```json
{"openapi":"3.0.0","info":{"title":"Cielo Public API","version":"1.0"},"tags":[{"name":"Base Trading","description":"Swap quotes and execution on Base."}],"servers":[{"url":"https://api.cielo.finance","description":"Endpoint"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"ErrorResponse":{"type":"object","description":"This object represents a response structure typically used to convey the outcome of a request. It primarily consists of a status indicator and a message, which together provide essential feedback about the request's processing. The status reflects the overall result of the request (such as success, error, etc.), while the message gives a more detailed explanation or the nature of the response, especially useful in cases of errors or exceptions.\n","properties":{"status":{"$ref":"#/components/schemas/ResponseStatus","description":"A reference to the response status object. This status is a key indicator of whether the request was processed successfully or resulted in an error."},"data":{"type":"object","description":"A flexible object intended to hold the actual data payload of the response. The structure of this object can vary depending on the specific endpoint and the nature of the response."},"message":{"type":"string","description":"A descriptive message providing additional details about the response. In case of an error, this message typically contains information useful for understanding the error's cause or nature."}},"required":["status","message"]},"ResponseStatus":{"type":"string","enum":["ok","error","pending"]}}},"paths":{"/api/trading/base/v2/quote":{"get":{"tags":["Base Trading"],"summary":"Get Base Chain Swap Quote","description":"Fetches a quote for buying or selling tokens on Base chain. Amount is human-readable. Collateral can be \"usdc\" (default) or \"eth\".\nPlans Included = Builder, Architect, Enterprise Cost per request = 5 credits.\n","operationId":"getBaseQuote","parameters":[{"name":"address","in":"query","description":"Token address (EVM format).","required":true,"schema":{"type":"string"}},{"name":"amount","in":"query","description":"Human-readable amount.","required":false,"schema":{"type":"number"}},{"name":"amount_raw","in":"query","description":"Raw unit amount (overrides amount).","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","description":"Trade type.","required":true,"schema":{"type":"string","enum":["buy","sell"]}},{"name":"collateral","in":"query","description":"Collateral token used as the payment/receive token.","required":false,"schema":{"type":"string","enum":["usdc","eth"],"default":"eth"}}],"responses":{"200":{"description":"Quote retrieved successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Execute Base Chain Swap

> Executes a token swap on Base chain. Amount is human-readable. Collateral determines which token is used as payment (buy) or received (sell). Slippage is in basis points (50 = 0.5%).\
> Requires both X-API-KEY and Authorization Bearer token.\
> Plans Included = Builder, Architect, Enterprise Cost per request = 1 credit.<br>

```json
{"openapi":"3.0.0","info":{"title":"Cielo Public API","version":"1.0"},"tags":[{"name":"Base Trading","description":"Swap quotes and execution on Base."}],"servers":[{"url":"https://api.cielo.finance","description":"Endpoint"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","in":"header","name":"X-API-KEY"}},"schemas":{"ErrorResponse":{"type":"object","description":"This object represents a response structure typically used to convey the outcome of a request. It primarily consists of a status indicator and a message, which together provide essential feedback about the request's processing. The status reflects the overall result of the request (such as success, error, etc.), while the message gives a more detailed explanation or the nature of the response, especially useful in cases of errors or exceptions.\n","properties":{"status":{"$ref":"#/components/schemas/ResponseStatus","description":"A reference to the response status object. This status is a key indicator of whether the request was processed successfully or resulted in an error."},"data":{"type":"object","description":"A flexible object intended to hold the actual data payload of the response. The structure of this object can vary depending on the specific endpoint and the nature of the response."},"message":{"type":"string","description":"A descriptive message providing additional details about the response. In case of an error, this message typically contains information useful for understanding the error's cause or nature."}},"required":["status","message"]},"ResponseStatus":{"type":"string","enum":["ok","error","pending"]}}},"paths":{"/api/trading/base/v2/swap":{"post":{"tags":["Base Trading"],"summary":"Execute Base Chain Swap","description":"Executes a token swap on Base chain. Amount is human-readable. Collateral determines which token is used as payment (buy) or received (sell). Slippage is in basis points (50 = 0.5%).\nRequires both X-API-KEY and Authorization Bearer token.\nPlans Included = Builder, Architect, Enterprise Cost per request = 1 credit.\n","operationId":"executeBaseSwap","parameters":[{"name":"Authorization","in":"header","description":"Bearer token for user authentication.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mint":{"type":"string","description":"Token address (EVM format)."},"type":{"type":"string","enum":["buy","sell"],"description":"Trade direction."},"amount":{"type":"number","description":"Human-readable amount. Provide either amount or amount_raw, not both."},"amount_raw":{"type":"string","description":"Raw amount in smallest unit. Overrides amount."},"slippage":{"type":"integer","description":"Slippage in basis points (50 = 0.5%). Default 50.","default":50},"collateral":{"type":"string","enum":["usdc","eth"],"description":"Collateral token. Default eth.","default":"eth"},"trading_wallet":{"type":"string","description":"EVM trading wallet address to use for the swap."}},"required":["mint","type"]}}}},"responses":{"200":{"description":"Swap executed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"data":{"type":"object","properties":{"inputAmount":{"type":"string","description":"Human-readable input amount."},"outputAmount":{"type":"string","description":"Human-readable output amount."},"txHash":{"type":"string","description":"Transaction hash on Base."}}}}}}}},"400":{"description":"Invalid swap request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```
