基于区块链的毕业设计Uniswap trading client – Uniswap交易客户端

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Uniswap trading client – Uniswap交易客户端 是一篇很好的国外资料

Uniswap trading client

Uniswap trading client - Uniswap交易客户端

Prerequisites

  • An ethereum address
  • An infura project with link (www.infura.io)
  • A Windows machine
  • Not sure whether needed anymore: Visual C++ build tools (www.visualstudio.microsoft.com/visual-cpp-build-tools/)

Getting started

  1. Read prerequisites

  2. Download the latest release or download “configfile.py” and “bot.exe” from the repository.

  3. Open “configfile.py” (with notepad for instance) and add your ethereum address and personal key at the bottom of the file between the quotation marks(”).

... my_address = '' my_pk = ''
  1. Run “bot.exe”
  • Make sure configfile.py and bot.exe are in the same folder.
  1. Edit settings according to choice.

  2. Add infura project url

Functions

Main coin/token: The token or coin you want to trade tokens for and with

Buy/Sell boundary: The amount of balance (calculated in $) that a token or your main coin/token has to be present to deduct whether the latest action was a buy or a sell. For instance: in the value is 100 ,your maincoin option ethereum and have 120$ worth of ethereum on your address, the bot will see the latest action as “sell”.

Token ETH address: Fill the token eth address you want to trade (such as 0x00000000000000000)

Low($): The price you want the trader to sell the token for (0.01 = 1 dollar cent)

High($): The price you want the trader to buy the token for (0.01 = 1 dollar cent)

Activate and Trade with ETH: Toggle if you want to activate trading with your main coin/token

Trade with ERC (Experimental!): Toggle if you want to trade the token with other ERC tokens of which this option is activated (see tokentokennumerator)

Stoploss: Toggle to activate stoploss (0.01 = 1 dollar cent)

Second(s) between checking price: Standard is 4 seconds. With a infura server with max 100.000tx/day 4 seconds is good for 2 activated token 24hr/day

Seconds waiting between trades: depends on how fast transactions finalize Max slippage: The maximum slippage you want to allow while trading (0.03 = 3%) $ to keep in ETH after trade: The amount of ETH/main token you want to keep after each trade (excluding transaction fee’s) in terms of $. GWEI option: The amount of gas you want to use for each trade (see ethgasstation.info) Under construction: use fast Update names: Press to update tokens names according to the Token address

Max GWEI: Set a limit to how much GWEI you want to use. If the chosen gas strategie gives a higher GWEI than the limit, the transaction wont be made.

Different deposit address: Use this if you want the swap output to go to a different ethereum address (without extra fees).

Tokentokennumerator (Experimental!): This value lets you trade ERC tokens with each other. The code to create the value is as followed:

if pricetoken1usd > ((token1high + token1low) / 2) and pricetoken2usd < ((token2high + token2low) / 2):   token1totoken2 = ((pricetoken1usd - token1low) / (token1high - token1low)) / ((pricetoken2usd - token2low) / (token2high - token2low))

If you dont want to wait till the token1 is sold for the maincoinoption, because you are uncertain whether token2 will still be at this price level or think that token1 will drop, you can use this function. To use this function, “Trade with ERC” should be activated for at least 2 tokens, and the highs and lows should be set seriously.

As an example, if the current price of token1 is $0.9 and its set “high”=$1 and “low”=$0, the value of this token is seen as “90%”. Token2 also has a high of $1, but the current price is 0.2$, value of this token is seen as 20%. The tokentokenmnumerator is set at 3.3. If we divide the 90% by the 20%, we get 4.5, which is higher than 3.3, which means that token1 gets traded for token2 instantly. If the tokentokennumerator was set to 5, the swap would not happen.

Changelog v1

-Several bug fixes that were found after testing all feature -Added current balances in $. The bot now tells you how much balance your account has. -Added buy-sell boundary. This value tells the bot how much ETH (or token such as USDT) is needed to be on the address to see the last action as a sell. …

  • Repacked into an executable due to edited modules and questions about python usage
  • Fixed problems regarding threading, the trader works much faster now
  • Further updates in custom gas strategies
  • Added the option to apply the maximum amount of GWEI you want to use
  • Added the option to send the swap output straight to a different address, without extra fees

Current bugs

  • Sloppy dinamic design of GUI
  • Sometimes lag when updating names or when starting the bot (0-10 seconds)
  • More: Let me know!

To do

  • New, more user-friendly design

(Depends on whether the application is used)

Author

During the latest pandemic I realised that I had time to learn how to code, I decided to do this by making trader-bots in python. Other than it being a good exercise, it was/is also very fun and lucrative! This is one of my first applications I made, so the documentation is still quite poor with spaghetti-code here and there, but it does what it should do!

Disclosure

I own some of the tokens portayed in the gif. These tokens are used only for example purposes and are not meant to be an endorsement. I am not affiliated with these tokens or any subsidiaries. Use the application at your own risk, I am not in any way responsible for losses.

Merge branch ‘main’ of


Uniswap trading client - Uniswap交易客户端

先决条件

  • 阅读必备软件
  • 下载最新版本或下载”配置文件.py“和”bot.exe文件“从存储库。
  • 打开”配置文件.py“(例如记事本)并在文件底部的引号(”)之间添加以太坊eth地址和个人密钥。
  • 跑步”bot.exe文件“

入门

  1. 确保配置文件.py以及bot.exe文件在同一个文件夹中。
  2. 根据选择编辑设置。
  3. 添加infura项目url
... my_address = '' my_pk = ''
  1. 由于编辑的模块和有关python用法的问题而重新打包到可执行文件中
  • 修复了有关线程的问题,交易员现在的工作速度要快得多
  1. 自定义天然气策略的进一步更新
  2. 添加了应用您要使用的最大GWEI量的选项

