Rechercher

PythonReactSEOPDF
OpenClaw

Saucerswap Arbitrage

SaucerSwap Arbitrage

harleyscodes0 installations selon la source☆ 0 Étoiles du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install harleyscodes/saucerswap-arbitrage

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

Instructions

SaucerSwap Arbitrage

Overview

SaucerSwap is the main DEX on Hedera. Triangular arbitrage: profit from price differences between 3 tokens.

Key Contracts (Mainnet)

  • SaucerSwap V1: 0xcaec9706a4622D356d2D3aEd8f8D40c51f0C0dF
  • SaucerSwap V2: 0xA6F4E11E5D8A3F62A7D4E3E6B1E7F3C9E8F2A1B4

Get Quotes (V1)

const axios = require('axios');

async function getQuote(amountIn, path) {
  const [tokenA, tokenB, tokenC] = path;
  const url = `https://mainnet-api.saucerswap.fi/route?from=${tokenA}&to=${tokenB}&amount=${amountIn}`;
  const response = await axios.get(url);
  return response.data;
}

Token Addresses (Hedera)

  • HBAR: 0.0.1000 (wrapped: 0x... in EVM format)
  • USDC: 0.0.456719
  • USDT: 0.0.456720
  • ETH: 0.0.456721
  • WBTC: 0.0.456722
  • SAUCE: 0.0.456723

Arbitrage Logic

1. Check Prices
// Get prices for potential paths
const paths = [
  ['USDC', 'HBAR', 'USDC'],
  ['USDC', 'SAUCE', 'USDC'],
  ['HBAR', 'USDC', 'HBAR']
];

for (const path of paths) {
  const out = await getQuote(1000, path);
  const profit = out - 1000;
  console.log(`${path.join(' → ')}: ${profit}`);
}
2. Execute Swap
// Via HashPack or direct contract call
const tx = new ContractExecuteTransaction()
  .setContractId(poolAddress)
  .setFunction("swap")
  .setParameters([...]);

Safety Checks

  1. Slippage: Set min output = expected * 0.97
  2. Gas: Estimate network fees (tinybars)
  3. Pool Depth: Check liquidity before large trades
  4. Hedera Gossip: Account for network latency

Key Differences from EVM

  • No EOA signatures: Must use Hedera native signing
  • Network fees: Paid in tinybars (not gas)
  • Transaction types: Use HAPI, not EVM
  • Token format: Use 0.0.xxxxx not 0x...

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/harleyscodes/saucerswap-arbitrage
Version
—
Commit
7714c76acf91bde3723e987e1084409f3eb5963b
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

Contenu extrait

SKILL.md
# SaucerSwap Arbitrage

## Overview

SaucerSwap is the main DEX on Hedera. Triangular arbitrage: profit from price differences between 3 tokens.

## Key Contracts (Mainnet)

- **SaucerSwap V1**: `0xcaec9706a4622D356d2D3aEd8f8D40c51f0C0dF`
- **SaucerSwap V2**: `0xA6F4E11E5D8A3F62A7D4E3E6B1E7F3C9E8F2A1B4`

## Get Quotes (V1)

```typescript
const axios = require('axios');

async function getQuote(amountIn, path) {
  const [tokenA, tokenB, tokenC] = path;
  const url = `https://mainnet-api.saucerswap.fi/route?from=${tokenA}&to=${tokenB}&amount=${amountIn}`;
  const response = await axios.get(url);
  return response.data;
}
```

## Token Addresses (Hedera)

- **HBAR**: `0.0.1000` (wrapped: `0x...` in EVM format)
- **USDC**: `0.0.456719`
- **USDT**: `0.0.456720`
- **ETH**: `0.0.456721`
- **WBTC**: `0.0.456722`
- **SAUCE**: `0.0.456723`

## Arbitrage Logic

### 1. Check Prices
```typescript
// Get prices for potential paths
const paths = [
  ['USDC', 'HBAR', 'USDC'],
  ['USDC', 'SAUCE', 'USDC'],
  ['HBAR', 'USDC', 'HBAR']
];

for (const path of paths) {
  const out = await getQuote(1000, path);
  const profit = out - 1000;
  console.log(`${path.join(' → ')}: ${profit}`);
}
```

### 2. Execute Swap
```typescript
// Via HashPack or direct contract call
const tx = new ContractExecuteTransaction()
  .setContractId(poolAddress)
  .setFunction("swap")
  .setParameters([...]);
```

## Safety Checks

1. **Slippage**: Set min output = expected * 0.97
2. **Gas**: Estimate network fees (tinybars)
3. **Pool Depth**: Check liquidity before large trades
4. **Hedera Gossip**: Account for network latency

## Key Differences from EVM

- **No EOA signatures**: Must use Hedera native signing
- **Network fees**: Paid in tinybars (not gas)
- **Transaction types**: Use HAPI, not EVM
- **Token format**: Use `0.0.xxxxx` not `0x...`

Skills associés

OpenClaw

1password

daggerkun007

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.