diff --git a/Frontend/Configuration/ChainSettings.cs b/Frontend/Configuration/ChainSettings.cs
index 000afe60a460d1fed0a69721911723f3672f8a88..dc076253f7386beaa4766a3a9e4422fb94b82daf 100644
--- a/Frontend/Configuration/ChainSettings.cs
+++ b/Frontend/Configuration/ChainSettings.cs
@@ -4,4 +4,5 @@ public class ChainSettings
         public  int ChainId { get; set; }
         public  string TokenAddress { get; set; }
         public  UniswapSettings Uniswap { get; set; }
+        public string SwapRouterV2Address { get; set; }
     }
\ No newline at end of file
diff --git a/Frontend/Events/SwapEventDTO.cs b/Frontend/Events/SwapEventDTO.cs
new file mode 100644
index 0000000000000000000000000000000000000000..2acc86b76f134d4f2f3effc6d24865dd6be0f770
--- /dev/null
+++ b/Frontend/Events/SwapEventDTO.cs
@@ -0,0 +1,15 @@
+using Nethereum.ABI.FunctionEncoding.Attributes;
+using Nethereum.Contracts;
+using System.Numerics;
+
+namespace Frontend.Events;
+
+[Event("Swap")]
+public class SwapEventDTO : IEventDTO
+{
+    [Parameter("uint256", "amountIn", 1, true)]
+    public BigInteger AmountIn { get; set; }
+
+    [Parameter("uint256", "amountOut", 2, true)]
+    public BigInteger AmountOut { get; set; }
+}
\ No newline at end of file
diff --git a/Frontend/Functions/FeeFunction.cs b/Frontend/Functions/FeeFunction.cs
new file mode 100644
index 0000000000000000000000000000000000000000..1f2add2b8324515212d15daba1bd533fed61c21f
--- /dev/null
+++ b/Frontend/Functions/FeeFunction.cs
@@ -0,0 +1,9 @@
+using Nethereum.ABI.FunctionEncoding.Attributes;
+using Nethereum.Contracts;
+
+namespace Frontend.Functions;
+
+[Function("fee", "uint24")]
+public class FeeFunction : FunctionMessage{
+
+}
\ No newline at end of file
diff --git a/Frontend/Functions/SwapExactInputSingleFunction.cs b/Frontend/Functions/SwapExactInputSingleFunction.cs
new file mode 100644
index 0000000000000000000000000000000000000000..c729446bd33e8f1ddef57817d38f1987dea6299f
--- /dev/null
+++ b/Frontend/Functions/SwapExactInputSingleFunction.cs
@@ -0,0 +1,33 @@
+using System.Numerics;
+using Nethereum.ABI.FunctionEncoding.Attributes;
+using Nethereum.Contracts;
+using HexBigInteger = Nethereum.Hex.HexTypes.HexBigInteger;
+
+namespace Frontend.Functions;
+
+public class SwapExactInputSingleFunction : FunctionMessage
+{
+    [Parameter("address", "tokenIn", 1)]
+    public string TokenIn { get; set; }
+
+    [Parameter("address", "tokenOut", 2)]
+    public string TokenOut { get; set; }
+
+    [Parameter("uint256", "amountIn", 3)]
+    public BigInteger AmountIn { get; set; }
+
+    [Parameter("uint256", "amountOutMinimum", 4)]
+    public BigInteger AmountOutMinimum { get; set; }
+
+    [Parameter("address", "recipient", 5)]
+    public string Recipient { get; set; }
+
+    [Parameter("uint256", "deadline", 6)]
+    public HexBigInteger Deadline { get; set; }
+
+    [Parameter("uint24", "fee", 7)]
+    public uint Fee { get; set; }
+
+    [Parameter("uint160", "sqrtPriceLimitX96", 8)]
+    public BigInteger SqrtPriceLimitX96 { get; set; }
+}
\ No newline at end of file
diff --git a/Frontend/PoolV3Client.cs b/Frontend/PoolV3Client.cs
index 0e829955cb5fe319ca57a9e9a525474c7223d77b..4a7063529c398a01ddcfd25988bed9df425095b8 100644
--- a/Frontend/PoolV3Client.cs
+++ b/Frontend/PoolV3Client.cs
@@ -1,24 +1,25 @@
 using System.Numerics;
 using Frontend.Functions;
+using Frontend.Events;
 using Nethereum.Contracts;
-using Nethereum.Contracts.Standards.ERC20.ContractDefinition;
+using Nethereum.Hex.HexTypes;
 using Nethereum.Web3;
 using Nethereum.Web3.Accounts;
 
-using Microsoft.Extensions.FileProviders.Physical;
-using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure;
+using Frontend.Configuration;
 namespace Frontend;
 
 public class PoolV3Client
 {
     private readonly Contract _pool;
     private readonly Web3 _web3;
+    private readonly ChainSettings _chainSettings;
 
-    private string? token0Address=null;
-    private string? token1Address=null;
+    private string? token0Address = null;
+    private string? token1Address = null;
+    private uint? poolFeeTier = null;
 
-
-    public PoolV3Client(string poolAddress, Web3 web3)
+    public PoolV3Client(string poolAddress, Web3 web3, ChainSettings chainSettings)
     {
 
         _pool = web3.Eth.GetContract(
@@ -33,6 +34,7 @@ public class PoolV3Client
             poolAddress
         );
         _web3 = web3;
+        _chainSettings = chainSettings;
     }
 
     public async Task<decimal> GetPairRatio()
@@ -54,29 +56,72 @@ public class PoolV3Client
     {
         return new BigInteger(Math.Sqrt(price) * Math.Pow(2, 96));
     }
-    public async Task<string> Token0Address(){
-        if(null == token0Address){
+    public async Task<string> Token0Address()
+    {
+        if (null == token0Address)
+        {
             var handler = _web3.Eth.GetContractQueryHandler<Token0Function>();
             var func = new Token0Function();
-            var result = await handler.QueryAsync<string>(_pool.Address, func); 
-            token0Address=result;
+            var result = await handler.QueryAsync<string>(_pool.Address, func);
+            token0Address = result;
         }
-        
+
         return token0Address;
     }
 
-     public async Task<string> Token1Address(){
-        if(null == token1Address){
+    public async Task<string> Token1Address()
+    {
+        if (null == token1Address)
+        {
             var handler = _web3.Eth.GetContractQueryHandler<Token1Function>();
             var func = new Token1Function();
-            var result = await handler.QueryAsync<string>(_pool.Address, func); 
-            token1Address=result;
+            var result = await handler.QueryAsync<string>(_pool.Address, func);
+            token1Address = result;
         }
-        
+
         return token1Address;
     }
 
-    public async Task swap(){
-        
+    public async Task<uint> getPoolFeeTier()
+    {
+        if (null == poolFeeTier)
+        {
+            var handler = _web3.Eth.GetContractQueryHandler<FeeFunction>();
+            var func = new FeeFunction();
+            var result = await handler.QueryAsync<int>(_pool.Address, func);
+            poolFeeTier = (uint)result;
+        }
+        return (uint)poolFeeTier;
+    }
+
+
+    /*
+    this function should swap the tokens in the pool
+    */
+    public async Task<decimal> SwapAsync(string fromTokenAddress, string toTokenAddress, decimal amount, Account account, decimal amountOutMinimum=0, uint sqrtPriceLimitX96=0)
+    {
+        var swapFunction = new SwapExactInputSingleFunction
+        {
+            TokenIn = fromTokenAddress,
+            TokenOut = toTokenAddress,
+            AmountIn = Web3.Convert.ToWei(amount),
+            AmountOutMinimum = Web3.Convert.ToWei(amountOutMinimum), // Set your minimum amount out
+            Recipient = account.Address,
+            Deadline = new HexBigInteger(DateTimeOffset.UtcNow.ToUnixTimeSeconds() + 90), // 1:30 minutes from now
+            Fee = await getPoolFeeTier(),
+            SqrtPriceLimitX96 = sqrtPriceLimitX96
+        };
+
+        var handler = _web3.Eth.GetContractTransactionHandler<SwapExactInputSingleFunction>();
+        var transactionReceipt = await handler.SendRequestAndWaitForReceiptAsync(_chainSettings.SwapRouterV2Address, swapFunction);
+        var swapEvent = transactionReceipt.DecodeAllEvents<SwapEventDTO>();
+        if (swapEvent.Count > 0)
+        {
+            var receivedAmount = swapEvent[0].Event.AmountOut;
+            return Web3.Convert.FromWei(receivedAmount);
+        }
+
+
+        throw new Exception("Swap event not found in transaction receipt");
     }
 }
\ No newline at end of file
diff --git a/Frontend/appsettings.json b/Frontend/appsettings.json
index 4464df1e5a8d92538f7f6266a59c5abe73659a24..9cbb59bae6183e45d3649b7786cc3cac0b2fea32 100644
--- a/Frontend/appsettings.json
+++ b/Frontend/appsettings.json
@@ -12,7 +12,8 @@
       "UniswapV3Factory":"0x0227628f3F023bb0B980b67D528571c95c6DaC1c",
       "QuoterV2":"0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3",
       "WethTokenAddress": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
-      "RocEthPoolAddress": "0xF22CA6B27eaC677f132945C50Cd3499A9b8a6CBC"
+      "RocEthPoolAddress": "0xF22CA6B27eaC677f132945C50Cd3499A9b8a6CBC",
+      "SwapRouterV2Address": "0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E"
     }
   },
   "AllowedHosts": "*",