Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ECLP / Gyro Fee Split #266

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
298 changes: 298 additions & 0 deletions fee_allocator/abi/GyroECLPPoolFactory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
[
{
"inputs": [
{
"internalType": "contract IVault",
"name": "vault",
"type": "address"
},
{
"internalType": "address",
"name": "_gyroConfigAddress",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "pool",
"type": "address"
}
],
"name": "PoolCreated",
"type": "event"
},
{
"inputs": [
{
"internalType": "string",
"name": "name",
"type": "string"
},
{
"internalType": "string",
"name": "symbol",
"type": "string"
},
{
"internalType": "contract IERC20[]",
"name": "tokens",
"type": "address[]"
},
{
"components": [
{
"internalType": "int256",
"name": "alpha",
"type": "int256"
},
{
"internalType": "int256",
"name": "beta",
"type": "int256"
},
{
"internalType": "int256",
"name": "c",
"type": "int256"
},
{
"internalType": "int256",
"name": "s",
"type": "int256"
},
{
"internalType": "int256",
"name": "lambda",
"type": "int256"
}
],
"internalType": "struct GyroECLPMath.Params",
"name": "eclpParams",
"type": "tuple"
},
{
"components": [
{
"components": [
{
"internalType": "int256",
"name": "x",
"type": "int256"
},
{
"internalType": "int256",
"name": "y",
"type": "int256"
}
],
"internalType": "struct GyroECLPMath.Vector2",
"name": "tauAlpha",
"type": "tuple"
},
{
"components": [
{
"internalType": "int256",
"name": "x",
"type": "int256"
},
{
"internalType": "int256",
"name": "y",
"type": "int256"
}
],
"internalType": "struct GyroECLPMath.Vector2",
"name": "tauBeta",
"type": "tuple"
},
{
"internalType": "int256",
"name": "u",
"type": "int256"
},
{
"internalType": "int256",
"name": "v",
"type": "int256"
},
{
"internalType": "int256",
"name": "w",
"type": "int256"
},
{
"internalType": "int256",
"name": "z",
"type": "int256"
},
{
"internalType": "int256",
"name": "dSq",
"type": "int256"
}
],
"internalType": "struct GyroECLPMath.DerivedParams",
"name": "derivedECLPParams",
"type": "tuple"
},
{
"internalType": "address[]",
"name": "rateProviders",
"type": "address[]"
},
{
"internalType": "uint256",
"name": "swapFeePercentage",
"type": "uint256"
},
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "capManager",
"type": "address"
},
{
"components": [
{
"internalType": "bool",
"name": "capEnabled",
"type": "bool"
},
{
"internalType": "uint120",
"name": "perAddressCap",
"type": "uint120"
},
{
"internalType": "uint128",
"name": "globalCap",
"type": "uint128"
}
],
"internalType": "struct ICappedLiquidity.CapParams",
"name": "capParams",
"type": "tuple"
},
{
"internalType": "address",
"name": "pauseManager",
"type": "address"
},
{
"components": [
{
"internalType": "uint256",
"name": "pauseWindowDuration",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "bufferPeriodDuration",
"type": "uint256"
}
],
"internalType": "struct ILocallyPausable.PauseParams",
"name": "pauseParams",
"type": "tuple"
}
],
"name": "create",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getCreationCode",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCreationCodeContracts",
"outputs": [
{
"internalType": "address",
"name": "contractA",
"type": "address"
},
{
"internalType": "address",
"name": "contractB",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getVault",
"outputs": [
{
"internalType": "contract IVault",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gyroConfigAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "pool",
"type": "address"
}
],
"name": "isPoolFromFactory",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
]
6 changes: 3 additions & 3 deletions fee_allocator/accounting/collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def collect_fee_info(
pools: list[str],
pools: dict[str, str],
chain: Chains,
pools_now: list[dict],
pools_shifted: list[Dict],
Expand All @@ -22,7 +22,7 @@ def collect_fee_info(
"""
fees = {}
token_fees = defaultdict(list)
for pool in pools:
for pool, symbol in pools.items():
poolutil = BalPoolsGauges(chain.value)
if not poolutil.has_alive_preferential_gauge(pool):
print(
Expand Down Expand Up @@ -81,7 +81,7 @@ def collect_fee_info(
)
token_fees_in_usd += Decimal(token_fee) * Decimal(token_price)
fees[pool_snapshot_now["pool"]["id"]] = {
"symbol": pool_snapshot_now["pool"]["symbol"],
"symbol": symbol,
"pool_addr": pool_snapshot_now["pool"]["address"],
"bpt_token_fee": round(bpt_token_fee, 2),
# One of two fields below should always be 0 because
Expand Down
Loading