# DEX events

### `proxima.{dex}.{network}.gen-dex-amm.1_0`

Events happening on decentralized exchanges like Uniswap, Quickswap, etc.

#### TypeScript schema:

```typescript
export type GeneralizedAmmDexEvent =
  NewAmmDex |
  NewPool |
  PoolUpdate;

export interface BlockchainEventBase extends JsonObject {
  ref?: TxRef;
}

export interface NewAmmDex extends BlockchainEventBase {
  type: "newDex";

  dex: AmmDex;
}

export interface NewPool extends BlockchainEventBase {
  type: "newPool";

  pool: Pool;
  dexId: AmmDexId;
  state: PoolState;
}

export interface PoolUpdate extends BlockchainEventBase {
  type: "poolUpdate";

  dexId: AmmDexId;
  poolId: PoolId;
  oldState: PoolState;
  newState: PoolState;
  event?: PoolEvent;
}

export interface PoolState extends JsonObject {
  liquidity: Amount[];
  priceWeights?: Amount[];
}

export type PoolEvent = SwapEvent | MintEvent | BurnEvent | undefined;

export interface SwapEvent extends JsonObject {
  type: "swap";
  amounts: Amount[];
}

export interface MintEvent extends JsonObject {
  type: "mint";
  lpTransfers?: Transfer[];
}

export interface BurnEvent extends JsonObject {
  type: "burn";
  lpTransfers?: Transfer[];
}


export interface AmmDex extends JsonObject {
  id: AmmDexId;
  network: Network;
  displayName: string;
  protocol: AmmDexProtocol | string;
}

export type AmmDexProtocol = "uniswap2" | "uniswap3";

export interface Network extends JsonObject {
  name: string;
  chainId?: number;
}

export interface Pool extends JsonObject {
  id: PoolId;
  assets: Asset[];
  lp?: Asset;
}

export type TxRef = Partial<Omit<TxRefBase, "chain">>;

export interface Transfer extends JsonObject {
  from?: UserId;
  to: UserId;
  value: Amount;
}

export type UserId = Address;
export type PoolId = Address;
export type AmmDexId = string;
export type Asset = Address;
```


---

# 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.proxima.one/proxima/streams/our-streams/dex-events.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.
