Skip to content

🫧 SMv3 is a proprietary margin engine for interacting with and trading on-chain derivatives via Synthetix v3

License

Notifications You must be signed in to change notification settings

JaredBorders/smv3

This branch is up to date with Kwenta/smart-margin-v3:main.

Folders and files

NameName
Last commit message
Last commit date
Dec 12, 2024
Mar 22, 2024
Dec 17, 2024
Jan 18, 2024
Mar 21, 2024
Dec 17, 2024
Dec 17, 2024
Dec 17, 2024
Dec 19, 2024
Oct 3, 2024
Jun 4, 2024
Nov 22, 2023
Jul 31, 2024
Aug 2, 2023
Jan 3, 2024
Sep 15, 2023
Dec 17, 2024
Jun 6, 2024
Jan 9, 2024
Jul 24, 2024
Dec 11, 2024
Dec 12, 2024
Nov 22, 2023

Repository files navigation

🧱 Smart Margin v3

Github Actions Foundry License: GPL-3.0

Docs

Please refer to the project wiki for all documentation.

Contracts

tree src/

src/
β”œβ”€β”€ Engine.sol
β”œβ”€β”€ interfaces
β”‚   β”œβ”€β”€ IEngine.sol
β”‚   β”œβ”€β”€ synthetix
β”‚   β”‚   β”œβ”€β”€ IERC7412.sol
β”‚   β”‚   β”œβ”€β”€ IPerpsMarketProxy.sol
β”‚   β”‚   └── ISpotMarketProxy.sol
β”‚   └── tokens
β”‚       └── IERC20.sol
β”œβ”€β”€ libraries
β”‚   β”œβ”€β”€ ConditionalOrderHashLib.sol
β”‚   β”œβ”€β”€ MathLib.sol
β”‚   └── SignatureCheckerLib.sol
└── utils
    β”œβ”€β”€ EIP712.sol
    β”œβ”€β”€ EIP7412.sol
    └── MulticallablePayable.sol

Tests

  1. Install dependencies
npm i
  1. Follow the Foundry guide to working on an existing project

  2. Build project

npm run compile
  1. Execute forge tests (requires rpc url(s) to be set in .env)
npm run test
  1. Run specific forge test
forge test --fork-url $(grep BASE_RPC_URL .env | cut -d '=' -f2) --match-test TEST_NAME -vvv
  1. Decode a custom error defined by Synthetix v3

    ex: npm run decode-custom-error -- 0x01de5522...

npm run decode-custom-error -- <error hash 0x...>
  1. Run hardhat tests

project must be compiled first (see step 2)

npm run test:hh

Deployment Addresses

See deployments/ folder

  1. Optimism deployments found in deployments/Optimism.json
  2. Optimism Goerli deployments found in deployments/OptimismGoerli.json
  3. Base deployments found in deployments/Base.json
  4. Base Goerli deployments found in deployments/BaseGoerli.json

Audits

See audits/ folder

  1. Internal audits found in audits/internal/
  2. External audits found in audits/external/

About

🫧 SMv3 is a proprietary margin engine for interacting with and trading on-chain derivatives via Synthetix v3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 99.1%
  • Other 0.9%