> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# getTokenEventsForMaker

> Returns a list of token events for a given maker (wallet address). getTokenEventsForMaker query reference: arguments and response fields.

## GraphQL

```
type Query {
  getTokenEventsForMaker(
    limit: Int
    query: MakerEventsQueryInput!
    cursor: String
    direction: RankingDirection
  ): MakerEventConnection
}

enum EventCommitmentLevel {
  Processed
  Confirmed
}

enum EventType {
  Burn
  Mint
  Swap
  Sync
  Collect
  CollectProtocol
  PoolBalanceChanged
  LiquidityLock
}

type BurnEventData {
  amount0: String
  amount1: String
  amount0Shifted: String
  amount1Shifted: String
  tickLower: String
  tickUpper: String
  type: EventType!
}

type MintEventData {
  amount0: String
  amount1: String
  amount0Shifted: String
  amount1Shifted: String
  tickLower: String
  tickUpper: String
  type: EventType!
}

type SwapEventData {
  amount0: String
  amount0In: String
  amount0Out: String
  amount1: String
  amount1In: String
  amount1Out: String
  amountNonLiquidityToken: String
  priceBaseToken: String
  priceBaseTokenTotal: String
  priceUsd: String
  priceUsdTotal: String
  tick: String
  type: EventType!
}

type PoolBalanceChangedEventData {
  amount0: String
  amount1: String
  amount0Shifted: String
  amount1Shifted: String
  token0: String
  token1: String
  sender: String
  protocolFeeAmount0: String
  protocolFeeAmount1: String
  liquidity0: String
  liquidity1: String
  type: EventType!
}

union EventData = BurnEventData | MintEventData | SwapEventData | PoolBalanceChangedEventData

enum QuoteToken {
  token0
  token1
}

enum EventDisplayType {
  Burn
  Mint
  Buy
  Sell
  Sync
  Collect
  CollectProtocol
}

enum SandwichLabelForEventType {
  sandwiched
  frontrun
  backrun
}

type SandwichLabelForEvent {
  label: String!
  sandwichType: SandwichLabelForEventType!
  token0DrainedAmount: String!
  token1DrainedAmount: String!
}

type WashtradeLabelForEvent {
  label: String!
}

type LabelsForEvent {
  sandwich: SandwichLabelForEvent
  washtrade: WashtradeLabelForEvent
}

type PumpCashbackFeeData {
  type: String!
  cashbackFeeBps: Int!
  cashbackAmountLamports: String!
}

type PumpAmmCashbackFeeData {
  type: String!
  cashbackFeeBps: Int!
  cashbackAmountLamports: String!
}

type LiftHarvestFeeData {
  type: String!
  positionId: String!
  quoteAddress: String!
  creatorAddress: String
  quoteToCreator: String!
  quoteToTreasury: String!
  baseBurned: String!
}

type TollyCollectionFeeData {
  type: String!
  positionId: String!
  projectToken: String!
  quoteCollectedRaw: String!
  tokenBurnedRaw: String!
  tollyBuybackRaw: String!
  projectBuybackRaw: String!
  projectBuybackAccruedRaw: String!
  holderRewardsRaw: String!
  protocolRaw: String!
  creatorPaidRaw: String!
  creatorAccruedRaw: String!
}

union SupplementalFeeData = PumpCashbackFeeData | PumpAmmCashbackFeeData | LiftHarvestFeeData | TollyCollectionFeeData

type EventFeeData {
  poolFeeRateRaw: String
  poolFeeBps: Float
  poolFeeAmountRaw: String
  dynamicFee: Boolean
  estimatedPoolFee: Boolean
  baseFeeNativeUnit: String
  priorityFeeNativeUnit: String
  gasUsed: String
  poolFeeCurrencyIndex: Int
  protocolFeeCurrencyIndex: Int
  builderTipNativeUnit: String
  l1DataFeeNativeUnit: String
  txEventCount: Int
  supplementalFeeData: SupplementalFeeData
}

type TradeSource {
  id: String!
  displayName: String
}

type CurrencyUnits {
  currency0: String!
  currency1: String!
  decimals0: Int!
  decimals1: Int!
}

type Event {
  address: String!
  commitmentLevel: EventCommitmentLevel!
  baseTokenPrice: String
  blockHash: String!
  blockNumber: Int!
  data: EventData
  eventType: EventType!
  id: String!
  liquidityToken: String
  logIndex: Int!
  maker: String
  networkId: Int!
  quoteToken: QuoteToken
  timestamp: Int!
  token0Address: String
  token1Address: String
  token0SwapValueUsd: String
  token1SwapValueUsd: String
  token0ValueBase: String
  token1ValueBase: String
  token0PoolValueUsd: String
  token1PoolValueUsd: String
  transactionHash: String!
  transactionIndex: Int!
  supplementalIndex: Int
  eventDisplayType: EventDisplayType
  labels: LabelsForEvent
  feeData: EventFeeData
  walletAge: Int
  walletLabels: [String!]
  tradeSource: TradeSource
  currencyUnits: CurrencyUnits
}

type MakerEventConnection {
  items: [Event]
  cursor: String
}

input EventQueryTimestampInput {
  from: Int!
  to: Int!
}

input NumberFilter {
  gte: Float
  gt: Float
  lte: Float
  lt: Float
}

input MakerEventsQueryInput {
  maker: String!
  timestamp: EventQueryTimestampInput
  networkId: Int
  priceUsdTotal: NumberFilter
  eventType: EventType
  tokenAddress: String
}

enum RankingDirection {
  ASC
  DESC
}
```

