Skip to content

Policy · LunnorBudgetPolicy

Your bot's budget, kept as versions.

Every change to the rule is a new version; old ones stay readable forever. Anyone can run the same test against any version, and a wallet can anchor a run: the contract runs it and keeps the hashes. It never places or blocks an order.

Connect a wallet or paste an address.

Interface

// Solidity, Robinhood Chain (chain 4663). No owner, no fee, no funds.
struct Policy { uint128 dailyCap; uint128 perOrderCap; uint16 resetOffsetMin; uint8 mode; }
struct Order  { uint64 time; uint128 qty; uint128 price; }   // micro-USD, millionths of a share, USD x 1e8

function setPolicy(Policy policy, bytes32 label) returns (uint256 version);
function simulate(Policy policy, Order[] orders) pure returns (Result, Step[]);
function simulateFor(address wallet, uint256 version, Order[] orders) view returns (Result, Step[]);
function anchorRun(uint256 version, Order[] orders) returns (uint256 runId);
function versionsOf(address wallet, uint256 start, uint256 count) view returns (Version[]);
function runAt(uint256 runId) view returns (Run);

Simulate up to 200 orders per call (about 1.0 M gas as a view, free through eth_call). Source, tests and the parity fixtures shared with this site are in the repository.