Initial commit: Deal orchestration tool - Freeze-resistant arbitrage loop
- Implemented complete arbitrage loop (Steps 0-4) - Risk control service with hard caps (30% LTV, 25% USDTz exposure) - Progressive redemption testing (0k → 50k → cd /home/intlc/projects/proxmox/dbis_core/src/core/defi/arbitrage && git commit -m "Initial commit: Deal orchestration tool - Freeze-resistant arbitrage loop - Implemented complete arbitrage loop (Steps 0-4) - Risk control service with hard caps (30% LTV, 25% USDTz exposure) - Progressive redemption testing ($50k → $250k → $1M+) - Graceful failure handling and state management - CLI interface and programmatic API - Comprehensive documentation Features: - Capital split into three buckets (Core ETH, Working Liquidity, Opportunistic) - ETH wrapping and collateral supply - USDT borrowing at controlled LTV - Discount arbitrage execution - Partial monetization with redemption testing - Loop closing with profit capture Design Principles: - One-way risk only - Anchor asset (ETH) untouchable - No leverage on discounted assets - Independent leg settlement"M+) - Graceful failure handling and state management - CLI interface and programmatic API - Comprehensive documentation Features: - Capital split into three buckets (Core ETH, Working Liquidity, Opportunistic) - ETH wrapping and collateral supply - USDT borrowing at controlled LTV - Discount arbitrage execution - Partial monetization with redemption testing - Loop closing with profit capture Design Principles: - One-way risk only - Anchor asset (ETH) untouchable - No leverage on discounted assets - Independent leg settlement
This commit is contained in:
82
config.ts
Normal file
82
config.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
// Deal Orchestration Tool - Configuration
|
||||
// ChainID 138 token addresses and protocol settings
|
||||
|
||||
/**
|
||||
* ChainID 138 Token Addresses
|
||||
* Source: docs/11-references/CHAIN138_TOKEN_ADDRESSES.md
|
||||
*/
|
||||
export const CHAIN138_TOKENS = {
|
||||
WETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
|
||||
WETH10: '0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f',
|
||||
LINK: '0xb7721dD53A8c629d9f1Ba31a5819AFe250002b03',
|
||||
cUSDT: '0x93E66202A11B1772E55407B32B44e5Cd8eda7f22',
|
||||
cUSDC: '0xf22258f57794CC8E06237084b353Ab30fFfa640b',
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* RPC Configuration
|
||||
*/
|
||||
export const RPC_CONFIG = {
|
||||
chainId: 138,
|
||||
rpcUrl: process.env.CHAIN138_RPC_URL || 'http://192.168.11.250:8545',
|
||||
explorerUrl: 'https://explorer.d-bis.org',
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Default Risk Parameters
|
||||
*/
|
||||
export const DEFAULT_RISK_PARAMS = {
|
||||
MAX_LTV: 0.30, // 30% maximum loan-to-value
|
||||
MAX_USDTZ_EXPOSURE_PCT: 0.25, // 25% of total NAV
|
||||
DEFAULT_USDTZ_DISCOUNT: 0.40, // 40% discount
|
||||
DEFAULT_MONETIZATION_SPLIT: {
|
||||
redemptionPortion: 0.35, // 35% for redemption
|
||||
coldStoragePortion: 0.65, // 65% for cold storage
|
||||
},
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Redemption Test Amounts (in USD)
|
||||
* Progressive testing: $50k → $250k → $1M+
|
||||
*/
|
||||
export const REDEMPTION_TEST_AMOUNTS = [
|
||||
50_000, // $50k
|
||||
250_000, // $250k
|
||||
1_000_000, // $1M
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Capital Split Defaults
|
||||
* Example: $10M total → $5M core, $3M working, $2M opportunistic
|
||||
*/
|
||||
export const DEFAULT_CAPITAL_SPLIT = {
|
||||
coreEthPct: 0.50, // 50% core ETH (never touched)
|
||||
workingLiquidityPct: 0.30, // 30% working liquidity
|
||||
opportunisticUsdtzPct: 0.20, // 20% opportunistic USDTz
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Protocol Addresses (to be configured based on actual deployment)
|
||||
*/
|
||||
export const PROTOCOL_ADDRESSES = {
|
||||
// Lending protocol on ChainID 138
|
||||
lendingProtocol: process.env.CHAIN138_LENDING_PROTOCOL || '',
|
||||
vault: process.env.CHAIN138_VAULT_ADDRESS || '',
|
||||
ledger: process.env.CHAIN138_LEDGER_ADDRESS || '',
|
||||
// USDTz swap/redemption contract
|
||||
usdtzSwap: process.env.CHAIN138_USDTZ_SWAP_ADDRESS || '',
|
||||
usdtzRedeem: process.env.CHAIN138_USDTZ_REDEEM_ADDRESS || '',
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Asset Type Mappings
|
||||
*/
|
||||
export const ASSET_TYPES = {
|
||||
ETH: 'ETH',
|
||||
WETH: 'WETH',
|
||||
WETH10: 'WETH10',
|
||||
USDT: 'USDT',
|
||||
cUSDT: 'cUSDT',
|
||||
cUSDC: 'cUSDC',
|
||||
USDTz: 'USDTz',
|
||||
} as const;
|
||||
Reference in New Issue
Block a user