MIRA Liquidity

Fetch liquidity events (i.e. Mint, Burn, Swap) for blocks 11700000 to 11710000.

curl -s --location --request GET \
 "https://app.pangea.foundation/v1/api/mira/v1/liquidity?chains=FUEL&from_block=11700000&to_block=11710000" \
 --header "Accept: application/jsonstream" \
 --header "Accept-Encoding: gzip" --compressed \
 --header "Authorization: Basic $PANGEA_AUTH" | jq

Response

{
  ...
  {
    "chain": 9889,
    "block_number": 11709963,
    "block_hash": "0x00dcfb5ab13387411f8e5e1134891f30a9ee5329a9ade0206659b2dd2d005ff3",
    "transaction_hash": "0x4be45a754b2081223f11aff4adbdf3edc99ed02c1225a652def71575f3aea648",
    "transaction_index": 0,
    "log_index": 1,
    "pool_address": "0x2e40f2b244b98ed6b8204b3de0156c6961f98525c8162f80162fcf53eebd90e7",
    "event_type": "Mint",
    "is_stable": false,
    "asset0_address": "0x286c479da40dc953bddc3bb4c453b608bba2e0ac483b077bd475174115395e6b",
    "asset1_address": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07",
    "recipient": "0xba70c92de864c46f546516440e8dc5e602b980a5db9cd21cbdee8d7ca4adc93f",
    "lp_address": "0xeb4287b73f6f3374760be1389a5cf8868e607b2e4de90da6bfa9135c76974f61",
    "lp_amount": 5619761,
    "asset0_in": 11000000,
    "asset1_in": 3427337,
    "asset0_out": 0,
    "asset1_out": 0
  },
  ...
}

Filter by liquidity pool

A specific liquidity pool is identified by its Pool ID (PID), which is the unique combination of asset0_address, asset0_address, and pool_address.

Fetch liquidity events for blocks 11700000 to 11710000 where asset0_address is 0x1d5d97005e41cae2187a895fd8eab0506111e0e2f3331cd3912c15c24e3c1d82 (FUEL), asset1_address is 0x286c479da40dc953bddc3bb4c453b608bba2e0ac483b077bd475174115395e6b (USDC), and pool_address is 0x2e40f2b244b98ed6b8204b3de0156c6961f98525c8162f80162fcf53eebd90e7 (MIRA).

curl -s --location --request GET \
 "https://app.pangea.foundation/v1/api/mira/v1/liquidity?chains=FUEL&from_block=11700000&to_block=11710000&asset0_address__in=0x1d5d97005e41cae2187a895fd8eab0506111e0e2f3331cd3912c15c24e3c1d82&asset1_address__in=0x286c479da40dc953bddc3bb4c453b608bba2e0ac483b077bd475174115395e6b&pool_address__in=0x2e40f2b244b98ed6b8204b3de0156c6961f98525c8162f80162fcf53eebd90e7" \
 --header "Accept: application/jsonstream" \
 --header "Accept-Encoding: gzip" --compressed \
 --header "Authorization: Basic $PANGEA_AUTH" | jq

Response

{
  ...
  {
    "chain": 9889,
    "block_number": 11709967,
    "block_hash": "0x1a2cecdfb612cf9378bad521b35f34187929428c754c5b089266d8bf3e7d2ffc",
    "transaction_hash": "0x49fac9f718afc902edf6dc2425fbfeb09f417a609e9831cd8c9c6e96d56790de",
    "transaction_index": 0,
    "log_index": 1,
    "pool_address": "0x2e40f2b244b98ed6b8204b3de0156c6961f98525c8162f80162fcf53eebd90e7",
    "event_type": "Swap",
    "is_stable": false,
    "asset0_address": "0x1d5d97005e41cae2187a895fd8eab0506111e0e2f3331cd3912c15c24e3c1d82",
    "asset1_address": "0x286c479da40dc953bddc3bb4c453b608bba2e0ac483b077bd475174115395e6b",
    "recipient": "0xeb6fa527a6f853374878c3690541fae0ac1f4bea695693785991682d39055efe",
    "lp_address": null,
    "lp_amount": null,
    "asset0_in": 0,
    "asset1_in": 5065056,
    "asset0_out": 124501930139,
    "asset1_out": 0
  }
}

Query parameters

v1/api/mira/v1/liquidity?chains=FUEL

  • chains: Filters the data by chain.
  • from_block: Filters the data by a starting block_number.
  • to_block: Filters the data by an ending block_number.
  • pool_address__in: Filters the data by pool_address. This is the singleton contract address for the protocol, not the address of the specific liquidity pool.
  • asset0__in / asset0_address__in: Filters the data by asset0_address.
  • asset1__in / asset1_address__in: Filters the data by asset1_address.
  • assets__in: Filters the data by either asset0_address or asset1_address.