Git Product home page Git Product logo

dss-lerp's Introduction

dss-lerp

Performs linear interpolation over time on any Maker governance parameter. Normally this is performed out of the executive spell as you require auth permissions.

Usage

// Increase the global debt ceiling from 100M to 200M over 7 days
lerpFactory.newLerp("20210421_VOW_HUMP1", vat, "Line", block.timestamp, 100 * MILLION * RAD, 200 * MILLION * RAD, 7 days);

// Increase the ETH-A debt ceiling from 100M to 200M over 7 days
lerpFactory.newIlkLerp("20210421_VOW_HUMP2", vat, "ETH-A", "line", block.timestamp, 100 * MILLION * RAD, 200 * MILLION * RAD, 7 days);

Parameters

Each lerp factory invocation creates a new contract which has the following properties:

target - The contract which we are changing an administrative parameter. what - The name of the parameter. startTime - The starting time of this lerp instance. start - The starting value of that parameter. end - The ending value of that parameter. duration - How long this lerp is running for. done - Whether this lerp instance is finished or not.

Executing

The Lerp contract has one method to call, which is permissionless and can be called by anyone:

tick() - Updates the target parameter to be whatever value it should be at this moment in time. This will also finish off the lerp and set the parameter to the end value if the elapsed time is longer than the duration.

LerpFactory

The Lerp Factory (AKA LERP_FAB) provides a singleton inteface to keep track of all active lerp instances. It is deployed at the following addresses:

Latest

Mainnet: 0x9175561733d138326fdea86cdfdf53e92b588276 Goerli: 0xe7988b75a19d8690272d65882ab0d07d492f7002

Deprecated

Mainnet: 0x00B416da876fe42dd02813da435Cc030F0d72434 Kovan: 0xa6766Ed3574bAFc6114618E74035C7bb5e9a6aa9

You can get a list of all active lerp instances by calling list() which returns an array of addresses for active lerps. This list of active lerps is not in any particular order. Alternatively you can query for specific lerps (even ones that are no longer active) by calling lerps(bytes32) which returns the address of the lerp or address(0) if there isn't a match. For example, calling lerps("20210421_VOW_HUMP1") would return the first lerp from the example above.

To tick() all active lerps you can use the convenience function tall() short for "tick all".

dss-lerp's People

Contributors

brianmcmichael avatar hexonaut 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.