Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 1.63 KB

README.md

File metadata and controls

32 lines (21 loc) · 1.63 KB

Overview

Script is an experimental framework for writing performant trustless trading strategies.

Problem

Script solves the non-custodial vault trilemma outlined in the Arrakis v2 docs: Arrakis Vaults Trilemma

  • Trustless Vaults implement strategies in smart contracts, so are trustless and low-friction but the strategies are public and limited by gas costs.
  • Managed Vaults are operated by an off-chain manager so are private, easy to use and not limited by gas but require trusting the manager.
  • Self Managed Vaults require the user to operate themselves so are private, not limited by gas, don't require trusting anyone but are complex to operate.

Architecture

In Script, trading strategies (or scripts) are themselves zero-knowledge circuits. As a result:

  • Scripts are private, preventing exploitation and protecting IP.
  • Scripts are verified succintly on-chain keeping gas costs low (constant) even for sophisticated strategies.

Script - Architecture Diagram

Getting Started

  1. Install circom and snarkjs here
  2. Run npm install
  3. Run npm generate to run generate.sh
  4. Run npm run strategy to run strategy.js
  5. (Optionally) Run npm run test to test the smart contracts

Future work

  • Write some more sophisticated strategies involving more signals (e.g. all liquidity positions, volatility)
  • Move to a higher level DSL for writing the circuits, e.g. Noir