GithubHelp home page GithubHelp logo

dss-cron's Introduction

dss-cron

Keeper jobs for Maker protocol. Designed to support multiple Keeper Networks. All jobs will be deployed contracts which implement the IJob interface.

Keeper Networks will be required to watch the activeJobs array in the Sequencer and find all instances of available jobs. Helper methods getNextJobs(...) can be used to check a subsection (or everything) of the array all at once. Each job is safe to be executed in parallel.

Funding of keeper networks is done through dss-vest.

It is important that the work function succeeds IF AND ONLY IF the workable function returns a valid execution. It is tempting to save gas by allowing execution if the internal function itself passes, but this opens an attack vector where keeper networks can spam the function to collect the DAI payout. Furthermore, care should be taken to ensure keeper networks cannot mess with the state to produce valid job executions in rapid succession as this opens up a spam attack vector too. If jobs are susceptable to this they should include a cooldown period to prevent these types of spam.

Deployed Contracts

Sequencer: 0x238b4E35dAed6100C6162fAE4510261f88996EC9

Active Jobs

AutoLineJob [thi=1000 bps, tlo=5000 bps]: 0x67AD4000e73579B9725eE3A149F85C4Af0A61361
LerpJob [maxDuration=1 day]: 0x8F8f2FC1F0380B9Ff4fE5c3142d0811aC89E32fB
D3MJob [threshold=500 bps, ttl=10 minutes]: 0x1Bb799509b0B039345f910dfFb71eEfAc7022323
ClipperMomJob: 0xc3A76B34CFBdA7A3a5215629a0B937CBDEC7C71a
OracleJob: 0xe717Ec34b2707fc8c226b34be5eae8482d06ED03
FlapJob [maxGasPrice=138 gwei]: 0xc32506E9bB590971671b649d9B8e18CB6260559F

Network Payment Adapters

NetworkPaymentAdapter (Gelato): 0x0B5a34D084b6A5ae4361de033d1e6255623b41eD
NetworkPaymentAdapter (Keep3r Network): 0xaeFed819b6657B3960A8515863abe0529Dfc444A
NetworkPaymentAdapter (Chainlink): 0xfB5e1D841BDA584Af789bDFABe3c6419140EC065

dss-cron's People

Contributors

hexonaut avatar oldchili avatar sunbreak1211 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dss-cron's Issues

Standardize the Keeper Buffer Interface

It's hard to keep track of each of the bespoke keeper network implementations of how to manage their DAI buffer. I'd like to standardize this interface and have the logic to refill the buffer moved to Maker's side.

Interface should look something like this:

interface IKeeperNetwork {
	/**
	 * This should return an estimate of the total value of the buffer in DAI.
	 * Keeper Networks should convert non-DAI assets to DAI value via an oracle.
	 * 
	 * Ex) If the network bulk trades DAI for ETH then the value of the ETH sitting
	 * in the treasury should count towards this buffer size.
	 */
	function getBufferSize() external view returns (uint256);
}

The Maker-side smart contract could then check this value and deal with the logic of when to send more DAI. MIP63 should also be changed with an additional value called Minimum Fill which sets the minimum amount of available streamed DAI capacity before executing the transfer. We should also get rid of the Buffer Min value as it doesn't really make sense. Someone needs to update the MIP.

Fill logic should be something like:

uint256 pendingDai = vest.unpaid(KEEPER_NETWORK_ID);
uint256 buf = keeperNetwork.getBufferSize();
if (buf >= bufferMax) return;	// We are full
else if (pendingDai >= minimumFill) {
	vest.vest(KEEPER_NETWORK_ID);
	
	// Send DAI up to the maximum and the rest should go back into the surplus buffer
}

A sane value for minimumFill might be something like 1000 DAI so that these transfers occur somewhat frequently, but not all the time.

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.