函数

Main coin/token: The token or coin you want to trade tokens for and with

主要硬币/代币:您要与代币进行交易的代币或硬币

买入/卖出边界:代币或您的主要硬币/代币必须存在的余额(以美元计),以扣除最近的操作是买入还是卖出。例如:在值为100,你的主币选择以太坊eth和有价值120美元的以太坊eth在你的地址,机器人会看到最新的行动是“出售”。

代币ETH地址:填写您想要交易的代币ETH地址(例如0x000000000000)

低($):您想要交易者以(0.01=1美元美分)的价格出售代币。

高($):您想要交易者以(0.01=1美元美分)的价格购买代币。

激活并与ETH交易:如果您想要,请切换要激活与您的主硬币/代币的交易

与ERC进行交易(实验!):Toggle如果您想与激活此选项的其他ERC代币进行交易(请参阅tokentokennumerator)

止损:Toggle激活止损(0.01=1美元分)

检查价格之间的秒数:标准为4秒。对于一个infura服务器,每天最多100.000tx,4秒适合2个激活的令牌24小时/天

交易之间等待的秒数:取决于交易完成的速度最大滑移:交易时您希望允许的最大滑移(0.03=3%)$交易后保留在ETH中:每次交易后您希望保留的ETH/主令牌的数量(不包括交易费)以美元计。GWEI选项:每笔交易要使用的天然气量(参见ethgastation.info文件)正在构建:使用快速更新名称:按可根据令牌地址更新令牌名称最大GWEI:设置要使用多少GWEI的限制。如果选择的天然气策略给出的GWEI高于限制,则不会进行交易。

不同的存款地址:如果您希望交换输出转到不同的以太坊eth地址(无需额外费用),请使用此选项。

标记分子(实验!):此值允许您相互交易ERC令牌。创建值的代码如下所示:

if pricetoken1usd > ((token1high + token1low) / 2) and pricetoken2usd < ((token2high + token2low) / 2):   token1totoken2 = ((pricetoken1usd - token1low) / (token1high - token1low)) / ((pricetoken2usd - token2low) / (token2high - token2low))

如果您不想等到token1为maincoinoption售出,因为您不确定token2是否仍将处于此价格水平,或者认为token1将下降,则可以使用此函数。要使用此功能,至少应为2个代币激活“与ERC交易”,并且应认真设置高点和低点。

例如,如果token1的当前价格为0.9美元,其设置“高”=$1,“低”=$0,则该token的值被视为“90%”。Token2也有1美元的高价,但当前的价格是0.2美元,这个token的价值是20%。tokenmnumerator设置为3.3。如果我们将90%除以20%,我们得到4.5,这高于3.3,这意味着token1可以立即被交易为token2。如果TokenNumerator设置为5,则交换不会发生。

当前错误

-在测试所有功能后发现的几个错误修复-以美元为单位添加了当前余额。机器人现在告诉你你的帐户有多少余额。-增加了买卖界限。这个值告诉bot地址上需要多少ETH(或像USDT这样的代币)才能将最后一个操作看作是一个sell。。。

  • 添加了将掉期输出直接发送到其他地址的选项,如果没有额外的费用,GUI的草率dinamic设计有时会在更新名称或启动bot时出现延迟(0-10秒)
  • 更多:让我知道!
  • 全新、更人性化的设计
  • Added the option to apply the maximum amount of GWEI you want to use
  • Added the option to send the swap output straight to a different address, without extra fees

要做的事

  • Sloppy dinamic design of GUI
  • Sometimes lag when updating names or when starting the bot (0-10 seconds)
  • More: Let me know!

作者

  • New, more user-friendly design

公开以太坊eth地址(网址:www.infura.io < LI> Windows机器 > LI>不确定是否需要:Visual C++构建工具(www.visualstudio.microsoft.com/visual-cpp-build-tools/)
  • 阅读必备软件
  • 下载最新版本或下载”配置文件.py“和”bot.exe文件“从存储库。
  • 打开”配置文件.py“(例如记事本)并在文件底部的引号(”)之间添加以太坊eth地址和个人密钥。
  • 跑步”bot.exe文件“
  • 确保配置文件.py以及bot.exe文件在同一个文件夹中。
  • 根据选择编辑设置。
  • 添加infura项目url
  • 由于编辑的模块和有关python用法的问题而重新打包到可执行文件中
  • 修复了有关线程的问题,交易员现在的工作速度要快得多
  • 自定义天然气策略的进一步更新
  • 添加了应用您要使用的最大GWEI量的选项
  • 添加了将掉期输出直接发送到其他地址的选项,如果没有额外的费用,GUI的草率dinamic设计有时会在更新名称或启动bot时出现延迟(0-10秒)
  • 更多:让我知道!
  • 全新、更人性化的设计
  • During the latest pandemic I realised that I had time to learn how to code, I decided to do this by making trader-bots in python. Other than it being a good exercise, it was/is also very fun and lucrative! This is one of my first applications I made, so the documentation is still quite poor with spaghetti-code here and there, but it does what it should do!

    (取决于是否使用应用程序)

    Disclosure

    I own some of the tokens portayed in the gif. These tokens are used only for example purposes and are not meant to be an endorsement. I am not affiliated with these tokens or any subsidiaries. Use the application at your own risk, I am not in any way responsible for losses.

    Merge branch ‘main’ of

    部分转自网络,侵权联系删除区块链源码网

    www.interchains.cc

    https://www.interchains.cc/20837.html

    区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
    区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Uniswap trading client – Uniswap交易客户端

    提供最优质的资源集合

    立即查看 了解详情