MIRA Swaps
Fetch swaps for blocks 11700000
to 11710000
.
curl -s --location --request GET \
"https://app.pangea.foundation/v1/api/mira/v1/swaps?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": 11710000,
"block_hash": "0xac848be68673101744933793b709bece675415f6faa4a2cf5e6c4688a25cd4bd",
"transaction_hash": "0x21654c672cda0485e25017bdd34d2ce9eb855e934b1f13baa557724e45da5509",
"transaction_index": 0,
"log_index": 0,
"pool_address": "0x2e40f2b244b98ed6b8204b3de0156c6961f98525c8162f80162fcf53eebd90e7",
"is_stable": false,
"asset0_address": "0x1d5d97005e41cae2187a895fd8eab0506111e0e2f3331cd3912c15c24e3c1d82",
"asset1_address": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07",
"decimals0": 9,
"decimals1": 9,
"recipient": "0x6fe8a05b52b071767d609df8e5914d6e70537cb7006294fc999a6932cece1c7f",
"side": "Buy",
"amount0": 0.001953116,
"amount1": 2.6e-08,
"execution_price": 1.3312061341978666e-05,
"settlement_price": 1.3272125157952728e-05
}
}
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 swaps 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/swaps?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",
"is_stable": false,
"asset0_address": "0x1d5d97005e41cae2187a895fd8eab0506111e0e2f3331cd3912c15c24e3c1d82",
"asset1_address": "0x286c479da40dc953bddc3bb4c453b608bba2e0ac483b077bd475174115395e6b",
"decimals0": 9,
"decimals1": 6,
"recipient": "0xeb6fa527a6f853374878c3690541fae0ac1f4bea695693785991682d39055efe",
"side": "Buy",
"amount0": 124.501930139,
"amount1": 5.065056,
"execution_price": 0.040682550016253774,
"settlement_price": 0.04056050236620501
}
}
Query parameters
v1/api/mira/v1/swaps?chains=FUEL
chains
: Filters the data bychain
.from_block
: Filters the data by a startingblock_number
.to_block
: Filters the data by an endingblock_number
.pool_address__in
: Filters the data bypool_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 byasset0_address
.asset1__in
/asset1_address__in
: Filters the data byasset1_address
.assets__in
: Filters the data by eitherasset0_address
orasset1_address
.