create a program that automatically scans cryptocurrency price differences between CEX and DEX exchanges

I'm struggling and having trouble creating a program that automatically scans for price differences between CEX exchanges (such as: Binance, Bybit, Okx, Bitget.. etc.) and DEX exchanges ( such as: Uniswap, Sushiswap, Pancakeswap, 1inch.v..v..), if anyone has any suggestions for this program, please comment, thank you very much!

There was a forum member working on something similar here Cryptocurrency Exchange Array (searching, tabling, etc) , Their flow might give you some ideas.

Data = money, blockchain has lots of data, so this is mostly locked behind api's for which needs to be paid.

Coingecko had an api that did not require an api key (up some months ago) - this api still works, their new api is free but requires registration. Their previous api still works, but I don't know for how long.

You can use a flow like this:

[{"id":"ce91e76dc754682f","type":"inject","z":"51924a530596d728","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":295,"y":2160,"wires":[["9c9a155a38c6ef3f"]],"l":false},{"id":"6de7f5c4bf8b8dfb","type":"debug","z":"51924a530596d728","name":"debug 592","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":870,"y":2200,"wires":[]},{"id":"9c9a155a38c6ef3f","type":"function","z":"51924a530596d728","name":"multiple tokens","func":"const tokens = ['bitcoin','ethereum','open-ticketing-ecosystem']\nmsg.url = `https://api.coingecko.com/api/v3/simple/price?ids=${tokens.join(\",\")}&vs_currencies=eur%2Cusd&include_market_cap=true&include_24hr_change=true`\n\nreturn msg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":2160,"wires":[["e49939c94740d8da"]]},{"id":"e49939c94740d8da","type":"http request","z":"51924a530596d728","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":690,"y":2200,"wires":[["6de7f5c4bf8b8dfb"]]},{"id":"45bae5bcd68ecbeb","type":"function","z":"51924a530596d728","name":"single token, market data","func":"const token = 'bitcoin'\nmsg.url = `https://api.coingecko.com/api/v3/coins/${token}?tickers=true&market_data=true&community_data=true&developer_data=true&sparkline=true`\n\nreturn msg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":2200,"wires":[["e49939c94740d8da"]]},{"id":"9596754660bd41c5","type":"inject","z":"51924a530596d728","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":295,"y":2200,"wires":[["45bae5bcd68ecbeb"]],"l":false},{"id":"f897d86bfd83f04d","type":"function","z":"51924a530596d728","name":"dex contract - market info","func":"const token = 'open-ticketing-ecosystem'\nconst contract_address = '0xc28eb2250d1AE32c7E74CFb6d6b86afC9BEb6509' // ethereum\nconst base_url = `https://api.coingecko.com/api/v3/`\nconst contract_info = `/coins/${token}/contract/${contract_address}`\n\nmsg.url = `${base_url}${contract_info}`\n\nreturn msg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":2240,"wires":[["e49939c94740d8da"]]},{"id":"c44ba00e40d23d46","type":"inject","z":"51924a530596d728","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":295,"y":2240,"wires":[["f897d86bfd83f04d"]],"l":false},{"id":"a30deb04c9635835","type":"function","z":"51924a530596d728","name":"dex contract history","func":"const token = 'open-ticketing-ecosystem'\nconst contract_address = '0xc28eb2250d1AE32c7E74CFb6d6b86afC9BEb6509' // ethereum\nconst base_url = `https://api.coingecko.com/api/v3/`\nconst market_chart = `/coins/${token}/contract/${contract_address}/market_chart?vs_currency=usd&days=1`\n\nmsg.url = `${base_url}${market_chart}`\n\nreturn msg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":2280,"wires":[["e49939c94740d8da"]]},{"id":"c98a8aea57c26ca6","type":"inject","z":"51924a530596d728","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":295,"y":2280,"wires":[["a30deb04c9635835"]],"l":false}]

With this flow you can get what you are looking for.
Dex data is a little more involved as you will need to specify the token name as specified by their api and the contract address you want to retrieve

Documentation via the internet archive

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.