0

HI My result of scanning with 0x Api is wrong and the results are not what shown in dexs for arbitrage

from urllib.request import urlopen
import requests
import pandas as pd
from json import loads as jsonloads, dumps as jsondumps
from io import StringIO
from pprint import pprint
from urllib.error import HTTPError, URLError
from time import sleep
from urllib.request import urlopen
import web3 







with open('joeavaxcleaned.csv') as csv_file:
        # open the file
        csv_reader = csv.reader(csv_file)
        # remove any headers
        next(csv_reader, None)
        # create empty list
        xx = []
        # add each row cotaining RSS url to feeds list
        for row in csv_reader:
            xx.append(row[0])

for xx in xx:

            
            
            try:    
                    url = f"https://avalanche.api.0x.org/swap/v1/quote?buyToken=0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7&includedSources=TraderJoe&buyAmount=10000000000000000000&sellToken={xx}"
                    response = urlopen(url, timeout=10)
                    status = response.code
                    response_json = jsonloads(response.read())
                    res12 = response_json["sellAmount"]
                    url1 = f"https://avalanche.api.0x.org/swap/v1/quote?buyToken={xx}&includedSources=Pangolin&buyAmount={res12}&sellToken=0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7"
                    status = 0
                    print(xx)
                    response = urlopen(url, timeout=10)
                    status = response.code
                    response1 = urlopen(url1, timeout=10)
                    status = response1.code
                    
                    
                    response_json = jsonloads(response.read())
                    #display(response_json)
                    #display(response_json1)
                    response_json1 = jsonloads(response1.read())
                    if response_json['price'] < response_json1['price'] :
                            print(  " Pangolin more  " + response_json['price'] + " TraderJoe " + response_json1['price'] + " Pangolin " ' ["0x60aE616a2155Ee3d9A68541Ba4544862310933d4", "0x60aE616a2155Ee3d9A68541Ba4544862310933d4"] ' + f' ["0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7","{xx}", "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7"] ' )
                            display(response_json["orders"]  )
                            display(response_json1["orders"] )
                            exit()           
                    #elif res_1 < res_0 :
                    #        print("pangolin " + res_1 + " trader joe  "   + res_0 + ' ["0xE54Ca86531e17Ef3616d22Ca28b0D458b6C89106", "0x60aE616a2155Ee3d9A68541Ba4544862310933d4"] ' +  f' ["0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7","{xx}", "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7"] ')
                    if response_json['price'] == response_json1['price'] :
                            print()       
                    #display(response_json['price']) 
                
                   


            except HTTPError as err:
                    if err.code == 429: # HTTP 'Too many requests' durum kodu
                        sleep(5)
                        continue
                    elif err.code == 400: # API'a özel, genelde 'insufficient asset liquiditiy' hataları
                        http_body = jsonloads(err.read())
                        continue
                                 
           

this is my code for scanning with 0x api

my csv file with addresses data

