Coder Social home page Coder Social logo

cgallic / arbitrage_wallet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davocarli/arbitrage_wallet

0.0 0.0 0.0 267 KB

A smart contract that holds coins/tokens for arbitrage on behalf of another user.

License: Apache License 2.0

Rust 100.00%

arbitrage_wallet's Introduction

Luna Arbitrage Wallet

Personas

  • owner: The person/wallet who will be performing the arbitrage of funds. Earns a configurable % of profits.
  • user: The perso/wallet that supplies the funds that will be arbitraged.

Contract Lifecycle

  • The owner instantiates the contract, supplying an address for the user.
  • The user whitelists specific addresses that the owner will be able to interact with - most likely, these should be exchange addresses. (Note: until the contract has been 'locked', the owner can supply these as well).
  • The user configures the list of Cw20 addresses & denoms that will be arbitraged with - these should be currencies that are all considered to have essentially equivalent value, such as Luna/bLuna/cLuna.
  • The user 'locks' the contract. This prevents the owner from making further configuration changes, securing the user's funds.
  • The user deposits funds into the contract. The amount of funds deposited is kept track of.
  • The owner can now, from their own wallet, send tokens/messages/Cw20ExecuteMsg's to the smart contract that will be forwarded on accordingly. This gives the owner the ability to freely interact with the wallet's funds, but only with the whitelisted addresses.
  • At any time, the owner or user can withdraw funds. The owner receives a % of the profit that has been made (default 20%). The rest of the funds are withdrawable by the user.

Future Considerations

  • In its current state, the owner must pay gas fees for the arbitrage trades. Assuming a profitable strategy, this should be less than the 20% commission, but I might consider creating a FeeGrant that allows the owner to use the funds stored in the contract itself.

NOTE: I probably should have flipped the naming of user/owner as I think the current naming scheme feels backwards.

arbitrage_wallet's People

Contributors

davocarli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.