Giter Club home page Giter Club logo

adobe's Introduction

adobe flash loans

i ate a weed gummy last week and remembered instruction introspection was a thing and wanted to try and write a flash loan program using it instead of cpi calls

you use this by calling borrow in app/api.js and it returns two instructions, borrow and repay. you put them in any transaction you want, bracketing whatever action you want a loan for. the borrow instruction checks there exists a valid repay instruction before lending funds

annoyingly the repay instruction requires a wallet signature. i can prolly do away with this when the new transaction format lands, i didnt want to take up more bytes requiring a third instruction (spl approve)

i built it by writing it. you can look at the code it was not hard it took like a couple days. the challenges i ran into was sometimes i had other things to do. blah blah blah

i think a good ux for people not importing this as a lib would be if it was a feature in the wallet. you could have a button when you go to sign the transaction that would add in the flash loan instructions for whatever desired amount. this would be good ux for the guard instruction concept too, i think this kinda stuff will be a lot more interesting with the new transaction format

uhhh i didnt add any fees or ponzinomics bullshit so there is no reason why anyone would want to deposit funds into this if i deployed on mainnet. i think probably you need to offer normal overcollat loans to entice capital and then just offer flash loans as a feature on top. i dont really wanna make a whole company or whatever just for this so im just releasing it for a picocrumb of clout

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.