0xffe04bf98c7111360bf7a6c56b343915543cd941
0xff579d6259dedcc80488c9b89d2820bcb5609160
0xfe6b19286885a4f7f55adad09c3cd1f906d2478f
0xfd0c58f03c83d6960bb9dbfd45076d78df2f095d
0xfcc6ce74f4cd7edef0c5429bb99d38a3608043a5
0xfc6da929c031162841370af240dec19099861d3b
0xfb98b335551a418cd0737375a2ea0ded62ea213b
0xf9a075c9647e91410bf6c402bdf166e1540f67f0
0xf891214fdcf9cdaa5fdc42369ee4f27f226adad6
0xf6d46849db378ae01d93732585bec2c4480d1fd5
0xf693248f96fe03422fea95ac0afbbbc4a8fdd172
0xf5ee578505f4d876fef288dfd9fd5e15e9ea1318
0xf57b80a574297892b64e9a6c997662889b04a73a
0xf49fe07b97bbfaa474614a43259d460e4c84f6fa
0xf481eec738c46f675e077ee966a680a19210af11
0xf3f8772f92028bfb6d641c28bbcf1dbded424767
0xf2f13f0b7008ab2fa4a2418f4ccc3684e49d20eb
0xf20d962a6c8f70c731bd838a3a388d7d48fa6e15
0xf1fc836b7345acad53c9353861876fa0a52952d0
0xf1293574ee43950e7a8c9f1005ff097a9a713959
0xf05e236a139cb19851cd5568a85094d6ee331fac
0xf03dccaec9a28200a6708c686cf0b8bf26ddc356
0xee9801669c6138e84bd50deb500827b776777d28
0xeddac506738019322f20c62c7014850a2c5dc7ea
0xed2b42d3c9c6e97e11755bb37df29b6375ede3eb
0xecc5c2015a9a5320bcbb08ee445d2cf374f3ac14
0xecc5748b1ff6b23f284ec81e8bf034409961d8dc
0xec3492a2508ddf4fdc0cd76f31f340b30d1793e6
0xebe2eae72d6eaa44a3bca32cfdf81d3a687917c2
0xeb8343d5284caec921f035207ca94db6baaacbcd
0xea068fba19ce95f12d252ad8cb2939225c4ea02d
0xe9b7cdaa8aba4efc12aa989946a3a4e754a3b72e
0xe896cdeaac9615145c0ca09c8cd5c25bced6384c
0xe7d06bb5079340bfd68bc3f5e52b5f65b01d75cd
0xe6e7e03b60c0f8daae5db98b03831610a60ffe1b
0xe5cc9bb854163ddb1b4525e7c538fc32de5000d3
0xe5caef4af8780e59df925470b050fb23c43ca68c
0xe5c987f00ebdd4e9414de30c2a0ff61e34d7d860
0xe337a99fe0ac0f3e01a97167d21082a2bb96326e
0xe1c110e1b1b4a1ded0caf3e42bfbdbb7b5d7ce1c
0xe19a1684873fab5fb694cfd06607100a632ff21c
0xe18950c8f3b01f549cfc79dc44c3944fbd43fb76
0xde3a24028580884448a5397872046a019649b084
0xdd33ef5704ada19d254cb636b5a0a1bad3936050
0xdb9438f5e3afa5ced760be9692604c3c5ab816d1
0xd9d90f882cddd6063959a9d837b05cb748718a05
0xd9702f5e3b0eb7452967cb82529776d672bdc03f
0xd7c295e399ca928a3a14b01d760e794f1adf8990
0xd74cca216f7c8fe33f0911da8698e2b3efc98835
0xd6070ae98b8069de6b494332d1a1a81b6179d960
0xd586e7f844cea2f87f50152665bcbc2c279d8d70
0xd2ad73ce020911a4c04c284bfd2d451b4a777bdb
0xd24c2ad096400b6fbcd2ad8b24e7acbc21a1da64
0xd1c3f94de7e5b45fa4edbba472491a9f4b166fc4
0xd036414fa2bcbb802691491e323bff1348c5f4ba
0xcf8419a615c57511807236751c0af38db4ba3351
0xce983dc04135107ca9e59fe8102e07da5d133937
0xce1bffbd5374dac86a2893119683f4911a2f7814
0xcc2f1d827b18321254223df4e84de399d9ff116c
0xcaf5191fc480f43e4df80106c7695eca56e48b18
0xca1068444196cdfe676fd15a29f35e502580a69e
0xc7f4debc8072e23fe9259a5c0398326d8efb7f5c
0xc7b5d72c836e718cda8888eaf03707faef675079
0xc763f8570a48c4c00c80b76107cbe744dda67b79
0xc7198437980c041c805a1edcba50c1ce5db95118
0xc55036b5348cfb45a932481744645985010d3a44
0xc50eb6c984e172f69ec5b219d815622c39eb01be
0xc4621e0d86d3c61045a58715968419165b51eddf
0xc38f41a296a4493ff429f1238e030924a1542e50
0xc17c30e98541188614df99239cabd40280810ca3
0xbee994ad257dcc84672c0c6e6168a4701041f39f
0xbd3936ec8d83a5d4e73eca625ecfa006da8c8f52
0xba7deebbfc5fa1100fb055a87773e1e99cd3507a
0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e
0xb8ef3a190b68175000b74b4160d325fd5024760e
0xb7e446ff1a2eeea8cd07331c7e06b0276d0b06b7
0xb599c3590f42f8f995ecfa0f85d2980b76862fc1
0xb54f16fb19478766a268f172c9480f8da1a7c9c3
0xb32ac3c79a94ac1eb258f3c830bbdbc676483c93
0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
0xb2a85c5ecea99187a977ac34303b80acbddfa208
0xb27c8941a7df8958a1778c0259f76d1f8b711c35
0xb19be04b313059be5832006009d4b1727111de12
0xb195af20a0fec7e2c95b22a1c5de86a2389e40d5
0xb1466d4cf0dcfc0bcddcf3500f473cdacb88b56d
0xb13573a7217e71e884a4309b29bd45cac5a150aa
0xb0a8e082e5f8d2a04e74372c1be47737d85a0e73
0xb09fe1613fe03e7361319d2a43edc17422f36b09
0xb00f1ad977a949a3ccc389ca1d1282a2946963b0
0xafe3d2a31231230875dee1fa1eef14a412443d22
0xafc4d521df3c0566d61931f81f02f1a525bad04d
0xafc43610c7840b20b90caaf93759be5b54b291c9
0xafb2780cbb58b2af27023eb2a0e60c8ca0eee9bb
0xad7476c49d3f82a144f4836aacb9b069c188b759
0xabc9547b534519ff73921b1fba6e672b5f58d083
0xab592d197acc575d16c3346f4eb70c703f308d1e
0xaafd2577fb67366d3c89db0d627c49d769ee2e5d
0xa9c1740fa56e4c0f6ce5a792fd27095c8b6ccd87
0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664
0xa7b47575a9b4c2ebf3e6f9ad1d84932bd7af380f
0xa746828215c867914a9da233f121a19382b63bb7
0xa72eab7327e48bde0ff873eaf1d4fecf6036504f
0xa5e2cfe48fe8c4abd682ca2b10fcaafe34b8774c
0xa56f9a54880afbc30cf29bb66d2d9adcdcaeadd6
0xa32608e873f9ddef944b24798db69d80bbb4d1ed
0xa2776a53da0bf664ea34b8efa1c8ab4241a10968
0xa1437720c93b791b72f5b8a5846227763792afd7
0x9f285507ea5b4f33822ca7abb5ec8953ce37a645
0x9e6832d13b29d0b1c1c3465242681039b31c7a05
0x9e15f045e44ea5a80e7fbc193a35287712cc5569
0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7
0x94960952876e3ed6a7760b198354fcc5319a406a
0x9466ab927611725b9af76b9f31b2f879ff14233d
0x945a6869819cdad404dc80647a2085957cb1f28b
0x938fe3788222a74924e062120e7bfac829c719fb
0x937e077abaea52d3abf879c9b9d3f2ebd15baa21
0x928722af2ab0478cb3fa131e008f10323e11b5e1
0x924157b5dbb387a823719916b25256410a4ad470
0x9235b893a3e61a14b2d02a91ec1394fbf411689e
0x90842eb834cfd2a1db0b1512b254a18e4d396215
0x8f47416cae600bccf9530e9f3aeaa06bdd1caa79
0x8e8148078f913a36c9d8c7fb2da8b479c77c6ba5
0x8d8db824bafdb617646e80360509274909c48127
0x8d88e48465f30acfb8dac0b3e35c9d6d7d36abaf
0x8cd309e14575203535ef120b5b0ab4dded0c2073
0x8c9fdd3fdbe3d555b5ecc7f55d1fe57db9a2842c
0x8b82a291f83ca07af22120aba21632088fc92931
0x8ae8be25c23833e0a01aa200403e826f611f9cd2
0x8a0271333150deaa50371ddbfe5404a9ef7dace5
0x8832d30286907612952aafc3d249e79e39732dcc
0x8729438eb15e2c8b576fcc6aecda6a148776c0f5
0x85272c4380b25e9047bc749d18c265550fd17017
0x846d50248baf8b7ceaa9d9b53bfd12d7d7fbb25a
0x83a283641c6b4df383bcddf807193284c84c5342
0x82fe038ea4b50f9c957da326c412ebd73462077c
0x7e5917720d9b1416464419654121b5e18bb66286
0x7dfce792c83f283ecfe7ea7ed308f9b891073540
0x7d1e8650abd5f8363d63dc7ab838cec8c726dd38
0x7d1232b90d3f809a54eeaeebc639c62df8a8942f
0x7b799037096490c3a8105b3cfdc99eeb99c99d6b
0x7b2b702706d9b361dfe3f00bd138c0cfda7fb2cf
0x78ea3fef1c1f07348199bf44f45b803b9b0dbe28
0x78ea17559b3d2cf85a7f9c2c704eda119db5e6de
0x788ae3b5d153d49f8db649aacba1857f744b739e
0x786f54c3f61e228dc22760b2374ae37d8174f465
0x779595f212b53e4f1f51b0875405bf21b5e4d805
0x7761e2338b35bceb6bda6ce477ef012bde7ae611
0x75ecfc5825dc0f1b346db945d5c463d212cdf2a3
0x74c2a8a0161ff501d44a71c2e2dfdb5485912b1f
0x71f78f6884acf32129b728157615540aadb579c6
0x7086e045b78e1e72f741f25231c08d238812cf8a
0x7086c48c997b8597a1692798155b4fcf2cee7f0f
0x6f3472de23cecade2b0e87d74e3714a8575c8719
0x6e84a6216ea6dacc71ee8e6b0a5b7322eebc0fdd
0x6e7f5c0b9f4432716bdd0a77a3601291b9d9e985
0x6da767394f079c1524b3e797d2110c23c3ecf322
0x6d923f688c7ff287dc3a5943caeefc994f97b290
0x6ca558bd3eab53da1b25ab97916dd14bf6cfee4e
0x6c1c0319d8ddcb0ffe1a68c5b3829fd361587db4
0x6b0d2a3c37d551963275bb104f045f6a68ab6374
0x6a6fae2d14a872d2b040f880d0ecdae11c6c3033
0x68f1f33f9610073c6c3dd94cf93420de97d61c62
0x66c00e4b114ce1302e31a8e97c31214148351bbd
0x6619ee604439a57cd3997a8a4042851783871db4
0x65378b697853568da9ff8eab60c13e1ee9f4a654
0x63a72806098bd3d9520cc43356dd78afe5d386d9
0x637afeff75ca669ff92e4570b14d6399a658902f
0x62edc0692bd897d2295872a9ffcac5425011c661
0x625fc9bb971bb305a2ad63252665dcfe9098bee9
0x61ecd63e42c27415696e10864d70ecea4aa11289
0x6121191018baf067c6dc6b18d42329447a164f05
0x60781c2586d68229fde47564546784ab3faca982
0x6033f3d6c653c9870a7475844663c48ddcbb5d62
0x6007fca39b5398feac4d06d75435a564a086bab8
0x5dd43c5c3e1917fe7548bde3b972690f2e26b61f
0x5c49b268c9841aff1cc3b0a418ff5c3442ee3f3b
0x5947bb275c521040051d82396192181b413227a3
0x59414b3089ce2af0010e7523dea7e2b35d776ec7
0x5817d4f0b62a59b17f75207da1848c2ce75e7af4
0x5541d83efad1f281571b343977648b75d95cdac2
0x542fa0b261503333b90fe60c78f2beed16b7b7fd
0x511d35c52a3c244e7b8bd92c0c297755fbd89212
0x5106f787e8778a86d1928ed5ad0b0215dbfa00b8
0x50c72103940d419fb64448f258f7eabba784f84b
0x50b7545627a5162f82a992c33b87adc75187b218
0x4fbf0429599460d327bd5f55625e30e4fc066095
0x4f60a160d8c2dddaafe16fcc57566db84d674bd6
0x4bfc90322dd638f81f034517359bd447f8e0235a
0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab
0x496e6f025ed7e799e43fd1babe61497e95677734
0x490bf3abcab1fb5c88533d850f2a8d6d38298465
0x47eb6f7525c1aa999fbc9ee92715f5231eb1241d
0x47536f17f4ff30e64a96a7555826b8f9e66ec468
0x4735721ed62713e3a141c939f4aa55ca8ad5f66a
0x45cdaf3fd17bd31d9830fa977159162dd2431683
0x4501e37a79cf953116331a105b3644d07b74c0f8
0x44a45a9baeb63c6ea4860ecf9ac5732c330c4d4e
0x449674b82f05d498e126dd6615a1057a9c088f2c
0x440abbf18c54b2782a4917b80a1746d3a2c2cce1
0x4123f55048889fa021dfb6de4b4071c6f90112ed
0x408d4cd0adb7cebd1f1a1c33a0ba2098e1295bab
0x3f3fea5dd9b1940c2ee4822d7b7a06f19d58656e
0x3eefb18003d033661f84e48360ebecd181a84709
0x3e5a9f09923936427ad6e487b24e23a862fcf6b7
0x397bbd6a0e41bdf4c3f971731e180db8ad06ebc1
0x37d87e316cb4e35163881fdb6c6bc0cdba91dc0a
0x36343024549c63e9ac61d965bb2e5b6a4a209cc8
0x35b11ed72dd0d49f1833cb9791e04b3afd1300f8
0x346a59146b9b4a77100d369a3d18e8007a9f46a6
0x340fe1d898eccaad394e2ba0fc1f93d27c7b717a
0x33333ee26a7d02e41c33828b42fb1e0889143477
0x321e7092a180bb43555132ec53aaa65a5bf84251
0x320ada89dbfa3a154613d2731c9bc3a4030dba19
0x2f6f07cdcf3588944bf4c42ac74ff24bf56e7590
0x2dee42737d769f7444f8e0c0365e0ee1f992a88c
0x2d5433e9d475c78542dbd0d16d7016b9aab99c1c
0x2ced20fdfcbe72c27a607d0c9ab1c9ada598c60f
0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be
0x29debf83eb8bc91ce9a13ac7e42d37e6e2abb480
0x264c1383ea520f73dd837f915ef3a732e204a493
0x260bbf5698121eb85e7a74f2e45e16ce762ebe11
0x25995c756961715a6aaa6942be0b7d667feb9bb0
0x237bed318a3bb26bdb3790901a7a79cf53c7b80f
0x22d4002028f537599be9f666d1c4fa138522f9c8
0x224db37f1745a2f5d49e06a204ad6a38ba827fa8
0x214db107654ff987ad859f34125307783fc8e387
0x2147efff675e4a4ee1c2f918d181cdbd7a8e208f
0x1f1e7c893855525b303f99bdf5c3c05be09ca251
0x1ecd47ff4d9598f89721a2866bfeb99505a413ed
0x1db749847c4abb991d8b6032102383e6bfd9b1c7
0x1bbe1def0590790484f34fab4be0a2f32889dc52
0x1b88d7ad51626044ec62ef9803ea264da4442f32
0x1affbc17938a25d245e1b7ec6f2fc949df8e9760
0x1a877b68bda77d78eea607443ccde667b31b0cdf
0x19613fec180746831bdf819e0790f35741040dfd
0x155dbbb7ce079f7b8ecfff9688adf6e6efb69a24
0x130966628846bfd36ff31a822705796e8cb8c18d
0x12ed2771c849c29ff3413099ddef6dc987624144
0x120ad3e5a7c796349e591f1570d9f7980f4ea9cb
0x107cdff313aa9aacb37995e5aea677d528cffefe
0x100cc3a819dd3e8573fd2e46d1e66ee866068f30
0x0f577433bf59560ef2a79c124e9ff99fca258948
0x0f34919404a290e71fc6a510cb4a6acb8d764b24
0x0da67235dd5787d67955420c84ca1cecd4e5bb3b
0x0c771c317ffbbfc0e5dbf4c3e5e67a0566fbff37
0x0ac80e1753dea5e298e8a2b6cf53f161937806a1
0x0802d66f029c46e042b74d543fc43b6705ccb4ba
0x0755fa2f4aa6311e1d7c19990416c86f17d16f86
0x027dbca046ca156de9622cd1e2d907d375e53aa7
0x026187bdbc6b751003517bcb30ac7817d5b766f8
0x01c2086facfd7aa38f69a6bd8c91bef3bb5adfca

i have shorten my csv list

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Dec 25, 2022 at 14:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.