# Identifying all LPs for a protocol

**URL:** <https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86>\
**Category:** GraphQL API\
**Tags:** closed\
**Created:** [May 27, 2021, 3:06pm UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86 "2021-05-27T15:06:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chiron](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/chiron/32/51_2.png) [@chiron](https://community.bitquery.io/u/chiron)\
**Post date:** [May 27, 2021, 3:06pm UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86/1 "2021-05-27T15:06:00Z")

</div>

Using the dexTrades cube, querying 1inch lp, returned 149 addresses. Per 1inch app there are 179 pools. 1inch operates on Ethereum, BSC and recently Polygon (Matic).  
It appears there is no cube to call for BSC. Here is code:

query MyQuery {  
ethereum {  
dexTrades(  
options: {desc: “tradeAmount”}  
protocol: {is: “One Inch Liquidity Pool”}  
) {  
protocol  
count  
tradeAmount(in: USD)  
smartContract {  
address {  
address  
}  
protocolType  
contractType  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [May 28, 2021, 7:02am UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86/2 "2021-05-28T07:02:39Z")

</div>

Can you show me where you are seeing 179 pools on 1inch. Are those 179 only on Ethereum?

---

<div class="post-metadata">

**Author:** ![chiron](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/chiron/32/51_2.png) [@chiron](https://community.bitquery.io/u/chiron)\
**Post date:** [May 30, 2021, 2:25am UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86/3 "2021-05-30T02:25:00Z")

</div>

Pools on 1inch (Ethereum) ([1inch - DeFi / DEX aggregator on Ethereum & Binance Smart Chain](https://app.1inch.io/#/1/dao/pools)) = 179  
Pools on 1inch (BSC) (change network) = 709  
Polygon = no pools yet

Per grapgQl (using query above):  
Pools (Ethereum) = 154  
Pools (BSC) = 274

Some protocol’s have a factory contract. Is best way to use [smartContractEvent: {is: “PairCreated”},], to be sure I have all Pools related to a particular protocol? But this assumes there’s a factory contract that creates the pools for every protocol. Would there be another way?

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [May 31, 2021, 5:49am UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86/4 "2021-05-31T05:49:44Z")

</div>

Yes, getting PairCreated events is the best way to get all the pools.

Can you send me the factory contract address on both Ethereum and BSC, I will investigate.

---

<div class="post-metadata">

**Author:** ![chiron](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/chiron/32/51_2.png) [@chiron](https://community.bitquery.io/u/chiron)\
**Post date:** [May 31, 2021, 6:06am UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86/5 "2021-05-31T06:06:43Z")

</div>

Factory contract (Ethereum): 0xCB06dF7F0Be5B8Bb261d294Cf87C794EB9Da85b1

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [May 31, 2021, 11:40am UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86/6 "2021-05-31T11:40:46Z")

</div>

> **[Farming: 1inch Liquidity Pool (1INCH-renBTC) (farm-1LP-1INCH-renBTC) ERC20...](https://explorer.bitquery.io/bsc/token/0xcb06df7f0be5b8bb261d294cf87c794eb9da85b1)**
>
> Check Farming: 1inch Liquidity Pool (1INCH-renBTC) (farm-1LP-1INCH-renBTC) ERC20 Token address in Binance Smart Chain Mainnet, transactions, wallet, status, gas fee, time, cost, transfers, and other analytics, charts and widgets

This is not a factory contract, it’s a Pool contract on BSC…

On Ethereum same address is a moniswap contract which is not emitting any event

---

<div class="post-metadata">

**Author:** ![chiron](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/chiron/32/51_2.png) [@chiron](https://community.bitquery.io/u/chiron)\
**Post date:** [May 31, 2021, 12:29pm UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86/7 "2021-05-31T12:29:43Z")

</div>

1inch is the new iteration of Mooniswap. This ‘mooniswap delpoyer’ contract, deploys v1.1 1inch LPs.  
I’ve noticed there weren’t any ‘event’ emitted, but this is definitely the contract that deploys LPs - they’re listed on Interan Txns tab. Can we pull these internal transactions via GraphQl? Or perhaps there’s another way of identifying LPs, knowing that this is deployer?  
I haven’t looked into BSC yet - thought I’d sort out Ethereum contract first.

---

<div class="post-metadata">

**Author:** ![chiron](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/chiron/32/51_2.png) [@chiron](https://community.bitquery.io/u/chiron)\
**Post date:** [May 31, 2021, 1:03pm UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86/8 "2021-05-31T13:03:01Z")

</div>

I looked up that BSC, and found this is the creator of that LP  
0x11799622F4D98A24514011E8527B969f7488eF47

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [May 31, 2021, 1:59pm UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86/9 "2021-05-31T13:59:30Z")

</div>

> [@chiron](#):
>
> 0x11799622F4D98A24514011E8527B969f7488eF47

Try this

```auto
{
  ethereum(network: bsc) {
    smartContractCalls(options: {desc: "block.timestamp.time", limit: 10}, date: {since: null, till: null}, caller: {is: "0x11799622f4d98a24514011e8527b969f7488ef47"}) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      smartContractMethod {
        name
        signatureHash
      }
      smartContract {
        address {
          address
          annotation
        }
      }
      transaction {
        hash
      }
      external
      gasValue
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![chiron](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/chiron/32/51_2.png) [@chiron](https://community.bitquery.io/u/chiron)\
**Post date:** [June 1, 2021, 5:50am UTC](https://community.bitquery.io/t/identifying-all-lps-for-a-protocol/86/10 "2021-06-01T05:50:51Z")

</div>

Thanks Gaurav, thanks great
