Skip to content

High Frequency Price Automation for GMX, Using Chainlink Keeper Data Streams

Notifications You must be signed in to change notification settings

Cyfrin/chainlink-gmx-automation

Repository files navigation

Chainlink <> GMX Automation

Prerequisites

  1. Git
  2. Foundry
  3. Yarn
  4. Arbitrum Goerli RPC URL

Installation

  1. Clone the repo:
    git clone [email protected]:Cyfrin/chainlink-gmx-automation.git
    
  2. Install dependencies:
    cd chainlink-gmx-automation
    forge install
    
  3. Install GMX dependencies:
    cd lib/gmx-synthetics
    yarn
    cd ../..
    
  4. Build:
    forge build
    
  5. Setup environment:
    cp .env.example .env
    
    Enter your RPC URL into the ARBITRUM_GOERLI_URL in .env
  6. Run the tests:
    forge test
    

Deployment

  1. Ensure that your .env file is fully populated, and the address for you PRIVATE_KEY variable is funded with Arbitrum Goerli ETH

  2. Run the following command to load your .env file into your environment:

    source .env
    
  3. To deploy the DepositAutomation contract, run the following script in the terminal:

    forge script script/DeployDepositAutomation.s.sol --rpc-url $ARBITRUM_GOERLI_URL --broadcast
    

    Other available scripts are script/DeployMarketAutomation.s.sol and script/DeployWithdrawalAutomation.s.sol

Automation Contracts

Automation Contract Event Log Type Log Name OrderType Enum Execution Contract Execute Function
MarketAutomation.sol Market Swap emitEventLog2 OrderCreated 0 OrderHandler executeOrder
- Market Increase emitEventLog2 OrderCreated 2 OrderHandler executeOrder
- Market Decrease emitEventLog2 OrderCreated 4 OrderHandler executeOrder
DepositAutomation.sol Deposit emitEventLog1 DepositCreated - DepositHandler executeDeposit
WithdrawalAutomation.sol Withdrawal emitEventLog1 WithdrawalCreated - WathdrawalHandler executeWithdrawal

About

High Frequency Price Automation for GMX, Using Chainlink Keeper Data Streams

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published