corgoptimizer
C-Org-Optimizer
Last updated 8 months ago by rmagier .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install corgoptimizer 
SYNC missed versions from official npm registry.

cOrgOptimizer

C-Org-Optimizer

This is the example code how to use this module:

const Optimizer = require('corgoptimizer')
const Web3 = require('web3')
const provider_http = 'http://localhost:8545'

var web3 = new Web3(new Web3.providers.HttpProvider(provider_http))

const daiExchange = '0x9B53246dd09549E120575fed900E3C41D595496c'
const fairExchange = '0x336FcAb263982922b4e5C736Ed888D577eE817cf'
const DAT = '0x93264ff8642d0F2C21BCC78aE367B9eC6137addA'


async function main()
{
    optimizer = new Optimizer(web3,daiExchange,fairExchange,DAT)
    let result = await optimizer.optimizeBuyTransaction('11083071190')
    console.log('Result of Buy Optimization. ')
    console.log('Amount to buy on Uniswap:   ', result.uniswap.toString())
    console.log('Amount to buy on DAT:       ', result.dat.toString())

    result = await optimizer.optimizeSellTransaction('11083071190')
    console.log()
    console.log('Result of Sell Optimization.') 
    console.log('Amount to sell on Uniswap:  ', result.uniswap.toString())
    console.log('Amount to sel on DAT:       ', result.dat.toString())
}

main()

Current Tags

  • 1.0.5                                ...           latest (8 months ago)

6 Versions

  • 1.0.5                                ...           8 months ago
  • 1.0.4                                ...           8 months ago
  • 1.0.3                                ...           8 months ago
  • 1.0.2                                ...           8 months ago
  • 1.0.1                                ...           8 months ago
  • 1.0.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 3
Last Month 0
Dependencies (6)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |