Skip to content

feat: Add partner fees #1

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

Merged
merged 4 commits into from
May 20, 2025
Merged

feat: Add partner fees #1

merged 4 commits into from
May 20, 2025

Conversation

AntonAndell
Copy link
Contributor

@AntonAndell AntonAndell commented May 15, 2025

WIP: of adding partner fees

@AntonAndell AntonAndell changed the title wip feat: Add partner fees May 15, 2025
@R0bi7 R0bi7 marked this pull request as ready for review May 16, 2025 15:59
} else {
calls.push(
MoneyMarketService.encodeBorrow(
{ asset: vaultAddress, amount: amount, interestRateMode: 2n, referralCode: 0, onBehalfOf: from },
moneyMarketConfig.lendingPool,
),
);
if (fee && feeAmount) {
calls.push(Erc20Service.encodeTansfer(vaultAddress, fee?.address, feeAmount))
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to remove the fee from amount sent to user

calls.push(Erc20Service.encodeApprove(intent.inputToken, intentsContract, intent.inputAmount));
// user has to send input amount + fee amount to the intent contract
const totalInputAmount = intent.inputAmount + feeAmount;
calls.push(Erc20Service.encodeApprove(intent.inputToken, intentsContract, totalInputAmount));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though we add this here, each createIntent in each spoke takes the Intent amount as input

@@ -49,6 +64,8 @@ export class EvmSolverService {
`hub asset not found for spoke chain token (intent.outputToken): ${createIntentParams.outputToken}`,
);

const [feeData, feeAmount] = EvmSolverService.createIntentFeeData(fee, createIntentParams.inputAmount);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might have been the wrong place to place this, Most services do not use this a outer function so fee data is not propagate properly via ex createAndSubmitIntent

Copy link

vercel bot commented May 20, 2025

@R0bi7 is attempting to deploy a commit to the ICON Foundation PRO team on Vercel, but is not a member of this team. To resolve this issue, you can:

  • Make your repository public. Collaboration is free for open source and public repositories.
  • Add @R0bi7 as a member. A Pro subscription is required to access Vercel's collaborative features.
    • If you're the owner of the team, click here and add @R0bi7 as a member.
    • If you're the user who initiated this build request, click here to request access.
    • If you're already a member of the ICON Foundation PRO team, make sure that your Vercel account is connected to your GitHub account.

To read more about collaboration on Vercel, click here.

*/
public static async createIntent<R extends boolean = false>(
public static async createIntentDeposit<R extends boolean = false>(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just questioning if this function is needed at all currently

@R0bi7 R0bi7 merged commit b05add2 into main May 20, 2025
0 of 4 checks passed
@R0bi7 R0bi7 deleted the feat/partner-fees branch May 20, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants