Inspiration

From the Kyber devs: (https://blog.kyber.network/kyber-network-bounties-for-eth-singapore-4a57e6be2f04) """ One strong advantage of Kyber is that liquidity is already on-chain (tokens and prices are already on the smart contract). Anyone can query the Kyber contract for the expect buy and sell rate, such as 1 or 2 ETH equivalent amount of a token. One can then reconstruct an orderbook with orders extracted from Kyber’s liquidity pool. For greater accuracy, consider querying rates from individual reserve contracts instead of Kyber’s contract. In any case, let us denote orders extracted from Kyber as on-chain orders.

It would be cool to build a relayer that can combine both 0x’s and Kyber’s model: there are always on-chain orders relayed from Kyber and users can also create new off-chain orders should they wish to sell/buy at a different price. What’s really interesting is how the settlement occurs between a new on-chain order with an existing off-chain order, since it may require interactions between both Kyber and 0x smart contracts. """

What it does

It's a simple webpage that interfaces with the Kyber and 0x smart contracts to find the best price.

How we built it

We set up a test blockchain locally using truffle and ganache, which had data imported from the 0x-starter project at https://github.com/0xProject/0x-starter-project and the Kyber workshop tutorial at https://github.com/KyberNetwork/workshop. We then made a user interface for users to query order books from the two protocols simultaneously.

We edited examples in the Kyber Network workshop for a basic Relayer smart contract to aggregate information from the Kyber Network, and edited examples in the 0x starter-project.

Challenges we ran into

Kyber - installation issues due to solc version - had to switch between different solidity versions in truffle. Error messages when transferring from admin to KyberReserve accounts not informative.

Accomplishments that we're proud of

Setting up the blockchain with all the smart contracts and accounts from Kyber and 0x for testing. Getting the web interface up.

What we learned

Gained experience with smart contract development tools - truffle Implementation of Kyber, 0x, usefulness of both for smart contract developers.

What's next for 0x-Kyber Relay

Fix the hacky bits.

Built With

Share this project:
×

Updates