Skip to content

Commit

Permalink
fix: links, typos, improve language clarity (#225)
Browse files Browse the repository at this point in the history
Co-authored-by: Not Jeremy Liu <[email protected]>
  • Loading branch information
ericHgorski and NotJeremyLiu authored Sep 16, 2024
1 parent 0071b78 commit 594f513
Show file tree
Hide file tree
Showing 17 changed files with 166 additions and 165 deletions.
2 changes: 1 addition & 1 deletion docs/advanced-transfer/evm-transactions.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'EVM Transactions Intro'
title: 'EVM Transactions'
description: 'This doc covers how to interact with the EvmTx type returned by the Skip Go API'
---

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-transfer/svm-transaction-details.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'SVM Transactions Intro'
title: 'SVM Transactions'
description: 'This document explains how to use Skip Go API and Client TypeScript Package to construct SVM transactions.'
---

Expand Down
4 changes: 2 additions & 2 deletions docs/client/gas-and-fee-tooling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ This field in `ExecuteRouteOptions` allows you to override our default gas price

`getGasPrice?: (chainID: string) => Promise<GasPrice | undefined>;`

The argument is a function that takes in a chain id and returns a gas price for that chain as a `GasPrice` object from CosmJS
The argument is a function that takes in a chain ID and returns a gas price for that chain as a `GasPrice` object from CosmJS

```text JavaScript
type GasPrice = {
Expand All @@ -100,7 +100,7 @@ If you provide a function that only returns a price for a subset of chains, the

### `ExecuteRouteOptions.gasAmountMultiplier`

This field in `ExecuteRouteOptions` allows you to override the default gas multiplier used in the SDK by default. (The default value is 1.5). Increases this value gives you higher confidence that your transaction will not run out of gas while executing, but increases the fee for the end user.
This field in `ExecuteRouteOptions` allows you to override the default gas multiplier used by default in the SDK. The default value is 1.5. Increasing this value provides higher confidence that transactions will not run out of gas while executing, but increases the fee for the end user.

The gas multiplier increases a transaction's `gasAmount` multiplicatively. To get a final gas amount, the router:

Expand Down
4 changes: 2 additions & 2 deletions docs/client/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const chains = await client.chains({
});
```

#### Get a map of assets by chain id
#### Get a map of assets by chain ID

Return type will be `Record<string, Asset[]>`

Expand All @@ -121,7 +121,7 @@ const assets = await client.assets({
includeSvmAssets: true,
});

// get assets filtered by chain id
// get assets filtered by chain ID
const assets = await client.assets({
chainID: 'cosmoshub-4'
includeEvmAssets: true,
Expand Down
24 changes: 12 additions & 12 deletions docs/general/affiliate-fees.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ description: "This page covers how integrators can earn affiliate fees on swaps.

### Overview

Many teams use Skip Go API as a source of a revenue for their project by charging fees on swaps. (Charging fees on transfers will be possible in the future!). We refer to these fees throughout the product and documentation as "affiliate fees"
Many teams use Skip Go as a source of a revenue for their project by charging fees on swaps. (Charging fees on transfers will be possible in the future!). We refer to these fees throughout the product and documentation as "affiliate fees"

Skip Go API's affiliate fee functionality is simple but flexible -- supporting a large variety of bespoke fee collection scenarios:
Skip Go's affiliate fee functionality is simple but flexible -- supporting a large variety of bespoke fee collection scenarios:

* Set your desired fee level on each swap (so you can offer lower fees to your most loyal users)
* Set the account that receives the fee on each swap (so you can account for funds easily & separate revenue into different tranches)
Expand All @@ -16,16 +16,16 @@ Skip Go API's affiliate fee functionality is simple but flexible -- supporting a
### Affiliate Fees Work

1. **At this time, affiliate fees can only be collected on swaps**. We do not support collecting affiliate fees on routes that only consist of transfers (e.g. CCTP transfers, IBC transfers, etc...) even when there are multi-hop transfers. Please contact us if charging fees on transfers is important to you
2. **Affiliate fees are collected on the chain where the last swap takes place**: Skip Go API aggregates over swap venues (DEXes, orderbooks, liquid staking protocols, etc...) on many different chains. Some routes even contain multiple swaps. For each individual cross-chain or single chain swap where you collect a fee, the fee is applied on the last swap and sent to an address you specify on the chain where the last swap takes place.
3. **Affiliate fees are collected/denominated in the output token of each swap**: For example, if a user swaps OSMO to ATOM, your fee collection address will earn a fee in ATOM.
4. **Affiliate fees are calculated using the minimum output amount, which is set based on our estimated execution price after accounting for the user's slippage tolerance** : For example, consider an ATOM to OSMO swap where min amount out is 10 uosmo and the cumulative fees are 1000 bps or 10%. If the swap successfully executes, the affiliate fee will be 1 uosmo. It will be 1 uosmo regardless of whether the user actually gets 10, 11, or 12 uosmo out of the swap.
2. **Affiliate fees are collected on the chain where the last swap takes place**: Skip Go aggregates over swap venues (DEXes, orderbooks, liquid staking protocols, etc...) on many different chains. Some routes even contain multiple swaps. For each individual cross-chain or single chain swap where you collect a fee, the fee is applied on the last swap and sent to an address you specify on the chain where the last swap takes place
3. **Affiliate fees are collected/denominated in the output token of each swap**: For example, if a user swaps OSMO to ATOM, your fee collection address will earn a fee in ATOM
4. **Affiliate fees are calculated using the minimum output amount, which is set based on our estimated execution price after accounting for the user's slippage tolerance** : For example, consider an ATOM to OSMO swap where min amount out is 10 uosmo and the cumulative fees are 1000 bps or 10%. If the swap successfully executes, the affiliate fee will be 1 uosmo. It will be 1 uosmo regardless of whether the user actually gets 10, 11, or 12 uosmo out of the swap

### How to Use Affiliate Fees

There are two simple steps involved in using affiliate fees:

1. **Incorporate the fee into the quote** : You need to request the route & quote with the total fee amount (in basis points) you will collect, so Skip Go API can deduct this automatically from the estimated `amount_out` it returns to the user. This ensures the quote you show the user already accounts for your fee, and they won't receive any unexpectedly low amount.
2. **Set the address(es) to receive the fee**: You also need to tell Skip Go API the exact address(es) to send the fee revenue to. You need to pass a list of addresses and specify a fee amount (in basis points) for each to collect.
1. **Incorporate the fee into the quote** : You need to request the route & quote with the total fee amount (in basis points) you will collect, so Skip Go can deduct this automatically from the estimated `amount_out` it returns to the user. This ensures the quote you show the user already accounts for the fee, and they won't receive any unexpectedly low amount.
2. **Set the address(es) to receive the fee**: You also need to tell Skip Go the exact address(es) to send the fee revenue to. You need to pass a list of addresses and specify a fee amount (in basis points) for each to collect.

#### Fees with /route and /msgs

Expand All @@ -38,18 +38,18 @@ When using `/route` and `/msgs`, you incorporate the fee into the quote when you
1. The sum of `basis_points_fee` values across all affiliates should equal `cumulative_affiliate_fee_bps`
2. If you pass any addresses that are not valid on the chain where the swap will take place, the request will return a `400` error

#### Fees with /msgs\_direct
#### Fees with `/msgs_direct`


<Info>
**/route and /msgs recommended over /msgs\_direct**
**`/route` and `/msgs` recommended over `/msgs_direct`**

We generally recommend integrators use `/route` and `/msgs` rather than `/msgs_direct`. The complexity you must manage below is part of the reason for this recommendation.
</Info>

1. Set `affiliates`to a list of\` `Affiliate` objects, where each corresponds to an address that will receive a portion of the fees if the swap takes place on the chain where that address is located. ( Within an `Affiliate` object, `address` gives the address, and `basis_points_fee` gives the fee amount).
1. You should pass a set of affiliate addresses for every chain where the swap _might_ take place. (You can get this list by querying the `/v2/fungible/swap_venues` endpoint for the list of all `swap_venues` and grabbing the `chain_id` for each). This is required because `/msgs_direct` is determining the route, so we don't know which chain the swap will take place on when calling it.
2. You should ensure that the sums of `basis_points_fee` for the sets of addresses you pass for each chain are equivalent. (For example, if you pass osmo1... addresses and neutron1... addresses, the sum of the `basis_points_fee` values for the osmo1... addresses must be the same as the sum for the neutron1... addresses.) You will receive an error if your fee sums are non-equivalent. (The error is necessary because we don't know which fee amount to simulate with.)
1. Set `affiliates`to a list of\` `Affiliate` objects, where each corresponds to an address that will receive a portion of the fees if the swap takes place on the chain where that address is located. (Within an `Affiliate` object, `address` gives the address, and `basis_points_fee` gives the fee amount).
1. You should pass a set of affiliate addresses for every chain where the swap _might_ take place. (You can get this list by querying the `/v2/fungible/swap_venues` endpoint for the list of all `swap_venues` and grabbing the `chain_id` for each). This is required because `/msgs_direct` determines the route, so we don't know which chain the swap will take place on when calling it.
2. You should ensure that the sums of `basis_points_fee` for the sets of addresses you pass for each chain are equivalent. (For example, if you pass osmo1... addresses and neutron1... addresses, the sum of the `basis_points_fee` values for the osmo1... addresses must be the same as the sum for the neutron1... addresses.) You will receive an error if your fee sums aren't equivalent. (The error is necessary because we don't know which fee amount to simulate with.)

<Check>
**Want to help us get better? Have questions or feedback?**
Expand Down
10 changes: 5 additions & 5 deletions docs/general/api-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Technically, you can access most of the basic functionality of the Skip Go API w
- **No rate limit**: Integrators that do not pass a valid API key in their requests will be subject to a restrictive global rate limit, shared with all other unauthenticated users.
- **Improved fee revenue share pricing**: Unauthenticated integrators will be subject to a 25% revenue share on their fee revenue by default. Authenticated integrators who use API keys will be subject to a cheaper 20% revenue share by default.
- **Access to privileged features:** Integrators who authenticate with an API key will receive access to premium features that we cannot offer to the general public (e.g. Gas estimation APIs, universal balance query APIs, etc...)
- **Metrics on your volume and revenue:** Authenticated integrators will receive access to monthly statistics regarding their total swap and transfer volume and the amount of fee revenue they've earned. They will also receive transaction data for taxes annually.
- **Metrics on your volume and revenue:** Authenticated integrators will receive access to monthly statistics regarding their total swap and transfer volume and the amount of fee revenue they've earned. They will also receive annual transaction data for taxes.

## How to get an API Key

### 1\. Request an API Key

Open a support ticket on our [Discord](https://skip.build/discord) and tell our customer support that you'd like an API key. \*\*
Open a support ticket on our [Discord](https://skip.build/discord) and tell our customer support that you'd like an API key.

Please provide the following information in your request to help us get to know your project:

Expand All @@ -47,7 +47,7 @@ The customer support team member at Skip will establish an official channel of c

**You should store the API key immediately when you create it. We do not store your raw API key in our server for security reasons, so we will not be able to access it for you if you lose it.**

It is important to keep your API key private: Anyone with your API key can make requests to the Skip Go API as you, getting access to your rate limit, privileged features, and affecting your revenue and volume statistics.
It is important to keep your API key private. Anyone with your API key can make requests to the Skip Go API as you, getting access to your rate limit, privileged features, and affecting your revenue and volume statistics.

## How to use an API key

Expand Down Expand Up @@ -92,7 +92,7 @@ const client = new SkipClient({

### Setup a Proxy to Receive Skip Go API Requests and Add the API Key

To keep your API key secure and private, we recommend that you proxy the API requests from the frontend to your own backend--where you can add your API key in the header before forwarding the request to Skip Go API.
To keep your API key secure and private, we recommend that you proxy the API requests from the frontend to your own backend--where you can add your API key in the header before forwarding the request to the Skip Go API.

The snippets below show you how to use Next.js/Vercel for this kind of proxying. It only takes a moment to set up.

Expand Down Expand Up @@ -175,7 +175,7 @@ SKIP_API_KEY=<YOUR API KEY>

## How to Request Volume & Revenue Statistics

Just return to your official communication channel with Skip (probably a Telegram channel) and request the data. We will be able to share monthly reports. Eventually, we will create a customer portal and dashboards, so you'll have access to all the data you need continuously in a self-service manner.
Just return to your official communication channel with Skip (probably a Telegram channel) and request the data. We can share monthly reports. Eventually, we will create a customer portal with dashboards, so you'll have access to all the data you need in a self-service manner.

<Check>
**Want to help us get better? Have questions or feedback?**
Expand Down
Loading

0 comments on commit 594f513

Please sign in to comment.