Skip to content

Commit

Permalink
add RaydiumLiquidityPoolV4Action:Swap Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjeffro committed Oct 4, 2024
1 parent 0dbc52c commit effe4e2
Show file tree
Hide file tree
Showing 8 changed files with 279 additions and 85 deletions.
164 changes: 82 additions & 82 deletions solana/data/raydiumLiquidityPoolV4_swap_1.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[
{
"blockTime": 1727633484,
"blockTime": 1728015997,
"meta": {
"computeUnitsConsumed": 41939,
"computeUnitsConsumed": 41147,
"err": null,
"fee": 1005000,
"innerInstructions": [
Expand All @@ -11,21 +11,21 @@
"instructions": [
{
"accounts": [
13,
6,
1,
5,
0
],
"data": "3s8MpY1f2PEo",
"data": "3Dc8EpW7Kr3R",
"programIdIndex": 16,
"stackHeight": 2
},
{
"accounts": [
5,
1,
6,
13,
26
],
"data": "3QE7viLoNfDh",
"data": "3a5LxFwgWKbD",
"programIdIndex": 16,
"stackHeight": 2
}
Expand Down Expand Up @@ -56,43 +56,43 @@
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3443 of 99550 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
"Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 invoke [1]",
"Program log: ray_log: A+E1LKzCAAAAHPYaDgAAAAABAAAAAAAAAOE1LKzCAAAAPfnuixQAAABHSrRr57wAAEBhCRUAAAAA",
"Program log: ray_log: AwDh9QUAAAAAFZl5bQgAAAACAAAAAAAAAADh9QUAAAAAr5cOfjEAAAB+AyCkd1MAAHtCtQUKAAAA",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
"Program log: Instruction: Transfer",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4645 of 77179 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4736 of 77972 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
"Program log: Instruction: Transfer",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4736 of 69553 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4645 of 70255 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
"Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 consumed 32367 of 96107 compute units",
"Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 consumed 31575 of 96107 compute units",
"Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 success",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]",
"Program log: Instruction: CloseAccount",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2915 of 63740 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2915 of 64532 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
"Program 11111111111111111111111111111111 invoke [1]",
"Program 11111111111111111111111111111111 success",
"Program 4pP8eDKACuV7T2rbFPE8CHxGKDYAzSdRsdMsGvz2k4oc invoke [1]",
"Program log: Received timestamp: 1727633504",
"Program log: Current timestamp: 1727633484",
"Program log: Received timestamp: 1728016016",
"Program log: Current timestamp: 1728015997",
"Program log: The provided timestamp is valid.",
"Program 4pP8eDKACuV7T2rbFPE8CHxGKDYAzSdRsdMsGvz2k4oc consumed 1661 of 60675 compute units",
"Program 4pP8eDKACuV7T2rbFPE8CHxGKDYAzSdRsdMsGvz2k4oc consumed 1661 of 61467 compute units",
"Program 4pP8eDKACuV7T2rbFPE8CHxGKDYAzSdRsdMsGvz2k4oc success",
"Program 11111111111111111111111111111111 invoke [1]",
"Program 11111111111111111111111111111111 success",
"Program HQ2UUt18uJqKaQFJhgV9zaTdQxUZjNrsKFgoEDquBkcx invoke [1]",
"Program log: Powered by bloXroute Trader Api",
"Program HQ2UUt18uJqKaQFJhgV9zaTdQxUZjNrsKFgoEDquBkcx consumed 803 of 58864 compute units",
"Program HQ2UUt18uJqKaQFJhgV9zaTdQxUZjNrsKFgoEDquBkcx consumed 803 of 59656 compute units",
"Program HQ2UUt18uJqKaQFJhgV9zaTdQxUZjNrsKFgoEDquBkcx success"
],
"postBalances": [
6554573528,
1798544928,
0,
6124800,
23357760,
16258560,
87896143341,
212670322335,
2039280,
3591360,
457104960,
Expand All @@ -108,12 +108,12 @@
0,
1398960,
1141440,
265173804904,
171636311320,
2171689787700,
235586097093,
1009200,
1141440,
616503706523,
5660815704
617888496398,
5660815707
],
"postTokenBalances": [
{
Expand All @@ -122,28 +122,28 @@
"owner": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "87894104061",
"amount": "212668283055",
"decimals": 9,
"uiAmount": 87.894104061,
"uiAmountString": "87.894104061"
"uiAmount": 212.668283055,
"uiAmountString": "212.668283055"
}
},
{
"accountIndex": 6,
"mint": "2CrtdajpSb7DpMRLKP4yMtFLbCsWZjMkEvgSTf4Ypump",
"mint": "E8yBUD4AGdxK7MbQEf85oaAvVBuSoRsGCvX2sMxSpump",
"owner": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "208538242678824",
"amount": "91730274337027",
"decimals": 6,
"uiAmount": 208538242.678824,
"uiAmountString": "208538242.678824"
"uiAmount": 91730274.337027,
"uiAmountString": "91730274.337027"
}
},
{
"accountIndex": 11,
"mint": "So11111111111111111111111111111111111111112",
"owner": "4Q9Epf566RJjUu9akgLv4badwC5u9Y75r9mp97xEw3sS",
"owner": "42txuiS2zXURYVQUcGbYEfX1aWDTAuvRHyQ16AZqgAoX",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "0",
Expand All @@ -154,8 +154,8 @@
},
{
"accountIndex": 12,
"mint": "2CrtdajpSb7DpMRLKP4yMtFLbCsWZjMkEvgSTf4Ypump",
"owner": "4Q9Epf566RJjUu9akgLv4badwC5u9Y75r9mp97xEw3sS",
"mint": "E8yBUD4AGdxK7MbQEf85oaAvVBuSoRsGCvX2sMxSpump",
"owner": "42txuiS2zXURYVQUcGbYEfX1aWDTAuvRHyQ16AZqgAoX",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "0",
Expand All @@ -166,24 +166,24 @@
},
{
"accountIndex": 13,
"mint": "2CrtdajpSb7DpMRLKP4yMtFLbCsWZjMkEvgSTf4Ypump",
"owner": "Do3UdALe5F7NRXB4uYcBzZtCbAt8ssu4a5kGZVucKhC5",
"mint": "E8yBUD4AGdxK7MbQEf85oaAvVBuSoRsGCvX2sMxSpump",
"owner": "ECvj86nDupkVh1cDgxrJw3zJkw3ahcDiVB3pPTbpskjD",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "0",
"amount": "43045438075",
"decimals": 6,
"uiAmount": null,
"uiAmountString": "0"
"uiAmount": 43045.438075,
"uiAmountString": "43045.438075"
}
}
],
"preBalances": [
6206795174,
1901449928,
0,
6124800,
23357760,
16258560,
88249079597,
212570322335,
2039280,
3591360,
457104960,
Expand All @@ -199,12 +199,12 @@
0,
1398960,
1141440,
265170652002,
171635311320,
2171688887700,
235585097093,
1009200,
1141440,
616503706523,
5660815704
617888496398,
5660815707
],
"preTokenBalances": [
{
Expand All @@ -213,28 +213,28 @@
"owner": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "88247040317",
"amount": "212568283055",
"decimals": 9,
"uiAmount": 88.247040317,
"uiAmountString": "88.247040317"
"uiAmount": 212.568283055,
"uiAmountString": "212.568283055"
}
},
{
"accountIndex": 6,
"mint": "2CrtdajpSb7DpMRLKP4yMtFLbCsWZjMkEvgSTf4Ypump",
"mint": "E8yBUD4AGdxK7MbQEf85oaAvVBuSoRsGCvX2sMxSpump",
"owner": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "207702130444871",
"amount": "91773319775102",
"decimals": 6,
"uiAmount": 207702130.444871,
"uiAmountString": "207702130.444871"
"uiAmount": 91773319.775102,
"uiAmountString": "91773319.775102"
}
},
{
"accountIndex": 11,
"mint": "So11111111111111111111111111111111111111112",
"owner": "4Q9Epf566RJjUu9akgLv4badwC5u9Y75r9mp97xEw3sS",
"owner": "42txuiS2zXURYVQUcGbYEfX1aWDTAuvRHyQ16AZqgAoX",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "0",
Expand All @@ -245,8 +245,8 @@
},
{
"accountIndex": 12,
"mint": "2CrtdajpSb7DpMRLKP4yMtFLbCsWZjMkEvgSTf4Ypump",
"owner": "4Q9Epf566RJjUu9akgLv4badwC5u9Y75r9mp97xEw3sS",
"mint": "E8yBUD4AGdxK7MbQEf85oaAvVBuSoRsGCvX2sMxSpump",
"owner": "42txuiS2zXURYVQUcGbYEfX1aWDTAuvRHyQ16AZqgAoX",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "0",
Expand All @@ -257,14 +257,14 @@
},
{
"accountIndex": 13,
"mint": "2CrtdajpSb7DpMRLKP4yMtFLbCsWZjMkEvgSTf4Ypump",
"owner": "Do3UdALe5F7NRXB4uYcBzZtCbAt8ssu4a5kGZVucKhC5",
"mint": "E8yBUD4AGdxK7MbQEf85oaAvVBuSoRsGCvX2sMxSpump",
"owner": "ECvj86nDupkVh1cDgxrJw3zJkw3ahcDiVB3pPTbpskjD",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "836112233953",
"amount": "0",
"decimals": 6,
"uiAmount": 836112.233953,
"uiAmountString": "836112.233953"
"uiAmount": null,
"uiAmountString": "0"
}
}
],
Expand All @@ -273,29 +273,29 @@
"Ok": null
}
},
"slot": 292734971,
"slot": 293583913,
"transaction": {
"message": {
"accountKeys": [
"Do3UdALe5F7NRXB4uYcBzZtCbAt8ssu4a5kGZVucKhC5",
"AgcEC7E1yxeZoRVnAZTmGA86ncrPTqKkBiz1T9F5MxhN",
"9xNtkAhkGNG6fPazLe7ZFmmiJ5Mss37sBx9eoya33o4q",
"FSJ5nF2HH6mCFSD4fBEeJUZaDutTf7NUmqZ73tqU3NZp",
"5ztrMHizPxA6viApPpjNDcjG7YQZch6qqpz293U16VK6",
"2uBUq62d4HcDMTSg9ZuBySw4KGaMZi2mvaWatcXWkj4b",
"4veQuvzFqRiibczQWZj8ZX4QdVLsB4N882b5wBNFxTA8",
"ADep3qDvTT3g5jv5cQ47JNfTmZRh3jpdzydYTsxi2rJ6",
"DycbwPd9Eh7hRmfgQY2Nbw1bbSY3whaLyoja1gwFcf6c",
"BnFxXagcuk3P2Vi5zCNcyRCScnKejkLXY98GfUcTCPTf",
"Bi1q1zMcdbWBxqQFCU1LAd8z7YyP9yebixUxBA7KGDDT",
"416A7C2UwM5ZKQk31oKsNDNTLVKi2oDeiYyUTCmxw5Sg",
"CTnHaCMQg9bchADTyvitsmHvxX4PoBPgPYzYEbmTaR3m",
"D2KYhSJfjgBv92JqJ24VkTsGaEXnyFDe7JBjxuRDdFHZ",
"ECvj86nDupkVh1cDgxrJw3zJkw3ahcDiVB3pPTbpskjD",
"BjN8ABECWCntiBmKe5ZE2R4EJHz7BeovZbEuQxXYjS7X",
"2mF8wbzawjPzDoCiGBqoinbaVxMJAwRm5wQ1dtgSLZdD",
"36QFFB6e8mHKShx3HQ1AbYz8rv3hF3T9K1hG7aHmnsAY",
"AXaq4H9RHKwsAVjj2qD65S8phLoHhfqAKdrtxrj6XyeN",
"GjFUSKqBvA4GZxmjFfLSm496seqy6WUsemTCC2KPdXH4",
"9Y1ecw9HgDLpq6pNbQ94eTgd6qDtiAdVzuX55MuKwS66",
"5srEL3hnZMT49JeZjMCj8DAGPS4jx1xnHfBfKWb3Z1pU",
"B1yZSxEq8sCv5RpisZtg8iiSjHMopsD6h5HqFpmgEzSU",
"9njoyGVu9DPwVwtb4Wtx1Dzwg7b5LBydz6r1sTJJcE5Z",
"8xiEky2Hgp7tG2YJ2HFzbvEhD1VruFVwGXUWpMfLt3Q5",
"HvV92yxUL2719K4atMHbBoFVSBk4jTJ8EZtPwQCzhBjL",
"GQwY85RRE36XPjQ8Ka15Db1tcMRrJXAQRuwYrW5Y1atR",
"CnpqgDSL9hSbS58kffaALXnsp1Vk4U61MZMxRP1tTYz6",
"ComputeBudget111111111111111111111111111111",
"11111111111111111111111111111111",
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
"4Q9Epf566RJjUu9akgLv4badwC5u9Y75r9mp97xEw3sS",
"42txuiS2zXURYVQUcGbYEfX1aWDTAuvRHyQ16AZqgAoX",
"4pP8eDKACuV7T2rbFPE8CHxGKDYAzSdRsdMsGvz2k4oc",
"HQ2UUt18uJqKaQFJhgV9zaTdQxUZjNrsKFgoEDquBkcx"
],
Expand Down Expand Up @@ -343,7 +343,7 @@
0,
1
],
"data": "3ipZWzrGnjtM6QGL2BcZh2zKPDXgZs13zC8eMeu9pfGQ7psPAXK7e23oZ5tPbKnzGY8oBKiisMgWP2Z8PFvproQC8bePpcSeceMSjwbZ9sEMP1eqoyuSBecgsYCesAy1zsVx39EL9YajbD5yE2PJQ8rCRXya4nr8BRa9W1zRe",
"data": "3ipZX1hTggYi7XxCuihpV8b8invHafWfqsoF554zGyjLmrCwryD2UW5YxwHy855ScVRRBHqAqXQX2yMZebj7eTcYJLX2WRU8BYCjXRemZdMyLZzzzoCx4NYZuxhs7zihFjRcJRYU9B2jWVVcbpdv3KbHUXuLhjDwZTGaehKUL",
"programIdIndex": 15,
"stackHeight": null
},
Expand Down Expand Up @@ -375,11 +375,11 @@
11,
12,
18,
13,
1,
13,
0
],
"data": "6PKQZz9QiXKmCCdXSsN45vf",
"data": "5ucmhStLiAKrMXCAhZeWGRV",
"programIdIndex": 17,
"stackHeight": null
},
Expand All @@ -398,13 +398,13 @@
0,
21
],
"data": "3Bxs41swEv8H3K5Z",
"data": "3Bxs4Tjx12waeTC3",
"programIdIndex": 15,
"stackHeight": null
},
{
"accounts": [],
"data": "HA7oZzFRp1d",
"data": "RABq3USsTaX",
"programIdIndex": 19,
"stackHeight": null
},
Expand All @@ -424,10 +424,10 @@
"stackHeight": null
}
],
"recentBlockhash": "CEkQf7vrQ7g7ej1HqZPcyMgZtjd5bYEWhwSRL6JG4GYs"
"recentBlockhash": "Gso3Ta2yvjTSHKYsrQH7PvZifU2cdraoFS4FP3sHcFbo"
},
"signatures": [
"3aQZsNRUbNXpH54GQEaxFpWZsmL554cYGGtWqqoypz8b6LUDYprbRd9AwgivXRLtFBYCU6MU6e9ANurwP8dCMV6"
"4pAEq48cQsw8VPQ5R3GSXNKS5VdLu5TDTCWuJJ8Bq8uEkohMF87HZMjwfQPQcuvq8bwv8h8HKp7fiNEAi5SKjvyQ"
]
},
"version": 0
Expand Down
4 changes: 4 additions & 0 deletions solana/globals/mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ const (
WSOL = "So11111111111111111111111111111111111111112"
USDC = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
)

const (
SOLDecimals = 9
)
Loading

0 comments on commit effe4e2

Please sign in to comment.