Skip to content

Commit 367e961

Browse files
authored
fix: rysk option volume (#4566)
1 parent 2c947f0 commit 367e961

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

dexs/rysk-v12/index.ts renamed to options/rysk-v12/index.ts

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
import { Adapter, FetchOptions, FetchResultV2 } from "../../adapters/types";
22
import { CHAIN } from "../../helpers/chains";
33

4-
/*
5-
Flow :
6-
1. User deposits his assets to the pool, transferToPool event is emitted by marginPool-> We consider this as volume
7-
2. He receives upfront covered call/secured put premium with transferToUser event emitted by mMarket -> We consider this as supply side revenue
8-
3. After maturity, based on the price of the asset he receives either base token or trade token at agreed execution price and transferToUser event is emitted by marginPool with different signature , so doesnt get mixed up with upfront premium(SSR)
9-
*/
10-
114
const ABI: any = {
125
transferToUser: 'event TransferToUser (address indexed asset,address indexed account, address indexed recipient, uint256 amount)',
136
transferToPool: 'event TransferToPool (address indexed asset, address indexed user, uint256 amount)'
@@ -17,8 +10,8 @@ const M_MARKET = '0x691a5fc3a81a144e36c6C4fBCa1fC82843c80d0d';
1710
const MARGIN_POOL = '0x24a44f1dc25540c62c1196FfC297dFC951C91aB4';
1811

1912
async function fetch(options: FetchOptions): Promise<FetchResultV2> {
20-
const dailyVolume = options.createBalances();
21-
const dailyFees = options.createBalances();
13+
const dailyNotionalVolume = options.createBalances();
14+
const dailyPremiumVolume = options.createBalances();
2215

2316
const depositLogs = await options.getLogs({
2417
eventAbi: ABI.transferToPool,
@@ -32,32 +25,24 @@ async function fetch(options: FetchOptions): Promise<FetchResultV2> {
3225

3326
depositLogs.forEach((deposit: any) => {
3427
const { asset, amount } = deposit;
35-
dailyVolume.add(asset, amount);
28+
dailyNotionalVolume.add(asset, amount);
3629
});
3730

3831
premiumReceivedLogs.forEach((premium: any) => {
3932
const { asset, amount } = premium;
40-
dailyFees.add(asset, amount);
33+
dailyPremiumVolume.add(asset, amount);
4134
});
4235

4336
return {
44-
dailyVolume,
45-
dailyFees,
46-
dailyRevenue:0,
47-
dailySupplySideRevenue: dailyFees
37+
dailyNotionalVolume,
38+
dailyPremiumVolume,
4839
}
4940
}
5041

51-
const methodology = {
52-
Volume: "Assets deposited by the users to be executed at pre-agreed price",
53-
Fees: "Option premium received by users of rysk",
54-
SupplySideRevenue: "Option premiums received by users"
55-
};
5642

5743
const adapter: Adapter = {
5844
version: 2,
5945
fetch,
60-
methodology,
6146
chains: [CHAIN.HYPERLIQUID],
6247
start: '2025-05-30'
6348
}

0 commit comments

Comments
 (0)