# FX (Foreign Exchange)

The FX Anchor service enables currency and token conversions on Keeta. It connects users who want to swap between different assets with liquidity providers who offer exchange services.

### Understanding FX Anchors

An FX Anchor operates like a decentralized exchange interface:

1. **Discovery**: Clients find FX providers using the Resolver
2. **Quote Request**: User requests a price for a conversion
3. **Quote Response**: Provider returns a signed quote with rate and fees
4. **Exchange**: User submits a block swapping tokens with the provider
5. **Settlement**: Provider completes the swap atomically on-chain

The SDK handles the quote signing, verification, and atomic swap construction, ensuring both parties are protected.

### Core Concepts

**Conversion Input**

Every FX operation starts with a `ConversionInput` specifying:

* **from**: The token you have
* **to**: The token you want
* **amount**: How much to convert
* **affinity**: Whether amount refers to 'from' (you have this much) or 'to' (you want this much)

**Quotes vs Estimates**

* **Estimate**: Non-binding price indication, useful for showing users expected rates
* **Quote**: Binding commitment from provider with signature, required for execution

**Floating vs Fixed Rate**

* **Fixed Rate (with quote)**: Price locked at quote time, guaranteed regardless of market movement
* **Floating Rate (without quote)**: Price determined at execution time, may be better or worse than estimate

### Basic Client FX Flow

{% @github-files/github-code-block url="<https://github.com/KeetaNetwork/keetanet-examples/blob/main/src/anchor/fx-client.ts>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeta.com/anchors/anchor-types/fx-foreign-exchange.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
