File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11import { parseEther } from 'viem'
22
3+ import * as erc20 from '@abi/erc20'
34import * as initializableAbstractStrategyAbi from '@abi/initializable-abstract-strategy'
45import { createOTokenActivityProcessor } from '@templates/otoken/activity-processor/activity-processor'
56import { createOTokenProcessor2 } from '@templates/otoken/otoken-2'
@@ -57,7 +58,13 @@ const otokenProcessor = createOTokenProcessor2({
5758 { height } ,
5859 sonicAddresses . OS . amoSwapX . strategy . address ,
5960 )
60- return contract . checkBalance ( sonicAddresses . tokens . wS )
61+ const balance = await contract . checkBalance ( sonicAddresses . tokens . wS )
62+ const ws = new erc20 . Contract ( ctx , { height } , sonicAddresses . tokens . wS )
63+ const os = new erc20 . Contract ( ctx , { height } , sonicAddresses . tokens . OS )
64+ const wsBalance = await ws . balanceOf ( sonicAddresses . OS . amoSwapX . pool )
65+ const osBalance = await os . balanceOf ( sonicAddresses . OS . amoSwapX . pool )
66+ const ratio = ( osBalance * 10n ** 18n ) / ( osBalance + wsBalance )
67+ return ( balance * ratio ) / 10n ** 18n
6168 } ,
6269} )
6370
You can’t perform that action at this time.
0 commit comments