Skip to content

Commit 54ea2c5

Browse files
authored
Merge branch 'bitquery:main' into main
2 parents 35deea0 + d9af54e commit 54ea2c5

File tree

6 files changed

+910
-211
lines changed

6 files changed

+910
-211
lines changed

docs/blockchain/BSC/four-meme-api.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Follow the steps here to create one: https://docs.bitquery.io/docs/authorisation
9494
- [Get liquidity of a Four Meme token ➤](#get-liquidity-of-a-four-meme-token)
9595
- [Track Liquidity Add Events for All Tokens on Four Meme ➤](#track-liquidity-add-events-for-all-tokens-on-four-meme)
9696
- [Track Liquidity Add Events for a Token on Four Meme ➤](#track-liquidity-add-events-for-a-token-on-four-meme)
97-
- [Check if a Token is Phishy ➤](#check-if-a-token-is-phishy)
97+
- [Check if a Four.meme Token is Phishy ➤](#check-if-a-fourmeme-token-is-phishy)
9898

9999
### 3. Trader Insights
100100

@@ -1799,7 +1799,7 @@ You can run the query [here](https://ide.bitquery.io/Liquidity-Added-to-specific
17991799

18001800
</details>
18011801

1802-
## Check if a Token is Phishy
1802+
## Check if a Four.meme Token is Phishy
18031803

18041804
This elaborative API approach uses two queries to detect if a Four Meme token is potentially phishy by analyzing the relationship between token transfers and trades.
18051805
This approach helps identify tokens where recipients received tokens without purchasing them, which is a common pattern in phishing or airdrop scams.
@@ -1823,7 +1823,7 @@ We are taking here example of `0x35a7bb282d8caafe71617c9d52ee30f1adfe4444` token
18231823

18241824
This query retrieves the first transfer of a token to each address, providing the timestamp when each address first received the token.
18251825

1826-
[Run Query](https://ide.bitquery.io/first-transfers-of-a-token_4)
1826+
[Run Query](https://ide.bitquery.io/first-transfers-of-a-token_5)
18271827

18281828
<details>
18291829
<summary>Click to expand GraphQL query</summary>
@@ -1853,7 +1853,7 @@ query MyQuery($token: String) {
18531853
Block {
18541854
first_transfer: Time(minimum: Block_Time)
18551855
}
1856-
total_bought_amount: sum(of: Transfer_Amount)
1856+
total_transferred_amount: sum(of: Transfer_Amount)
18571857
}
18581858
}
18591859
}
@@ -1871,7 +1871,7 @@ query MyQuery($token: String) {
18711871

18721872
This query checks if the addresses from Query 1 ever bought the token and when. Pass the address array from Query 1 as a variable to this query.
18731873

1874-
[Run Query](https://ide.bitquery.io/get-first-buys-of-an-address-list-of-a-specific-token_1)
1874+
[Run Query](https://ide.bitquery.io/get-first-buys-of-an-address-list-of-a-specific-token_2)
18751875

18761876
<details>
18771877
<summary>Click to expand GraphQL query</summary>
@@ -1880,7 +1880,7 @@ This query checks if the addresses from Query 1 ever bought the token and when.
18801880
query MyQuery($token: String!, $buyersList: [String!]) {
18811881
EVM(network: bsc, dataset: combined) {
18821882
DEXTradeByTokens(
1883-
orderBy: { descendingByField: "Block_first_buy" }
1883+
orderBy: { ascendingByField: "Block_first_buy" }
18841884
where: {
18851885
Trade: {
18861886
Currency: { SmartContract: { is: $token } }

docs/blockchain/Solana/Pumpfun/Pump-Fun-API.mdx

Lines changed: 147 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,23 @@ import VideoPlayer from "../../../../src/components/videoplayer.js";
103103

104104
### 6. Token Holder & Trader Insights
105105

106-
- [Get Devs Holdings of a Token ➤](#get-devs-holdings-of-a-token)
106+
- [Get Dev's Holdings of a Token ➤](#get-devs-holdings-of-a-token)
107107
- [Get Top 10 Token Holders ➤](#get-top-10-token-holders)
108108
- [Get Top Traders of a Token ➤](#get-top-traders-of-a-token)
109109
- [Get Top Token Creators ➤](#get-top-token-creators)
110110

111-
### 7. Token Rankings & Filters
111+
### 7. Token Security & Analysis
112+
113+
- [Check if a Pump.fun Token is Phishy ➤](#check-if-a-pumpfun-token-is-phishy)
114+
115+
### 8. Token Rankings & Filters
112116

113117
- [Top Pump.fun Tokens by Market Cap ➤](#top-pumpfun-tokens-by-market-cap)
114118
- [All Tokens Above 10K Market Cap ➤](#all-tokens-above-10k-market-cap)
115119
- [Track King of the Hill Tokens ➤](#track-king-of-the-hill-tokens-30k35k-market-cap)
116120
- [Tokens Between 400K–450K Market Cap ➤](#tokens-between-400k450k-market-cap-with-dev--creation-time)
117121

118-
### 8.[ Video Tutorials](#video-tutorials)
122+
### 9.[ Video Tutorials](#video-tutorials)
119123

120124
## Token Creation & Metadata
121125

@@ -1597,6 +1601,146 @@ query MyQuery {
15971601

15981602
</details>
15991603

1604+
## Token Security & Analysis
1605+
1606+
### Check if a Pump.fun Token is Phishy
1607+
1608+
This elaborative API approach uses two queries to detect if a Pump.fun token is potentially phishy by analyzing the relationship between token transfers and trades.
1609+
This approach helps identify tokens where recipients received tokens without purchasing them, which is a common pattern in phishing or airdrop scams.
1610+
1611+
#### How It Works
1612+
1613+
The detection method works by:
1614+
1615+
1. **First Query**: Get the first transfers of a token to addresses - this provides the timestamp of when each address first received the token.
1616+
2. **Second Query**: Check if those addresses ever bought the token and when - pass the address list from the first query as a variable to check their purchase history.
1617+
3. **Analysis**: Compare transfer times and trade times in your code:
1618+
1619+
- If an address **never bought** the token, it's suspicious.
1620+
- If an address's **first buy time is later than the first transfer time**, it indicates the token was received before being purchased, which is a red flag for phishing behavior.
1621+
1622+
Above analysis means someone else transferred the token to them which is phishy because devs often send token to famous KOLs or Influential People in crypto space to misguide traders.
1623+
1624+
We are taking here example of `3Fymji2JPhhbKuCzNPKEyjdEuF9cyFuQ8HksyjRGpump` token, this may or may not be phishy as we are not running the further comparison between timestamps. Here we are just demonstrating that how you can get data from Bitquery and later run basic analysis on it.
1625+
1626+
#### Query 1: Get First Transfers of a Token to Addresses
1627+
1628+
This query retrieves the first transfer of a token to each address, providing the timestamp when each address first received the token.
1629+
1630+
[Run Query](https://ide.bitquery.io/first-transfers-of-a-pump-fun-token_1#)
1631+
1632+
<details>
1633+
<summary>Click to expand GraphQL query</summary>
1634+
1635+
```graphql
1636+
query MyQuery($token: String, $bonding_curve: String) {
1637+
Solana {
1638+
Transfers(
1639+
limit: { count: 1000 }
1640+
orderBy: { ascendingByField: "Block_first_transfer" }
1641+
where: {
1642+
Transfer: {
1643+
Receiver: { Token: { Owner: { not: $bonding_curve } } }
1644+
Currency: { MintAddress: { is: $token } }
1645+
}
1646+
Transaction: { Result: { Success: true } }
1647+
}
1648+
) {
1649+
Transfer {
1650+
Receiver {
1651+
Token {
1652+
Owner
1653+
}
1654+
}
1655+
}
1656+
Block {
1657+
first_transfer: Time(minimum: Block_Time)
1658+
}
1659+
total_transferred_amount: sum(of: Transfer_Amount)
1660+
}
1661+
}
1662+
}
1663+
```
1664+
1665+
```
1666+
{
1667+
"token": "3Fymji2JPhhbKuCzNPKEyjdEuF9cyFuQ8HksyjRGpump",
1668+
"bonding_curve": "6AMeqEdepfKKmTQAwcMvbrwugcaJaXtt3MsJGy7WdXpk"
1669+
}
1670+
```
1671+
1672+
</details>
1673+
1674+
#### Query 2: Get First Buys of an Address List for a Specific Token
1675+
1676+
This query checks if the addresses from Query 1 ever bought the token and when. Pass the address array from Query 1 as a variable to this query.
1677+
1678+
[Run Query](https://ide.bitquery.io/get-first-buys-of-an-address-list-of-a-specific-pump-fun-token#)
1679+
1680+
<details>
1681+
<summary>Click to expand GraphQL query</summary>
1682+
1683+
```graphql
1684+
query MyQuery($token: String!, $buyersList: [String!]) {
1685+
Solana {
1686+
DEXTradeByTokens(
1687+
orderBy: { ascendingByField: "Block_first_buy" }
1688+
where: {
1689+
Trade: {
1690+
Account: { Token: { Owner: { in: $buyersList } } }
1691+
Currency: { MintAddress: { is: $token } }
1692+
Dex: {
1693+
ProgramAddress: {
1694+
is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
1695+
}
1696+
}
1697+
Side: { Type: { is: buy } }
1698+
}
1699+
Transaction: { Result: { Success: true } }
1700+
}
1701+
) {
1702+
Trade {
1703+
Account {
1704+
Token {
1705+
Owner
1706+
}
1707+
}
1708+
Currency {
1709+
Name
1710+
Symbol
1711+
MintAddress
1712+
}
1713+
Side {
1714+
Type
1715+
}
1716+
}
1717+
Block {
1718+
first_buy: Time(minimum: Block_Time)
1719+
}
1720+
total_bought_amount: sum(of: Trade_Amount)
1721+
}
1722+
}
1723+
}
1724+
```
1725+
1726+
```json
1727+
{
1728+
"token": "3Fymji2JPhhbKuCzNPKEyjdEuF9cyFuQ8HksyjRGpump",
1729+
"buyersList": [ PASS THE ADDRESS LIST YOU GOT FROM QUERY 1 HERE ]
1730+
}
1731+
```
1732+
1733+
</details>
1734+
1735+
#### Implementation Notes
1736+
1737+
- Extract the address list and first transfer timestamps from Query 1
1738+
- Pass the address array as a variable to Query 2
1739+
- Compare the timestamps for all addresses:
1740+
- If `firstTransferTime < firstBuyTime` or `firstBuyTime` is null → **Phishy indicator**
1741+
- If `firstBuyTime <= firstTransferTime`**Normal behavior**
1742+
- You can implement this logic in your application code to automatically flag suspicious tokens
1743+
16001744
## Token Rankings & Filters
16011745

16021746
### Top Pump.fun Tokens by Market Cap

0 commit comments

Comments
 (0)