Skip to content

grappafinance/core-physical

Folders and files

NameName
Last commit message
Last commit date

Latest commit

dca6ba5 · Apr 3, 2024
May 31, 2023
Nov 29, 2022
Jun 2, 2023
May 30, 2023
Apr 3, 2024
Apr 2, 2024
Oct 12, 2023
Jan 20, 2023
Oct 12, 2023
Dec 23, 2022
Jun 26, 2023
Jun 4, 2022
Jan 2, 2023
Jun 27, 2022
Jun 2, 2023
Jan 2, 2023
May 17, 2023
Feb 3, 2023
Jun 20, 2023
Nov 29, 2022

Repository files navigation

Grappa Core



Don't waste your capital.

Introduction

This is the repository of the core component of Grappa, which is a decentralized settlement layer for options and spreads.

In our design, a option (derivative) token can be created by different margin engine. Users with different risk tolerance can choose among different engines based on gas cost, capital efficiency and risk of liquidation.

We also natively support call spread and put spread that can increase capital efficiency by a lot while being fully collateralized.

Documentation

For detailed documentation about how the system architecture is designed, please visit docs

Get Started

forge build
forge test

For auto linting and running gas snapshot, you will also need to setup npm environment, and install husky hooks

# install yarn dependencies
yarn
# install hooks
npx husky install

Test locally

forge test

Run Coverage

forge coverage

Linting

forge fmt

Deployment

Simulate deployment for launch

forge script script/deploy-launch.sol --private-key <your PK> --fork-url <RPC-endpoint> 

Run Slither

installation

pip3 install slither-analyzer
pip3 install solc-select
solc-select install 0.8.13
solc-select use 0.8.13

Run analysis

slither ./src/core/

Install Grappa into your project

With hardhat

yarn add @grappafinance/grappa-contracts

# or

npm install @grappafinance/grappa-contracts

With Foundry

forge install grappafinance/core

Then you will be able to import the libraries or contract interface

pragma solidity ^0.8.0;

import "@grappafinance/grappa-contracts/src/libraries/ActionUtil.sol";