设计:一个以太坊市场,用于设计更好的金融市场表现

devise的Python项目详细描述


^{str 1}传统的交易所没有将美元资产上市,这样对冲基金就可以产生alpha,但显然市场并不是完全有效的,而且还有alpha可以攫取。devise是一个另类的交易所,它包含数百种人工合成资产,这些资产从一开始就被设计用来帮助基金经理寻找alpha。合成资产可以匿名访问,保证了访问的稀缺性,并且可以在没有可信中心方的情况下以完全分散的方式进行审计。

当且仅当可证明已在设计上的所有资产以及60种最具流动性的美国期货(占交易量的90%以上)根据我们Yellow Paper中描述的信息理论有用性证明框架增值时,设计综合资产才在设计上列出。

设备上的每个合成资产都是一个独特的数据流,可通过加密驱动的api访问。以太坊智能合约用于(匿名)控制对API的访问权限,用户通过其以太坊地址进行标识,以太坊区块链可以用作分散式审计系统,以解决访问不足的问题。

在订阅的基础上授予对设计的访问权,每月的条款自动更新,直至取消。费用以自定义(应用内)实用令牌支付,即设计令牌或dvz。每月租费由出租智能合同自动设置,通过拍卖机制,旨在最大化设计基于客户出价的替代交换的价值,以及在访问次数的稀缺约束下。若要访问设备,应将100个席位中的一个分配给客户。希望进一步限制进入设计的客户可以选择预订超过1个座位,最多100个,并相应地支付更高的租金。

此repo包含支持所有与devise相关操作的官方python 3客户机,以及一个javascript库和所有可靠的源代码。

要了解更多有关设计的信息,请查看我们的primer

Installation

安装devise repo的最简单方法是从pypi:

$ pip install devise

或者,您可以克隆此repo并安装它:

$ git clone https://github.com/devisechain/Devise
$ cd Devise/python
$ pip install .

有关更详细的安装说明和平台特定系统依赖项的信息,请参阅我们的Installation Guide

How To Use Our Python Package

所有与设计相关的操作都可以通过DeviseClient类执行。

一个DeviseClient对象通过一个公共以太坊节点连接到以太坊网络,既用于需要签名的链上操作(也称为事务),也用于免费的链外操作(也称为调用)。

对于任何需要加密签名的操作,我们支持Official Ethereum Wallet、硬件钱包(具体来说是Ledger Nano STrezor)、加密密钥库文件和清除私钥。

要使用Official Ethereum Wallet,请运行

fromdeviseimportDeviseClient# Create a Devise client object to interact with our smart contracts and API.devise_client=DeviseClient(account='0xd4a6B94E45B8c0185...',password='<your password>')

要使用硬件钱包,请运行

fromdeviseimportDeviseClient# Create a Devise client object to interact with our smart contracts and API.devise_client=DeviseClient(account='0xd4a6B94E45B8c0185...',auth_type='[ledger|trezor]')

要使用密钥库文件,请运行

fromdeviseimportDeviseClient# Create a Devise client object to interact with our smart contracts and API.devise_client=DeviseClient(key_file='<path to your encrypted json keystore file>',password='<your password>')

要使用清除私钥,请运行

fromdeviseimportDeviseClient# Create a Devise client object to interact with our smart contracts and API.devise_client=DeviseClient(private_key='<your private key>')

参数password始终是可选的。当需要签名但未提供时,每次需要签名事务时,系统都会提示您键入。

如果需要,可以在创建DeviseClient实例时指定自己的node_url来覆盖用于连接以太坊网络的公共节点。

How To Access The Devise Alternative Exchange

为了访问设计替代交换,您需要i)在您的托管帐户中有足够的设计令牌(DVZ),ii)提交投标,以及iii)如果您的投标成功,则从API请求数据。

要在我们这里为您的托管账户提供资金,请运行:

# Provision your escrow account with DVZ by transferring qty ETH from your Ethereum wallet to the rental Smart contract.qty=1000devise_client.fund_account(amount=qty,unit='ETH',source='ETH')# Check your remaining escrow balance in DVZ tokensremaining=devise_client.dvz_balance_escrow

如果需要,您可以请求历史数据来评估增值:

# Note: Historical data are free of charge, but your escrow account# must be sufficiently provisioned to pay one month rent to be allowed# access historical data.# Check if you are currently allowed to request historical data.has_access=devise_client.client_summary['historical_data_access']print(has_access)# Download historical weights of all leptons on the Devise alternative# exchange and store them in the file 'devise_historical_weights.tar'# in the current folder.devise_client.download_historical_weights()# Download historical returns of all leptons on the Devise alternative# exchange and store them in the file 'devise_historical_returns.tar'# in the current folder.devise_client.download_historical_returns()

一旦你知道你想要多少个座位,以什么价格,你可以通过运行提交您的出价

# Example: submit a bid for 10 seats on the Devise alternative exchange, for a monthly rent capped at 200,000 DVZ.seats=10# Note: The limit monthly rent per seat below is indicative.lmt_monthly_rent_per_seat=200000# The limit price the auction abides by is the limit price per bit of total incremental usefulness.# If between terms leptons are added to the chain, the total incremental usefulness might change,# and as a result you might be paying a higher rent. Your rent per seat and per unit of total# incremental usefulness will however never exceed your specified limit price per bit.lmt_price=lmt_monthly_rent_per_seat/devise_client.total_incremental_usefulnessdevise_client.lease_all(lmt_price,seats)

要检查您是否赢得了本学期的席位,请运行

# Check how many seats you have access to in the current term.total_seats=devise_client.current_term_seatshas_seats=total_seats>0print(has_seats)

如果您有资格获得座位,您可以通过运行来请求公文包权重更新

# Download latests weights of all leptons on the Devise alternative exchange# and stores them in the file 'devise_latest_weights_<yyyy-mm-dd>.tar'# in the current folder. Data updates are available on a daily basis before 7AM ET.latest_weights=devise_client.download_latest_weights()

有关更多信息,请查看我们的wiki

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在reducer中迭代自定义可写组件时出现java问题   属性文件中属性的java命名约定   任务链关闭的java Executor服务   java从Eclipse中的字段生成多个构造函数   java通过继承读取Json   java在不知道密钥的情况下解析json   java camel cxf如何在电子邮件中发送soap请求响应   java程序似乎跳过了if语句的一部分,在移回正确位置之前先移到else语句   测试简单的Java加密/解密inputFileName不存在   java从Jenkins REST API获取所有作业的所有构建的构建细节   java基本包装器和静态“类型”类对象   在WebSphere8.5上部署java代码   java对象相等(对象引用“=”)   java MongoDB整型字段到枚举的转换   每次我重新导入gradle时,IntelliJ都会不断重置Java设置   类型使用键或索引从Java中的数据类型检索值   在Java的列表接口中需要listIterator()和iterator()是什么?