This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This is an example how to swap CAPSA tokens for USDC automatically. | |
The flow is simple: | |
1. allow USDC to be spent by our contract | |
2. call buyCAPSA to exchenge USDC for CAPSA | |
3. call sellCAPSA to exchange CASPA for USDC | |
Note: | |
You need to multiply by 10 ** 6 both USDC allowance and CAPSA operations. |
We can't make this file beautiful and searchable because it's too large.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
,timestamp,bb,ba | |
0,1662482691.43856,19767.0,19770.0 | |
1,1662482691.484459,19770.0,19773.0 | |
2,1662482691.6621041,19773.0,19774.0 | |
3,1662482691.710656,19773.0,19774.0 | |
4,1662482691.7550368,19773.0,19774.0 | |
5,1662482691.769418,19773.0,19774.0 | |
6,1662482691.8808682,19773.0,19774.0 | |
7,1662482691.882221,19773.0,19774.0 | |
8,1662482691.899898,19773.0,19774.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Impermax related functions. | |
imxc = Impermax collateral token, given in exchange of the actual LP pair. | |
slp = staked LP token. | |
""" | |
from providers import polygon | |
from chain_data import get_lp_pair_holdings, get_token_decimals | |
import json | |
imxc_abi = json.load(open("./abis/imxc.json", "rb")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | indexChannel | rate | date | |
---|---|---|---|---|
28145 | .ETHFR8H | 0.01 | 2021-07-10 08:00:00 | |
28106 | .ETHFR8H | 0.01 | 2021-07-10 00:00:00 | |
28068 | .ETHFR8H | 0.01 | 2021-07-09 16:00:00 | |
28030 | .ETHFR8H | 0.01 | 2021-07-09 08:00:00 | |
27990 | .ETHFR8H | 0.01 | 2021-07-09 00:00:00 | |
27915 | .ETHFR8H | 0.01 | 2021-07-08 16:00:00 | |
27873 | .ETHFR8H | 0.01 | 2021-07-08 08:00:00 | |
27821 | .ETHFR8H | 0.01 | 2021-07-08 00:00:00 | |
27783 | .ETHFR8H | 0.01 | 2021-07-07 16:00:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | indexChannel | date | rate | |
---|---|---|---|---|
28144 | .BTCFR8H | 2021-07-10 08:00:00 | -0.004272 | |
28105 | .BTCFR8H | 2021-07-10 00:00:00 | 0.01 | |
28067 | .BTCFR8H | 2021-07-09 16:00:00 | 0.01 | |
28029 | .BTCFR8H | 2021-07-09 08:00:00 | 0.01 | |
27989 | .BTCFR8H | 2021-07-09 00:00:00 | 0.000568 | |
27914 | .BTCFR8H | 2021-07-08 16:00:00 | -0.008789 | |
27872 | .BTCFR8H | 2021-07-08 08:00:00 | 0.01 | |
27820 | .BTCFR8H | 2021-07-08 00:00:00 | 0.01 | |
27782 | .BTCFR8H | 2021-07-07 16:00:00 | 0.01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Deploy API functions to Appwrite. | |
This script will loop though your ./api folder, get all .py files, then: | |
- check if this function version has been deployed | |
- if not, will create or update the function | |
Functions name will be the name of the file, without ".py". | |
By default functions have no execution permission, you need to change | |
it manually. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Bon la c'est simple et sale j'utilise tesseract pour faire du OCR. | |
""" | |
import requests | |
import json | |
import shutil | |
try: | |
from PIL import Image | |
except ImportError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Petite explication : | |
je sais que tes messages sont des Lorem ipsum, donc du latin. | |
Ma stratégie est de me constituer un dictionnaire de mots latins, puis de déchiffrer le texte | |
avec chacun des mots. | |
Pour savoir si le texte a correctement été déchiffré, je caclcul un score qui correspond au | |
nombre de mots qui sont dans mon dictionnaire. Je récupère le texte avec le plus grand score. | |
Dernière étape, je met les majuscules la ou elles sont dans le texte d'origine. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$count = 0; | |
$targetY = 5; | |
for ($i = 0; $i < count($inputs); $i++) { | |
$first = $inputs[$i]; | |
$second = $inputs[$i + 1]; | |
if ($targetY >= $first && $targetY <= $second) { | |
$count++; | |
} | |
} |