Skip to content

turingcapitalgroup/kam-settler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KAM kSettler

Batch settlement orchestration contract for the KAM (Keyrock Asset Management) protocol. The kSettler contract manages complex batch settlement processes including rebalancing, fee calculations, asset netting, and profit distribution for delta-neutral vaults.

For detailed technical documentation including architecture, settlement flows, and fee models, see docs/architecture.md.

Installation

git clone https://github.com/turingcapitalgroup/kam-settler.git
cd kam-settler
forge install

Usage

Build

make build
# or
forge build

Test

make test
# or
forge test

Format

make format
# or
forge fmt

Coverage

make coverage

Deployment

Configuration

Network configurations are stored in deployments/config/:

  • mainnet.json - Ethereum mainnet settings
  • sepolia.json - Sepolia testnet settings
  • localhost.json - Local development settings

Each config specifies:

  • KAM registry address
  • Role addresses (owner, admin, relayer)

Environment Variables

Create a .env file:

RPC_MAINNET=<mainnet-rpc-url>
RPC_SEPOLIA=<sepolia-rpc-url>
DEPLOYER_ADDRESS=<deployer-address>
ETHERSCAN_MAINNET_KEY=<etherscan-api-key>
ETHERSCAN_SEPOLIA_KEY=<etherscan-api-key>

Deploy Commands

# Mainnet
make deploy-mainnet
make deploy-mainnet-dry-run    # Simulate without broadcasting

# Sepolia
make deploy-sepolia
make deploy-sepolia-dry-run

# Localhost (full stack: KAM + kSettler)
make deploy-localhost

# Localhost (kSettler only, requires existing KAM deployment)
make deploy-settler-localhost

Verify on Etherscan

make verify-mainnet
make verify-sepolia

Access Control

The contract uses role-based access control:

  • Owner - Contract owner, can grant roles
  • Admin - Administrative operations, can grant relayer role
  • Relayer - Executes settlement operations (main operator role)

Dependencies

Technical Details

  • Solidity: 0.8.30
  • Framework: Foundry
  • Optimizer: Enabled with 10,000 runs
  • Via IR: Enabled

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors