# Raw Uniswap events

### `proxima.univ2.{network}.domain-events.2_0`

Uniswap V2 events parsed from logs emitted by pool contracts.

#### TypeScript schema:

```typescript
export type Univ2Event = NewPair | PairTx;

export interface NewPair {
  type: "NewPair";

  address: string;
  token0: string;
  token1: string;
}

export interface PairTx {
  type: "PairTx";

  pairAddress: string;
  sync: SyncState;
  event: PairEvent;
}

export interface SyncState {
  reserve0: string;
  reserve1: string;
}

export type PairEvent = MintEvent | BurnEvent | SwapEvent | OtherEvent;

export interface MintEvent {
  type: "Mint";

  sender: string;
  mintsTo: EthTransfer[];
  amount0: string;
  amount1: string;
}

export interface EthTransfer {
  from: string;
  to: string;
  value: string;
}

export interface BurnEvent {
  type: "Burn";

  sender: string;
  amount0: string;
  amount1: string;
  burnTransfers: EthTransfer[];
  feeTransfers: EthTransfer[];
}

export interface SwapEvent {
  type: "Swap";

  to: string;
  sender: string;
  amount0In: string;
  amount1In: string;
  amount0Out: string;
  amount1Out: string;
}

export class OtherEvent {
  type = "Other" as const;
}
```

### `proxima.univ3.{network}.domain-events.2_0`

Uniswap V3 events parsed from logs emitted by pool contracts.

#### TypeScript schema:

```typescript
export type Univ3Event = FactoryEvent | PoolTx;

export type FactoryEvent = PoolCreated | OwnerChanged | FeeAmountEnabled;

export type PoolCreated = {
  type: "PoolCreated";

  poolAddress: Address;
  token0: string;
  token1: string;
  fee: number;
  tickSpacing: number;
};

export interface OwnerChanged {
  type: "OwnerChanged";

  oldOwner: Address;
  newOwner: Address;
}

export interface FeeAmountEnabled {
  type: "FeeAmountEnabled";

  fee: number;
  tickSpacing: number;
}

export interface PoolTx {
  type: "PoolTx";

  poolAddress: string;
  event: PoolEvent;
}

export type PoolEvent = DexEvent | FlashLoanEvent | OracleEvent;

export type DexEvent = Swap | Burn | Mint | Collect | Initialize;

export type OracleEvent = IncreaseObservationCardinalityNext;

export type FlashLoanEvent = SetFeeProtocol | CollectProtocol | Flash;

export type Swap = {
  type: "Swap";

  sender: Address;
  recipient: Address;
  amount0: EthNumber;
  amount1: EthNumber;
  sqrtPriceX96: EthNumber;
  liquidity: EthNumber;
  tick: number;
};

export type Burn = {
  type: "Burn";

  owner: Address;
  tickLower: number;
  tickUpper: number;
  amount: EthNumber;
  amount0: EthNumber;
  amount1: EthNumber;
};

export type Mint = {
  type: "Mint";

  sender: Address;
  owner: Address;
  tickLower: number;
  tickUpper: number;
  amount: EthNumber;
  amount0: EthNumber;
  amount1: EthNumber;
};

export type Collect = {
  type: "Collect";

  owner: Address;
  recipient: Address;
  tickLower: number;
  tickUpper: number;
  amount0: EthNumber;
  amount1: EthNumber;
};

export type Initialize = {
  type: "Initialize";

  sqrtPriceX96: EthNumber;
  tick: number;
};

export type IncreaseObservationCardinalityNext = {
  type: "IncreaseObservationCardinalityNext";

  observationCardinalityNextOld: number;
  observationCardinalityNextNew: number;
};

export type CollectProtocol = {
  type: "CollectProtocol";

  sender: Address;
  recipient: Address;
  amount0: EthNumber;
  amount1: EthNumber;
};

export type SetFeeProtocol = {
  type: "SetFeeProtocol";

  feeProtocol0Old: number;
  feeProtocol1Old: number;
  feeProtocol0New: number;
  feeProtocol1New: number;
};

export type Flash = {
  type: "Flash";

  sender: Address;
  recipient: Address;
  amount0: EthNumber;
  amount1: EthNumber;
  paid0: EthNumber;
  paid1: EthNumber;
};

export type EthNumber = string;
export type Address = string;
```


---

# 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/private-streams/raw-uniswap-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.