### Example

[Test this query in the Explorer →](https://docs.codex.io/explore.md)

```graphql theme={null}
{
  getTokenEventsForMaker(
    query: {maker: "71CPXu3TvH3iUKaY1bNkAAow24k6tjH473SsKprQBABC", eventType: Swap, networkId: 1399811149}
    direction: DESC
    limit: 200
  ) {
    items {
      address
      baseTokenPrice
      eventDisplayType
      timestamp
      token0Address
      token0ValueBase
      token1Address
      token1ValueBase
      eventType
      data {
        ... on SwapEventData {
          amount0
          amount1
          priceBaseToken
          priceBaseTokenTotal
          priceUsd
          priceUsdTotal
        }
      }
      transactionHash
    }
    cursor
  }
}
```

### Usage Guidelines

* Specify a desired `eventType` (eg: `Swap`, `Mint`, `Burn`, etc.) to suit your needs on any supported network and timeframe
* Narrow results by specific network, token address, and combine with filters such as `priceUsdTotal` for more targeted results.
* To fetch all trades for a wallet on a specific token, pass `maker` plus `tokenAddress` in `query` — no `timestamp` range is required.
* Set `limit: 200` (the maximum) when you want complete results over an open-ended range. The default is 10, and because results are paginated through database slices, a page may return fewer items than your limit even when more exist — a low limit can force many near-empty cursor calls. Smaller or default limits work fine when you scope the query with a tight `timestamp` range.
* Note: Token transfer events are not supported
* Multi-hop transactions will show each intermediate transaction separately (see troubleshooting tip below for details)
* Each event can include a `tradeSource` identifying the app the trade was placed through (swaps on Solana and EVM networks; null for most events, since most trades carry no identifying signal) — see [Trade source](https://docs.codex.io/recipes/events.md#trade-source)

### Troubleshooting Tips

> [accordion] My query returned fewer items than my limit but included a cursor. Are results missing?
>
> No — the cursor pages through the database in slices, so a single page can return fewer items than `limit` even when more results exist. Keep requesting with the returned `cursor` until it comes back null to collect everything. To minimize round trips over an open-ended query, set `limit: 200` (the maximum — higher values return an error): a wallet with 15 trades returns in one response at `limit: 200`, but can take \~10 cursor calls at the default limit of 10. If you're querying a finely scoped `timestamp` range, smaller limits are fine since there are fewer slices to walk.

> [accordion] A single transaction is returning multiple buy & sell events for the same transaction (multi-hop). Is this expected and how can we simplify?
>
> Yes this is expected behavior for a multi-hop transaction, where a maker will initiate a transaction from Token A -> Token B -> Token C, for example. We understand that Token B is likely of zero interest, however, it is still a legitimate transaction that we must index. Using the transaction hash to disambiguate on the client side is really the only way to attempt to simplify the swap down to just Token A -> Token C.

> [accordion] A token swap event was not returned with our query results, why?
>
> The transaction most likely occured on a protocol that we do not support. While we endeavor to support as many dexes as possible, including thousands of Uniswap forks, there are some we may not have yet. You can reach out to our team to inquire about specific exchanges you would like to see supported in a future update.

> [accordion] How do I determine which tokens were received vs sent for a given transaction?
>
> Look at the signs of amount0 and amount1 in the data field: \
> Negative amount = Token received (bought) \
> Positive amount = Token spent (sold)
>
> This rule is consistent for ALL transactions: \
> Positive = what they gave up (OUT of wallet) \
> Negative = what they received (INTO wallet)
>
> The eventDisplayType "Buy"/"Sell" indicates the primary action from the user's perspective (buying or selling the non-native token), while the amount signs show the actual token flows.

### Related Recipes

* [Events](https://docs.codex.io/recipes/events.md): Build a token swap list with filtering, pagination, and real-time updates
* [Wallets](https://docs.codex.io/recipes/wallets/discover-traders.md): Analyze wallet performance, discover top traders, and build portfolio views


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.